summaryrefslogtreecommitdiffabout
path: root/kabc/plugins
Unidiff
Diffstat (limited to 'kabc/plugins') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/plugins/qtopia/qtopia.pro37
-rw-r--r--kabc/plugins/qtopia/qtopiaconverter.h5
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
2CONFIG += qt warn_on release
3
4TARGET = microkabc_qtopia
5
6INCLUDEPATH += ../.. ../../.. ../../../kabc ../../../microkde ../../../microkde/kdecore ../../../microkde/kio/kfile ../../../microkde/kio/kio ../../../microkde/kresources
7
8DESTDIR = ../../../bin
9#LIBS += -lmicrokde
10#LIBS += -lkamicrokabc
11
12DEFINES += KAB_EMBEDDED DESKTOP_VERSION
13
14INTERFACES = \
15
16HEADERS = \
17 resourceqtopia.h \
18 resourceqtopiaconfig.h \
19 qtopiaconverter.h
20
21SOURCES = \
22 resourceqtopia.cpp \
23 resourceqtopiaconfig.cpp \
24 qtopiaconverter.cpp
25
26
27
28unix : {
29OBJECTS_DIR = obj/unix
30MOC_DIR = moc/unix
31}
32win32: {
33CONFIG += dll
34DEFINES += _WIN32_
35OBJECTS_DIR = obj/win
36MOC_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,130 +1,133 @@
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/*
22Enhanced Version of the file for platform independent KDE tools. 22Enhanced Version of the file for platform independent KDE tools.
23Copyright (c) 2004 Ulf Schenk 23Copyright (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
35class Categories; 38class Categories;
36 39
37namespace KABC { 40namespace KABC {
38 41
39 42
40 43
41class OpieCategories { 44class 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
87class QtopiaConverter 90class QtopiaConverter
88{ 91{
89public: 92public:
90 93
91 /** 94 /**
92 * Constructor. 95 * Constructor.
93 */ 96 */
94 QtopiaConverter(); 97 QtopiaConverter();
95 98
96 /** 99 /**
97 * Destructor. 100 * Destructor.
98 */ 101 */
99 virtual ~QtopiaConverter(); 102 virtual ~QtopiaConverter();
100 103
101 bool init(); 104 bool init();
102 void deinit(); 105 void deinit();
103 106
104 /** 107 /**
105 * Converts a vcard string to an addressee. 108 * Converts a vcard string to an addressee.
106 * 109 *
107 * @param contact The qtopia contact. 110 * @param contact The qtopia contact.
108 * @param addr The addressee. 111 * @param addr The addressee.
109 */ 112 */
110 bool qtopiaToAddressee( const QDomElement& el, Addressee &adr ); 113 bool qtopiaToAddressee( const QDomElement& el, Addressee &adr );
111 /** 114 /**
112 * Converts an addressee to a vcard string. 115 * Converts an addressee to a vcard string.
113 * 116 *
114 * @param addr The addressee. 117 * @param addr The addressee.
115 * @param contact The qtopia contact. 118 * @param contact The qtopia contact.
116 */ 119 */
117 bool addresseeToQtopia( const Addressee &ab, QTextStream *stream ); 120 bool addresseeToQtopia( const Addressee &ab, QTextStream *stream );
118 121
119 private: 122 private:
120 QString categoriesToNumber( const QStringList &list, const QString &app ); 123 QString categoriesToNumber( const QStringList &list, const QString &app );
121 QString escape( const QString& s){ return s;}; 124 QString escape( const QString& s){ return s;};
122 CategoryEdit *m_edit; 125 CategoryEdit *m_edit;
123 QDate fromString( const QString& ); 126 QDate fromString( const QString& );
124 QDate dateFromString( const QString& ); 127 QDate dateFromString( const QString& );
125 QString dateToString( const QDate& ); 128 QString dateToString( const QDate& );
126 129
127 130
128}; 131};
129} 132}
130#endif 133#endif