summaryrefslogtreecommitdiff
path: root/library/backend/categories.h
Unidiff
Diffstat (limited to 'library/backend/categories.h') (more/less context) (ignore whitespace changes)
-rw-r--r--library/backend/categories.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/library/backend/categories.h b/library/backend/categories.h
index d5b3669..91c93e7 100644
--- a/library/backend/categories.h
+++ b/library/backend/categories.h
@@ -130,48 +130,51 @@ public:
130 bool removeGlobalCategory( int uid ); 130 bool removeGlobalCategory( int uid );
131 131
132 QArray<int> ids( const QString &app, const QStringList &labels) const; 132 QArray<int> ids( const QString &app, const QStringList &labels) const;
133 133
134 /** Returns the id associated with the app */ 134 /** Returns the id associated with the app */
135 int id( const QString &app, const QString &cat ) const; 135 int id( const QString &app, const QString &cat ) const;
136 /** Returns the label associated with the id */ 136 /** Returns the label associated with the id */
137 QString label( const QString &app, int id ) const; 137 QString label( const QString &app, int id ) const;
138 138
139 enum ExtraLabels { NoExtra, AllUnfiled, AllLabel, UnfiledLabel }; 139 enum ExtraLabels { NoExtra, AllUnfiled, AllLabel, UnfiledLabel };
140 /** Returns the sorted list of all categories that are 140 /** Returns the sorted list of all categories that are
141 * associated with the app. 141 * associated with the app.
142 * If includeGlobal parameter is TRUE then the returned 142 * If includeGlobal parameter is TRUE then the returned
143 * categories will include the global category items. 143 * categories will include the global category items.
144 * If extra = NoExtra, then 144 * If extra = NoExtra, then
145 * If extra = AllUnfiled, then All and Unfiled will be prepended to 145 * If extra = AllUnfiled, then All and Unfiled will be prepended to
146 * the list 146 * the list
147 * If extra = AllLabel, then All is prepended 147 * If extra = AllLabel, then All is prepended
148 * If extra = UnfiledLabel, then Unfiled is prepended 148 * If extra = UnfiledLabel, then Unfiled is prepended
149 */ 149 */
150 QStringList labels( const QString &app, 150 QStringList labels( const QString &app,
151 bool includeGlobal = TRUE, 151 bool includeGlobal = TRUE,
152 ExtraLabels extra = NoExtra ) const; 152 ExtraLabels extra = NoExtra ) const;
153 153
154 QStringList labels( const QString &app,
155 const QArray<int> &catids ) const;
156
154 enum DisplaySingle { ShowMulti, ShowAll, ShowFirst }; 157 enum DisplaySingle { ShowMulti, ShowAll, ShowFirst };
155 158
156 /** Returns a single string associated with the cat ids for display in 159 /** Returns a single string associated with the cat ids for display in
157 * a combobox or any area that requires one string. If catids are empty 160 * a combobox or any area that requires one string. If catids are empty
158 * then "Unfiled" will be returned. If multiple categories are assigned 161 * then "Unfiled" will be returned. If multiple categories are assigned
159 * then the behavior depends on the DisplaySingle type. 162 * then the behavior depends on the DisplaySingle type.
160 * If /a display is set to ShowMulti then " (multi)" appended to the 163 * If /a display is set to ShowMulti then " (multi)" appended to the
161 * first string. If /a display is set to ShowAll, then a space seperated 164 * first string. If /a display is set to ShowAll, then a space seperated
162 * string is returned with all categories. If ShowFirst is returned, 165 * string is returned with all categories. If ShowFirst is returned,
163 * the just the first string is returned. 166 * the just the first string is returned.
164 */ 167 */
165 QString displaySingle( const QString &app, 168 QString displaySingle( const QString &app,
166 const QArray<int> &catids, 169 const QArray<int> &catids,
167 DisplaySingle display ) const; 170 DisplaySingle display ) const;
168 171
169 QStringList globalCategories() const { return mGlobalCats.labels();} 172 QStringList globalCategories() const { return mGlobalCats.labels();}
170 173
171 bool renameCategory( const QString &appname, 174 bool renameCategory( const QString &appname,
172 const QString &oldName, 175 const QString &oldName,
173 const QString &newName ); 176 const QString &newName );
174 bool renameGlobalCategory( const QString &oldName, 177 bool renameGlobalCategory( const QString &oldName,
175 const QString &newName ); 178 const QString &newName );
176 179
177 void setGlobal( const QString &appname, const QString &catname, 180 void setGlobal( const QString &appname, const QString &catname,