author | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2007-07-04 11:23:42 (UTC) |
commit | a08aff328d4393031d5ba7d622c2b05705a89d73 (patch) (unidiff) | |
tree | 8ee90d686081c52e7c69b5ce946e9b1a7d690001 /kabc/plugins/qtopia/qtopiaconverter.h | |
parent | 11edc920afe4f274c0964436633aa632c8288a40 (diff) | |
download | kdepimpi-p1.zip kdepimpi-p1.tar.gz kdepimpi-p1.tar.bz2 |
initial public commit of qt4 portp1
Diffstat (limited to 'kabc/plugins/qtopia/qtopiaconverter.h') (more/less context) (show whitespace changes)
-rw-r--r-- | kabc/plugins/qtopia/qtopiaconverter.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/kabc/plugins/qtopia/qtopiaconverter.h b/kabc/plugins/qtopia/qtopiaconverter.h index 744dd41..389926c 100644 --- a/kabc/plugins/qtopia/qtopiaconverter.h +++ b/kabc/plugins/qtopia/qtopiaconverter.h | |||
@@ -7,127 +7,130 @@ | |||
7 | License as published by the Free Software Foundation; either | 7 | License as published by the Free Software Foundation; either |
8 | version 2 of the License, or (at your option) any later version. | 8 | version 2 of the License, or (at your option) any later version. |
9 | 9 | ||
10 | This library is distributed in the hope that it will be useful, | 10 | This library is distributed in the hope that it will be useful, |
11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
13 | Library General Public License for more details. | 13 | Library General Public License for more details. |
14 | 14 | ||
15 | You should have received a copy of the GNU Library General Public License | 15 | You should have received a copy of the GNU Library General Public License |
16 | along with this library; see the file COPYING.LIB. If not, write to | 16 | along with this library; see the file COPYING.LIB. If not, write to |
17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 17 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
18 | Boston, MA 02111-1307, USA. | 18 | Boston, MA 02111-1307, USA. |
19 | */ | 19 | */ |
20 | 20 | ||
21 | /* | 21 | /* |
22 | Enhanced Version of the file for platform independent KDE tools. | 22 | Enhanced Version of the file for platform independent KDE tools. |
23 | Copyright (c) 2004 Ulf Schenk | 23 | Copyright (c) 2004 Ulf Schenk |
24 | $Id$ | 24 | $Id$ |
25 | */ | 25 | */ |
26 | 26 | ||
27 | #ifndef KABC_QTOPIACONVERTER_H | 27 | #ifndef KABC_QTOPIACONVERTER_H |
28 | #define KABC_QTOPIACONVERTER_H | 28 | #define KABC_QTOPIACONVERTER_H |
29 | 29 | ||
30 | #include <qstring.h> | 30 | #include <qstring.h> |
31 | //Added by qt3to4: | ||
32 | #include <Q3ValueList> | ||
33 | #include <Q3TextStream> | ||
31 | 34 | ||
32 | #include "addressee.h" | 35 | #include "addressee.h" |
33 | #ifdef DESKTOP_VERSION | 36 | #ifdef DESKTOP_VERSION |
34 | #include <qdom.h> | 37 | #include <qdom.h> |
35 | #else | 38 | #else |
36 | #include <xml/qdom.h> | 39 | #include <xml/qdom.h> |
37 | #endif | 40 | #endif |
38 | class Categories; | 41 | class Categories; |
39 | 42 | ||
40 | namespace KABC { | 43 | namespace KABC { |
41 | 44 | ||
42 | 45 | ||
43 | 46 | ||
44 | class OpieCategories { | 47 | class OpieCategories { |
45 | public: | 48 | public: |
46 | //friend class KSync::OpieSocket; | 49 | //friend class KSync::OpieSocket; |
47 | friend bool operator== ( const OpieCategories &a, const OpieCategories &b ); | 50 | friend bool operator== ( const OpieCategories &a, const OpieCategories &b ); |
48 | OpieCategories(); | 51 | OpieCategories(); |
49 | OpieCategories(const QString &id, const QString &name, const QString &app ); | 52 | OpieCategories(const QString &id, const QString &name, const QString &app ); |
50 | OpieCategories(const OpieCategories & ); | 53 | OpieCategories(const OpieCategories & ); |
51 | ~OpieCategories() {}; | 54 | ~OpieCategories() {}; |
52 | OpieCategories &operator=(const OpieCategories & ); | 55 | OpieCategories &operator=(const OpieCategories & ); |
53 | QString id()const; | 56 | QString id()const; |
54 | QString name()const; | 57 | QString name()const; |
55 | QString app()const; | 58 | QString app()const; |
56 | 59 | ||
57 | private: | 60 | private: |
58 | QString m_name; | 61 | QString m_name; |
59 | QString m_app; | 62 | QString m_app; |
60 | QString m_id; | 63 | QString m_id; |
61 | }; | 64 | }; |
62 | 65 | ||
63 | 66 | ||
64 | class CategoryEdit { | 67 | class CategoryEdit { |
65 | public: | 68 | public: |
66 | CategoryEdit(); | 69 | CategoryEdit(); |
67 | CategoryEdit(const QString &fileName); | 70 | CategoryEdit(const QString &fileName); |
68 | ~CategoryEdit(); | 71 | ~CategoryEdit(); |
69 | 72 | ||
70 | void save(const QString&) const; | 73 | void save(const QString&) const; |
71 | int addCategory( const QString &name, int id = 0 ); | 74 | int addCategory( const QString &name, int id = 0 ); |
72 | int addCategory(const QString &appName, const QString &name, int id = 0); | 75 | int addCategory(const QString &appName, const QString &name, int id = 0); |
73 | void parse( const QString &fileName ); | 76 | void parse( const QString &fileName ); |
74 | 77 | ||
75 | QString categoryById(const QString &id, const QString &app )const; | 78 | QString categoryById(const QString &id, const QString &app )const; |
76 | QStringList categoriesByIds( const QStringList& ids, const QString& app ); | 79 | QStringList categoriesByIds( const QStringList& ids, const QString& app ); |
77 | 80 | ||
78 | void clear(); | 81 | void clear(); |
79 | QValueList<OpieCategories> categories()const { return m_categories; }; | 82 | Q3ValueList<OpieCategories> categories()const { return m_categories; }; |
80 | private: | 83 | private: |
81 | /** | 84 | /** |
82 | * this function will be used internally to update the kde categories... | 85 | * this function will be used internally to update the kde categories... |
83 | */ | 86 | */ |
84 | void updateKDE( const QString& app, const QStringList& categories ); | 87 | void updateKDE( const QString& app, const QStringList& categories ); |
85 | QMap<int, bool> ids; // from tt Qtopia::UidGen | 88 | QMap<int, bool> ids; // from tt Qtopia::UidGen |
86 | QValueList<OpieCategories> m_categories; | 89 | Q3ValueList<OpieCategories> m_categories; |
87 | }; | 90 | }; |
88 | 91 | ||
89 | 92 | ||
90 | class QtopiaConverter | 93 | class QtopiaConverter |
91 | { | 94 | { |
92 | public: | 95 | public: |
93 | 96 | ||
94 | /** | 97 | /** |
95 | * Constructor. | 98 | * Constructor. |
96 | */ | 99 | */ |
97 | QtopiaConverter(); | 100 | QtopiaConverter(); |
98 | 101 | ||
99 | /** | 102 | /** |
100 | * Destructor. | 103 | * Destructor. |
101 | */ | 104 | */ |
102 | virtual ~QtopiaConverter(); | 105 | virtual ~QtopiaConverter(); |
103 | 106 | ||
104 | bool init(); | 107 | bool init(); |
105 | void deinit(); | 108 | void deinit(); |
106 | 109 | ||
107 | /** | 110 | /** |
108 | * Converts a vcard string to an addressee. | 111 | * Converts a vcard string to an addressee. |
109 | * | 112 | * |
110 | * @param contact The qtopia contact. | 113 | * @param contact The qtopia contact. |
111 | * @param addr The addressee. | 114 | * @param addr The addressee. |
112 | */ | 115 | */ |
113 | bool qtopiaToAddressee( const QDomElement& el, Addressee &adr ); | 116 | bool qtopiaToAddressee( const QDomElement& el, Addressee &adr ); |
114 | /** | 117 | /** |
115 | * Converts an addressee to a vcard string. | 118 | * Converts an addressee to a vcard string. |
116 | * | 119 | * |
117 | * @param addr The addressee. | 120 | * @param addr The addressee. |
118 | * @param contact The qtopia contact. | 121 | * @param contact The qtopia contact. |
119 | */ | 122 | */ |
120 | bool addresseeToQtopia( const Addressee &ab, QTextStream *stream ); | 123 | bool addresseeToQtopia( const Addressee &ab, Q3TextStream *stream ); |
121 | 124 | ||
122 | private: | 125 | private: |
123 | QString categoriesToNumber( const QStringList &list, const QString &app ); | 126 | QString categoriesToNumber( const QStringList &list, const QString &app ); |
124 | QString escape( const QString& s){ return s;}; | 127 | QString escape( const QString& s){ return s;}; |
125 | CategoryEdit *m_edit; | 128 | CategoryEdit *m_edit; |
126 | QDate fromString( const QString& ); | 129 | QDate fromString( const QString& ); |
127 | QDate dateFromString( const QString& ); | 130 | QDate dateFromString( const QString& ); |
128 | QString dateToString( const QDate& ); | 131 | QString dateToString( const QDate& ); |
129 | 132 | ||
130 | 133 | ||
131 | }; | 134 | }; |
132 | } | 135 | } |
133 | #endif | 136 | #endif |