summaryrefslogtreecommitdiff
path: root/library/categoryselect.cpp
Unidiff
Diffstat (limited to 'library/categoryselect.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/categoryselect.cpp112
1 files changed, 110 insertions, 2 deletions
diff --git a/library/categoryselect.cpp b/library/categoryselect.cpp
index 21b3f91..8473aeb 100644
--- a/library/categoryselect.cpp
+++ b/library/categoryselect.cpp
@@ -2,2 +2,3 @@
2** Copyright (C) 2001 Trolltech AS. All rights reserved. 2** Copyright (C) 2001 Trolltech AS. All rights reserved.
3** Copyright (C) 2003 zecke introduce a needed symbol
3** 4**
@@ -33,2 +34,37 @@
33 34
35
36/*! \enum CategorySelect::SelectorWidget
37 Chooses a type of widget to use as the selection widget.
38
39 \value ComboBox
40 \value ListView
41*/
42
43/*!
44 \class CategorySelect
45 \brief The CategorySelect widget allows users to select Categories with a
46 combobox interface.
47
48 CategorySelect is useful to provide a QComboBox of Categories for
49 filtering (such as in the Contacts table view) or to allow the user
50 to select multiple Categories. The allCategories variable sets
51 whether the CategorySelect is in filtering or selecting mode.
52
53 In filtering mode, the All and Unfiled categories are added. The
54
55 In selecting mode, the CategorySelect may either be a QComboBox and
56 a QToolButton or a QListView with checkable items depending on the
57 screen size.
58
59 CategorySelect automatically updates itself if Categories has been
60 changed elsewhere in the environment.
61
62 Signals and slots are provided to notify the application of the users
63 selections. A QToolButton is also provided so that users can edit the
64 Categories manually.
65
66 \ingroup qtopiaemb
67*/
68
69
34static QString categoryEdittingFileName() 70static QString categoryEdittingFileName()
@@ -288,2 +324,22 @@ void CategoryCombo::slotValueChanged( int )
288 324
325/*!
326 Constructs a category selector with parent \a parent, name \a name.
327
328 This constructor is provided to make Opie compatible with Sharp ROM.
329*/
330CategorySelect::CategorySelect( QWidget* parent, const char* name )
331 : QHBox( parent, name ),
332 cmbCat( 0 ),
333 cmdCat( 0 ),
334 d( 0 )
335{
336 d = new CategorySelectPrivate();
337 init(0); // default argument
338}
339/*!
340 Constructs a category selector with parent \a parent, name \a name and
341 fixed width \a width.
342
343 This constructor is provided to make integration with Qt Designer easier.
344*/
289CategorySelect::CategorySelect( QWidget *parent, const char *name,int width) 345CategorySelect::CategorySelect( QWidget *parent, const char *name,int width)
@@ -298,2 +354,7 @@ CategorySelect::CategorySelect( QWidget *parent, const char *name,int width)
298 354
355/*!
356 \overload
357 This constructor accepts an array \a vl of integers representing Categories.
358 \a appName is used as the visible name string.
359*/
299CategorySelect::CategorySelect( const QArray<int> &vl, 360CategorySelect::CategorySelect( const QArray<int> &vl,
@@ -310,2 +371,9 @@ CategorySelect::CategorySelect( const QArray<int> &vl,
310 371
372/*!
373 \overload
374
375 This constructor accepts an array \a vl of integers representing Categories.
376 \a visibleName is the string used when the name of this widget is required
377 to be displayed. \a width is an integer used as the fixed width of the widget.
378*/
311CategorySelect::CategorySelect( const QArray<int> &vl, 379CategorySelect::CategorySelect( const QArray<int> &vl,
@@ -321,2 +389,5 @@ CategorySelect::CategorySelect( const QArray<int> &vl,
321 389
390/*!
391 Destructs a CategorySelect widget.
392*/
322CategorySelect::~CategorySelect() 393CategorySelect::~CategorySelect()
@@ -326,2 +397,5 @@ CategorySelect::~CategorySelect()
326 397
398/*!
399 This slot is called when the user pushes the button to edit Categories.
400*/
327void CategorySelect::slotDialog() 401void CategorySelect::slotDialog()
@@ -359,2 +433,6 @@ void CategorySelect::slotDialog()
359 433
434
435/*!
436 This slot is called when a new Category is available.
437*/
360void CategorySelect::slotNewCat( int newUid ) 438void CategorySelect::slotNewCat( int newUid )
@@ -378,2 +456,12 @@ void CategorySelect::slotNewCat( int newUid )
378 456
457/*!
458 \overload
459
460 Resets the CategorySelect to select the \a vlCats for
461 the Categories assoicated with \a appName.
462
463 This function should only be called if <i>filtering</i>
464 on Categories and not selecting and therefore possibly
465 allowing the user to edit Categories.
466*/
379QString CategorySelect::setCategories( const QArray<int> &rec, 467QString CategorySelect::setCategories( const QArray<int> &rec,
@@ -384,2 +472,8 @@ QString CategorySelect::setCategories( const QArray<int> &rec,
384 472
473/*!
474 Resets the CategorySelect to select the \a vlCats for
475 the Categories assoicated with \a appName and displays
476 the \a visibleName if the user is selecting and therefore editing
477 new Categories.
478 */
385QString CategorySelect::setCategories( const QArray<int> &rec, 479QString CategorySelect::setCategories( const QArray<int> &rec,
@@ -408,3 +502,5 @@ void CategorySelect::init(int width)
408 502
409 503/*!
504 Return the value of the currently selected category.
505 */
410int CategorySelect::currentCategory() const 506int CategorySelect::currentCategory() const
@@ -414,2 +510,3 @@ int CategorySelect::currentCategory() const
414 510
511
415void CategorySelect::setCurrentCategory( int newCatUid ) 512void CategorySelect::setCurrentCategory( int newCatUid )
@@ -419,3 +516,5 @@ void CategorySelect::setCurrentCategory( int newCatUid )
419 516
420 517/*!
518 Returns a shallow copy of the categories in this CategorySelect.
519 */
421const QArray<int> &CategorySelect::currentCategories() const 520const QArray<int> &CategorySelect::currentCategories() const
@@ -425,2 +524,5 @@ const QArray<int> &CategorySelect::currentCategories() const
425 524
525/*!
526 Hides the edit section of the CategorySelect widget if \a remove is TRUE.
527 */
426void CategorySelect::setRemoveCategoryEdit( bool remove ) 528void CategorySelect::setRemoveCategoryEdit( bool remove )
@@ -436,2 +538,5 @@ void CategorySelect::setRemoveCategoryEdit( bool remove )
436 538
539/*!
540 Changes this CategorySelect to the All category if \a all is TRUE.
541 */
437void CategorySelect::setAllCategories( bool add ) 542void CategorySelect::setAllCategories( bool add )
@@ -447,2 +552,5 @@ void CategorySelect::setAllCategories( bool add )
447// 01.12.21 added 552// 01.12.21 added
553/*!
554 Sets the fixed width of the widget to \a width.
555 */
448void CategorySelect::setFixedWidth(int width) 556void CategorySelect::setFixedWidth(int width)