Diffstat (limited to 'kabc/plugins/qtopia/qtopiaconverter.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | kabc/plugins/qtopia/qtopiaconverter.h | 66 |
1 files changed, 59 insertions, 7 deletions
diff --git a/kabc/plugins/qtopia/qtopiaconverter.h b/kabc/plugins/qtopia/qtopiaconverter.h index 012a6e2..d318ded 100644 --- a/kabc/plugins/qtopia/qtopiaconverter.h +++ b/kabc/plugins/qtopia/qtopiaconverter.h | |||
@@ -32,5 +32,6 @@ $Id$ | |||
32 | #include "addressee.h" | 32 | #include "addressee.h" |
33 | #include <qpe/pim/contact.h> | 33 | //#include <qpe/pim/contact.h> |
34 | #include <qpe/quuid.h> | 34 | //#include <qpe/quuid.h> |
35 | 35 | ||
36 | #include <xml/qdom.h> | ||
36 | class Categories; | 37 | class Categories; |
@@ -39,2 +40,50 @@ namespace KABC { | |||
39 | 40 | ||
41 | |||
42 | |||
43 | class OpieCategories { | ||
44 | public: | ||
45 | //friend class KSync::OpieSocket; | ||
46 | friend bool operator== ( const OpieCategories &a, const OpieCategories &b ); | ||
47 | OpieCategories(); | ||
48 | OpieCategories(const QString &id, const QString &name, const QString &app ); | ||
49 | OpieCategories(const OpieCategories & ); | ||
50 | ~OpieCategories() {}; | ||
51 | OpieCategories &operator=(const OpieCategories & ); | ||
52 | QString id()const; | ||
53 | QString name()const; | ||
54 | QString app()const; | ||
55 | |||
56 | private: | ||
57 | QString m_name; | ||
58 | QString m_app; | ||
59 | QString m_id; | ||
60 | }; | ||
61 | |||
62 | |||
63 | class CategoryEdit { | ||
64 | public: | ||
65 | CategoryEdit(); | ||
66 | CategoryEdit(const QString &fileName); | ||
67 | ~CategoryEdit(); | ||
68 | |||
69 | void save(const QString&) const; | ||
70 | int addCategory( const QString &name, int id = 0 ); | ||
71 | int addCategory(const QString &appName, const QString &name, int id = 0); | ||
72 | void parse( const QString &fileName ); | ||
73 | |||
74 | QString categoryById(const QString &id, const QString &app )const; | ||
75 | QStringList categoriesByIds( const QStringList& ids, const QString& app ); | ||
76 | |||
77 | void clear(); | ||
78 | QValueList<OpieCategories> categories()const { return m_categories; }; | ||
79 | private: | ||
80 | /** | ||
81 | * this function will be used internally to update the kde categories... | ||
82 | */ | ||
83 | void updateKDE( const QString& app, const QStringList& categories ); | ||
84 | QMap<int, bool> ids; // from tt Qtopia::UidGen | ||
85 | QValueList<OpieCategories> m_categories; | ||
86 | }; | ||
87 | |||
88 | |||
40 | class QtopiaConverter | 89 | class QtopiaConverter |
@@ -62,4 +111,3 @@ public: | |||
62 | */ | 111 | */ |
63 | bool qtopiaToAddressee( const PimContact &contact, Addressee &addr ); | 112 | bool qtopiaToAddressee( const QDomElement& el, Addressee &adr ); |
64 | |||
65 | /** | 113 | /** |
@@ -70,6 +118,11 @@ public: | |||
70 | */ | 118 | */ |
71 | bool addresseeToQtopia( const Addressee &addr, PimContact &contact ); | 119 | bool addresseeToQtopia( const Addressee &ab, QTextStream *stream ); |
72 | 120 | ||
73 | private: | 121 | private: |
74 | Categories* catDB; | 122 | QString categoriesToNumber( const QStringList &list, const QString &app ); |
123 | QString escape( const QString& s){ return s;}; | ||
124 | CategoryEdit *m_edit; | ||
125 | QDate fromString( const QString& ); | ||
126 | QDate dateFromString( const QString& ); | ||
127 | QString dateToString( const QDate& ); | ||
75 | 128 | ||
@@ -77,3 +130,2 @@ public: | |||
77 | }; | 130 | }; |
78 | |||
79 | } | 131 | } |