-rw-r--r-- | library/backend/categories.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/library/backend/categories.h b/library/backend/categories.h index 91c93e7..6be3bc0 100644 --- a/library/backend/categories.h +++ b/library/backend/categories.h | |||
@@ -1,81 +1,82 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free | 7 | ** GNU General Public License version 2 as published by the Free |
8 | ** Software Foundation and appearing in the file LICENSE.GPL included | 8 | ** Software Foundation and appearing in the file LICENSE.GPL included |
9 | ** in the packaging of this file. | 9 | ** in the packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING |
12 | ** THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A | 12 | ** THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A |
13 | ** PARTICULAR PURPOSE. | 13 | ** PARTICULAR PURPOSE. |
14 | ** | 14 | ** |
15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 15 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
16 | ** | 16 | ** |
17 | ** Contact info@trolltech.com if any conditions of this licensing are | 17 | ** Contact info@trolltech.com if any conditions of this licensing are |
18 | ** not clear to you. | 18 | ** not clear to you. |
19 | ** | 19 | ** |
20 | **********************************************************************/ | 20 | **********************************************************************/ |
21 | 21 | ||
22 | #ifndef QTPALMTOP_CATEGORIES_H | 22 | #ifndef QTPALMTOP_CATEGORIES_H |
23 | #define QTPALMTOP_CATEGORIES_H | 23 | #define QTPALMTOP_CATEGORIES_H |
24 | 24 | ||
25 | #include <qstring.h> | 25 | #include <qstring.h> |
26 | #include <qstringlist.h> | 26 | #include <qstringlist.h> |
27 | #include <qmap.h> | 27 | #include <qmap.h> |
28 | #include <qlistview.h> | 28 | #include <qlistview.h> |
29 | #include <qarray.h> | 29 | #include <qarray.h> |
30 | #include "qpcglobal.h" | 30 | #include "qpcglobal.h" |
31 | #include "palmtopuidgen.h" | 31 | #include "palmtopuidgen.h" |
32 | 32 | ||
33 | class CategoryGroup; | 33 | class CategoryGroup; |
34 | QString categoryFileName(); | ||
34 | 35 | ||
35 | #if defined(QPC_TEMPLATEDLL) | 36 | #if defined(QPC_TEMPLATEDLL) |
36 | // MOC_SKIP_BEGIN | 37 | // MOC_SKIP_BEGIN |
37 | template class QPC_EXPORT QMap<int, QString>; | 38 | template class QPC_EXPORT QMap<int, QString>; |
38 | template class QPC_EXPORT QMap<QString, int>; | 39 | template class QPC_EXPORT QMap<QString, int>; |
39 | template class QPC_EXPORT QMap< QString, CategoryGroup >; | 40 | template class QPC_EXPORT QMap< QString, CategoryGroup >; |
40 | // MOC_SKIP_END | 41 | // MOC_SKIP_END |
41 | #endif | 42 | #endif |
42 | 43 | ||
43 | class QPC_EXPORT CategoryGroup | 44 | class QPC_EXPORT CategoryGroup |
44 | { | 45 | { |
45 | friend class Categories; | 46 | friend class Categories; |
46 | public: | 47 | public: |
47 | CategoryGroup(): mIdLabelMap(), mLabelIdMap() { } | 48 | CategoryGroup(): mIdLabelMap(), mLabelIdMap() { } |
48 | CategoryGroup( const CategoryGroup &c ) : | 49 | CategoryGroup( const CategoryGroup &c ) : |
49 | mIdLabelMap( c.mIdLabelMap), mLabelIdMap( c.mLabelIdMap ) { } | 50 | mIdLabelMap( c.mIdLabelMap), mLabelIdMap( c.mLabelIdMap ) { } |
50 | 51 | ||
51 | void clear() { mIdLabelMap.clear(); mLabelIdMap.clear(); } | 52 | void clear() { mIdLabelMap.clear(); mLabelIdMap.clear(); } |
52 | 53 | ||
53 | int add( const QString &label ); | 54 | int add( const QString &label ); |
54 | bool add( int uid, const QString &label ); | 55 | bool add( int uid, const QString &label ); |
55 | 56 | ||
56 | bool remove( const QString &label ); | 57 | bool remove( const QString &label ); |
57 | bool remove( int uid ); | 58 | bool remove( int uid ); |
58 | 59 | ||
59 | bool rename( int uid, const QString &newLabel ); | 60 | bool rename( int uid, const QString &newLabel ); |
60 | bool rename( const QString &oldLabel, const QString &newLabel ); | 61 | bool rename( const QString &oldLabel, const QString &newLabel ); |
61 | 62 | ||
62 | bool contains(int id) const; | 63 | bool contains(int id) const; |
63 | bool contains(const QString &label) const; | 64 | bool contains(const QString &label) const; |
64 | 65 | ||
65 | /** Returns label associated with the uid or QString::null if | 66 | /** Returns label associated with the uid or QString::null if |
66 | * not found | 67 | * not found |
67 | */ | 68 | */ |
68 | const QString &label(int id) const; | 69 | const QString &label(int id) const; |
69 | /** Returns the uid associated with label or 0 if not found */ | 70 | /** Returns the uid associated with label or 0 if not found */ |
70 | int id(const QString &label) const; | 71 | int id(const QString &label) const; |
71 | 72 | ||
72 | /** Returns a sorted list of labels */ | 73 | /** Returns a sorted list of labels */ |
73 | QStringList labels() const; | 74 | QStringList labels() const; |
74 | 75 | ||
75 | QStringList labels( const QArray<int> &catids ) const; | 76 | QStringList labels( const QArray<int> &catids ) const; |
76 | 77 | ||
77 | const QMap<int, QString> &idMap() const { return mIdLabelMap; } | 78 | const QMap<int, QString> &idMap() const { return mIdLabelMap; } |
78 | 79 | ||
79 | private: | 80 | private: |
80 | void insert( int uid, const QString &label ); | 81 | void insert( int uid, const QString &label ); |
81 | QMap<int, QString> mIdLabelMap; | 82 | QMap<int, QString> mIdLabelMap; |