summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/qtopia/qtopiaconverter.h
Unidiff
Diffstat (limited to 'kabc/plugins/qtopia/qtopiaconverter.h') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/qtopia/qtopiaconverter.h66
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
@@ -30,13 +30,62 @@ $Id$
30#include <qstring.h> 30#include <qstring.h>
31 31
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>
36class Categories; 37class Categories;
37 38
38namespace KABC { 39namespace KABC {
39 40
41
42
43class 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
40class QtopiaConverter 89class QtopiaConverter
41{ 90{
42public: 91public:
@@ -60,21 +109,24 @@ public:
60 * @param contact The qtopia contact. 109 * @param contact The qtopia contact.
61 * @param addr The addressee. 110 * @param addr The addressee.
62 */ 111 */
63 bool qtopiaToAddressee( const PimContact &contact, Addressee &addr ); 112 bool qtopiaToAddressee( const QDomElement& el, Addressee &adr );
64
65 /** 113 /**
66 * Converts an addressee to a vcard string. 114 * Converts an addressee to a vcard string.
67 * 115 *
68 * @param addr The addressee. 116 * @param addr The addressee.
69 * @param contact The qtopia contact. 117 * @param contact The qtopia contact.
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
76 129
77}; 130};
78
79} 131}
80#endif 132#endif