author | eilers <eilers> | 2003-08-08 14:45:49 (UTC) |
---|---|---|
committer | eilers <eilers> | 2003-08-08 14:45:49 (UTC) |
commit | 14d394e6c107b037a09a31a92605034fe50f7813 (patch) (unidiff) | |
tree | 800699cf4dc9681c3eb023340634dd6a15fd04c8 /library/categoryselect.cpp | |
parent | dbc6ea35f5535a1f69deb7ebbafc0f721721dbf2 (diff) | |
download | opie-14d394e6c107b037a09a31a92605034fe50f7813.zip opie-14d394e6c107b037a09a31a92605034fe50f7813.tar.gz opie-14d394e6c107b037a09a31a92605034fe50f7813.tar.bz2 |
Merged branches from BRANCH_1_0
-rw-r--r-- | library/categoryselect.cpp | 112 |
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 | |||
34 | static QString categoryEdittingFileName() | 70 | static 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 | */ | ||
330 | CategorySelect::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 | */ | ||
289 | CategorySelect::CategorySelect( QWidget *parent, const char *name,int width) | 345 | CategorySelect::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 | */ | ||
299 | CategorySelect::CategorySelect( const QArray<int> &vl, | 360 | CategorySelect::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 | */ | ||
311 | CategorySelect::CategorySelect( const QArray<int> &vl, | 379 | CategorySelect::CategorySelect( const QArray<int> &vl, |
@@ -321,2 +389,5 @@ CategorySelect::CategorySelect( const QArray<int> &vl, | |||
321 | 389 | ||
390 | /*! | ||
391 | Destructs a CategorySelect widget. | ||
392 | */ | ||
322 | CategorySelect::~CategorySelect() | 393 | CategorySelect::~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 | */ | ||
327 | void CategorySelect::slotDialog() | 401 | void 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 | */ | ||
360 | void CategorySelect::slotNewCat( int newUid ) | 438 | void 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 | */ | ||
379 | QString CategorySelect::setCategories( const QArray<int> &rec, | 467 | QString 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 | */ | ||
385 | QString CategorySelect::setCategories( const QArray<int> &rec, | 479 | QString 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 | */ | ||
410 | int CategorySelect::currentCategory() const | 506 | int CategorySelect::currentCategory() const |
@@ -414,2 +510,3 @@ int CategorySelect::currentCategory() const | |||
414 | 510 | ||
511 | |||
415 | void CategorySelect::setCurrentCategory( int newCatUid ) | 512 | void 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 | */ | ||
421 | const QArray<int> &CategorySelect::currentCategories() const | 520 | const 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 | */ | ||
426 | void CategorySelect::setRemoveCategoryEdit( bool remove ) | 528 | void 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 | */ | ||
437 | void CategorySelect::setAllCategories( bool add ) | 542 | void 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 | */ | ||
448 | void CategorySelect::setFixedWidth(int width) | 556 | void CategorySelect::setFixedWidth(int width) |