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/categorymenu.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/categorymenu.cpp | 62 |
1 files changed, 57 insertions, 5 deletions
diff --git a/library/categorymenu.cpp b/library/categorymenu.cpp index e733107..5d7adf7 100644 --- a/library/categorymenu.cpp +++ b/library/categorymenu.cpp | |||
@@ -26,4 +26,33 @@ | |||
26 | 26 | ||
27 | /*! | ||
28 | \class CategoryMenu | ||
29 | \brief The CategoryMenu widget aids in filtering records or files by Category. | ||
30 | |||
31 | The CategoryMenu widget provides a popup menu that will make filtering records | ||
32 | or files by category much easier. The widget will lookup the available | ||
33 | categories for an application, populate the menu, and keep a track of which | ||
34 | categories are being filtered against. A set of categories can be tested | ||
35 | by the isSelected() function to see if a record or file containing those | ||
36 | categories would be allowed through by the filter. | ||
37 | |||
38 | \warning Currently this class is not suitable for extending. | ||
39 | |||
40 | \ingroup qtopiaemb | ||
41 | */ | ||
42 | |||
43 | /*! | ||
44 | \fn void CategoryMenu::categoryChange() | ||
45 | This signal is emitted when the user selects a different category in the | ||
46 | menu, hence changing what records or files should be selected. | ||
47 | */ | ||
48 | |||
49 | /*! | ||
50 | Creates a new CategoryMenu with \a parent and \a name. The menu will be | ||
51 | populated with the available categories for \a application. | ||
52 | |||
53 | If \a globals is TRUE then it will also poplulate the menu with the | ||
54 | global categories. | ||
55 | */ | ||
27 | CategoryMenu::CategoryMenu( const QString &n, bool ig = TRUE, | 56 | CategoryMenu::CategoryMenu( const QString &n, bool ig = TRUE, |
28 | QWidget *parent, const char *name ) : | 57 | QWidget *parent, const char *name ) : |
29 | QPopupMenu(parent, name), | 58 | QPopupMenu(parent, name), |
@@ -37,3 +66,6 @@ CategoryMenu::CategoryMenu( const QString &n, bool ig = TRUE, | |||
37 | 66 | ||
38 | CategoryMenu::~CategoryMenu( ) | 67 | /*! |
68 | Destroys a CategoryMenu. | ||
69 | */ | ||
70 | CategoryMenu::~CategoryMenu( ) | ||
39 | { | 71 | { |
@@ -41,2 +73,5 @@ CategoryMenu::~CategoryMenu( ) | |||
41 | 73 | ||
74 | /*! | ||
75 | Repopulates the widget's list of available categories. | ||
76 | */ | ||
42 | void CategoryMenu::reload() | 77 | void CategoryMenu::reload() |
@@ -68,3 +103,6 @@ void CategoryMenu::reload() | |||
68 | 103 | ||
69 | void CategoryMenu::mapMenuId(int id) | 104 | /*! |
105 | \internal | ||
106 | */ | ||
107 | void CategoryMenu::mapMenuId(int id) | ||
70 | { | 108 | { |
@@ -79,2 +117,7 @@ void CategoryMenu::mapMenuId(int id) | |||
79 | 117 | ||
118 | /*! | ||
119 | Returns TRUE if a record or file with the set of category ids \a cUids | ||
120 | is allowed by the current selection in the CategoryMenu. | ||
121 | Otherwise returns FALSE. | ||
122 | */ | ||
80 | bool CategoryMenu::isSelected(const QArray<int> &cUids) const | 123 | bool CategoryMenu::isSelected(const QArray<int> &cUids) const |
@@ -84,3 +127,3 @@ bool CategoryMenu::isSelected(const QArray<int> &cUids) const | |||
84 | 127 | ||
85 | if (currentMid == 2 && cUids.count() == 0) | 128 | if (currentMid == 2 && cUids.count() == 0) |
86 | return TRUE; | 129 | return TRUE; |
@@ -93,5 +136,8 @@ bool CategoryMenu::isSelected(const QArray<int> &cUids) const | |||
93 | 136 | ||
137 | /*! | ||
138 | Sets the menu to have \a newCatUid as the currently selected Category. | ||
139 | */ | ||
94 | void CategoryMenu::setCurrentCategory( int newCatUid ) | 140 | void CategoryMenu::setCurrentCategory( int newCatUid ) |
95 | { | 141 | { |
96 | if (!idToMenu.contains(newCatUid)) | 142 | if (!idToMenu.contains(newCatUid)) |
97 | return; | 143 | return; |
@@ -101,2 +147,5 @@ void CategoryMenu::setCurrentCategory( int newCatUid ) | |||
101 | 147 | ||
148 | /*! | ||
149 | Sets the menu to allow all category sets. | ||
150 | */ | ||
102 | void CategoryMenu::setCurrentCategoryAll( ) | 151 | void CategoryMenu::setCurrentCategoryAll( ) |
@@ -106,2 +155,5 @@ void CategoryMenu::setCurrentCategoryAll( ) | |||
106 | 155 | ||
156 | /*! | ||
157 | Sets the menu to allow only empty category sets. | ||
158 | */ | ||
107 | void CategoryMenu::setCurrentCategoryUnfiled( ) | 159 | void CategoryMenu::setCurrentCategoryUnfiled( ) |