-rw-r--r-- | kabc/plugins/qtopia/qtopia.pro | 37 | ||||
-rw-r--r-- | kabc/plugins/qtopia/qtopiaconverter.h | 5 |
2 files changed, 41 insertions, 1 deletions
diff --git a/kabc/plugins/qtopia/qtopia.pro b/kabc/plugins/qtopia/qtopia.pro new file mode 100644 index 0000000..6efb678 --- a/dev/null +++ b/kabc/plugins/qtopia/qtopia.pro | |||
@@ -0,0 +1,37 @@ | |||
1 | TEMPLATE= lib | ||
2 | CONFIG += qt warn_on release | ||
3 | |||
4 | TARGET = microkabc_qtopia | ||
5 | |||
6 | INCLUDEPATH += ../.. ../../.. ../../../kabc ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources | ||
7 | |||
8 | DESTDIR = ../../../bin | ||
9 | #LIBS += -lmicrokde | ||
10 | #LIBS += -lkamicrokabc | ||
11 | |||
12 | DEFINES += KAB_EMBEDDED DESKTOP_VERSION | ||
13 | |||
14 | INTERFACES = \ | ||
15 | |||
16 | HEADERS = \ | ||
17 | resourceqtopia.h \ | ||
18 | resourceqtopiaconfig.h \ | ||
19 | qtopiaconverter.h | ||
20 | |||
21 | SOURCES = \ | ||
22 | resourceqtopia.cpp \ | ||
23 | resourceqtopiaconfig.cpp \ | ||
24 | qtopiaconverter.cpp | ||
25 | |||
26 | |||
27 | |||
28 | unix : { | ||
29 | OBJECTS_DIR = obj/unix | ||
30 | MOC_DIR = moc/unix | ||
31 | } | ||
32 | win32: { | ||
33 | CONFIG += dll | ||
34 | DEFINES += _WIN32_ | ||
35 | OBJECTS_DIR = obj/win | ||
36 | MOC_DIR = moc/win | ||
37 | } | ||
diff --git a/kabc/plugins/qtopia/qtopiaconverter.h b/kabc/plugins/qtopia/qtopiaconverter.h index cb5b433..744dd41 100644 --- a/kabc/plugins/qtopia/qtopiaconverter.h +++ b/kabc/plugins/qtopia/qtopiaconverter.h | |||
@@ -1,98 +1,101 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of libkabc. | 2 | This file is part of libkabc. |
3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> | 3 | Copyright (c) 2002 Tobias Koenig <tokoe@kde.org> |
4 | 4 | ||
5 | This library is free software; you can redistribute it and/or | 5 | This library is free software; you can redistribute it and/or |
6 | modify it under the terms of the GNU Library General Public | 6 | modify it under the terms of the GNU Library General Public |
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 | 31 | ||
32 | #include "addressee.h" | 32 | #include "addressee.h" |
33 | 33 | #ifdef DESKTOP_VERSION | |
34 | #include <qdom.h> | ||
35 | #else | ||
34 | #include <xml/qdom.h> | 36 | #include <xml/qdom.h> |
37 | #endif | ||
35 | class Categories; | 38 | class Categories; |
36 | 39 | ||
37 | namespace KABC { | 40 | namespace KABC { |
38 | 41 | ||
39 | 42 | ||
40 | 43 | ||
41 | class OpieCategories { | 44 | class OpieCategories { |
42 | public: | 45 | public: |
43 | //friend class KSync::OpieSocket; | 46 | //friend class KSync::OpieSocket; |
44 | friend bool operator== ( const OpieCategories &a, const OpieCategories &b ); | 47 | friend bool operator== ( const OpieCategories &a, const OpieCategories &b ); |
45 | OpieCategories(); | 48 | OpieCategories(); |
46 | OpieCategories(const QString &id, const QString &name, const QString &app ); | 49 | OpieCategories(const QString &id, const QString &name, const QString &app ); |
47 | OpieCategories(const OpieCategories & ); | 50 | OpieCategories(const OpieCategories & ); |
48 | ~OpieCategories() {}; | 51 | ~OpieCategories() {}; |
49 | OpieCategories &operator=(const OpieCategories & ); | 52 | OpieCategories &operator=(const OpieCategories & ); |
50 | QString id()const; | 53 | QString id()const; |
51 | QString name()const; | 54 | QString name()const; |
52 | QString app()const; | 55 | QString app()const; |
53 | 56 | ||
54 | private: | 57 | private: |
55 | QString m_name; | 58 | QString m_name; |
56 | QString m_app; | 59 | QString m_app; |
57 | QString m_id; | 60 | QString m_id; |
58 | }; | 61 | }; |
59 | 62 | ||
60 | 63 | ||
61 | class CategoryEdit { | 64 | class CategoryEdit { |
62 | public: | 65 | public: |
63 | CategoryEdit(); | 66 | CategoryEdit(); |
64 | CategoryEdit(const QString &fileName); | 67 | CategoryEdit(const QString &fileName); |
65 | ~CategoryEdit(); | 68 | ~CategoryEdit(); |
66 | 69 | ||
67 | void save(const QString&) const; | 70 | void save(const QString&) const; |
68 | int addCategory( const QString &name, int id = 0 ); | 71 | int addCategory( const QString &name, int id = 0 ); |
69 | int addCategory(const QString &appName, const QString &name, int id = 0); | 72 | int addCategory(const QString &appName, const QString &name, int id = 0); |
70 | void parse( const QString &fileName ); | 73 | void parse( const QString &fileName ); |
71 | 74 | ||
72 | QString categoryById(const QString &id, const QString &app )const; | 75 | QString categoryById(const QString &id, const QString &app )const; |
73 | QStringList categoriesByIds( const QStringList& ids, const QString& app ); | 76 | QStringList categoriesByIds( const QStringList& ids, const QString& app ); |
74 | 77 | ||
75 | void clear(); | 78 | void clear(); |
76 | QValueList<OpieCategories> categories()const { return m_categories; }; | 79 | QValueList<OpieCategories> categories()const { return m_categories; }; |
77 | private: | 80 | private: |
78 | /** | 81 | /** |
79 | * this function will be used internally to update the kde categories... | 82 | * this function will be used internally to update the kde categories... |
80 | */ | 83 | */ |
81 | void updateKDE( const QString& app, const QStringList& categories ); | 84 | void updateKDE( const QString& app, const QStringList& categories ); |
82 | QMap<int, bool> ids; // from tt Qtopia::UidGen | 85 | QMap<int, bool> ids; // from tt Qtopia::UidGen |
83 | QValueList<OpieCategories> m_categories; | 86 | QValueList<OpieCategories> m_categories; |
84 | }; | 87 | }; |
85 | 88 | ||
86 | 89 | ||
87 | class QtopiaConverter | 90 | class QtopiaConverter |
88 | { | 91 | { |
89 | public: | 92 | public: |
90 | 93 | ||
91 | /** | 94 | /** |
92 | * Constructor. | 95 | * Constructor. |
93 | */ | 96 | */ |
94 | QtopiaConverter(); | 97 | QtopiaConverter(); |
95 | 98 | ||
96 | /** | 99 | /** |
97 | * Destructor. | 100 | * Destructor. |
98 | */ | 101 | */ |