summaryrefslogtreecommitdiffabout
path: root/kaddressbook
Unidiff
Diffstat (limited to 'kaddressbook') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/kaddressbook.pro8
-rw-r--r--kaddressbook/kaddressbookE.pro8
-rw-r--r--kaddressbook/xxportmanager.cpp15
-rw-r--r--kaddressbook/xxportobject.cpp21
-rw-r--r--kaddressbook/xxportobject.h35
5 files changed, 78 insertions, 9 deletions
diff --git a/kaddressbook/kaddressbook.pro b/kaddressbook/kaddressbook.pro
index 77fce1b..0da5842 100644
--- a/kaddressbook/kaddressbook.pro
+++ b/kaddressbook/kaddressbook.pro
@@ -1,177 +1,183 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on 2 CONFIG = qt warn_on
3 TARGET = kapi 3 TARGET = kapi
4DESTDIR= ../bin 4DESTDIR= ../bin
5 5
6include( ../variables.pri ) 6include( ../variables.pri )
7 7
8 8
9INCLUDEPATH += . ./details ./features ./kcmconfigs ./xxport ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../kabc ../ interfaces 9INCLUDEPATH += . ./details ./features ./kcmconfigs ./xxport ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../ interfaces
10DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION 10DEFINES += KAB_EMBEDDED KAB_NOSPLITTER DESKTOP_VERSION
11 11
12unix : { 12unix : {
13LIBS += ../bin/libmicrokdepim.so 13LIBS += ../bin/libmicrokdepim.so
14LIBS += ../bin/libmicrokde.so 14LIBS += ../bin/libmicrokde.so
15LIBS += ../bin/libmicrokabc.so 15LIBS += ../bin/libmicrokabc.so
16LIBS += ../bin/libmicrokcal.so 16LIBS += ../bin/libmicrokcal.so
17LIBS += -lldap 17LIBS += -lldap
18OBJECTS_DIR = obj/unix 18OBJECTS_DIR = obj/unix
19MOC_DIR = moc/unix 19MOC_DIR = moc/unix
20} 20}
21win32: { 21win32: {
22DEFINES += _WIN32_ 22DEFINES += _WIN32_
23LIBS += ../bin/microkdepim.lib 23LIBS += ../bin/microkdepim.lib
24LIBS += ../bin/microkcal.lib 24LIBS += ../bin/microkcal.lib
25LIBS += ../bin/microkde.lib 25LIBS += ../bin/microkde.lib
26LIBS += ../bin/microkabc.lib 26LIBS += ../bin/microkabc.lib
27QMAKE_LINK += /NODEFAULTLIB:LIBC 27QMAKE_LINK += /NODEFAULTLIB:LIBC
28OBJECTS_DIR = obj/win 28OBJECTS_DIR = obj/win
29MOC_DIR = moc/win 29MOC_DIR = moc/win
30LIBS += mfc71u.lib 30LIBS += mfc71u.lib
31} 31}
32 32
33 33
34 34
35 35
36 36
37 37
38 38
39 39
40INTERFACES = \ 40INTERFACES = \
41# filteredit_base.ui \ 41# filteredit_base.ui \
42# kofilterview_base.ui \ 42# kofilterview_base.ui \
43 43
44HEADERS = \ 44HEADERS = \
45features/mergewidget.h \ 45features/mergewidget.h \
46features/distributionlistwidget.h \ 46features/distributionlistwidget.h \
47kcmconfigs/addresseewidget.h \ 47kcmconfigs/addresseewidget.h \
48kcmconfigs/extensionconfigdialog.h \ 48kcmconfigs/extensionconfigdialog.h \
49kcmconfigs/kcmkabconfig.h \ 49kcmconfigs/kcmkabconfig.h \
50kcmconfigs/kabconfigwidget.h \ 50kcmconfigs/kabconfigwidget.h \
51addresseeeditordialog.h \ 51addresseeeditordialog.h \
52addresseeeditorwidget.h \ 52addresseeeditorwidget.h \
53addresseditwidget.h \ 53addresseditwidget.h \
54addresseeconfig.h \ 54addresseeconfig.h \
55addresseeutil.h \ 55addresseeutil.h \
56emaileditwidget.h \ 56emaileditwidget.h \
57filtereditdialog.h \ 57filtereditdialog.h \
58kaddressbookmain.h \ 58kaddressbookmain.h \
59kabprefs.h \ 59kabprefs.h \
60kabcore.h \ 60kabcore.h \
61viewmanager.h \ 61viewmanager.h \
62extensionmanager.h \ 62extensionmanager.h \
63extensionwidget.h \ 63extensionwidget.h \
64kaddressbookview.h \ 64kaddressbookview.h \
65geowidget.h \ 65geowidget.h \
66imagewidget.h \ 66imagewidget.h \
67incsearchwidget.h \ 67incsearchwidget.h \
68jumpbuttonbar.h \ 68jumpbuttonbar.h \
69phoneeditwidget.h \ 69phoneeditwidget.h \
70secrecywidget.h \ 70secrecywidget.h \
71keywidget.h \ 71keywidget.h \
72nameeditdialog.h \ 72nameeditdialog.h \
73filter.h \ 73filter.h \
74addviewdialog.h \ 74addviewdialog.h \
75configurewidget.h \ 75configurewidget.h \
76viewconfigurewidget.h \ 76viewconfigurewidget.h \
77viewconfigurefieldspage.h \ 77viewconfigurefieldspage.h \
78viewconfigurefilterpage.h \ 78viewconfigurefilterpage.h \
79typecombo.h \ 79typecombo.h \
80undo.h \ 80undo.h \
81undocmds.h \ 81undocmds.h \
82xxportmanager.h \ 82xxportmanager.h \
83xxportobject.h \ 83xxportobject.h \
84xxportselectdialog.h \ 84xxportselectdialog.h \
85details/detailsviewcontainer.h \ 85details/detailsviewcontainer.h \
86details/look_basic.h \ 86details/look_basic.h \
87details/look_html.h \ 87details/look_html.h \
88views/kaddressbookiconview.h \ 88views/kaddressbookiconview.h \
89views/kaddressbooktableview.h \ 89views/kaddressbooktableview.h \
90views/kaddressbookcardview.h \ 90views/kaddressbookcardview.h \
91views/configuretableviewdialog.h \ 91views/configuretableviewdialog.h \
92views/configurecardviewdialog.h \ 92views/configurecardviewdialog.h \
93views/cardview.h \ 93views/cardview.h \
94views/colorlistbox.h \ 94views/colorlistbox.h \
95views/contactlistview.h \ 95views/contactlistview.h \
96xxport/vcard_xxport.h \ 96xxport/vcard_xxport.h \
97xxport/kde2_xxport.h \ 97xxport/kde2_xxport.h \
98xxport/csv_xxport.h \ 98xxport/csv_xxport.h \
99xxport/csvimportdialog.h \ 99xxport/csvimportdialog.h \
100xxport/opie_xxport.h \
101xxport/qtopia_xxport.h \
102xxport/sharpdtm_xxport.h \
100#details/look_details.h \ 103#details/look_details.h \
101#mainwindoiw.h \ 104#mainwindoiw.h \
102# alarmclient.h \ 105# alarmclient.h \
103# calendarview.h \ 106# calendarview.h \
104# customlistviewitem.h \ 107# customlistviewitem.h \
105# datenavigator.h 108# datenavigator.h
106 109
107SOURCES = \ 110SOURCES = \
108addresseeeditordialog.cpp \ 111addresseeeditordialog.cpp \
109addresseeeditorwidget.cpp \ 112addresseeeditorwidget.cpp \
110addresseditwidget.cpp \ 113addresseditwidget.cpp \
111addresseeconfig.cpp \ 114addresseeconfig.cpp \
112addresseeutil.cpp \ 115addresseeutil.cpp \
113extensionmanager.cpp \ 116extensionmanager.cpp \
114features/mergewidget.cpp \ 117features/mergewidget.cpp \
115features/distributionlistwidget.cpp \ 118features/distributionlistwidget.cpp \
116kcmconfigs/addresseewidget.cpp \ 119kcmconfigs/addresseewidget.cpp \
117kcmconfigs/extensionconfigdialog.cpp \ 120kcmconfigs/extensionconfigdialog.cpp \
118kcmconfigs/kcmkabconfig.cpp \ 121kcmconfigs/kcmkabconfig.cpp \
119kcmconfigs/kabconfigwidget.cpp \ 122kcmconfigs/kabconfigwidget.cpp \
120emaileditwidget.cpp \ 123emaileditwidget.cpp \
121filtereditdialog.cpp \ 124filtereditdialog.cpp \
122mainembedded.cpp \ 125mainembedded.cpp \
123kaddressbookmain.cpp \ 126kaddressbookmain.cpp \
124kabcore.cpp \ 127kabcore.cpp \
125kabprefs.cpp \ 128kabprefs.cpp \
126viewmanager.cpp \ 129viewmanager.cpp \
127kaddressbookview.cpp \ 130kaddressbookview.cpp \
128extensionwidget.cpp \ 131extensionwidget.cpp \
129geowidget.cpp \ 132geowidget.cpp \
130imagewidget.cpp \ 133imagewidget.cpp \
131incsearchwidget.cpp \ 134incsearchwidget.cpp \
132jumpbuttonbar.cpp \ 135jumpbuttonbar.cpp \
133phoneeditwidget.cpp \ 136phoneeditwidget.cpp \
134secrecywidget.cpp \ 137secrecywidget.cpp \
135keywidget.cpp \ 138keywidget.cpp \
136nameeditdialog.cpp \ 139nameeditdialog.cpp \
137filter.cpp \ 140filter.cpp \
138addviewdialog.cpp \ 141addviewdialog.cpp \
139configurewidget.cpp \ 142configurewidget.cpp \
140viewconfigurewidget.cpp \ 143viewconfigurewidget.cpp \
141viewconfigurefieldspage.cpp \ 144viewconfigurefieldspage.cpp \
142viewconfigurefilterpage.cpp \ 145viewconfigurefilterpage.cpp \
143undo.cpp \ 146undo.cpp \
144undocmds.cpp \ 147undocmds.cpp \
145xxportmanager.cpp \ 148xxportmanager.cpp \
146xxportobject.cpp \ 149xxportobject.cpp \
147xxportselectdialog.cpp \ 150xxportselectdialog.cpp \
148details/detailsviewcontainer.cpp \ 151details/detailsviewcontainer.cpp \
149details/look_basic.cpp \ 152details/look_basic.cpp \
150details/look_html.cpp \ 153details/look_html.cpp \
151views/kaddressbookiconview.cpp \ 154views/kaddressbookiconview.cpp \
152views/kaddressbooktableview.cpp \ 155views/kaddressbooktableview.cpp \
153views/kaddressbookcardview.cpp \ 156views/kaddressbookcardview.cpp \
154views/configuretableviewdialog.cpp \ 157views/configuretableviewdialog.cpp \
155views/configurecardviewdialog.cpp \ 158views/configurecardviewdialog.cpp \
156views/cardview.cpp \ 159views/cardview.cpp \
157views/contactlistview.cpp \ 160views/contactlistview.cpp \
158views/colorlistbox.cpp \ 161views/colorlistbox.cpp \
159xxport/vcard_xxport.cpp \ 162xxport/vcard_xxport.cpp \
160xxport/kde2_xxport.cpp \ 163xxport/kde2_xxport.cpp \
161xxport/csv_xxport.cpp \ 164xxport/csv_xxport.cpp \
162xxport/csvimportdialog.cpp \ 165xxport/csvimportdialog.cpp \
166xxport/opie_xxport.cpp \
167xxport/qtopia_xxport.cpp \
168xxport/sharpdtm_xxport.cpp \
163#details/look_details.cpp \ 169#details/look_details.cpp \
164#mainwindow.cpp \ 170#mainwindow.cpp \
165# calendarview.cpp \ 171# calendarview.cpp \
166# timespanview.cpp 172# timespanview.cpp
167 173
168 174
169 175
170win32: { 176win32: {
171HEADERS += ../outport/msoutl9.h \ 177HEADERS += ../outport/msoutl9.h \
172 kaimportoldialog.h 178 kaimportoldialog.h
173 179
174SOURCES += ../outport/msoutl9.cpp \ 180SOURCES += ../outport/msoutl9.cpp \
175 kaimportoldialog.cpp 181 kaimportoldialog.cpp
176} 182}
177 183
diff --git a/kaddressbook/kaddressbookE.pro b/kaddressbook/kaddressbookE.pro
index dc4a2f2..95e6641 100644
--- a/kaddressbook/kaddressbookE.pro
+++ b/kaddressbook/kaddressbookE.pro
@@ -1,157 +1,163 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG += qt warn_on 2 CONFIG += qt warn_on
3 3
4 4
5 TARGET = kapi 5 TARGET = kapi
6OBJECTS_DIR = obj/$(PLATFORM) 6OBJECTS_DIR = obj/$(PLATFORM)
7MOC_DIR = moc/$(PLATFORM) 7MOC_DIR = moc/$(PLATFORM)
8DESTDIR=$(QPEDIR)/bin 8DESTDIR=$(QPEDIR)/bin
9 9
10#LFLAGS += -Wl,-export-dynamic 10#LFLAGS += -Wl,-export-dynamic
11 11
12 12
13INCLUDEPATH += . ./details ./features ./kcmconfigs ./xxport ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include 13INCLUDEPATH += . ./details ./features ./kcmconfigs ./xxport ../microkde ../microkde/kdecore ../microkde/kutils ../microkde/kio/kfile ../microkde/kio/kio ../microkde/kdeui ../microkde/kresources ../kabc ../qtcompat ../ interfaces $(QPEDIR)/include
14DEFINES += KAB_EMBEDDED KAB_NOSPLITTER 14DEFINES += KAB_EMBEDDED KAB_NOSPLITTER
15#DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL 15#DEFINES += KORG_NODND KORG_NOPLUGINS KORG_NOKABC KORG_NOARCHIVE KORG_NOMAIL
16#DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER 16#DEFINES += KORG_NOPRINTER KORG_NODCOP KORG_NOKALARMD KORG_NORESOURCEVIEW KORG_NOSPLITTER
17#DEFINES += KORG_NOLVALTERNATION 17#DEFINES += KORG_NOLVALTERNATION
18LIBS += -lmicrokdepim 18LIBS += -lmicrokdepim
19#LIBS += -lmicrokcal 19#LIBS += -lmicrokcal
20LIBS += -lmicrokde 20LIBS += -lmicrokde
21LIBS += -lmicrokcal 21LIBS += -lmicrokcal
22LIBS += -lmicroqtcompat 22LIBS += -lmicroqtcompat
23LIBS += -lmicrokabc 23LIBS += -lmicrokabc
24LIBS += -lqpe 24LIBS += -lqpe
25LIBS += -ljpeg 25LIBS += -ljpeg
26LIBS += $(QTOPIALIB) 26LIBS += $(QTOPIALIB)
27LIBS += -L$(QPEDIR)/lib 27LIBS += -L$(QPEDIR)/lib
28LIBS += -Wl,-export-dynamic 28LIBS += -Wl,-export-dynamic
29 29
30INTERFACES = \ 30INTERFACES = \
31# filteredit_base.ui \ 31# filteredit_base.ui \
32# kofilterview_base.ui \ 32# kofilterview_base.ui \
33 33
34HEADERS = \ 34HEADERS = \
35features/mergewidget.h \ 35features/mergewidget.h \
36features/distributionlistwidget.h \ 36features/distributionlistwidget.h \
37kcmconfigs/addresseewidget.h \ 37kcmconfigs/addresseewidget.h \
38kcmconfigs/extensionconfigdialog.h \ 38kcmconfigs/extensionconfigdialog.h \
39kcmconfigs/kcmkabconfig.h \ 39kcmconfigs/kcmkabconfig.h \
40kcmconfigs/kabconfigwidget.h \ 40kcmconfigs/kabconfigwidget.h \
41addresseeeditordialog.h \ 41addresseeeditordialog.h \
42addresseeeditorwidget.h \ 42addresseeeditorwidget.h \
43addresseditwidget.h \ 43addresseditwidget.h \
44addresseeconfig.h \ 44addresseeconfig.h \
45addresseeutil.h \ 45addresseeutil.h \
46emaileditwidget.h \ 46emaileditwidget.h \
47filtereditdialog.h \ 47filtereditdialog.h \
48kaddressbookmain.h \ 48kaddressbookmain.h \
49kabprefs.h \ 49kabprefs.h \
50kabcore.h \ 50kabcore.h \
51viewmanager.h \ 51viewmanager.h \
52extensionmanager.h \ 52extensionmanager.h \
53extensionwidget.h \ 53extensionwidget.h \
54kaddressbookview.h \ 54kaddressbookview.h \
55geowidget.h \ 55geowidget.h \
56imagewidget.h \ 56imagewidget.h \
57incsearchwidget.h \ 57incsearchwidget.h \
58jumpbuttonbar.h \ 58jumpbuttonbar.h \
59phoneeditwidget.h \ 59phoneeditwidget.h \
60secrecywidget.h \ 60secrecywidget.h \
61keywidget.h \ 61keywidget.h \
62nameeditdialog.h \ 62nameeditdialog.h \
63filter.h \ 63filter.h \
64addviewdialog.h \ 64addviewdialog.h \
65configurewidget.h \ 65configurewidget.h \
66viewconfigurewidget.h \ 66viewconfigurewidget.h \
67viewconfigurefieldspage.h \ 67viewconfigurefieldspage.h \
68viewconfigurefilterpage.h \ 68viewconfigurefilterpage.h \
69typecombo.h \ 69typecombo.h \
70undo.h \ 70undo.h \
71undocmds.h \ 71undocmds.h \
72xxportmanager.h \ 72xxportmanager.h \
73xxportobject.h \ 73xxportobject.h \
74xxportselectdialog.h \ 74xxportselectdialog.h \
75details/detailsviewcontainer.h \ 75details/detailsviewcontainer.h \
76details/look_basic.h \ 76details/look_basic.h \
77details/look_html.h \ 77details/look_html.h \
78views/kaddressbookiconview.h \ 78views/kaddressbookiconview.h \
79views/kaddressbooktableview.h \ 79views/kaddressbooktableview.h \
80views/kaddressbookcardview.h \ 80views/kaddressbookcardview.h \
81views/configuretableviewdialog.h \ 81views/configuretableviewdialog.h \
82views/configurecardviewdialog.h \ 82views/configurecardviewdialog.h \
83views/cardview.h \ 83views/cardview.h \
84views/colorlistbox.h \ 84views/colorlistbox.h \
85views/contactlistview.h \ 85views/contactlistview.h \
86xxport/vcard_xxport.h \ 86xxport/vcard_xxport.h \
87xxport/kde2_xxport.h \ 87xxport/kde2_xxport.h \
88xxport/csv_xxport.h \ 88xxport/csv_xxport.h \
89xxport/csvimportdialog.h \ 89xxport/csvimportdialog.h \
90xxport/opie_xxport.h \
91xxport/qtopia_xxport.h \
92xxport/sharpdtm_xxport.h \
90#details/look_details.h \ 93#details/look_details.h \
91#mainwindoiw.h \ 94#mainwindoiw.h \
92# alarmclient.h \ 95# alarmclient.h \
93# calendarview.h \ 96# calendarview.h \
94# customlistviewitem.h \ 97# customlistviewitem.h \
95# datenavigator.h 98# datenavigator.h
96 99
97SOURCES = \ 100SOURCES = \
98addresseeeditordialog.cpp \ 101addresseeeditordialog.cpp \
99addresseeeditorwidget.cpp \ 102addresseeeditorwidget.cpp \
100addresseditwidget.cpp \ 103addresseditwidget.cpp \
101addresseeconfig.cpp \ 104addresseeconfig.cpp \
102addresseeutil.cpp \ 105addresseeutil.cpp \
103extensionmanager.cpp \ 106extensionmanager.cpp \
104features/mergewidget.cpp \ 107features/mergewidget.cpp \
105features/distributionlistwidget.cpp \ 108features/distributionlistwidget.cpp \
106kcmconfigs/addresseewidget.cpp \ 109kcmconfigs/addresseewidget.cpp \
107kcmconfigs/extensionconfigdialog.cpp \ 110kcmconfigs/extensionconfigdialog.cpp \
108kcmconfigs/kcmkabconfig.cpp \ 111kcmconfigs/kcmkabconfig.cpp \
109kcmconfigs/kabconfigwidget.cpp \ 112kcmconfigs/kabconfigwidget.cpp \
110emaileditwidget.cpp \ 113emaileditwidget.cpp \
111filtereditdialog.cpp \ 114filtereditdialog.cpp \
112mainembedded.cpp \ 115mainembedded.cpp \
113kaddressbookmain.cpp \ 116kaddressbookmain.cpp \
114kabcore.cpp \ 117kabcore.cpp \
115kabprefs.cpp \ 118kabprefs.cpp \
116viewmanager.cpp \ 119viewmanager.cpp \
117kaddressbookview.cpp \ 120kaddressbookview.cpp \
118extensionwidget.cpp \ 121extensionwidget.cpp \
119geowidget.cpp \ 122geowidget.cpp \
120imagewidget.cpp \ 123imagewidget.cpp \
121incsearchwidget.cpp \ 124incsearchwidget.cpp \
122jumpbuttonbar.cpp \ 125jumpbuttonbar.cpp \
123phoneeditwidget.cpp \ 126phoneeditwidget.cpp \
124secrecywidget.cpp \ 127secrecywidget.cpp \
125keywidget.cpp \ 128keywidget.cpp \
126nameeditdialog.cpp \ 129nameeditdialog.cpp \
127filter.cpp \ 130filter.cpp \
128addviewdialog.cpp \ 131addviewdialog.cpp \
129configurewidget.cpp \ 132configurewidget.cpp \
130viewconfigurewidget.cpp \ 133viewconfigurewidget.cpp \
131viewconfigurefieldspage.cpp \ 134viewconfigurefieldspage.cpp \
132viewconfigurefilterpage.cpp \ 135viewconfigurefilterpage.cpp \
133undo.cpp \ 136undo.cpp \
134undocmds.cpp \ 137undocmds.cpp \
135xxportmanager.cpp \ 138xxportmanager.cpp \
136xxportobject.cpp \ 139xxportobject.cpp \
137xxportselectdialog.cpp \ 140xxportselectdialog.cpp \
138details/detailsviewcontainer.cpp \ 141details/detailsviewcontainer.cpp \
139details/look_basic.cpp \ 142details/look_basic.cpp \
140details/look_html.cpp \ 143details/look_html.cpp \
141views/kaddressbookiconview.cpp \ 144views/kaddressbookiconview.cpp \
142views/kaddressbooktableview.cpp \ 145views/kaddressbooktableview.cpp \
143views/kaddressbookcardview.cpp \ 146views/kaddressbookcardview.cpp \
144views/configuretableviewdialog.cpp \ 147views/configuretableviewdialog.cpp \
145views/configurecardviewdialog.cpp \ 148views/configurecardviewdialog.cpp \
146views/cardview.cpp \ 149views/cardview.cpp \
147views/contactlistview.cpp \ 150views/contactlistview.cpp \
148views/colorlistbox.cpp \ 151views/colorlistbox.cpp \
149xxport/vcard_xxport.cpp \ 152xxport/vcard_xxport.cpp \
150xxport/kde2_xxport.cpp \ 153xxport/kde2_xxport.cpp \
151xxport/csv_xxport.cpp \ 154xxport/csv_xxport.cpp \
152xxport/csvimportdialog.cpp \ 155xxport/csvimportdialog.cpp \
156xxport/opie_xxport.cpp \
157xxport/qtopia_xxport.cpp \
158xxport/sharpdtm_xxport.cpp \
153#details/look_details.cpp \ 159#details/look_details.cpp \
154#mainwindow.cpp \ 160#mainwindow.cpp \
155# calendarview.cpp \ 161# calendarview.cpp \
156# timespanview.cpp 162# timespanview.cpp
157 163
diff --git a/kaddressbook/xxportmanager.cpp b/kaddressbook/xxportmanager.cpp
index 2962951..a6797c9 100644
--- a/kaddressbook/xxportmanager.cpp
+++ b/kaddressbook/xxportmanager.cpp
@@ -1,258 +1,261 @@
1/* 1/*
2 This file is part of KAddressbook. 2 This file is part of KAddressbook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program 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 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qlayout.h> 31#include <qlayout.h>
32#include <qlist.h> 32#include <qlist.h>
33 33
34#include <kabc/addressbook.h> 34#include <kabc/addressbook.h>
35#include <kabc/resource.h> 35#include <kabc/resource.h>
36#include <kdebug.h> 36#include <kdebug.h>
37#include <kdialogbase.h> 37#include <kdialogbase.h>
38#include <klocale.h> 38#include <klocale.h>
39#include <kmessagebox.h> 39#include <kmessagebox.h>
40 40
41#ifndef KAB_EMBEDDED 41#ifndef KAB_EMBEDDED
42#include <ktrader.h> 42#include <ktrader.h>
43#else //KAB_EMBEDDED 43#else //KAB_EMBEDDED
44extern "C" 44extern "C"
45{ 45{
46 void* init_kaddrbk_csv_xxport(); 46 void* init_microkaddrbk_csv_xxport();
47 void* init_kaddrbk_kde2_xxport(); 47 void* init_microkaddrbk_kde2_xxport();
48 void* init_kaddrbk_vcard_xxport(); 48 void* init_microkaddrbk_vcard_xxport();
49 void* init_microkaddrbk_opie_xxport();
50 void* init_microkaddrbk_qtopia_xxport();
51 void* init_microkaddrbk_sharpdtm_xxport();
49} 52}
50#endif //KAB_EMBEDDED 53#endif //KAB_EMBEDDED
51 54
52#include <libkdepim/addresseeview.h> 55#include <libkdepim/addresseeview.h>
53 56
54#include "kabcore.h" 57#include "kabcore.h"
55#include "undocmds.h" 58#include "undocmds.h"
56#include "xxportselectdialog.h" 59#include "xxportselectdialog.h"
57 60
58#include "xxportmanager.h" 61#include "xxportmanager.h"
59 62
60KURL XXPortManager::importURL = KURL(); 63KURL XXPortManager::importURL = KURL();
61QString XXPortManager::importData = QString::null; 64QString XXPortManager::importData = QString::null;
62 65
63class PreviewDialog : public KDialogBase 66class PreviewDialog : public KDialogBase
64{ 67{
65 public: 68 public:
66 PreviewDialog( const KABC::Addressee &addr, 69 PreviewDialog( const KABC::Addressee &addr,
67 QWidget *parent, const char *name = 0 ); 70 QWidget *parent, const char *name = 0 );
68}; 71};
69 72
70XXPortManager::XXPortManager( KABCore *core, QObject *parent, const char *name ) 73XXPortManager::XXPortManager( KABCore *core, QObject *parent, const char *name )
71 : QObject( parent, name ), mCore( core ), mShowPreview( false ) 74 : QObject( parent, name ), mCore( core ), mShowPreview( false )
72{ 75{
73 loadPlugins(); 76 loadPlugins();
74} 77}
75 78
76XXPortManager::~XXPortManager() 79XXPortManager::~XXPortManager()
77{ 80{
78} 81}
79 82
80void XXPortManager::restoreSettings() 83void XXPortManager::restoreSettings()
81{ 84{
82} 85}
83 86
84void XXPortManager::saveSettings() 87void XXPortManager::saveSettings()
85{ 88{
86} 89}
87 90
88void XXPortManager::importVCard( const KURL &url ) 91void XXPortManager::importVCard( const KURL &url )
89{ 92{
90 importVCard( url, false ); 93 importVCard( url, false );
91} 94}
92 95
93void XXPortManager::importVCard( const KURL &url, bool showPreview ) 96void XXPortManager::importVCard( const KURL &url, bool showPreview )
94{ 97{
95 importURL = url; 98 importURL = url;
96 mShowPreview = showPreview; 99 mShowPreview = showPreview;
97 slotImport( "vcard", "<empty>" ); 100 slotImport( "vcard", "<empty>" );
98 mShowPreview = false; 101 mShowPreview = false;
99 importURL = KURL(); 102 importURL = KURL();
100} 103}
101 104
102void XXPortManager::importVCard( const QString &vCard, bool showPreview ) 105void XXPortManager::importVCard( const QString &vCard, bool showPreview )
103{ 106{
104 importData = vCard; 107 importData = vCard;
105 mShowPreview = showPreview; 108 mShowPreview = showPreview;
106 slotImport( "vcard", "<empty>" ); 109 slotImport( "vcard", "<empty>" );
107 mShowPreview = false; 110 mShowPreview = false;
108 importData = ""; 111 importData = "";
109} 112}
110 113
111void XXPortManager::slotImport( const QString &identifier, const QString &data ) 114void XXPortManager::slotImport( const QString &identifier, const QString &data )
112{ 115{
113 XXPortObject *obj = mXXPortObjects[ identifier ]; 116 XXPortObject *obj = mXXPortObjects[ identifier ];
114 if ( !obj ) { 117 if ( !obj ) {
115 KMessageBox::error( mCore, i18n( "<qt>No import plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); 118 KMessageBox::error( mCore, i18n( "<qt>No import plugin available for <b>%1</b>.</qt>" ).arg( identifier ) );
116 return; 119 return;
117 } 120 }
118 121
119 KABC::Resource *resource = mCore->requestResource( mCore ); 122 KABC::Resource *resource = mCore->requestResource( mCore );
120 if ( !resource ) 123 if ( !resource )
121 return; 124 return;
122 125
123 KABC::AddresseeList list = obj->importContacts( data ); 126 KABC::AddresseeList list = obj->importContacts( data );
124 KABC::AddresseeList::Iterator it; 127 KABC::AddresseeList::Iterator it;
125 bool imported = false; 128 bool imported = false;
126 for ( it = list.begin(); it != list.end(); ++it ) { 129 for ( it = list.begin(); it != list.end(); ++it ) {
127 if ( mShowPreview ) { 130 if ( mShowPreview ) {
128 PreviewDialog dlg( *it, mCore ); 131 PreviewDialog dlg( *it, mCore );
129 if ( !dlg.exec() ) 132 if ( !dlg.exec() )
130 continue; 133 continue;
131 } 134 }
132 135
133 (*it).setResource( resource ); 136 (*it).setResource( resource );
134 // We use a PwNewCommand so the user can undo it. 137 // We use a PwNewCommand so the user can undo it.
135 PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it ); 138 PwNewCommand *command = new PwNewCommand( mCore->addressBook(), *it );
136 UndoStack::instance()->push( command ); 139 UndoStack::instance()->push( command );
137 RedoStack::instance()->clear(); 140 RedoStack::instance()->clear();
138 imported = true; 141 imported = true;
139 } 142 }
140 143
141 if ( imported ) { 144 if ( imported ) {
142 KMessageBox::information( mCore, i18n( "contacts successfully imported." ) ); 145 KMessageBox::information( mCore, i18n( "contacts successfully imported." ) );
143 146
144 emit modified(); 147 emit modified();
145 } 148 }
146} 149}
147 150
148void XXPortManager::slotExport( const QString &identifier, const QString &data ) 151void XXPortManager::slotExport( const QString &identifier, const QString &data )
149{ 152{
150 XXPortObject *obj = mXXPortObjects[ identifier ]; 153 XXPortObject *obj = mXXPortObjects[ identifier ];
151 if ( !obj ) { 154 if ( !obj ) {
152 KMessageBox::error( mCore, i18n( "<qt>No export plugin available for <b>%1</b>.</qt>" ).arg( identifier ) ); 155 KMessageBox::error( mCore, i18n( "<qt>No export plugin available for <b>%1</b>.</qt>" ).arg( identifier ) );
153 return; 156 return;
154 } 157 }
155 158
156 KABC::AddresseeList addrList; 159 KABC::AddresseeList addrList;
157 XXPortSelectDialog dlg( mCore, obj->requiresSorting(), mCore ); 160 XXPortSelectDialog dlg( mCore, obj->requiresSorting(), mCore );
158 if ( dlg.exec() ) 161 if ( dlg.exec() )
159 addrList = dlg.contacts(); 162 addrList = dlg.contacts();
160 else 163 else
161 return; 164 return;
162 165
163 if ( !obj->exportContacts( addrList, data ) ) 166 if ( !obj->exportContacts( addrList, data ) )
164 KMessageBox::error( mCore, i18n( "Unable to export contacts." ) ); 167 KMessageBox::error( mCore, i18n( "Unable to export contacts." ) );
165 else 168 else
166 KMessageBox::information( mCore, i18n( "contacts successfully exported." ) ); 169 KMessageBox::information( mCore, i18n( "contacts successfully exported." ) );
167} 170}
168 171
169void XXPortManager::loadPlugins() 172void XXPortManager::loadPlugins()
170{ 173{
171 mXXPortObjects.clear(); 174 mXXPortObjects.clear();
172 175
173#ifndef KAB_EMBEDDED 176#ifndef KAB_EMBEDDED
174 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/XXPort" ); 177 KTrader::OfferList plugins = KTrader::self()->query( "KAddressBook/XXPort" );
175 KTrader::OfferList::ConstIterator it; 178 KTrader::OfferList::ConstIterator it;
176 for ( it = plugins.begin(); it != plugins.end(); ++it ) { 179 for ( it = plugins.begin(); it != plugins.end(); ++it ) {
177 if ( !(*it)->hasServiceType( "KAddressBook/XXPort" ) ) 180 if ( !(*it)->hasServiceType( "KAddressBook/XXPort" ) )
178 continue; 181 continue;
179 182
180 KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() ); 183 KLibFactory *factory = KLibLoader::self()->factory( (*it)->library().latin1() );
181 if ( !factory ) { 184 if ( !factory ) {
182 kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl; 185 kdDebug(5720) << "XXPortManager::loadExtensions(): Factory creation failed" << endl;
183 continue; 186 continue;
184 } 187 }
185 188
186 XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory ); 189 XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory );
187 190
188 if ( !xxportFactory ) { 191 if ( !xxportFactory ) {
189 kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl; 192 kdDebug(5720) << "XXPortManager::loadExtensions(): Cast failed" << endl;
190 continue; 193 continue;
191 } 194 }
192 195
193#else //KAB_EMBEDDED 196#else //KAB_EMBEDDED
194 QList<XXPortFactory> factorylist; 197 QList<XXPortFactory> factorylist;
195 factorylist.append(static_cast<XXPortFactory*>(init_kaddrbk_csv_xxport())); 198 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_csv_xxport()));
196 factorylist.append(static_cast<XXPortFactory*>(init_kaddrbk_kde2_xxport())); 199 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_kde2_xxport()));
197 factorylist.append(static_cast<XXPortFactory*>(init_kaddrbk_vcard_xxport())); 200 factorylist.append(static_cast<XXPortFactory*>(init_microkaddrbk_vcard_xxport()));
198 201
199 //add the opie import library dynamically 202 //add the opie import library dynamically
200 KLibFactory *factory = KLibLoader::self()->factory( "microkaddrbk_opie_xxport" ); 203 KLibFactory *factory = KLibLoader::self()->factory( "microkaddrbk_opie_xxport" );
201 if ( factory ) { 204 if ( factory ) {
202 XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory ); 205 XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory );
203 factorylist.append(xxportFactory); 206 factorylist.append(xxportFactory);
204 } 207 }
205 208
206 //add the qtopia import library dynamically 209 //add the qtopia import library dynamically
207 factory = KLibLoader::self()->factory( "microkaddrbk_qtopia_xxport" ); 210 factory = KLibLoader::self()->factory( "microkaddrbk_qtopia_xxport" );
208 if ( factory ) { 211 if ( factory ) {
209 XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory ); 212 XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory );
210 factorylist.append(xxportFactory); 213 factorylist.append(xxportFactory);
211 } 214 }
212 215
213 //add the sharp import library dynamically 216 //add the sharp import library dynamically
214 factory = KLibLoader::self()->factory( "microkaddrbk_sharpdtm_xxport" ); 217 factory = KLibLoader::self()->factory( "microkaddrbk_sharpdtm_xxport" );
215 if ( factory ) { 218 if ( factory ) {
216 XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory ); 219 XXPortFactory *xxportFactory = static_cast<XXPortFactory*>( factory );
217 factorylist.append(xxportFactory); 220 factorylist.append(xxportFactory);
218 } 221 }
219 222
220 QListIterator<XXPortFactory> it(factorylist); 223 QListIterator<XXPortFactory> it(factorylist);
221 for ( ; it.current(); ++it ) 224 for ( ; it.current(); ++it )
222 { 225 {
223 XXPortFactory *xxportFactory = it.current(); 226 XXPortFactory *xxportFactory = it.current();
224#endif //KAB_EMBEDDED 227#endif //KAB_EMBEDDED
225 228
226 XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore ); 229 XXPortObject *obj = xxportFactory->xxportObject( mCore->addressBook(), mCore );
227 if ( obj ) { 230 if ( obj ) {
228 mCore->addGUIClient( obj ); 231 mCore->addGUIClient( obj );
229 mXXPortObjects.insert( obj->identifier(), obj ); 232 mXXPortObjects.insert( obj->identifier(), obj );
230 connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ), 233 connect( obj, SIGNAL( exportActivated( const QString&, const QString& ) ),
231 this, SLOT( slotExport( const QString&, const QString& ) ) ); 234 this, SLOT( slotExport( const QString&, const QString& ) ) );
232 connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ), 235 connect( obj, SIGNAL( importActivated( const QString&, const QString& ) ),
233 this, SLOT( slotImport( const QString&, const QString& ) ) ); 236 this, SLOT( slotImport( const QString&, const QString& ) ) );
234 } 237 }
235 } 238 }
236} 239}
237 240
238 241
239PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent, 242PreviewDialog::PreviewDialog( const KABC::Addressee &addr, QWidget *parent,
240 const char *name ) 243 const char *name )
241 : KDialogBase( Plain, i18n( "Contact Preview" ), Ok | Cancel, Ok, parent, 244 : KDialogBase( Plain, i18n( "Contact Preview" ), Ok | Cancel, Ok, parent,
242 name, true, true ) 245 name, true, true )
243{ 246{
244 QWidget *page = plainPage(); 247 QWidget *page = plainPage();
245 QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() ); 248 QVBoxLayout *layout = new QVBoxLayout( page, marginHint(), spacingHint() );
246 249
247 KPIM::AddresseeView *view = new KPIM::AddresseeView( page ); 250 KPIM::AddresseeView *view = new KPIM::AddresseeView( page );
248 view->setAddressee( addr ); 251 view->setAddressee( addr );
249 252
250 layout->addWidget( view ); 253 layout->addWidget( view );
251 254
252 resize( 400, 300 ); 255 resize( 400, 300 );
253} 256}
254 257
255#ifndef KAB_EMBEDDED 258#ifndef KAB_EMBEDDED
256#include "xxportmanager.moc" 259#include "xxportmanager.moc"
257#endif //KAB_EMBEDDED 260#endif //KAB_EMBEDDED
258 261
diff --git a/kaddressbook/xxportobject.cpp b/kaddressbook/xxportobject.cpp
index 42ab0fb..bb985a6 100644
--- a/kaddressbook/xxportobject.cpp
+++ b/kaddressbook/xxportobject.cpp
@@ -1,152 +1,173 @@
1/* 1/*
2 This file is part of KAddressbook. 2 This file is part of KAddressbook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program 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 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#include <qmap.h> 31#include <qmap.h>
32#include <qsignalmapper.h> 32#include <qsignalmapper.h>
33 33
34#include <kaction.h> 34#include <kaction.h>
35#include <kmessagebox.h> 35#include <kmessagebox.h>
36 36
37#include "kabcore.h" 37#include "kabcore.h"
38 38
39#include "xxportobject.h" 39#include "xxportobject.h"
40 40
41class XXPortObject::XXPortObjectPrivate 41class XXPortObject::XXPortObjectPrivate
42{ 42{
43 public: 43 public:
44 QSignalMapper *mExportMapper; 44 QSignalMapper *mExportMapper;
45 QSignalMapper *mImportMapper; 45 QSignalMapper *mImportMapper;
46}; 46};
47 47
48XXPortObject::XXPortObject( KABC::AddressBook *ab, QWidget *parent, 48XXPortObject::XXPortObject( KABC::AddressBook *ab, QWidget *parent,
49 const char *name ) 49 const char *name )
50 : QObject( parent, name ), mAddressBook( ab ), mParentWidget( parent ), 50 : QObject( parent, name ), mAddressBook( ab ), mParentWidget( parent ),
51 d( new XXPortObjectPrivate ) 51 d( new XXPortObjectPrivate )
52{ 52{
53 d->mExportMapper = new QSignalMapper( this ); 53 d->mExportMapper = new QSignalMapper( this );
54 d->mImportMapper = new QSignalMapper( this ); 54 d->mImportMapper = new QSignalMapper( this );
55 55
56 connect( d->mExportMapper, SIGNAL( mapped( const QString& ) ), 56 connect( d->mExportMapper, SIGNAL( mapped( const QString& ) ),
57 SLOT( slotExportActivated( const QString& ) ) ); 57 SLOT( slotExportActivated( const QString& ) ) );
58 connect( d->mImportMapper, SIGNAL( mapped( const QString& ) ), 58 connect( d->mImportMapper, SIGNAL( mapped( const QString& ) ),
59 SLOT( slotImportActivated( const QString& ) ) ); 59 SLOT( slotImportActivated( const QString& ) ) );
60} 60}
61 61
62XXPortObject::~XXPortObject() 62XXPortObject::~XXPortObject()
63{ 63{
64 delete d; 64 delete d;
65 d = 0; 65 d = 0;
66} 66}
67 67
68bool XXPortObject::exportContacts( const KABC::AddresseeList&, const QString& ) 68bool XXPortObject::exportContacts( const KABC::AddresseeList&, const QString& )
69{ 69{
70 // do nothing 70 // do nothing
71 return false; 71 return false;
72} 72}
73 73
74KABC::AddresseeList XXPortObject::importContacts( const QString& ) const 74KABC::AddresseeList XXPortObject::importContacts( const QString& ) const
75{ 75{
76 // do nothing 76 // do nothing
77 return KABC::AddresseeList(); 77 return KABC::AddresseeList();
78} 78}
79 79
80void XXPortObject::createImportAction( const QString &label, const QString &data ) 80void XXPortObject::createImportAction( const QString &label, const QString &data )
81{ 81{
82#ifdef KAB_EMBEDDED 82#ifdef KAB_EMBEDDED
83 KABCore* kabcore = (KABCore*)mParentWidget; 83 KABCore* kabcore = (KABCore*)mParentWidget;
84#endif //KAB_EMBEDDED 84#endif //KAB_EMBEDDED
85 85
86 QString id = "file_import_" + identifier() + ( data.isEmpty() ? QString( "" ) : "_" + data ); 86 QString id = "file_import_" + identifier() + ( data.isEmpty() ? QString( "" ) : "_" + data );
87#ifndef KAB_EMBEDDED 87#ifndef KAB_EMBEDDED
88 KAction *action = new KAction( label, 0, d->mImportMapper, SLOT( map() ), actionCollection(), id.latin1() ); 88 KAction *action = new KAction( label, 0, d->mImportMapper, SLOT( map() ), actionCollection(), id.latin1() );
89#else //KAB_EMBEDDED 89#else //KAB_EMBEDDED
90 KAction *action = new KAction( label, 0, d->mImportMapper, SLOT( map() ), kabcore->actionCollection(), id.latin1() ); 90 KAction *action = new KAction( label, 0, d->mImportMapper, SLOT( map() ), kabcore->actionCollection(), id.latin1() );
91#endif //KAB_EMBEDDED 91#endif //KAB_EMBEDDED
92 92
93 d->mImportMapper->setMapping( action, ( data.isEmpty() ? QString( "<empty>" ) : data ) ); 93 d->mImportMapper->setMapping( action, ( data.isEmpty() ? QString( "<empty>" ) : data ) );
94 94
95#ifndef KAB_EMBEDDED 95#ifndef KAB_EMBEDDED
96 setXMLFile( identifier() + "_xxportui.rc" ); 96 setXMLFile( identifier() + "_xxportui.rc" );
97#endif //KAB_EMBEDDED 97#endif //KAB_EMBEDDED
98 98
99#ifdef KAB_EMBEDDED 99#ifdef KAB_EMBEDDED
100 action->plug((QWidget*)kabcore->getImportMenu()); 100 action->plug((QWidget*)kabcore->getImportMenu());
101#endif //KAB_EMBEDDED 101#endif //KAB_EMBEDDED
102 102
103} 103}
104 104
105void XXPortObject::createExportAction( const QString &label, const QString &data ) 105void XXPortObject::createExportAction( const QString &label, const QString &data )
106{ 106{
107#ifdef KAB_EMBEDDED 107#ifdef KAB_EMBEDDED
108 KABCore* kabcore = (KABCore*)mParentWidget; 108 KABCore* kabcore = (KABCore*)mParentWidget;
109#endif //KAB_EMBEDDED 109#endif //KAB_EMBEDDED
110 110
111 QString id = "file_export_" + identifier() + ( data.isEmpty() ? QString( "" ) : "_" + data ); 111 QString id = "file_export_" + identifier() + ( data.isEmpty() ? QString( "" ) : "_" + data );
112#ifndef KAB_EMBEDDED 112#ifndef KAB_EMBEDDED
113 KAction *action = new KAction( label, 0, d->mExportMapper, SLOT( map() ), actionCollection(), id.latin1() ); 113 KAction *action = new KAction( label, 0, d->mExportMapper, SLOT( map() ), actionCollection(), id.latin1() );
114#else //KAB_EMBEDDED 114#else //KAB_EMBEDDED
115 KAction *action = new KAction( label, 0, d->mExportMapper, SLOT( map() ), kabcore->actionCollection(), id.latin1() ); 115 KAction *action = new KAction( label, 0, d->mExportMapper, SLOT( map() ), kabcore->actionCollection(), id.latin1() );
116#endif //KAB_EMBEDDED 116#endif //KAB_EMBEDDED
117 117
118 d->mExportMapper->setMapping( action, ( data.isEmpty() ? QString( "<empty>" ) : data ) ); 118 d->mExportMapper->setMapping( action, ( data.isEmpty() ? QString( "<empty>" ) : data ) );
119 119
120#ifndef KAB_EMBEDDED 120#ifndef KAB_EMBEDDED
121 setXMLFile( identifier() + "_xxportui.rc" ); 121 setXMLFile( identifier() + "_xxportui.rc" );
122#endif //KAB_EMBEDDED 122#endif //KAB_EMBEDDED
123 123
124#ifdef KAB_EMBEDDED 124#ifdef KAB_EMBEDDED
125 action->plug((QWidget*)kabcore->getExportMenu()); 125 action->plug((QWidget*)kabcore->getExportMenu());
126#endif //KAB_EMBEDDED 126#endif //KAB_EMBEDDED
127 127
128} 128}
129 129
130KABC::AddressBook *XXPortObject::addressBook() const 130KABC::AddressBook *XXPortObject::addressBook() const
131{ 131{
132 return mAddressBook; 132 return mAddressBook;
133} 133}
134 134
135QWidget *XXPortObject::parentWidget() const 135QWidget *XXPortObject::parentWidget() const
136{ 136{
137 return mParentWidget; 137 return mParentWidget;
138} 138}
139 139
140void XXPortObject::slotExportActivated( const QString &data ) 140void XXPortObject::slotExportActivated( const QString &data )
141{ 141{
142 emit exportActivated( identifier(), ( data == "<empty>" ? QString::null : data ) ); 142 emit exportActivated( identifier(), ( data == "<empty>" ? QString::null : data ) );
143} 143}
144 144
145void XXPortObject::slotImportActivated( const QString &data ) 145void XXPortObject::slotImportActivated( const QString &data )
146{ 146{
147 emit importActivated( identifier(), ( data == "<empty>" ? QString::null : data ) ); 147 emit importActivated( identifier(), ( data == "<empty>" ? QString::null : data ) );
148} 148}
149 149
150/********************************************************************
151 *
152 *******************************************************************/
153
154
155XXPortResourceObject::XXPortResourceObject( KABC::AddressBook *ab, QWidget *parent,
156 const char *name )
157 : XXPortObject( ab, parent, name ), mResource(0)
158{
159}
160
161XXPortResourceObject::~XXPortResourceObject()
162{
163}
164
165bool XXPortResourceObject::isAvailable()
166{
167 return (mResource != 0);
168}
169
170
150#ifndef KAB_EMBEDDED 171#ifndef KAB_EMBEDDED
151#include "xxportobject.moc" 172#include "xxportobject.moc"
152#endif //KAB_EMBEDDED 173#endif //KAB_EMBEDDED
diff --git a/kaddressbook/xxportobject.h b/kaddressbook/xxportobject.h
index fddc219..d547855 100644
--- a/kaddressbook/xxportobject.h
+++ b/kaddressbook/xxportobject.h
@@ -1,137 +1,170 @@
1/* 1/*
2 This file is part of KAddressbook. 2 This file is part of KAddressbook.
3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org> 3 Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program 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 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24/* 24/*
25Enhanced Version of the file for platform independent KDE tools. 25Enhanced Version of the file for platform independent KDE tools.
26Copyright (c) 2004 Ulf Schenk 26Copyright (c) 2004 Ulf Schenk
27 27
28$Id$ 28$Id$
29*/ 29*/
30 30
31#ifndef XXPORTOBJECT_H 31#ifndef XXPORTOBJECT_H
32#define XXPORTOBJECT_H 32#define XXPORTOBJECT_H
33 33
34#include <qobject.h> 34#include <qobject.h>
35 35
36#include <kabc/addressbook.h> 36#include <kabc/addressbook.h>
37#include <kabc/addresseelist.h> 37#include <kabc/addresseelist.h>
38#include <kabc/resource.h>
38#include <kxmlguiclient.h> 39#include <kxmlguiclient.h>
39#include <klibloader.h> 40#include <klibloader.h>
40 41
41 42
43
44
45
42class XXPortObject : public QObject, virtual public KXMLGUIClient 46class XXPortObject : public QObject, virtual public KXMLGUIClient
43{ 47{
44 Q_OBJECT 48 Q_OBJECT
45 49
46 public: 50 public:
47 XXPortObject( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); 51 XXPortObject( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 );
48 ~XXPortObject(); 52 ~XXPortObject();
49 53
50 /** 54 /**
51 Returns the unique identifier of this xxport modul, it should 55 Returns the unique identifier of this xxport modul, it should
52 be the lowercase name of the import/export format e.g. 'vcard' 56 be the lowercase name of the import/export format e.g. 'vcard'
53 */ 57 */
54 virtual QString identifier() const = 0; 58 virtual QString identifier() const = 0;
55 59
56 /** 60 /**
57 Reimplement this method if the XXPortManager shall 61 Reimplement this method if the XXPortManager shall
58 pass a sorted list to @ref exportContacts(). 62 pass a sorted list to @ref exportContacts().
59 */ 63 */
60 virtual bool requiresSorting() const { return false; } 64 virtual bool requiresSorting() const { return false; }
61 65
66 /**
67 Returns true if the XXPortObject can be used.
68 One case it can not be used is for example if a needed lib could not be loaded.
69 */
70 virtual bool isAvailable() const { return true; };
71
72
62 public slots: 73 public slots:
63 /** 74 /**
64 Reimplement this method for exporting the contacts. 75 Reimplement this method for exporting the contacts.
65 */ 76 */
66 virtual bool exportContacts( const KABC::AddresseeList &list, const QString& identifier ); 77 virtual bool exportContacts( const KABC::AddresseeList &list, const QString& identifier );
67 78
68 /** 79 /**
69 Reimplement this method for importing the contacts. 80 Reimplement this method for importing the contacts.
70 */ 81 */
71 virtual KABC::AddresseeList importContacts( const QString& identifier ) const; 82 virtual KABC::AddresseeList importContacts( const QString& identifier ) const;
72 83
73 signals: 84 signals:
74 /** 85 /**
75 Emitted whenever the export action is activated. 86 Emitted whenever the export action is activated.
76 The parameter contains the @ref identifier() for 87 The parameter contains the @ref identifier() for
77 unique identification. 88 unique identification.
78 */ 89 */
79 void exportActivated( const QString&, const QString& ); 90 void exportActivated( const QString&, const QString& );
80 91
81 /** 92 /**
82 Emitted whenever the import action is activated. 93 Emitted whenever the import action is activated.
83 The parameter contains the @ref identifier() for 94 The parameter contains the @ref identifier() for
84 unique identification. 95 unique identification.
85 */ 96 */
86 void importActivated( const QString&, const QString& ); 97 void importActivated( const QString&, const QString& );
87 98
88 protected: 99 protected:
89 /** 100 /**
90 Create the import action. The identifier is passed in the import slot. 101 Create the import action. The identifier is passed in the import slot.
91 */ 102 */
92 void createImportAction( const QString &label, const QString &identifier = QString::null ); 103 void createImportAction( const QString &label, const QString &identifier = QString::null );
93 104
94 /** 105 /**
95 Create the export action. The identifier is passed in the export slot. 106 Create the export action. The identifier is passed in the export slot.
96 */ 107 */
97 void createExportAction( const QString &label, const QString &identifier = QString::null ); 108 void createExportAction( const QString &label, const QString &identifier = QString::null );
98 109
99 /** 110 /**
100 Returns a pointer to the address book object. 111 Returns a pointer to the address book object.
101 */ 112 */
102 KABC::AddressBook *addressBook() const; 113 KABC::AddressBook *addressBook() const;
103 114
104 /** 115 /**
105 Returns a pointer to the parent widget. It can be used as parent for 116 Returns a pointer to the parent widget. It can be used as parent for
106 message boxes. 117 message boxes.
107 */ 118 */
108 QWidget *parentWidget() const; 119 QWidget *parentWidget() const;
109 120
110 121
111 private slots: 122 private slots:
112 void slotImportActivated( const QString& ); 123 void slotImportActivated( const QString& );
113 void slotExportActivated( const QString& ); 124 void slotExportActivated( const QString& );
114 125
115 private: 126 private:
116 KABC::AddressBook *mAddressBook; 127 KABC::AddressBook *mAddressBook;
117 QWidget *mParentWidget; 128 QWidget *mParentWidget;
118 129
119 class XXPortObjectPrivate; 130 class XXPortObjectPrivate;
120 XXPortObjectPrivate *d; 131 XXPortObjectPrivate *d;
121}; 132};
122 133
134
135
136class XXPortResourceObject : public XXPortObject
137{
138 Q_OBJECT
139
140 public:
141 XXPortResourceObject( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 );
142 ~XXPortResourceObject();
143
144 /**
145 Returns true if the XXPortObject can be used.
146 One case it can not be used is for example if a needed lib could not be loaded.
147 */
148 virtual bool isAvailable();
149 protected:
150 KABC::Resource* mResource;
151};
152
153
154
155
123class XXPortFactory : public KLibFactory 156class XXPortFactory : public KLibFactory
124{ 157{
125 public: 158 public:
126 virtual XXPortObject *xxportObject( KABC::AddressBook *ab, QWidget *parent, 159 virtual XXPortObject *xxportObject( KABC::AddressBook *ab, QWidget *parent,
127 const char *name = 0 ) = 0; 160 const char *name = 0 ) = 0;
128 161
129 protected: 162 protected:
130 virtual QObject* createObject( QObject*, const char*, const char*, 163 virtual QObject* createObject( QObject*, const char*, const char*,
131 const QStringList & ) 164 const QStringList & )
132 { 165 {
133 return 0; 166 return 0;
134 } 167 }
135}; 168};
136 169
137#endif 170#endif