From deac2ca49faed824fe83066080714eb6d653615b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 15:13:01 -0600 Subject: Rename a number of classes to enhance compatibility with KDE4 --- knewstuff/providerdialog.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'knewstuff/providerdialog.cpp') diff --git a/knewstuff/providerdialog.cpp b/knewstuff/providerdialog.cpp index a66258701..23aa94388 100644 --- a/knewstuff/providerdialog.cpp +++ b/knewstuff/providerdialog.cpp @@ -34,11 +34,11 @@ using namespace KNS; -class ProviderItem : public KListViewItem +class ProviderItem : public TDEListViewItem { public: - ProviderItem( KListView *parent, Provider *provider ) : - KListViewItem( parent ), mProvider( provider ) + ProviderItem( TDEListView *parent, Provider *provider ) : + TDEListViewItem( parent ), mProvider( provider ) { setText( 0, provider->name() ); } @@ -61,7 +61,7 @@ ProviderDialog::ProviderDialog( Engine *engine, TQWidget *parent ) : TQLabel *description = new TQLabel( i18n("Please select one of the providers listed below:"), topPage ); topLayout->addWidget( description ); - mListView = new KListView( topPage ); + mListView = new TDEListView( topPage ); mListView->addColumn( i18n("Name") ); topLayout->addWidget( mListView ); } -- cgit v1.2.3 From d1e0cc99a202cef3306b90b8839a6726e89f201e Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Fri, 1 Feb 2013 23:21:04 -0600 Subject: Rename many classes and header files to avoid conflicts with KDE4 --- KDE2PORTING.html | 6 +- KDE3PORTING.html | 10 +- arts/kde/kvideowidget.cpp | 2 +- dcop/dcopidl2cpp/dcopidl_test.h | 2 +- dnssd/README | 2 +- interfaces/tdescript/scriptloader.cpp | 2 +- interfaces/tdescript/scriptloader.h | 4 +- interfaces/tdetexteditor/CMakeLists.txt | 8 +- interfaces/tdetexteditor/Makefile.am | 8 +- .../bloctdeselectiondcopinterface.cpp | 4 +- .../tdetexteditor/bloctdeselectiondcopinterface.h | 4 +- .../tdetexteditor/bloctdeselectioninterface.cpp | 4 +- .../tdetexteditor/bloctdeselectioninterface.h | 6 +- interfaces/tdetexteditor/tdetexteditor.cpp | 2 +- interfaces/terminal/test/main.cc | 2 +- kab/kabapi.cc | 2 +- kabc/addresseedialog.h | 2 +- kabc/addresslineedit.cpp | 2 +- kabc/ldapconfigwidget.cpp | 2 +- kabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp | 2 +- kabc/resourceselectdialog.cpp | 2 +- kate/data/idconsole.xml | 2 +- kate/interfaces/document.h | 4 +- kate/part/kateautoindent.cpp | 2 +- kate/part/katebookmarks.cpp | 4 +- kate/part/katedialogs.cpp | 8 +- kate/part/katedialogs.h | 2 +- kate/part/katedocument.cpp | 4 +- kate/part/katedocumenthelpers.cpp | 2 +- kate/part/katefiletype.cpp | 2 +- kate/part/katehighlight.cpp | 2 +- kate/part/katekeyinterceptorfunctor.h | 2 +- kate/part/kateprinter.cpp | 2 +- kate/part/kateschema.cpp | 4 +- kate/part/kateschema.h | 2 +- kate/part/katesearch.cpp | 2 +- kate/part/katespell.cpp | 2 +- kate/part/kateview.cpp | 4 +- kate/part/kateview.h | 2 +- kate/part/kateviewhelpers.cpp | 2 +- kate/part/kateviewhelpers.h | 2 +- kate/part/test_regression.cpp | 4 +- kate/plugins/autobookmarker/autobookmarker.cpp | 4 +- kate/plugins/insertfile/insertfileplugin.cpp | 2 +- kate/plugins/isearch/ISearchPlugin.cpp | 2 +- kate/plugins/kdatatool/kate_kdatatool.cpp | 4 +- kate/plugins/wordcompletion/docwordcompletion.cpp | 2 +- kate/tests/highlight.xsl | 2 +- kded/kded.cpp | 2 +- kded/tdebuildsycoca.cpp | 14 +- kdewidgets/kde.widgets | 12 +- kdewidgets/pics/CMakeLists.txt | 8 +- kdewidgets/pics/Makefile.am | 8 +- kdewidgets/tests/test.widgets | 10 +- knewstuff/downloaddialog.cpp | 2 +- knewstuff/knewstuff.cpp | 2 +- knewstuff/providerdialog.cpp | 2 +- knewstuff/uploaddialog.cpp | 2 +- mimetypes/application/x-linguist.desktop | 2 +- mimetypes/application/x-xliff.desktop | 2 +- tdecert/tdecertpart.cc | 2 +- tdecert/tdecertpart.h | 2 +- tdecore/CMakeLists.txt | 14 +- tdecore/MAINTAINERS | 12 +- tdecore/Makefile.am | 18 +-- tdecore/kapplication.cpp | 4 +- tdecore/kcheckaccelerators.cpp | 4 +- tdecore/kcompletion.h | 2 +- tdecore/kglobalaccel.cpp | 4 +- tdecore/kglobalaccel.h | 2 +- tdecore/kglobalaccel_emb.h | 4 +- tdecore/kglobalaccel_mac.h | 4 +- tdecore/kglobalaccel_win.h | 4 +- tdecore/kglobalaccel_x11.h | 4 +- tdecore/kglobalsettings.cpp | 4 +- tdecore/kkeynative.h | 2 +- tdecore/kkeyserver_x11.cpp | 4 +- tdecore/kkeyserver_x11.h | 2 +- tdecore/network/ipv6blacklist | 3 + tdecore/network/ipv6blactdelist | 3 - tdecore/tdeaccel.cpp | 14 +- tdecore/tdeaccel.h | 4 +- tdecore/tdeaccelaction.cpp | 6 +- tdecore/tdeaccelaction.h | 2 +- tdecore/tdeaccelbase.cpp | 4 +- tdecore/tdeaccelbase.h | 2 +- tdecore/tdeaccelmanager.cpp | 6 +- tdecore/tdeconfig_compiler/checkkcfg.pl | 6 +- tdecore/tdeshortcut.cpp | 2 +- tdecore/tdeshortcutlist.cpp | 8 +- tdecore/tdeshortcutmenu.cpp | 6 +- tdecore/tdeshortcutmenu.h | 2 +- tdecore/tdestdaccel.cpp | 10 +- tdecore/tdestdaccel.h | 4 +- tdecore/tests/Makefile.am | 6 +- tdecore/tests/tdestdacceltest.cpp | 4 +- tdehtml/domtreeview.h | 2 +- tdehtml/ecma/kjs_debugwin.cpp | 8 +- tdehtml/ecma/kjs_debugwin.h | 2 +- tdehtml/misc/knsplugininstaller.cpp | 2 +- tdehtml/rendering/render_form.h | 2 +- tdehtml/tdehtml_ext.cpp | 4 +- tdehtml/tdehtml_ext.h | 2 +- tdehtml/tdehtml_part.cpp | 2 +- tdehtml/tdehtmlpart_p.h | 2 +- tdehtml/tdehtmlview.cpp | 2 +- tdehtml/test_regression.cpp | 4 +- tdehtml/testtdehtml.cpp | 4 +- tdeio/bookmarks/kbookmarkbar.cc | 6 +- tdeio/bookmarks/kbookmarkbar.h | 2 +- tdeio/bookmarks/kbookmarkmanager.h | 2 +- tdeio/bookmarks/kbookmarkmenu.cc | 4 +- tdeio/bookmarks/kbookmarkmenu.h | 2 +- tdeio/bookmarks/kbookmarkmenu_p.h | 2 +- tdeio/misc/uiserver.cpp | 4 +- tdeio/misc/uiserver.h | 4 +- tdeio/tdefile/CMakeLists.txt | 6 +- tdeio/tdefile/Makefile.am | 8 +- tdeio/tdefile/kacleditwidget.h | 2 +- tdeio/tdefile/kacleditwidget_p.h | 2 +- tdeio/tdefile/kcustommenueditor.cpp | 2 +- tdeio/tdefile/kdiroperator.cpp | 6 +- tdeio/tdefile/kdiroperator.h | 2 +- tdeio/tdefile/kdirselectdialog.cpp | 4 +- tdeio/tdefile/kencodingfiledialog.cpp | 4 +- tdeio/tdefile/knotifydialog.h | 2 +- tdeio/tdefile/knotifywidgetbase.ui | 2 +- tdeio/tdefile/kopenwith.cpp | 2 +- tdeio/tdefile/kopenwith_p.h | 2 +- tdeio/tdefile/kpropertiesdesktopbase.ui | 2 +- tdeio/tdefile/kpropertiesdialog.cpp | 2 +- tdeio/tdefile/kpropertiesmimetypebase.ui | 2 +- tdeio/tdefile/kurlbar.h | 2 +- tdeio/tdefile/kurlrequester.cpp | 2 +- tdeio/tdefile/kurlrequesterdlg.cpp | 4 +- tdeio/tdefile/tdefilebookmarkhandler.cpp | 2 +- tdeio/tdefile/tdefiledetailview.h | 2 +- tdeio/tdefile/tdefiledialog.cpp | 14 +- tdeio/tdefile/tdefileiconview.cpp | 2 +- tdeio/tdefile/tdefilepreview.cpp | 2 +- tdeio/tdefile/tdefiletreeview.h | 2 +- tdeio/tdefile/tdefiletreeviewitem.h | 2 +- tdeio/tdefile/tdefileview.cpp | 2 +- tdeio/tdefile/tderecentdirs.cpp | 4 +- tdeio/tdefile/tderecentdocument.cpp | 2 +- tdeio/tdefile/tests/tdefiletreeviewtest.cpp | 2 +- tdeio/tdeio/job.cpp | 2 +- tdeio/tdeio/kdatatool.h | 2 +- tdeio/tdeio/kmimetypechooser.cpp | 2 +- tdeio/tdeio/krun.cpp | 2 +- tdeio/tdeio/kurifilter.h | 6 +- tdeio/tests/kurifiltertest.cpp | 28 ++-- tdeio/tests/tdeioslavetest.h | 2 +- tdemdi/tdemdi/guiclient.cpp | 8 +- tdemdi/tdemdi/guiclient.h | 4 +- tdemdi/tdemdi/mainwindow.h | 2 +- tdemdi/tdemdi/tabwidget.cpp | 2 +- tdemdi/tdemdi/toolviewaccessor_p.h | 2 +- tdemdi/tdemdidocumentviewtabwidget.cpp | 2 +- tdemdi/tdemdiguiclient.cpp | 10 +- tdemdi/tdemdiguiclient.h | 2 +- tdemdi/tdemdimainfrm.cpp | 2 +- tdemdi/tdemdimainfrm.h | 2 +- tdemdi/tdemditaskbar.h | 2 +- tdemdi/tdemditoolviewaccessor_p.h | 2 +- tdeparts/dockmainwindow.cpp | 166 +++++++++++++++++++++ tdeparts/dockmainwindow.h | 88 +++++++++++ tdeparts/doctdemainwindow.cpp | 166 --------------------- tdeparts/doctdemainwindow.h | 88 ----------- tdeparts/mainwindow.cpp | 2 +- tdeparts/mainwindow.h | 4 +- tdeparts/plugin.h | 2 +- tdeparts/statusbarextension.cpp | 2 +- tdeparts/tests/example.cpp | 2 +- tdeparts/tests/ghostview.cpp | 2 +- tdeparts/tests/normalktm.cpp | 2 +- tdeparts/tests/normalktm.h | 2 +- tdeparts/tests/notepad.cpp | 2 +- tdeparts/tests/parts.cpp | 2 +- tdeparts/tests/plugin_spellcheck.cpp | 2 +- tdeprint/cups/cupsdconf2/editlist.cpp | 2 +- tdeprint/cups/cupsdconf2/qdirmultilineedit.cpp | 2 +- tdeprint/cups/kmcupsmanager.cpp | 2 +- tdeprint/cups/kmcupsuimanager.cpp | 2 +- tdeprint/cups/kmwfax.cpp | 2 +- tdeprint/cups/kmwippprinter.cpp | 2 +- tdeprint/cups/kmwippselect.cpp | 2 +- tdeprint/cups/kmwother.cpp | 2 +- tdeprint/driverview.h | 2 +- tdeprint/droptionview.cpp | 2 +- tdeprint/kmjobmanager.cpp | 2 +- tdeprint/kpfilterpage.cpp | 2 +- tdeprint/kprintaction.cpp | 2 +- tdeprint/kprintaction.h | 2 +- tdeprint/kprintpreview.cpp | 6 +- tdeprint/lpr/editentrydialog.cpp | 2 +- tdeprint/lpr/kmlprmanager.cpp | 2 +- tdeprint/management/cjanuswidget.cpp | 2 +- tdeprint/management/kiconselectaction.cpp | 4 +- tdeprint/management/kiconselectaction.h | 2 +- tdeprint/management/kmconfigfilter.cpp | 2 +- tdeprint/management/kmconfigfonts.cpp | 2 +- tdeprint/management/kmdriverdbwidget.cpp | 2 +- tdeprint/management/kminstancepage.cpp | 2 +- tdeprint/management/kmjobviewer.cpp | 6 +- tdeprint/management/kmjobviewer.h | 2 +- tdeprint/management/kmmainview.cpp | 8 +- tdeprint/management/kmmainview.h | 2 +- tdeprint/management/kmprinterview.cpp | 2 +- tdeprint/management/kmwclass.cpp | 2 +- tdeprint/management/kmwdriverselect.cpp | 2 +- tdeprint/management/kmwlocal.cpp | 2 +- tdeprint/management/kmwsocket.cpp | 2 +- tdeprint/management/kxmlcommanddlg.cpp | 4 +- tdeprint/management/pluginaction.h | 2 +- tdeprint/management/smbview.h | 2 +- tdeprint/rlpr/kmwrlpr.cpp | 2 +- tdeprint/tdefilelist.cpp | 2 +- tdeprint/tests/helpwindow.cpp | 2 +- tdeprint/tests/helpwindow.h | 2 +- tderesources/configpage.cpp | 2 +- tderesources/selectdialog.cpp | 2 +- tdersync/rsyncconfigdialog.cpp | 8 +- tdersync/tdersync.h | 8 +- tdeui/AUTHORS | 2 +- tdeui/CMakeLists.txt | 56 +++---- tdeui/MAINTAINERS | 26 ++-- tdeui/Makefile.am | 58 +++---- tdeui/kanimwidget.cpp | 2 +- tdeui/kcmenumngr.cpp | 2 +- tdeui/kcolorbutton.cpp | 2 +- tdeui/kcolorcombo.cpp | 2 +- tdeui/kcolorcombo.h | 2 +- tdeui/kcolordialog.cpp | 2 +- tdeui/kcolordialog.h | 2 +- tdeui/kcombobox.cpp | 4 +- tdeui/kcombobox.h | 2 +- tdeui/kcommand.cpp | 6 +- tdeui/kcompletionbox.h | 2 +- tdeui/kdatepicker.cpp | 2 +- tdeui/kdatetbl.cpp | 8 +- tdeui/kdcopactionproxy.cpp | 2 +- tdeui/kdepackages.h | 2 +- tdeui/kdockwidget.cpp | 4 +- tdeui/kdockwidget.h | 4 +- tdeui/keditcl1.cpp | 4 +- tdeui/kedittoolbar.cpp | 4 +- tdeui/khelpmenu.cpp | 6 +- tdeui/kiconviewsearchline.cpp | 2 +- tdeui/kinputdialog.cpp | 2 +- tdeui/kjanuswidget.cpp | 2 +- tdeui/kjanuswidget.h | 2 +- tdeui/kkeybutton.cpp | 2 +- tdeui/kkeybutton.h | 2 +- tdeui/kkeydialog.cpp | 14 +- tdeui/kkeydialog.h | 2 +- tdeui/klineedit.cpp | 4 +- tdeui/kmessagebox.cpp | 2 +- tdeui/kpanelmenu.cpp | 2 +- tdeui/kpanelmenu.h | 2 +- tdeui/kpixmapregionselectorwidget.cpp | 4 +- tdeui/kstdaction.cpp | 6 +- tdeui/kstdaction_p.h | 2 +- tdeui/ksystemtray.cpp | 6 +- tdeui/ktextedit.cpp | 2 +- tdeui/ktimezonewidget.cpp | 2 +- tdeui/ktimezonewidget.h | 2 +- tdeui/kxmlguibuilder.cpp | 10 +- tdeui/kxmlguiclient.cpp | 2 +- tdeui/kxmlguifactory.cpp | 4 +- tdeui/kxmlguifactory_p.h | 2 +- tdeui/tdeaction.cpp | 158 ++++++++++---------- tdeui/tdeaction.h | 16 +- tdeui/tdeactionclasses.cpp | 20 +-- tdeui/tdeactionclasses.h | 8 +- tdeui/tdeactioncollection.cpp | 72 ++++----- tdeui/tdeactioncollection.h | 20 +-- tdeui/tdeactionselector.cpp | 4 +- tdeui/tdeactionshortcutlist.h | 4 +- tdeui/tdefontcombo.cpp | 6 +- tdeui/tdefontdialog.cpp | 4 +- tdeui/tdefontdialog.h | 4 +- tdeui/tdefontrequester.cpp | 6 +- tdeui/tdefontrequester.h | 2 +- tdeui/tdelistbox.cpp | 4 +- tdeui/tdelistview.cpp | 8 +- tdeui/tdelistviewlineedit.h | 2 +- tdeui/tdelistviewsearchline.cpp | 10 +- tdeui/tdemainwindow.cpp | 24 +-- tdeui/tdemainwindow.h | 6 +- tdeui/tdemainwindowiface.cpp | 6 +- tdeui/tdemainwindowiface.h | 2 +- tdeui/tdepopupmenu.cpp | 4 +- tdeui/tdeselect.cpp | 4 +- tdeui/tdeshortcutdialog.cpp | 8 +- tdeui/tdeshortcutdialog.h | 2 +- tdeui/tdeshortcutdialog_advanced.ui | 2 +- tdeui/tdeshortcutdialog_simple.ui | 2 +- tdeui/tdespell.cpp | 4 +- tdeui/tdespelldlg.cpp | 4 +- tdeui/tdetoolbar.cpp | 12 +- tdeui/tdetoolbarbutton.cpp | 8 +- tdeui/tdetoolbarhandler.cpp | 10 +- tdeui/tdetoolbarlabelaction.cpp | 2 +- tdeui/tdetoolbarlabelaction.h | 2 +- tdeui/tdetoolbarradiogroup.cpp | 8 +- tdeui/tests/CMakeLists.txt | 12 +- tdeui/tests/Makefile.am | 28 ++-- tdeui/tests/itemcontainertest.cpp | 4 +- tdeui/tests/kdockwidgettest.cpp | 2 +- tdeui/tests/krulertest.h | 2 +- tdeui/tests/kstatusbartest.cpp | 2 +- tdeui/tests/kstatusbartest.h | 2 +- tdeui/tests/kxmlguitest.cpp | 4 +- tdeui/tests/tdeaccelgentest.cpp | 2 +- tdeui/tests/tdeactiontest.cpp | 4 +- tdeui/tests/tdefontdialogtest.cpp | 2 +- tdeui/tests/tdelistviewtest.cpp | 4 +- tdeui/tests/tdemainwindowrestoretest.cpp | 6 +- tdeui/tests/tdemainwindowrestoretest.h | 2 +- tdeui/tests/tdemainwindowtest.cpp | 6 +- tdeui/tests/tdemainwindowtest.h | 2 +- tdeui/tests/tdepopuptest.cpp | 4 +- tdeui/tests/tdetoolbarlabelactiontest.cpp | 10 +- tdeui/tests/tdetoolbarlabelactiontestui.rc | 2 +- tdeui/tests/twindowtest.cpp | 4 +- tdeui/tests/twindowtest.h | 4 +- tdeui/twindowlistmenu.h | 2 +- tdeutils/kpluginselector.cpp | 2 +- tdeutils/ksettings/componentsdialog.cpp | 2 +- .../interfaces/tdetexteditor/tdetexteditor.pro | 8 +- win/pro_files/kio/kio.pro | 4 +- win/pro_files/tdecore/tdecore.pro | 16 +- win/pro_files/tdeui/tdeui.pro | 46 +++--- win/tdelibs_global_win.h | 2 +- 335 files changed, 1114 insertions(+), 1114 deletions(-) create mode 100644 tdecore/network/ipv6blacklist delete mode 100644 tdecore/network/ipv6blactdelist create mode 100644 tdeparts/dockmainwindow.cpp create mode 100644 tdeparts/dockmainwindow.h delete mode 100644 tdeparts/doctdemainwindow.cpp delete mode 100644 tdeparts/doctdemainwindow.h (limited to 'knewstuff/providerdialog.cpp') diff --git a/KDE2PORTING.html b/KDE2PORTING.html index 63692b613..47e00c03b 100644 --- a/KDE2PORTING.html +++ b/KDE2PORTING.html @@ -694,15 +694,15 @@ can combine TreeView's and normal Tablists without problems.

TDEToolBarButton & TDERadioGroup

If you need to do anything with TDEToolBarButton you now need to include -<ktoolbarbutton.h> TDERadioGroup has been renamed to TDEToolBarRadioGroup and -requires you to include <ktoolbarradiogroup.h>

+<tdetoolbarbutton.h> TDERadioGroup has been renamed to TDEToolBarRadioGroup and +requires you to include <tdetoolbarradiogroup.h>

Return to the Table of Contents

TDEAccel

The functions keyToString() and stringToKey() which were previously -declared globally in kaccel.h are now static methods in TDEAccel.

+declared globally in tdeaccel.h are now static methods in TDEAccel.

Return to the Table of Contents

diff --git a/KDE3PORTING.html b/KDE3PORTING.html index 407d5c5ad..457fd0cfa 100644 --- a/KDE3PORTING.html +++ b/KDE3PORTING.html @@ -154,9 +154,9 @@ not be available. diff --git a/arts/kde/kvideowidget.cpp b/arts/kde/kvideowidget.cpp index a4307dbbf..389228d99 100644 --- a/arts/kde/kvideowidget.cpp +++ b/arts/kde/kvideowidget.cpp @@ -26,7 +26,7 @@ #define XEvent void #endif -#include +#include #include #include "kvideowidget.h" diff --git a/dcop/dcopidl2cpp/dcopidl_test.h b/dcop/dcopidl2cpp/dcopidl_test.h index a6c72a888..66f18f92f 100644 --- a/dcop/dcopidl2cpp/dcopidl_test.h +++ b/dcop/dcopidl2cpp/dcopidl_test.h @@ -1,4 +1,4 @@ -#include +#include #include "main.h" #ifndef TEST_H diff --git a/dnssd/README b/dnssd/README index 304a7babb..49be40c48 100644 --- a/dnssd/README +++ b/dnssd/README @@ -1,4 +1,4 @@ -Checklist to ensure that zeroconf will work: +Chectdelist to ensure that zeroconf will work: 1) Install Avahi, at least version 0.3 2) compile tdednssd-avahi and install it to replace 'stub' libtdednssd.so provided by tdelibs diff --git a/interfaces/tdescript/scriptloader.cpp b/interfaces/tdescript/scriptloader.cpp index a11032ada..65b6604b5 100644 --- a/interfaces/tdescript/scriptloader.cpp +++ b/interfaces/tdescript/scriptloader.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/interfaces/tdescript/scriptloader.h b/interfaces/tdescript/scriptloader.h index d0b338822..7fa4fa93f 100644 --- a/interfaces/tdescript/scriptloader.h +++ b/interfaces/tdescript/scriptloader.h @@ -19,8 +19,8 @@ #ifndef _script_loader_h #define _script_loader_h #include -#include -#include +#include +#include #include /** diff --git a/interfaces/tdetexteditor/CMakeLists.txt b/interfaces/tdetexteditor/CMakeLists.txt index 0808a84f3..5ed7edeca 100644 --- a/interfaces/tdetexteditor/CMakeLists.txt +++ b/interfaces/tdetexteditor/CMakeLists.txt @@ -37,7 +37,7 @@ install( FILES document.h view.h editor.h plugin.h editinterface.h undointerface.h selectioninterface.h cursorinterface.h clipboardinterface.h popupmenuinterface.h viewcursorinterface.h - searchinterface.h highlightinginterface.h blockselectioninterface.h + searchinterface.h highlightinginterface.h bloctdeselectioninterface.h codecompletioninterface.h configinterface.h markinterface.h printinterface.h wordwrapinterface.h dynwordwrapinterface.h markinterfaceextension.h configinterfaceextension.h @@ -69,7 +69,7 @@ set( target tdetexteditor ) set( ${target}_SRCS tdetexteditor.cpp editinterface.cpp clipboardinterface.cpp selectioninterface.cpp searchinterface.cpp - codecompletioninterface.cpp wordwrapinterface.cpp blockselectioninterface.cpp + codecompletioninterface.cpp wordwrapinterface.cpp bloctdeselectioninterface.cpp configinterface.cpp cursorinterface.cpp dynwordwrapinterface.cpp printinterface.cpp highlightinginterface.cpp markinterface.cpp popupmenuinterface.cpp undointerface.cpp viewcursorinterface.cpp @@ -78,8 +78,8 @@ set( ${target}_SRCS searchdcopinterface.cpp searchdcopinterface.skel markinterfaceextension.cpp configinterfaceextension.cpp encodinginterface.cpp sessionconfiginterface.cpp viewstatusmsginterface.cpp editorchooser_ui.ui editorchooser.cpp - blockselectiondcopinterface.cpp documentinfo.cpp documentdcopinfo.cpp - blockselectiondcopinterface.skel documentdcopinfo.skel encodingdcopinterface.cpp + bloctdeselectiondcopinterface.cpp documentinfo.cpp documentdcopinfo.cpp + bloctdeselectiondcopinterface.skel documentdcopinfo.skel encodingdcopinterface.cpp encodingdcopinterface.skel printdcopinterface.cpp printdcopinterface.skel undodcopinterface.cpp undodcopinterface.skel viewcursordcopinterface.cpp viewcursordcopinterface.skel viewstatusmsgdcopinterface.cpp diff --git a/interfaces/tdetexteditor/Makefile.am b/interfaces/tdetexteditor/Makefile.am index b535b39cc..7cba7d096 100644 --- a/interfaces/tdetexteditor/Makefile.am +++ b/interfaces/tdetexteditor/Makefile.am @@ -4,7 +4,7 @@ lib_LTLIBRARIES = libtdetexteditor.la libtdetexteditor_la_SOURCES = tdetexteditor.cpp \ editinterface.cpp clipboardinterface.cpp selectioninterface.cpp searchinterface.cpp \ - codecompletioninterface.cpp wordwrapinterface.cpp blockselectioninterface.cpp \ + codecompletioninterface.cpp wordwrapinterface.cpp bloctdeselectioninterface.cpp \ configinterface.cpp cursorinterface.cpp dynwordwrapinterface.cpp \ printinterface.cpp highlightinginterface.cpp markinterface.cpp \ popupmenuinterface.cpp undointerface.cpp viewcursorinterface.cpp \ @@ -13,8 +13,8 @@ libtdetexteditor_la_SOURCES = tdetexteditor.cpp \ searchdcopinterface.cpp searchdcopinterface.skel markinterfaceextension.cpp \ configinterfaceextension.cpp encodinginterface.cpp sessionconfiginterface.cpp \ viewstatusmsginterface.cpp editorchooser_ui.ui editorchooser.cpp \ - blockselectiondcopinterface.cpp documentinfo.cpp documentdcopinfo.cpp\ - blockselectiondcopinterface.skel documentdcopinfo.skel encodingdcopinterface.cpp \ + bloctdeselectiondcopinterface.cpp documentinfo.cpp documentdcopinfo.cpp\ + bloctdeselectiondcopinterface.skel documentdcopinfo.skel encodingdcopinterface.cpp \ encodingdcopinterface.skel printdcopinterface.cpp printdcopinterface.skel \ undodcopinterface.cpp undodcopinterface.skel viewcursordcopinterface.cpp \ viewcursordcopinterface.skel viewstatusmsgdcopinterface.cpp \ @@ -29,7 +29,7 @@ tdetexteditorinclude_HEADERS = document.h view.h editor.h plugin.h editinterface selectioninterface.h cursorinterface.h \ clipboardinterface.h popupmenuinterface.h \ viewcursorinterface.h searchinterface.h highlightinginterface.h \ - blockselectioninterface.h codecompletioninterface.h \ + bloctdeselectioninterface.h codecompletioninterface.h \ configinterface.h markinterface.h printinterface.h wordwrapinterface.h \ dynwordwrapinterface.h markinterfaceextension.h configinterfaceextension.h \ encodinginterface.h viewstatusmsginterface.h sessionconfiginterface.h editorchooser.h \ diff --git a/interfaces/tdetexteditor/bloctdeselectiondcopinterface.cpp b/interfaces/tdetexteditor/bloctdeselectiondcopinterface.cpp index 34b7294b2..1648c3eb3 100644 --- a/interfaces/tdetexteditor/bloctdeselectiondcopinterface.cpp +++ b/interfaces/tdetexteditor/bloctdeselectiondcopinterface.cpp @@ -1,5 +1,5 @@ -#include "blockselectiondcopinterface.h" -#include "blockselectioninterface.h" +#include "bloctdeselectiondcopinterface.h" +#include "bloctdeselectioninterface.h" #include using namespace KTextEditor; diff --git a/interfaces/tdetexteditor/bloctdeselectiondcopinterface.h b/interfaces/tdetexteditor/bloctdeselectiondcopinterface.h index 4b74fd2a0..3117ee163 100644 --- a/interfaces/tdetexteditor/bloctdeselectiondcopinterface.h +++ b/interfaces/tdetexteditor/bloctdeselectiondcopinterface.h @@ -38,13 +38,13 @@ namespace KTextEditor /** * Returns the status of the selection mode - true indicates block selection mode is on. * If this is true, selections applied via the SelectionInterface are handled as - * blockselections and the paste functions of the ClipboardInterface works on + * bloctdeselections and the paste functions of the ClipboardInterface works on * rectangular blocks of text rather than normal. (copy too, but thats clear I hope ;) */ bool blockSelectionMode (); /** - * set blockselection mode to state "on" + * set bloctdeselection mode to state "on" */ bool setBlockSelectionMode (bool on) ; diff --git a/interfaces/tdetexteditor/bloctdeselectioninterface.cpp b/interfaces/tdetexteditor/bloctdeselectioninterface.cpp index 6d562a43e..0a7068dba 100644 --- a/interfaces/tdetexteditor/bloctdeselectioninterface.cpp +++ b/interfaces/tdetexteditor/bloctdeselectioninterface.cpp @@ -18,8 +18,8 @@ // $Id$ -#include "blockselectioninterface.h" -#include "blockselectiondcopinterface.h" +#include "bloctdeselectioninterface.h" +#include "bloctdeselectiondcopinterface.h" #include "document.h" namespace KTextEditor diff --git a/interfaces/tdetexteditor/bloctdeselectioninterface.h b/interfaces/tdetexteditor/bloctdeselectioninterface.h index b2cd785eb..34ab553f9 100644 --- a/interfaces/tdetexteditor/bloctdeselectioninterface.h +++ b/interfaces/tdetexteditor/bloctdeselectioninterface.h @@ -16,8 +16,8 @@ Boston, MA 02110-1301, USA. */ -#ifndef __tdetexteditor_blockselectioninterface_h__ -#define __tdetexteditor_blockselectioninterface_h__ +#ifndef __tdetexteditor_bloctdeselectioninterface_h__ +#define __tdetexteditor_bloctdeselectioninterface_h__ #include @@ -51,7 +51,7 @@ class KTEXTEDITOR_EXPORT BlockSelectionInterface /** * Returns the status of the selection mode - true indicates block selection mode is on. * If this is true, selections applied via the SelectionInterface are handled as - * blockselections and the paste functions of the ClipboardInterface works on + * bloctdeselections and the paste functions of the ClipboardInterface works on * rectangular blocks of text rather than normal. (copy too, but thats clear I hope ;) */ virtual bool blockSelectionMode () = 0; diff --git a/interfaces/tdetexteditor/tdetexteditor.cpp b/interfaces/tdetexteditor/tdetexteditor.cpp index 354361ed2..25726577b 100644 --- a/interfaces/tdetexteditor/tdetexteditor.cpp +++ b/interfaces/tdetexteditor/tdetexteditor.cpp @@ -24,7 +24,7 @@ #include "plugin.h" #include "editor.h" -#include +#include #include #include diff --git a/interfaces/terminal/test/main.cc b/interfaces/terminal/test/main.cc index 399b6451c..19b820056 100644 --- a/interfaces/terminal/test/main.cc +++ b/interfaces/terminal/test/main.cc @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kab/kabapi.cc b/kab/kabapi.cc index 245f07c5d..05cffe946 100644 --- a/kab/kabapi.cc +++ b/kab/kabapi.cc @@ -17,7 +17,7 @@ */ #include "kabapi.h" -#include +#include #include #include #include diff --git a/kabc/addresseedialog.h b/kabc/addresseedialog.h index 83166b50b..74470d1b4 100644 --- a/kabc/addresseedialog.h +++ b/kabc/addresseedialog.h @@ -25,7 +25,7 @@ #include #include -#include +#include #include "addressbook.h" diff --git a/kabc/addresslineedit.cpp b/kabc/addresslineedit.cpp index 1affd0997..88703094b 100644 --- a/kabc/addresslineedit.cpp +++ b/kabc/addresslineedit.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include diff --git a/kabc/ldapconfigwidget.cpp b/kabc/ldapconfigwidget.cpp index eff79a73a..5996477a0 100644 --- a/kabc/ldapconfigwidget.cpp +++ b/kabc/ldapconfigwidget.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include diff --git a/kabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp b/kabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp index 15efa5ba6..f53ee7d30 100644 --- a/kabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp +++ b/kabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/kabc/resourceselectdialog.cpp b/kabc/resourceselectdialog.cpp index e840e027e..3b6e25752 100644 --- a/kabc/resourceselectdialog.cpp +++ b/kabc/resourceselectdialog.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/kate/data/idconsole.xml b/kate/data/idconsole.xml index fa2a5cffd..9275cd944 100644 --- a/kate/data/idconsole.xml +++ b/kate/data/idconsole.xml @@ -197,7 +197,7 @@ host_speeds hostname hpkextract - hpklist + hptdelist hpkremove hpkval hud_centerid diff --git a/kate/interfaces/document.h b/kate/interfaces/document.h index 4d596fb01..aaf241eee 100644 --- a/kate/interfaces/document.h +++ b/kate/interfaces/document.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include @@ -38,7 +38,7 @@ #include #include -#include +#include class KCompletion; diff --git a/kate/part/kateautoindent.cpp b/kate/part/kateautoindent.cpp index 792c53385..d904e16ce 100644 --- a/kate/part/kateautoindent.cpp +++ b/kate/part/kateautoindent.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include diff --git a/kate/part/katebookmarks.cpp b/kate/part/katebookmarks.cpp index d3fb52a72..5a1a085c2 100644 --- a/kate/part/katebookmarks.cpp +++ b/kate/part/katebookmarks.cpp @@ -24,8 +24,8 @@ #include "kateview.h" #include -#include -#include +#include +#include #include #include #include diff --git a/kate/part/katedialogs.cpp b/kate/part/katedialogs.cpp index 099dad99d..0bf1d7ea7 100644 --- a/kate/part/katedialogs.cpp +++ b/kate/part/katedialogs.cpp @@ -42,7 +42,7 @@ #include #include -#include +#include #include #include #include @@ -52,20 +52,20 @@ #include #include #include -#include +#include #include #include #include #include #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include diff --git a/kate/part/katedialogs.h b/kate/part/katedialogs.h index c97f45d9a..0f865fcea 100644 --- a/kate/part/katedialogs.h +++ b/kate/part/katedialogs.h @@ -29,7 +29,7 @@ #include "../interfaces/document.h" -#include +#include #include #include diff --git a/kate/part/katedocument.cpp b/kate/part/katedocument.cpp index 74e5c3225..cb1844489 100644 --- a/kate/part/katedocument.cpp +++ b/kate/part/katedocument.cpp @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include #include @@ -3976,7 +3976,7 @@ void KateDocument::transform( KateView *v, const KateTextCursor &c, { // If bol or the character before is not in a word, up this one: // 1. if both start and p is 0, upper char. - // 2. if blockselect or first line, and p == 0 and start-1 is not in a word, upper + // 2. if bloctdeselect or first line, and p == 0 and start-1 is not in a word, upper // 3. if p-1 is not in a word, upper. if ( ( ! start && ! p ) || ( ( ln == selstart.line() || v->blockSelectionMode() ) && diff --git a/kate/part/katedocumenthelpers.cpp b/kate/part/katedocumenthelpers.cpp index 370be7684..e50906b0d 100644 --- a/kate/part/katedocumenthelpers.cpp +++ b/kate/part/katedocumenthelpers.cpp @@ -24,7 +24,7 @@ #include "katedocument.h" #include "kateview.h" -#include +#include #include KateBrowserExtension::KateBrowserExtension( KateDocument* doc ) diff --git a/kate/part/katefiletype.cpp b/kate/part/katefiletype.cpp index 15dd7c9f6..f0b01ef2d 100644 --- a/kate/part/katefiletype.cpp +++ b/kate/part/katefiletype.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include diff --git a/kate/part/katehighlight.cpp b/kate/part/katehighlight.cpp index f06518649..3c84007eb 100644 --- a/kate/part/katehighlight.cpp +++ b/kate/part/katehighlight.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kate/part/katekeyinterceptorfunctor.h b/kate/part/katekeyinterceptorfunctor.h index 0126ff814..2a973026a 100644 --- a/kate/part/katekeyinterceptorfunctor.h +++ b/kate/part/katekeyinterceptorfunctor.h @@ -17,7 +17,7 @@ */ #ifndef _KATE_KEY_INTERCEPTOR_FUNCTOR_H #define _KATE_KEY_INTERCEPTOR_FUNCTOR_H -#include +#include class KateKeyInterceptorFunctor { public: virtual bool operator()(KKey key)=0; diff --git a/kate/part/kateprinter.cpp b/kate/part/kateprinter.cpp index 1b264a602..77ed4dcca 100644 --- a/kate/part/kateprinter.cpp +++ b/kate/part/kateprinter.cpp @@ -34,7 +34,7 @@ #include #include #include // for spacingHint() -#include +#include #include #include #include diff --git a/kate/part/kateschema.cpp b/kate/part/kateschema.cpp index 9a7e4e1ab..8f4f03a10 100644 --- a/kate/part/kateschema.cpp +++ b/kate/part/kateschema.cpp @@ -32,11 +32,11 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include #include #include diff --git a/kate/part/kateschema.h b/kate/part/kateschema.h index 6675a6bc8..77cc112a1 100644 --- a/kate/part/kateschema.h +++ b/kate/part/kateschema.h @@ -30,7 +30,7 @@ #include #include -#include +#include class KateView; class KateStyleListItem; diff --git a/kate/part/katesearch.cpp b/kate/part/katesearch.cpp index 9d0dc896b..b66be04c6 100644 --- a/kate/part/katesearch.cpp +++ b/kate/part/katesearch.cpp @@ -696,7 +696,7 @@ bool KateSearch::doSearch( const TQString& text ) col = foundCol+1; } while (s.flags.selected && m_view->blockSelectionMode() && found); - // in the case we want to search in selection + blockselection we need to loop + // in the case we want to search in selection + bloctdeselection we need to loop if( !found ) return false; diff --git a/kate/part/katespell.cpp b/kate/part/katespell.cpp index 53767d672..fc7e943cf 100644 --- a/kate/part/katespell.cpp +++ b/kate/part/katespell.cpp @@ -26,7 +26,7 @@ #include "kateview.h" -#include +#include #include #include #include diff --git a/kate/part/kateview.cpp b/kate/part/kateview.cpp index 03b1fa5d3..dc82922a3 100644 --- a/kate/part/kateview.cpp +++ b/kate/part/kateview.cpp @@ -61,10 +61,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include #include diff --git a/kate/part/kateview.h b/kate/part/kateview.h index 0a00ab1fc..9d04a524f 100644 --- a/kate/part/kateview.h +++ b/kate/part/kateview.h @@ -222,7 +222,7 @@ class KateView : public Kate::View, */ inline const KateSuperCursor &selEnd () const { return selectEnd; } - // should cursor be wrapped ? take config + blockselection state in account + // should cursor be wrapped ? take config + bloctdeselection state in account bool wrapCursor (); // some internal functions to get selection state of a line/col diff --git a/kate/part/kateviewhelpers.cpp b/kate/part/kateviewhelpers.cpp index fc0072982..72b7be0f5 100644 --- a/kate/part/kateviewhelpers.cpp +++ b/kate/part/kateviewhelpers.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include diff --git a/kate/part/kateviewhelpers.h b/kate/part/kateviewhelpers.h index 0faa90309..0ff59352e 100644 --- a/kate/part/kateviewhelpers.h +++ b/kate/part/kateviewhelpers.h @@ -21,7 +21,7 @@ #ifndef __KATE_VIEW_HELPERS_H__ #define __KATE_VIEW_HELPERS_H__ -#include +#include #include #include diff --git a/kate/part/test_regression.cpp b/kate/part/test_regression.cpp index 1a7b73bf3..8dabeb2f6 100644 --- a/kate/part/test_regression.cpp +++ b/kate/part/test_regression.cpp @@ -39,11 +39,11 @@ #include #include -#include +#include #include #include "katefactory.h" #include -#include +#include #include #include diff --git a/kate/plugins/autobookmarker/autobookmarker.cpp b/kate/plugins/autobookmarker/autobookmarker.cpp index 449675f6c..4e0d70b86 100644 --- a/kate/plugins/autobookmarker/autobookmarker.cpp +++ b/kate/plugins/autobookmarker/autobookmarker.cpp @@ -28,12 +28,12 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/kate/plugins/insertfile/insertfileplugin.cpp b/kate/plugins/insertfile/insertfileplugin.cpp index 2f0d01ed4..567262a64 100644 --- a/kate/plugins/insertfile/insertfileplugin.cpp +++ b/kate/plugins/insertfile/insertfileplugin.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/kate/plugins/isearch/ISearchPlugin.cpp b/kate/plugins/isearch/ISearchPlugin.cpp index 758449fbe..a36c9dc60 100644 --- a/kate/plugins/isearch/ISearchPlugin.cpp +++ b/kate/plugins/isearch/ISearchPlugin.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kate/plugins/kdatatool/kate_kdatatool.cpp b/kate/plugins/kdatatool/kate_kdatatool.cpp index 829a0f31f..d3b762b8e 100644 --- a/kate/plugins/kdatatool/kate_kdatatool.cpp +++ b/kate/plugins/kdatatool/kate_kdatatool.cpp @@ -20,13 +20,13 @@ #include "kate_kdatatool.h" #include "kate_kdatatool.moc" #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include diff --git a/kate/plugins/wordcompletion/docwordcompletion.cpp b/kate/plugins/wordcompletion/docwordcompletion.cpp index 4c38b1287..5041cc8ad 100644 --- a/kate/plugins/wordcompletion/docwordcompletion.cpp +++ b/kate/plugins/wordcompletion/docwordcompletion.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kate/tests/highlight.xsl b/kate/tests/highlight.xsl index f6e0efb12..d5699f31b 100644 --- a/kate/tests/highlight.xsl +++ b/kate/tests/highlight.xsl @@ -3,7 +3,7 @@ $entry\n"; - $entryiso = $entry; - $entryiso =~ s/$ARGV[0]\///; - $entryiso =~ s/\/entry\.desktop//; - # print " $entryiso\n"; - open (IN, $entry); - @entryfile = ; - close IN; - chomp @entryfile; - foreach $entryfileline (@entryfile) { - if ( $entryfileline =~ /^Name.*=(.*)$/ ) { - # push (@mappings, $1 . "\t" . $entryiso ); - print "$1\t$entryiso\n"; - } - } -} - -# add some convenience entries which aren't part of the entry.desktop files - -print "Czech Republic\tcz\n"; diff --git a/kabc/scripts/entrylist b/kabc/scripts/entrylist deleted file mode 100644 index 87c342a06..000000000 --- a/kabc/scripts/entrylist +++ /dev/null @@ -1,82 +0,0 @@ -# This file describes the fields of an address book entry. -# -# The following comma-separated fields are used: -# -# Control: A generates accessor functions. -# L generates a static function for returning a tranlsated label -# F generates a Field id and object for generic field handling -# E generate an equality test in Addressee::operator==(). -# Field Name : A descriptive name which is shown to the user. -# Comment : A comment helping translators to understand the field name -# Type : C++ type of field. -# Identifier : A string used in code as variable name etc. -# Field Category : Categories the field belongs to (see Field::FieldCategory). -# Output function: Function used to convert type to string for debug output (optional) - -ALE,name,,TQString,name - -ALFE,formatted name,,TQString,formattedName,Frequent - -ALFE,family name,,TQString,familyName,Frequent -ALFE,given name,,TQString,givenName,Frequent -ALFE,additional names,,TQString,additionalName -ALFE,honorific prefixes,,TQString,prefix -ALFE,honorific suffixes,,TQString,suffix - -ALFE,nick name,,TQString,nickName,Personal - -ALFE,birthday,,TQDateTime,birthday,Personal,.toString() - -#Address address -LF,home address street,,TQString,homeAddressStreet,Address|Personal -LF,home address city,,TQString,homeAddressLocality,Address|Personal -LF,home address state,,TQString,homeAddressRegion,Address|Personal -LF,home address zip code,,TQString,homeAddressPostalCode,Address|Personal -LF,home address country,,TQString,homeAddressCountry,Address|Personal -LF,home address label,,TQString,homeAddressLabel,Address|Personal - -LF,business address street,,TQString,businessAddressStreet,Address|Organization -LF,business address city,,TQString,businessAddressLocality,Address|Organization -LF,business address state,,TQString,businessAddressRegion,Address|Organization -LF,business address zip code,,TQString,businessAddressPostalCode,Address|Organization -LF,business address country,,TQString,businessAddressCountry,Address|Organization -LF,business address label,,TQString,businessAddressLabel,Address|Organization - -#phoneNumbers -LF,home phone,,TQString,homePhone,Personal|Frequent -LF,business phone,,TQString,businessPhone,Organization|Frequent -LF,mobile phone,,TQString,mobilePhone,Frequent -LF,home fax,,TQString,homeFax -LF,business fax,,TQString,businessFax -LF,car phone,,TQString,carPhone -LF,ISDN,,TQString,isdn -LF,pager,,TQString,pager - -#emails -LF,email address,,TQString,email,Email|Frequent - -ALFE,mail client,,TQString,mailer,Email - -ALE,time zone,,TimeZone,timeZone,,.asString() -ALE,geographic position,,Geo,geo,,.asString() - -ALFE,title,person,TQString,title,Organization -ALFE,role,person in organization,TQString,role,Organization -ALFE,organization,,TQString,organization,Organization -ALFE,department,,TQString,department,Organization - -ALFE,note,,TQString,note - -ALE,product identifier,,TQString,productId -ALE,revision date,,TQDateTime,revision,,.toString() - -ALE,sort string,,TQString,sortString - -ALF,homepage,,KURL,url,,.url() - -ALE,security class,,Secrecy,secrecy,,.asString() - -ALE,logo,,Picture,logo,,.asString() -ALE,photo,,Picture,photo,,.asString() -ALE,sound,,Sound,sound,,.asString() -ALE,agent,,Agent,agent,,.asString() diff --git a/kabc/scripts/field.src.cpp b/kabc/scripts/field.src.cpp deleted file mode 100644 index 2c80810b7..000000000 --- a/kabc/scripts/field.src.cpp +++ /dev/null @@ -1,512 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include -#include - -#include "field.h" -#include "address.h" - -using namespace KABC; - -class Field::FieldImpl -{ - public: - FieldImpl( int fieldId, int category = 0, - const TQString &label = TQString::null, - const TQString &key = TQString::null, - const TQString &app = TQString::null ) - : mFieldId( fieldId ), mCategory( category ), mLabel( label ), - mKey( key ), mApp( app ) {} - - enum FieldId - { - CustomField, - --ENUMS-- - }; - - int fieldId() { return mFieldId; } - int category() { return mCategory; } - - TQString label() { return mLabel; } - TQString key() { return mKey; } - TQString app() { return mApp; } - - private: - int mFieldId; - int mCategory; - - TQString mLabel; - TQString mKey; - TQString mApp; -}; - - -Field::List Field::mAllFields; -Field::List Field::mDefaultFields; -Field::List Field::mCustomFields; - - -Field::Field( FieldImpl *impl ) -{ - mImpl = impl; -} - -Field::~Field() -{ - delete mImpl; -} - -TQString Field::label() -{ - switch ( mImpl->fieldId() ) { - --CASELABEL-- - case FieldImpl::CustomField: - return mImpl->label(); - default: - return i18n("Unknown Field"); - } -} - -int Field::category() -{ - return mImpl->category(); -} - -TQString Field::categoryLabel( int category ) -{ - switch ( category ) { - case All: - return i18n("All"); - case Frequent: - return i18n("Frequent"); - case Address: - return i18n("street/postal","Address"); - case Email: - return i18n("Email"); - case Personal: - return i18n("Personal"); - case Organization: - return i18n("Organization"); - case CustomCategory: - return i18n("Custom"); - default: - return i18n("Undefined"); - } -} - -TQString Field::value( const KABC::Addressee &a ) -{ - switch ( mImpl->fieldId() ) { - --CASEVALUE-- - case FieldImpl::Email: - return a.preferredEmail(); - case FieldImpl::Birthday: - if ( a.birthday().isValid() ) - return a.birthday().date().toString( Qt::ISODate ); - else - return TQString::null; - case FieldImpl::Url: - return a.url().prettyURL(); - case FieldImpl::HomePhone: - { - PhoneNumber::List::ConstIterator it; - - { - // check for preferred number - const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Home | PhoneNumber::Pref ); - for ( it = list.begin(); it != list.end(); ++it ) - if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home ) - return (*it).number(); - } - - { - // check for normal home number - const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Home ); - for ( it = list.begin(); it != list.end(); ++it ) - if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home ) - return (*it).number(); - } - - return TQString::null; - } - case FieldImpl::BusinessPhone: - { - PhoneNumber::List::ConstIterator it; - - { - // check for preferred number - const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Work | PhoneNumber::Pref ); - for ( it = list.begin(); it != list.end(); ++it ) - if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work ) - return (*it).number(); - } - - { - // check for normal work number - const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Work ); - for ( it = list.begin(); it != list.end(); ++it ) - if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work ) - return (*it).number(); - } - - return TQString::null; - } - case FieldImpl::MobilePhone: - return a.phoneNumber( PhoneNumber::Cell ).number(); - case FieldImpl::HomeFax: - return a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ).number(); - case FieldImpl::BusinessFax: - return a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ).number(); - case FieldImpl::CarPhone: - return a.phoneNumber( PhoneNumber::Car ).number(); - case FieldImpl::Isdn: - return a.phoneNumber( PhoneNumber::Isdn ).number(); - case FieldImpl::Pager: - return a.phoneNumber( PhoneNumber::Pager ).number(); - case FieldImpl::HomeAddressStreet: - return a.address( Address::Home ).street(); - case FieldImpl::HomeAddressLocality: - return a.address( Address::Home ).locality(); - case FieldImpl::HomeAddressRegion: - return a.address( Address::Home ).region(); - case FieldImpl::HomeAddressPostalCode: - return a.address( Address::Home ).postalCode(); - case FieldImpl::HomeAddressCountry: - return a.address( Address::Home ).country(); - case FieldImpl::HomeAddressLabel: - return a.address( Address::Home ).label(); - case FieldImpl::BusinessAddressStreet: - return a.address( Address::Work ).street(); - case FieldImpl::BusinessAddressLocality: - return a.address( Address::Work ).locality(); - case FieldImpl::BusinessAddressRegion: - return a.address( Address::Work ).region(); - case FieldImpl::BusinessAddressPostalCode: - return a.address( Address::Work ).postalCode(); - case FieldImpl::BusinessAddressCountry: - return a.address( Address::Work ).country(); - case FieldImpl::BusinessAddressLabel: - return a.address( Address::Work ).label(); - case FieldImpl::CustomField: - return a.custom( mImpl->app(), mImpl->key() ); - default: - return TQString::null; - } -} - -bool Field::setValue( KABC::Addressee &a, const TQString &value ) -{ - switch ( mImpl->fieldId() ) { - --CASESETVALUE-- - case FieldImpl::MobilePhone: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Cell ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::HomeFax: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::BusinessFax: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::CarPhone: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Car ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::Isdn: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Isdn ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::Pager: - { - PhoneNumber number = a.phoneNumber( PhoneNumber::Pager ); - number.setNumber( value ); - a.insertPhoneNumber( number ); - return true; - } - case FieldImpl::HomeAddressStreet: - { - KABC::Address address = a.address( Address::Home ); - address.setStreet( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::HomeAddressLocality: - { - KABC::Address address = a.address( Address::Home ); - address.setLocality( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::HomeAddressRegion: - { - KABC::Address address = a.address( Address::Home ); - address.setRegion( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::HomeAddressPostalCode: - { - KABC::Address address = a.address( Address::Home ); - address.setPostalCode( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::HomeAddressCountry: - { - KABC::Address address = a.address( Address::Home ); - address.setCountry( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::HomeAddressLabel: - { - KABC::Address address = a.address( Address::Home ); - address.setLabel( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressStreet: - { - KABC::Address address = a.address( Address::Work ); - address.setStreet( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressLocality: - { - KABC::Address address = a.address( Address::Work ); - address.setLocality( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressRegion: - { - KABC::Address address = a.address( Address::Work ); - address.setRegion( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressPostalCode: - { - KABC::Address address = a.address( Address::Work ); - address.setPostalCode( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressCountry: - { - KABC::Address address = a.address( Address::Work ); - address.setCountry( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::BusinessAddressLabel: - { - KABC::Address address = a.address( Address::Work ); - address.setLabel( value ); - a.insertAddress( address ); - return true; - } - case FieldImpl::Birthday: - a.setBirthday( TQT_TQDATE_OBJECT(TQDate::fromString( value, Qt::ISODate )) ); - return true; - case FieldImpl::CustomField: - a.insertCustom( mImpl->app(), mImpl->key(), value ); - return true; - default: - return false; - } -} - -TQString Field::sortKey( const KABC::Addressee &a ) -{ - switch ( mImpl->fieldId() ) { - --CASEVALUE-- - case FieldImpl::Birthday: - if ( a.birthday().isValid() ) { - TQDate date = TQT_TQDATE_OBJECT(a.birthday().date()); - TQString key; - key.sprintf( "%02d-%02d", date.month(), date.day() ); - return key; - } else - return TQString( "00-00" ); - default: - return value( a ).lower(); - } -} - -bool Field::isCustom() -{ - return mImpl->fieldId() == FieldImpl::CustomField; -} - -Field::List Field::allFields() -{ - if ( mAllFields.isEmpty() ) { - --CREATEFIELDS-- - } - - return mAllFields; -} - -Field::List Field::defaultFields() -{ - if ( mDefaultFields.isEmpty() ) { - createDefaultField( FieldImpl::FormattedName ); - createDefaultField( FieldImpl::Email ); - } - - return mDefaultFields; -} - -void Field::createField( int id, int category ) -{ - mAllFields.append( new Field( new FieldImpl( id, category ) ) ); -} - -void Field::createDefaultField( int id, int category ) -{ - mDefaultFields.append( new Field( new FieldImpl( id, category ) ) ); -} - -void Field::deleteFields() -{ - Field::List::ConstIterator it; - - for ( it = mAllFields.constBegin(); it != mAllFields.constEnd(); ++it ) { - delete (*it); - } - mAllFields.clear(); - - for ( it = mDefaultFields.constBegin(); it != mDefaultFields.constEnd(); ++it ) { - delete (*it); - } - mDefaultFields.clear(); - - for ( it = mCustomFields.constBegin(); it != mCustomFields.constEnd(); ++it ) { - delete (*it); - } - mCustomFields.clear(); -} - -void Field::saveFields( const TQString &identifier, - const Field::List &fields ) -{ - TDEConfig *cfg = TDEGlobal::config(); - TDEConfigGroupSaver( cfg, "KABCFields" ); - - saveFields( cfg, identifier, fields ); -} - -void Field::saveFields( TDEConfig *cfg, const TQString &identifier, - const Field::List &fields ) -{ - TQValueList fieldIds; - - int custom = 0; - Field::List::ConstIterator it; - for( it = fields.begin(); it != fields.end(); ++it ) { - fieldIds.append( (*it)->mImpl->fieldId() ); - if( (*it)->isCustom() ) { - TQStringList customEntry; - customEntry << (*it)->mImpl->label(); - customEntry << (*it)->mImpl->key(); - customEntry << (*it)->mImpl->app(); - cfg->writeEntry( "KABC_CustomEntry_" + identifier + "_" + - TQString::number( custom++ ), customEntry ); - } - } - - cfg->writeEntry( identifier, fieldIds ); -} - -Field::List Field::restoreFields( const TQString &identifier ) -{ - TDEConfig *cfg = TDEGlobal::config(); - TDEConfigGroupSaver( cfg, "KABCFields" ); - - return restoreFields( cfg, identifier ); -} - -Field::List Field::restoreFields( TDEConfig *cfg, const TQString &identifier ) -{ - const TQValueList fieldIds = cfg->readIntListEntry( identifier ); - - Field::List fields; - - int custom = 0; - TQValueList::ConstIterator it; - for( it = fieldIds.begin(); it != fieldIds.end(); ++it ) { - FieldImpl *f = 0; - if ( (*it) == FieldImpl::CustomField ) { - TQStringList customEntry = cfg->readListEntry( "KABC_CustomEntry_" + - identifier + "_" + - TQString::number( custom++ ) ); - f = new FieldImpl( *it, CustomCategory, customEntry[ 0 ], - customEntry[ 1 ], customEntry[ 2 ] ); - } else { - f = new FieldImpl( *it ); - } - fields.append( new Field( f ) ); - } - - return fields; -} - -bool Field::equals( Field *field ) -{ - bool sameId = ( mImpl->fieldId() == field->mImpl->fieldId() ); - - if ( !sameId ) return false; - - if ( mImpl->fieldId() != FieldImpl::CustomField ) return true; - - return mImpl->key() == field->mImpl->key(); -} - -Field *Field::createCustomField( const TQString &label, int category, - const TQString &key, const TQString &app ) -{ - Field *field = new Field( new FieldImpl( FieldImpl::CustomField, - category | CustomCategory, - label, key, app ) ); - mCustomFields.append( field ); - - return field; -} diff --git a/kabc/scripts/makeaddressee b/kabc/scripts/makeaddressee deleted file mode 100755 index fa955b0bf..000000000 --- a/kabc/scripts/makeaddressee +++ /dev/null @@ -1,215 +0,0 @@ -#!/usr/bin/perl - -my $srcdir; -$srcdir = `dirname $0` || die "Can't determine \$srcdir."; -chomp $srcdir; - -if (!open( ENTRIES, "$srcdir/entrylist" ) ) { - print "Can't open $srcdir/entrylist\n"; - exit 1; -} - - while() { - if (/^#/) { next; } - chop; - @entries = split /,/; - if (!/^.+,(\w+),(\w+)/) { next; } - push @entryCtrl, @entries[0]; - push @entryRealNames, @entries[1]; - push @entryComments, @entries[2]; - push @entryTypes, @entries[3]; - push @entryNames, @entries[4]; - push @entryCategory, @entries[5]; - push @entryDebug, @entries[6]; - } - -close ENTRIES; - -if (!open( H_IN, "$srcdir/addressee.src.h" ) ) { - print "Can't open $srcdir/addressee.src.h\n"; - exit 1; -} -if (!open( H_OUT, ">../addressee.h" ) ) { - print "Can't open addressee.h\n"; - exit 1; -} - print H_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; - - while( ) { - if (/--DECLARATIONS--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] =~ /A/ ) { - print H_OUT " /**\n"; - print H_OUT " Set $entryRealNames[$i].\n"; - print H_OUT " */\n"; - print H_OUT " void set" . ucfirst($entryNames[$i]); - print H_OUT "( const $entryTypes[$i] &$entryNames[$i] );\n"; - - print H_OUT " /**\n"; - print H_OUT " Return $entryRealNames[$i].\n"; - print H_OUT " */\n"; - print H_OUT " $entryTypes[$i] $entryNames[$i]() const;\n"; - } - - if ( $entryCtrl[$i] !~ /L/ ) { next; } - print H_OUT " /**\n"; - print H_OUT " Return translated label for $entryNames[$i] field.\n"; - print H_OUT " */\n"; - print H_OUT " static TQString $entryNames[$i]Label();\n\n"; - } - } else { - print H_OUT; - } - } - -close H_OUT; -close H_IN; - -if (!open( CPP_IN, "$srcdir/addressee.src.cpp" ) ) { - print "Can't open $srcdir/addressee.src.cpp\n"; - exit 1; -} -if (!open( CPP_OUT, ">../addressee.cpp" ) ) { - print "Can't open addressee.cpp\n"; - exit 1; -} - print CPP_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; - - while( ) { - if (/--VARIABLES--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /A/ ) { next; } - print CPP_OUT " $entryTypes[$i] $entryNames[$i];\n"; - } - } elsif (/--DEFINITIONS--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] =~ /A/ ) { - print CPP_OUT "void Addressee::set" . ucfirst($entryNames[$i]); - print CPP_OUT "( const $entryTypes[$i] &$entryNames[$i] )\n{\n"; - print CPP_OUT " if ( $entryNames[$i] == mData->$entryNames[$i] ) return;\n"; - print CPP_OUT " detach();\n mData->empty = false;\n"; - print CPP_OUT " mData->$entryNames[$i] = $entryNames[$i];\n}\n\n"; - - print CPP_OUT "$entryTypes[$i] Addressee::$entryNames[$i]() const\n{\n"; - print CPP_OUT " return mData->$entryNames[$i];\n}\n\n"; - } - - if ( $entryCtrl[$i] !~ /L/ ) { next; } - @labelwords = split ' ', $entryRealNames[$i]; - for( $j=0; $j < @labelwords; ++$j ) { - $labelwords[$j] = ucfirst $labelwords[$j]; - } - $label = join ' ', @labelwords; - print CPP_OUT "TQString Addressee::$entryNames[$i]Label()\n{\n"; - if ( $entryComments[$i] ) { - print CPP_OUT " return i18n(\"$entryComments[$i]\",\"$label\");\n"; - } else { - print CPP_OUT " return i18n(\"$label\");\n"; - } - print CPP_OUT "}\n\n\n"; - } - } elsif (/--EQUALSTEST--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] =~ /E/ ) { - if ( $entryNames[$i] !~ "revision" ) { - if ( $entryTypes[$i] =~ "TQString" ) { - print CPP_OUT " if ( mData->$entryNames[$i] != a.mData->$entryNames[$i] &&\n"; - print CPP_OUT " !( mData->$entryNames[$i].isEmpty() && a.mData->$entryNames[$i].isEmpty() ) ) {\n"; - print CPP_OUT " kdDebug(5700) << \"$entryNames[$i] differs\" << endl;\n"; - print CPP_OUT " return false;\n"; - print CPP_OUT " }\n"; - } else { - print CPP_OUT " if ( mData->$entryNames[$i] != a.mData->$entryNames[$i] ) {\n"; - print CPP_OUT " kdDebug(5700) << \"$entryNames[$i] differs\" << endl;\n"; - print CPP_OUT " return false;\n"; - print CPP_OUT " }\n"; - } - } - } - } - } elsif (/--STREAMOUT--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] =~ /A/ ) { - print CPP_OUT " s << a.mData->$entryNames[$i];\n"; - } - } - } elsif (/--STREAMIN--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] =~ /A/ ) { - print CPP_OUT " s >> a.mData->$entryNames[$i];\n"; - } - } - } elsif (/--DEBUG--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /A/ ) { next; } - print CPP_OUT " kdDebug(5700) << \" " . ucfirst($entryNames[$i]); - print CPP_OUT ": '\" << $entryNames[$i]()$entryDebug[$i] << \"'\" << endl;\n"; - } - } else { - print CPP_OUT; - } - } - -close CPP_OUT; -close CPP_IN; - -if (!open( CPP_IN, "$srcdir/field.src.cpp" ) ) { - print "Can't open $srcdir/field.src.cpp\n"; - exit 1; -} -if (!open( CPP_OUT, ">../field.cpp" ) ) { - print "Can't open field.cpp\n"; - exit 1; -} - print CPP_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; - - while( ) { - if (/--ENUMS--/) { - $first = 1; - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /F/ ) { next; } - if ( $first ) { $first = 0; } - else { print CPP_OUT ",\n"; } - print CPP_OUT " " . ucfirst($entryNames[$i]); - } - print CPP_OUT "\n"; - } elsif (/--CASELABEL--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /F/ ) { next; } - if ( $entryCtrl[$i] !~ /L/ ) { next; } - print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; - print CPP_OUT " return Addressee::$entryNames[$i]Label();\n"; - } - } elsif (/--CASEVALUE--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /A/ ) { next; } - if ( $entryCtrl[$i] !~ /F/ ) { next; } - if ( $entryTypes[$i] ne "TQString" ) { next; } - print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; - print CPP_OUT " return a.$entryNames[$i]();\n"; - } - } elsif (/--CASESETVALUE--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /A/ ) { next; } - if ( $entryCtrl[$i] !~ /F/ ) { next; } - if ( $entryTypes[$i] ne "TQString" ) { next; } - print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; - print CPP_OUT " a.set" . ucfirst($entryNames[$i]) . "( value );\n"; - print CPP_OUT " return true;\n"; - } - } elsif (/--CREATEFIELDS--/) { - for( $i=0; $i<@entryNames; ++$i ) { - if ( $entryCtrl[$i] !~ /F/ ) { next; } - print CPP_OUT " createField( FieldImpl::" . ucfirst($entryNames[$i]); - if ( $entryCategory[$i] ) { - print CPP_OUT ", $entryCategory[$i]"; - } - print CPP_OUT " );\n"; - } - } else { - print CPP_OUT; - } - } - -close CPP_OUT; -close CPP_IN; diff --git a/kabc/secrecy.cpp b/kabc/secrecy.cpp deleted file mode 100644 index 7ec439b0c..000000000 --- a/kabc/secrecy.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include - -#include "secrecy.h" - -using namespace KABC; - -Secrecy::Secrecy( int type ) - : mType( type ) -{ -} - -bool Secrecy::operator==( const Secrecy &s ) const -{ - return ( mType == s.mType ); -} - -bool Secrecy::operator!=( const Secrecy &s ) const -{ - return !( *this == s ); -} - -bool Secrecy::isValid() const -{ - return mType != Invalid; -} - -void Secrecy::setType( int type ) -{ - mType = type; -} - -int Secrecy::type() const -{ - return mType; -} - -Secrecy::TypeList Secrecy::typeList() -{ - static TypeList list; - - if ( list.isEmpty() ) - list << Public << Private << Confidential; - - return list; -} - -TQString Secrecy::typeLabel( int type ) -{ - switch ( type ) { - case Public: - return i18n( "Public" ); - break; - case Private: - return i18n( "Private" ); - break; - case Confidential: - return i18n( "Confidential" ); - break; - default: - return i18n( "Unknown type" ); - break; - } -} - -TQString Secrecy::asString() const -{ - return typeLabel( mType ); -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const Secrecy &secrecy ) -{ - return s << secrecy.mType; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, Secrecy &secrecy ) -{ - s >> secrecy.mType; - - return s; -} diff --git a/kabc/secrecy.h b/kabc/secrecy.h deleted file mode 100644 index 5cc60b11d..000000000 --- a/kabc/secrecy.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KABC_SECRECY_H -#define KABC_SECRECY_H - -#include - -#include - -namespace KABC { - -class KABC_EXPORT Secrecy -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Secrecy & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Secrecy & ); - -public: - typedef TQValueList TypeList; - - /** - * Secrecy types - * - * @li Public - for public access - * @li Private - only private access - * @li Confidential - access for confidential persons - */ - enum Types { - Public, - Private, - Confidential, - Invalid - }; - - /** - * Constructor. - * - * @param type The secrecy type, see Types. - */ - Secrecy( int type = Invalid ); - - bool operator==( const Secrecy & ) const; - bool operator!=( const Secrecy & ) const; - - /** - Returns if the Secrecy object has a valid value. - */ - bool isValid() const; - - /** - * Sets the type, see Types. - */ - void setType( int type ); - - /** - * Returns the type, see Types. - */ - int type() const; - - /** - * Returns a list of all available secrecy types. - */ - static TypeList typeList(); - - /** - * Returns a translated label for a given secrecy type. - */ - static TQString typeLabel( int type ); - - /** - * For debug. - */ - TQString asString() const; - -private: - int mType; -}; - -KABC_EXPORT TQDataStream& operator<<( TQDataStream &s, const Secrecy &secrecy ); -KABC_EXPORT TQDataStream& operator>>( TQDataStream &s, Secrecy &secrecy ); - -} -#endif diff --git a/kabc/sortmode.cpp b/kabc/sortmode.cpp deleted file mode 100644 index ee9a6f82d..000000000 --- a/kabc/sortmode.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2004 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include - -#include "sortmode.h" - -using namespace KABC; - -NameSortMode::NameSortMode() - : mNameType( FormattedName ), mAscendingOrder( true ), d( 0 ) -{ - mNameType = FormattedName; -} - -NameSortMode::NameSortMode( NameType type, bool ascending ) - : mNameType( type ), mAscendingOrder( ascending ), d( 0 ) -{ -} - -bool NameSortMode::lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const -{ - bool lesser = false; - - switch ( mNameType ) { - case FormattedName: - lesser = TQString::localeAwareCompare( first.formattedName(), second.formattedName() ) < 0; - break; - case FamilyName: - lesser = TQString::localeAwareCompare( first.familyName(), second.familyName() ) < 0; - break; - case GivenName: - lesser = TQString::localeAwareCompare( first.givenName(), second.givenName() ) < 0; - break; - default: - lesser = false; - break; - } - - if ( !mAscendingOrder ) - lesser = !lesser; - - return lesser; -} - -FieldSortMode::FieldSortMode( KABC::Field *field, bool ascending ) - : mField( field ), mAscendingOrder( ascending ), d( 0 ) -{ -} - -bool FieldSortMode::lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const -{ - if ( !mField ) - return false; - else { - bool lesser = TQString::localeAwareCompare( mField->value( first ), mField->value( second ) ) < 0; - if ( !mAscendingOrder ) - lesser = !lesser; - - return lesser; - } -} diff --git a/kabc/sortmode.h b/kabc/sortmode.h deleted file mode 100644 index 9768fc8c5..000000000 --- a/kabc/sortmode.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2004 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KABC_SORTMODE_H -#define KABC_SORTMODE_H - -#include - -#include - -namespace KABC { - -/** - @short Sort method for sorting an addressee list. - - This interface should be reimplemented by classes which shall act as - SortModes for KABC::AddresseeList. -*/ -class KABC_EXPORT SortMode -{ - public: - /** - Reimplement this method and return whether the first contact is 'smaller' - than the second. - */ - virtual bool lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const = 0; -}; - -class KABC_EXPORT NameSortMode : public SortMode -{ - public: - enum NameType - { - FormattedName, - FamilyName, - GivenName - }; - - /** - Constructor. - - Creates a NameSortMethod with FormattedName as name type set. - */ - NameSortMode(); - - /** - Constructor. - - Creates a NameSortMethod with the specified name type. - - @param type The name type. - @param ascending true for ascending sort, false for descending. - */ - NameSortMode( NameType type, bool ascending = true ); - - /** - Returns whether the first contact is 'smaller' then the second. - */ - virtual bool lesser( const KABC::Addressee&, const KABC::Addressee& ) const; - - private: - NameType mNameType; - bool mAscendingOrder; - - class NameSortModePrivate; - NameSortModePrivate *d; -}; - -class KABC_EXPORT FieldSortMode : public SortMode -{ - public: - /** - Constructor. - - Creates a FieldSortMethod with the specified field. - - @param field The field. - @param ascending true for ascending sort, false for descending. - */ - FieldSortMode( KABC::Field *field, bool ascending = true ); - - /** - Returns whether the first contact is 'smaller' then the second. - */ - virtual bool lesser( const KABC::Addressee&, const KABC::Addressee& ) const; - - private: - KABC::Field *mField; - bool mAscendingOrder; - - class FieldSortModePrivate; - FieldSortModePrivate *d; -}; - -} - -#endif diff --git a/kabc/sound.cpp b/kabc/sound.cpp deleted file mode 100644 index cf645be83..000000000 --- a/kabc/sound.cpp +++ /dev/null @@ -1,118 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "sound.h" - -#include - -using namespace KABC; - -Sound::Sound() - : mIntern( false ) -{ -} - -Sound::Sound( const TQString &url ) - : mUrl( url ), mIntern( false ) -{ -} - -Sound::Sound( const TQByteArray &data ) - : mData( data ), mIntern( true ) -{ -} - -Sound::~Sound() -{ -} - -bool Sound::operator==( const Sound &s ) const -{ - if ( mIntern != s.mIntern ) return false; - - if ( mIntern ) { - if ( mData != s.mData ) - return false; - } else { - if ( mUrl != s.mUrl ) - return false; - } - - return true; -} - -bool Sound::operator!=( const Sound &s ) const -{ - return !( s == *this ); -} - -void Sound::setUrl( const TQString &url ) -{ - mUrl = url; - mIntern = false; -} - -void Sound::setData( const TQByteArray &data ) -{ - mData = data; - mIntern = true; -} - -bool Sound::isIntern() const -{ - return mIntern; -} - -bool Sound::isEmpty() const -{ - return (!mIntern) && mUrl.isEmpty(); - -} - -TQString Sound::url() const -{ - return mUrl; -} - -TQByteArray Sound::data() const -{ - return mData; -} - -TQString Sound::asString() const -{ - if ( mIntern ) - return "intern sound"; - else - return mUrl; -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const Sound &sound ) -{ - return s << sound.mIntern << sound.mUrl; -// return s << sound.mIntern << sound.mUrl << sound.mData; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, Sound &sound ) -{ - s >> sound.mIntern >> sound.mUrl; -// s >> sound.mIntern >> sound.mUrl >> sound.mData; - return s; -} diff --git a/kabc/sound.h b/kabc/sound.h deleted file mode 100644 index 98dcf320b..000000000 --- a/kabc/sound.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KABC_SOUND_H -#define KABC_SOUND_H - -#include -#include - -#include - -namespace KABC { - -/** @short Class that holds a Sound clip for a contact. - * - * The sound can be played doing something like this: - * - * \code - * KTempFile tmp; - * if(sound.isIntern()) { - * tmp.file()->tqwriteBlock( sound.data() ); - * tmp.close(); - * KAudioPlayer::play( tmp.name() ); - * } else if(!sound.url().isEmpty()) { - * TQString tmpFile; - * if(!TDEIO::NetAccess::download(KURL(themeURL.url()), tmpFile, NULL)) - * { - * KMessageBox::error(0L, - * TDEIO::NetAccess::lastErrorString(), - * i18n("Failed to download sound file"), - * KMessageBox::Notify - * ); - * return; - * } - * KAudioPlayer::play( tmpFile ); - * } - * \endcode - * - * Unfortunetly KAudioPlayer::play is ASync, so to delete the temporary file, the best you can really do is set a timer. - * - */ -class KABC_EXPORT Sound -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Sound & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Sound & ); - -public: - - /** - * Consturctor. Creates an empty object. - */ - Sound(); - - /** - * Consturctor. - * - * @param url A URL that describes the position of the sound file. - */ - Sound( const TQString &url ); - - /** - * Consturctor. - * - * @param data The raw data of the sound. - */ - Sound( const TQByteArray &data ); - - /** - * Destructor. - */ - ~Sound(); - - - bool operator==( const Sound & ) const; - bool operator!=( const Sound & ) const; - - /** - * Sets a URL for the location of the sound file. When using this - * function, isIntern() will return 'false' until you use - * setData(). - * - * @param url The location URL of the sound file. - */ - void setUrl( const TQString &url ); - - /** - * Test if this sound file has been set. - * Just does: !isIntern() && url.isEmpty() - * @since 3.4 - */ - bool isEmpty() const; - - /** - * Sets the raw data of the sound. When using this function, - * isIntern() will return 'true' until you use setUrl(). - * - * @param data The raw data of the sound. - */ - void setData( const TQByteArray &data ); - - /** - * Returns whether the sound is described by a URL (extern) or - * by the raw data (intern). - * When this method returns 'true' you can use data() to - * get the raw data. Otherwise you can request the URL of this - * sound by url() and load the raw data from that location. - */ - bool isIntern() const; - - /** - * Returns the location URL of this sound. - */ - TQString url() const; - - /** - * Returns the raw data of this sound. - */ - TQByteArray data() const; - - /** - * Returns string representation of the sound. - */ - TQString asString() const; - -private: - TQString mUrl; - TQByteArray mData; - - int mIntern; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Sound & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Sound & ); - -} -#endif diff --git a/kabc/stdaddressbook.cpp b/kabc/stdaddressbook.cpp deleted file mode 100644 index c887fcb83..000000000 --- a/kabc/stdaddressbook.cpp +++ /dev/null @@ -1,203 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include - -#include -#include -#include -#include -#include -#include -#include -#include - -#include "resource.h" - -#include "stdaddressbook.h" - -using namespace KABC; - -StdAddressBook *StdAddressBook::mSelf = 0; -bool StdAddressBook::mAutomaticSave = true; - -static KStaticDeleter addressBookDeleter; - -TQString StdAddressBook::fileName() -{ - return locateLocal( "data", "kabc/std.vcf" ); -} - -TQString StdAddressBook::directoryName() -{ - return locateLocal( "data", "kabc/stdvcf" ); -} - -void StdAddressBook::handleCrash() -{ -} - -StdAddressBook *StdAddressBook::self() -{ - if ( !mSelf ) - addressBookDeleter.setObject( mSelf, new StdAddressBook ); - - return mSelf; -} - -StdAddressBook *StdAddressBook::self( bool asynchronous ) -{ - if ( !mSelf ) - addressBookDeleter.setObject( mSelf, new StdAddressBook( asynchronous ) ); - - return mSelf; -} - -StdAddressBook::StdAddressBook() - : AddressBook( "" ) -{ - kdDebug(5700) << "StdAddressBook::StdAddressBook()" << endl; - - init( false ); -} - -StdAddressBook::StdAddressBook( bool asynchronous ) - : AddressBook( "" ) -{ - kdDebug(5700) << "StdAddressBook::StdAddressBook( bool )" << endl; - - init( asynchronous ); -} - -StdAddressBook::~StdAddressBook() -{ - if ( mAutomaticSave ) - saveAll(); -} - -void StdAddressBook::init( bool asynchronous ) -{ - KRES::Manager *manager = resourceManager(); - - KRES::Manager::ActiveIterator it; - for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { - (*it)->setAddressBook( this ); - if ( !(*it)->open() ) { - error( TQString( "Unable to open resource '%1'!" ).arg( (*it)->resourceName() ) ); - continue; - } - connect( *it, TQT_SIGNAL( loadingFinished( Resource* ) ), - this, TQT_SLOT( resourceLoadingFinished( Resource* ) ) ); - connect( *it, TQT_SIGNAL( savingFinished( Resource* ) ), - this, TQT_SLOT( resourceSavingFinished( Resource* ) ) ); - - connect( *it, TQT_SIGNAL( loadingError( Resource*, const TQString& ) ), - this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); - connect( *it, TQT_SIGNAL( savingError( Resource*, const TQString& ) ), - this, TQT_SLOT( resourceSavingError( Resource*, const TQString& ) ) ); - } - - Resource *res = standardResource(); - if ( !res ) { - res = manager->createResource( "file" ); - if ( res ) - addResource( res ); - else - kdDebug(5700) << "No resource available!!!" << endl; - } - - setStandardResource( res ); - manager->writeConfig(); - - if ( asynchronous ) - asyncLoad(); - else - load(); -} - -bool StdAddressBook::saveAll() -{ - kdDebug(5700) << "StdAddressBook::saveAll()" << endl; - bool ok = true; - - deleteRemovedAddressees(); - - KRES::Manager::ActiveIterator it; - KRES::Manager *manager = resourceManager(); - for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { - if ( !(*it)->readOnly() && (*it)->isOpen() ) { - Ticket *ticket = requestSaveTicket( *it ); - if ( !ticket ) { - error( i18n( "Unable to save to resource '%1'. It is locked." ) - .arg( (*it)->resourceName() ) ); - return false; - } - - if ( !AddressBook::save( ticket ) ) { - ok = false; - releaseSaveTicket( ticket ); - } - } - } - - return ok; -} - -bool StdAddressBook::save() -{ - kdDebug(5700) << "StdAddressBook::save()" << endl; - - if ( mSelf ) - return mSelf->saveAll(); - else - return true; -} - -void StdAddressBook::close() -{ - addressBookDeleter.destructObject(); -} - -void StdAddressBook::setAutomaticSave( bool enable ) -{ - mAutomaticSave = enable; -} - -bool StdAddressBook::automaticSave() -{ - return mAutomaticSave; -} - -// should get const for 4.X -Addressee StdAddressBook::whoAmI() -{ - TDEConfig config( "kabcrc" ); - config.setGroup( "General" ); - - return findByUid( config.readEntry( "WhoAmI" ) ); -} - -void StdAddressBook::setWhoAmI( const Addressee &addr ) -{ - TDEConfig config( "kabcrc" ); - config.setGroup( "General" ); - - config.writeEntry( "WhoAmI", addr.uid() ); -} diff --git a/kabc/stdaddressbook.h b/kabc/stdaddressbook.h deleted file mode 100644 index 935b2bad1..000000000 --- a/kabc/stdaddressbook.h +++ /dev/null @@ -1,153 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KABC_STDADDRESSBOOK_H -#define KABC_STDADDRESSBOOK_H - -#include "addressbook.h" - -namespace KABC { - -/** - Standard KDE address book - - This class provides access to the standard KDE address book shared by all - applications. - - It's implemented as a singleton. Use self() to get the address book - object. On the first self() call the address book also gets loaded. - - Example: - - \code - KABC::AddressBook *ab = KABC::StdAddressBook::self(); - - AddressBook::Ticket *ticket = ab->requestSaveTicket(); - - if ( ticket ) { - KABC::AddressBook::Iterator it; - for ( it = ab->begin(); it != ab->end(); ++it ) { - kdDebug() << "UID=" << (*it).uid() << endl; - - // do some other stuff - } - - KABC::StdAddressBook::save( ticket ); - } - \endcode -*/ -class KABC_EXPORT StdAddressBook : public AddressBook -{ - public: - - /** - Destructor. - */ - ~StdAddressBook(); - - /** - Returns the standard addressbook object. It also loads all resources of - the users standard address book synchronously. - */ - static StdAddressBook *self(); - - /** - This is the same as above, but with specified behaviour of resource loading. - - @param asynchronous When true, the resources are loaded asynchronous, that - means you have the data foremost the addressBookChanged() - signal has been emitted. So connect to this signal when - using this method! - */ - static StdAddressBook *self( bool asynchronous ); - - /** - Saves the standard address book to disk. - - @deprecated Use AddressBook::save( Ticket* ) instead - */ - static bool save() KDE_DEPRECATED; - - /** - @deprecated There is no need to call this function anymore. - */ - static void handleCrash() KDE_DEPRECATED; - - /** - Returns the default file name for vcard-based addressbook - */ - static TQString fileName(); - - /** - Returns the default directory name for vcard-based addressbook - */ - static TQString directoryName(); - - /** - Sets the automatic save property of the address book. - - @param state If true, the address book is saved automatically - at destruction time, otherwise you have to call - AddressBook::save( Ticket* ). - */ - static void setAutomaticSave( bool state ); - - /** - Closes the address book. Depending on automaticSave() it will - save the address book first. - */ - static void close(); - - /** - Returns whether the address book is saved at destruction time. - See also setAutomaticSave(). - */ - static bool automaticSave(); - - /** - Returns the contact, that is associated with the owner of the - address book. This contact should be used by other programs - to access user specific data. - */ - Addressee whoAmI(); - - /** - Sets the users contact. See whoAmI() for more information. - - @param addr The users contact. - */ - void setWhoAmI( const Addressee &addr ); - - protected: - StdAddressBook(); - StdAddressBook( bool asynchronous ); - - void init( bool asynchronous ); - bool saveAll(); - - private: - static StdAddressBook *mSelf; - static bool mAutomaticSave; -}; - -} - -#endif - diff --git a/kabc/tdeab2tdeabc.cpp b/kabc/tdeab2tdeabc.cpp deleted file mode 100644 index f03a80f45..000000000 --- a/kabc/tdeab2tdeabc.cpp +++ /dev/null @@ -1,476 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "addressbook.h" -#include "stdaddressbook.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - { "disable-autostart", I18N_NOOP( "Disable automatic startup on login" ), 0 }, - { "quiet", "", 0 }, - { "o", 0, 0 }, - { "override", I18N_NOOP( "Override existing entries" ), "1" }, - TDECmdLineLastOption -}; - -void readKMailEntry( const TQString &kmailEntry, KABC::AddressBook *ab ) -{ - kdDebug() << "KMAILENTRY: " << kmailEntry << endl; - - TQString entry = kmailEntry.simplifyWhiteSpace(); - if ( entry.isEmpty() ) return; - - TQString email; - TQString name; - TQString comment; - - if ( entry.at( entry.length() -1 ) == ')' ) { - int br = entry.findRev( '(' ); - if ( br >= 0 ) { - comment = entry.mid( br + 1, entry.length() - br - 2 ); - entry.truncate( br ); - if ( entry.at( entry.length() - 1 ).isSpace() ) { - entry.truncate( br - 1 ); - } - } - } - - int posSpace = entry.findRev( ' ' ); - if ( posSpace < 0 ) { - email = entry; - if ( !comment.isEmpty() ) { - name = comment; - comment = ""; - } - } else { - email = entry.mid( posSpace + 1 ); - name = entry.left( posSpace ); - } - - if ( email.at( 0 ) == '<' && email.at( email.length() - 1) == '>' ) { - email = email.mid( 1, email.length() - 2 ); - } - if ( name.at( 0 ) == '"' && name.at( name.length() - 1) == '"' ) { - name = name.mid( 1, name.length() - 2 ); - } - if ( name.at( 0 ) == '\'' && name.at( name.length() - 1) == '\'' ) { - name = name.mid( 1, name.length() - 2 ); - } - - if ( name.at( name.length() -1 ) == ')' ) { - int br = name.findRev( '(' ); - if ( br >= 0 ) { - comment = name.mid( br + 1, name.length() - br - 2 ) + " " + comment; - name.truncate( br ); - if ( name.at( name.length() - 1 ).isSpace() ) { - name.truncate( br - 1 ); - } - } - } - - kdDebug() << " EMAIL : " << email << endl; - kdDebug() << " NAME : " << name << endl; - kdDebug() << " COMMENT : " << comment << endl; - - KABC::Addressee::List al = ab->findByEmail( email ); - if ( al.isEmpty() ) { - KABC::Addressee a; - a.setNameFromString( name ); - a.insertEmail( email ); - a.setNote( comment ); - - ab->insertAddressee( a ); - - kdDebug() << "--INSERTED: " << a.realName() << endl; - } -} - -void importKMailAddressBook( KABC::AddressBook *ab ) -{ - TQString fileName = locateLocal( "data", "kmail/addressbook" ); - TQString kmailConfigName = locate( "config", "kmailrc" ); - if ( !kmailConfigName.isEmpty() ) { - TDEConfig cfg( kmailConfigName ); - cfg.setGroup( "Addressbook" ); - fileName = cfg.readPathEntry( "default", fileName ); - } - if ( !TDEStandardDirs::exists( fileName ) ) { - kdDebug(5700) << "Couldn't find KMail addressbook." << endl; - return; - } - - TQFile f( fileName ); - if ( !f.open(IO_ReadOnly) ) { - kdDebug(5700) << "Couldn't open file '" << fileName << "'" << endl; - return; - } - - TQStringList kmailEntries; - - TQTextStream t( &f ); - while ( !t.eof() ) { - kmailEntries.append( t.readLine() ); - } - f.close(); - - TQStringList::ConstIterator it; - for ( it = kmailEntries.begin(); it != kmailEntries.end(); ++it ) { - if ( (*it).at( 0 ) == '#' ) continue; - bool insideQuote = false; - int end = (*it).length() - 1; - for ( int i = end; i; i-- ) { - if ( (*it).at( i ) == '"' ) { - if ( insideQuote ) - insideQuote = false; - else - insideQuote = true; - } else if ( (*it).at( i ) == ',' && !insideQuote ) { - readKMailEntry( (*it).mid( i + 1, end - i ), ab ); - end = i - 1; - } - } - - readKMailEntry( (*it).mid( 0, end + 1 ), ab ); - } -} - -void readKAddressBookEntries( const TQString &dataString, Addressee &a ) -{ - // Strip "KMail:1.0" prefix and "[EOS]" suffix. - TQString str = dataString.mid( 11, dataString.length() - 24 ); - - TQStringList entries = TQStringList::split( "\n[EOR]\n ", str ); - - Address homeAddress( Address::Home ); - Address businessAddress( Address::Work ); - Address otherAddress; - - TQStringList::ConstIterator it; - for ( it = entries.begin(); it != entries.end(); ++it ) { - int pos = (*it).find( "\n" ); - TQString fieldName = (*it).left( pos ); - TQString fieldValue = (*it).mid( pos + 2 ); - - if ( fieldName == "X-HomeFax" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home | - PhoneNumber::Fax ) ); - } else if ( fieldName == "X-OtherPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, 0 ) ); - } else if ( fieldName == "X-PrimaryPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pref ) ); - } else if ( fieldName == "X-BusinessFax" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work | - PhoneNumber::Fax ) ); - } else if ( fieldName == "X-CarPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Car ) ); - } else if ( fieldName == "X-MobilePhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Cell ) ); - } else if ( fieldName == "X-ISDN" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Isdn ) ); - } else if ( fieldName == "X-OtherFax" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Fax ) ); - } else if ( fieldName == "X-Pager" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pager ) ); - } else if ( fieldName == "X-BusinessPhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work ) ); - } else if ( fieldName == "X-HomePhone" ) { - a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home ) ); - } else if ( fieldName == "X-HomeAddress" ) { - homeAddress.setLabel( fieldValue ); - } else if ( fieldName == "X-HomeAddressStreet" ) { - homeAddress.setStreet( fieldValue ); - } else if ( fieldName == "X-HomeAddressCity" ) { - homeAddress.setLocality( fieldValue ); - } else if ( fieldName == "X-HomeAddressPostalCode" ) { - homeAddress.setPostalCode( fieldValue ); - } else if ( fieldName == "X-HomeAddressState" ) { - homeAddress.setRegion( fieldValue ); - } else if ( fieldName == "X-HomeAddressCountry" ) { - homeAddress.setCountry( fieldValue ); - } else if ( fieldName == "X-BusinessAddress" ) { - businessAddress.setLabel( fieldValue ); - } else if ( fieldName == "X-BusinessAddressStreet" ) { - businessAddress.setStreet( fieldValue ); - } else if ( fieldName == "X-BusinessAddressCity" ) { - businessAddress.setLocality( fieldValue ); - } else if ( fieldName == "X-BusinessAddressPostalCode" ) { - businessAddress.setPostalCode( fieldValue ); - } else if ( fieldName == "X-BusinessAddressState" ) { - businessAddress.setRegion( fieldValue ); - } else if ( fieldName == "X-BusinessAddressCountry" ) { - businessAddress.setCountry( fieldValue ); - } else if ( fieldName == "X-OtherAddress" ) { - otherAddress.setLabel( fieldValue ); - } else if ( fieldName == "X-OtherAddressStreet" ) { - otherAddress.setStreet( fieldValue ); - } else if ( fieldName == "X-OtherAddressCity" ) { - otherAddress.setLocality( fieldValue ); - } else if ( fieldName == "X-OtherAddressPostalCode" ) { - otherAddress.setPostalCode( fieldValue ); - } else if ( fieldName == "X-OtherAddressState" ) { - otherAddress.setRegion( fieldValue ); - } else if ( fieldName == "X-OtherAddressCountry" ) { - otherAddress.setCountry( fieldValue ); - } else if ( fieldName == "NICKNAME" ) { - a.setNickName( fieldValue ); - } else if ( fieldName == "ORG" ) { - a.setOrganization( fieldValue ); - } else if ( fieldName == "ROLE" ) { - a.setRole( fieldValue ); - } else if ( fieldName == "BDAY" ) { - a.setBirthday( TDEGlobal::locale()->readDate( fieldValue ) ); - } else if ( fieldName == "WEBPAGE" ) { - a.setUrl( KURL( fieldValue ) ); - } else if ( fieldName == "N" ) { - } else if ( fieldName == "X-FirstName" ) { - } else if ( fieldName == "X-MiddleName" ) { - } else if ( fieldName == "X-LastName" ) { - } else if ( fieldName == "X-Title" ) { - } else if ( fieldName == "X-Suffix" ) { - } else if ( fieldName == "X-FileAs" ) { - } else if ( fieldName == "EMAIL" ) { - a.insertEmail( fieldValue, true ); - } else if ( fieldName == "X-E-mail2" ) { - a.insertEmail( fieldValue ); - } else if ( fieldName == "X-E-mail3" ) { - a.insertEmail( fieldValue ); - } else if ( fieldName == "X-Notes" ) { - } else { - a.insertCustom( "KADDRESSBOOK", fieldName, fieldValue ); - } - } - - if ( !homeAddress.isEmpty() ) a.insertAddress( homeAddress ); - if ( !businessAddress.isEmpty() ) a.insertAddress( businessAddress ); - if ( !otherAddress.isEmpty() ) a.insertAddress( otherAddress ); -} - -void importKab( KABC::AddressBook *ab, bool override, bool quiet ) -{ - TQString fileName = TDEGlobal::dirs()->saveLocation( "data", "kab/" ); - fileName += "addressbook.kab"; - if ( !TQFile::exists( fileName ) ) { - if ( !quiet ) { - KMessageBox::error( 0, "" + i18n( "Address book file %1 not found! Make sure the old address book is located there and you have read permission for this file." ) - .arg( fileName ) + "" ); - } - kdDebug(5700) << "No KDE 2 addressbook found." << endl; - return; - } - - kdDebug(5700) << "Converting old-style kab addressbook to " - "new-style kabc addressbook." << endl; - - KabAPI kab( 0 ); - if ( kab.init() != ::AddressBook::NoError ) { - kdDebug(5700) << "Error initing kab" << endl; - exit( 1 ); - } - - KabKey key; - ::AddressBook::Entry entry; - - int num = kab.addressbook()->noOfEntries(); - - kdDebug(5700) << "kab Addressbook has " << num << " entries." << endl; - - for ( int i = 0; i < num; ++i ) { - if ( ::AddressBook::NoError != kab.addressbook()->getKey( i, key ) ) { - kdDebug(5700) << "Error getting key for index " << i << " from kab." << endl; - continue; - } - if ( ::AddressBook::NoError != kab.addressbook()->getEntry( key, entry ) ) { - kdDebug(5700) << "Error getting entry for index " << i << " from kab." << endl; - continue; - } - - Addressee a; - - // Convert custom entries - int count = 0; - bool idFound = false; - TQStringList::ConstIterator customIt; - for ( customIt = entry.custom.begin(); customIt != entry.custom.end(); ++customIt ) { - if ( (*customIt).startsWith( "X-KABC-UID:" ) ) { - a.setUid( (*customIt).mid( (*customIt).find( ":" ) + 1 ) ); - idFound = true; - } else if ( (*customIt).startsWith( "KMail:1.0\n" ) ) { - readKAddressBookEntries( *customIt, a ); - } else { - a.insertCustom( "tdeab2tdeabc", TQString::number( count++ ), *customIt ); - } - } - if ( idFound ) { - if ( !override ) continue; - } else { - entry.custom << "X-KABC-UID:" + a.uid(); - ::AddressBook::ErrorCode error = kab.addressbook()->change( key, entry ); - if ( error != ::AddressBook::NoError ) { - kdDebug(5700) << "kab.change returned with error " << error << endl; - } else { - kdDebug(5700) << "Wrote back to kab uid " << a.uid() << endl; - } - } - - a.setTitle( entry.title ); - a.setFormattedName( entry.fn ); - a.setPrefix( entry.nameprefix ); - a.setGivenName( entry.firstname ); - a.setAdditionalName( entry.middlename ); - a.setFamilyName( entry.lastname ); - a.setBirthday( entry.birthday ); - - TQStringList::ConstIterator emailIt; - for ( emailIt = entry.emails.begin(); emailIt != entry.emails.end(); ++emailIt ) - a.insertEmail( *emailIt ); - - TQStringList::ConstIterator phoneIt; - for ( phoneIt = entry.telephone.begin(); phoneIt != entry.telephone.end(); ++phoneIt ) { - int kabType = (*phoneIt++).toInt(); - if ( phoneIt == entry.telephone.end() ) break; - TQString number = *phoneIt; - int type = 0; - if ( kabType == ::AddressBook::Fixed ) type = PhoneNumber::Voice; - else if ( kabType == ::AddressBook::Mobile ) type = PhoneNumber::Cell | PhoneNumber::Voice; - else if ( kabType == ::AddressBook::Fax ) type = PhoneNumber::Fax; - else if ( kabType == ::AddressBook::Modem ) type = PhoneNumber::Modem; - a.insertPhoneNumber( PhoneNumber( number, type ) ); - } - - if ( entry.URLs.count() > 0 ) { - a.setUrl( KURL( entry.URLs.first() ) ); - if ( entry.URLs.count() > 1 ) { - kdWarning() << "More than one URL. Ignoring all but the first." << endl; - } - } - - int noAdr = entry.noOfAddresses(); - for ( int j = 0; j < noAdr; ++j ) { - ::AddressBook::Entry::Address kabAddress; - entry.getAddress( j, kabAddress ); - - Address adr; - - adr.setStreet( kabAddress.address ); - adr.setPostalCode( kabAddress.zip ); - adr.setLocality( kabAddress.town ); - adr.setCountry( kabAddress.country ); - adr.setRegion( kabAddress.state ); - - TQString label; - if ( !kabAddress.headline.isEmpty() ) label += kabAddress.headline + "\n"; - if ( !kabAddress.position.isEmpty() ) label += kabAddress.position + "\n"; - if ( !kabAddress.org.isEmpty() ) label += kabAddress.org + "\n"; - if ( !kabAddress.orgUnit.isEmpty() ) label += kabAddress.orgUnit + "\n"; - if ( !kabAddress.orgSubUnit.isEmpty() ) label += kabAddress.orgSubUnit + "\n"; - if ( !kabAddress.deliveryLabel.isEmpty() ) label += kabAddress.deliveryLabel + "\n"; - adr.setLabel( label ); - - a.insertAddress( adr ); - } - - TQString note = entry.comment; - - if ( !entry.user1.isEmpty() ) note += "\nUser1: " + entry.user1; - if ( !entry.user2.isEmpty() ) note += "\nUser2: " + entry.user2; - if ( !entry.user3.isEmpty() ) note += "\nUser3: " + entry.user3; - if ( !entry.user4.isEmpty() ) note += "\nUser4: " + entry.user4; - - if ( !entry.keywords.count() == 0 ) note += "\nKeywords: " + entry.keywords.join( ", " ); - - TQStringList::ConstIterator talkIt; - for ( talkIt = entry.talk.begin(); talkIt != entry.talk.end(); ++talkIt ) { - note += "\nTalk: " + (*talkIt); - } - - a.setNote( note ); - - a.setPrefix( entry.rank + a.prefix() ); // Add rank to prefix - - a.setCategories( entry.categories ); - - kdDebug(5700) << "Addressee: " << a.familyName() << endl; - - ab->insertAddressee( a ); - } - - kab.save( true ); -} - -int main( int argc, char **argv ) -{ - TDEAboutData aboutData( "tdeab2tdeabc", I18N_NOOP( "Kab to Kabc Converter" ), "0.1" ); - aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); - - TDECmdLineArgs::init( argc, argv, &aboutData ); - TDECmdLineArgs::addCmdLineOptions( options ); - - TDEApplication app; - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - - bool override = false; - - if ( args->isSet( "override" ) ) { - kdDebug() << "Override existing entries." << endl; - - override = true; - } - - bool quiet = false; - - if ( args->isSet( "quiet" ) ) - quiet = true; - - if ( args->isSet( "disable-autostart" ) ) { - kdDebug() << "Disable autostart." << endl; - - TDEConfig *config = app.config(); - config->setGroup( "Startup" ); - config->writeEntry( "EnableAutostart", false ); - } - - KABC::AddressBook *kabcBook = StdAddressBook::self(); - - importKMailAddressBook( kabcBook ); - - importKab( kabcBook, override, quiet ); - - StdAddressBook::save(); - - kdDebug(5700) << "Saved kabc addressbook to '" << kabcBook->identifier() << "'" << endl; -} - diff --git a/kabc/tdeab2tdeabc.desktop b/kabc/tdeab2tdeabc.desktop deleted file mode 100644 index 945f044d4..000000000 --- a/kabc/tdeab2tdeabc.desktop +++ /dev/null @@ -1,105 +0,0 @@ -[Desktop Entry] -Name=tdeab2tdeabc -Name[af]=kab-na-kabc -Name[csb]=Kònwersëjô adresowi knéżczi -Name[eo]=Konvertilo de "kab" al "kabc" -Name[fr]=KAB2KABC -Name[fy]=Kab2kabc -Name[hu]=Kab2kabc -Name[it]=Kab2Kabc -Name[nl]=Kab2kabc -Name[pl]=Konwersja książki adresowej -Name[pt_BR]=Conversão de kab para kabc -Name[ro]=Kab2kabc -Name[sv]=Kab2kabc -Name[te]=కెఎబి2కెఎబిసి -Name[zu]=i-tdeab2tdeabc -Exec=tdeab2tdeabc --disable-autostart --quiet -Icon=misc -Type=Application -Comment=libkab to libkabc conversion tool. -Comment[af]=libkab na libkabc omskakeling program. -Comment[ar]=أداة تحويل libkab إلى libkabc. -Comment[az]=libkab - libkabc dönüşdürmə vasitəsi. -Comment[be]=Інструмент пераўтварэння libkab у libkabc. -Comment[bg]=Програма за конвертиране на libkab до libkabc. -Comment[bn]=libkab থেকে libkabc-তে পরিবর্তন করার প্রোগ্রাম। -Comment[bs]=alat za pretvaranje libkab u libkabc. -Comment[ca]=Eina de conversió de libkab a libkabc. -Comment[cs]=Převod dat z libkab do libkabc. -Comment[csb]=Nôrzãdze do kònwersëji z libkab do libkabc. -Comment[cy]=erfyn trosi libkab i libkabc -Comment[da]=libkab-til-libkabc-konverteringsværktøj. -Comment[de]=Konvertierung von libkab in libkabc -Comment[el]=Εργαλείο μετατροπής από το libkab στο libkabc. -Comment[eo]=Konvertilo de "libkab" al "libkabc" -Comment[es]=Conversor libkab a libkabc. -Comment[et]=libkab -> libkabc teisendamine -Comment[eu]=libkab-etik libkabc-era bihurtzeko tresna. -Comment[fa]=ابزار تبدیل libkab به libcabc. -Comment[fi]=libkab-libkabc -muunnin -Comment[fr]=Outil de conversion de libkab vers libkabc. -Comment[fy]=Konversjeprogramma fan libkab nei libkabc. -Comment[ga]=Uirlis tiontaithe ó libkab go libkabc. -Comment[gl]=Ferramenta de conversión de libkab a libkabc. -Comment[he]=כלי המרה מ־libkab ל־libkabc -Comment[hi]=libkab से libkabc बदलने वाला औजार -Comment[hr]=Alat za pretvaranje iz libkab u libkabc -Comment[hsb]=libkab -> libkabc konwerter -Comment[hu]=libkab -> libkabc konvertáló. -Comment[id]=konverter libkab ke libkabc. -Comment[is]=libkab í libkabc breytingatól. -Comment[it]=Strumento di conversione da libkab a libkabc. -Comment[ja]=libkab から libkabc への変換ツール -Comment[ka]=libkab => libkabc გარდაქმნის ხელსაწყო. -Comment[kk]=libkab дегеннен libkabc дегенге айналдыру құралы. -Comment[km]=ឧបករណ៍​បម្លែង​ពី libkab ទៅ libkabc -Comment[ko]=libkab을 libkabc로 바꿔주는 연장. -Comment[lb]=libkab op libkabc Konvertéierungs-Hëllefsmëttel. -Comment[lt]=libkab į libkabc konvertavimo įrankis. -Comment[lv]=libkab uz libkabc kovertēšanas rīks. -Comment[mk]=алатка за претворање од libkab во libkabc. -Comment[mn]=libkab-аас libkabc-руу хөрвүүлэгч -Comment[ms]=perkakasan penukaran libkab to libkabc. -Comment[mt]=Għodda għall-konverżjoni libkab għal libkabc -Comment[nb]=libkab til libkabc konverteringsverktøy. -Comment[nds]=Warktüüch för't Ümwanneln vun libkab na libkabc. -Comment[ne]=libkab to libkabc रूपान्तरण उपकरण । -Comment[nl]=Conversieprogramma van libkab naar libkabc. -Comment[nn]=Konverterer libkab til libkabc -Comment[nso]=Sebereka sa phetosetso ya libkab go libkabc -Comment[pa]=libkab ਤੋ libkabc ਤਬਦੀਲੀ ਸੰਦ। -Comment[pl]=Narzędzie do konwersji z libkab do libkabc. -Comment[pt]=Ferramenta de conversão de libkab para libkabc. -Comment[pt_BR]=Ferramenta de conversão de libkab para libkabc. -Comment[ro]=Utilitar de conversie de la "libkab" la "libkabc". -Comment[ru]=утилита преобразования libkab в libkabc. -Comment[rw]=Igikoresho cy'ihindura libkab muri libkabc. -Comment[se]=konverterenreaidu libkab:as libkabc:ai -Comment[sk]=Prevod dát z libkab do libkabc. -Comment[sl]=Orodje za pretvorbo iz libkab v libkabc -Comment[sq]=Vegla për shëndrimin e libkab në libkabc. -Comment[sr]=Алат за конверзију из libkab-а у libkabc. -Comment[sr@Latn]=Alat za konverziju iz libkab-a u libkabc. -Comment[ss]=Lithulusi lekutjintja le-libkab kuya ku-libkabc. -Comment[sv]=Konverteringsverktyg från libkab till libkabc -Comment[ta]=libkab இலிருந்து libkabc க்கு மாற்றும் கருவி. -Comment[te]=libkab నుంచి libkabc కు మార్చు పనిముట్టు -Comment[tg]=асбоби дигаргунсози libkab ба libkabc -Comment[th]=เครื่องมือเปลี่ยน libkab เป็น libkabc -Comment[tr]=libkab' tan libkabc' ye dönüştürme aracı -Comment[tt]=libkab-›libkabc äyländerü qoralı. -Comment[uk]=Засіб перетворення libkab до libkabc. -Comment[uz]=libkab'ni libkabc'ga aylantiradigan vosita. -Comment[uz@cyrillic]=libkab'ни libkabc'га айлантирадиган восита. -Comment[ven]=Tshishumiswa tsha u shandukisa libkab itshi ya kha libkabc -Comment[vi]=Công cụ chuyển đổi libkab sang libkabc. -Comment[xh]=libkab kwi libkabc isixhobo sokuguqulela. -Comment[zh_CN]=libkab 到 libkabc 的转换工具。 -Comment[zh_HK]=libkab 至 libkabc 的轉換工具 -Comment[zh_TW]=libkab 至 libkabc 轉換工具 -Comment[zu]=Ithuluzi lokuguqula le-libkab kuyaku-libkabc -Terminal=false -NoDisplay=true -X-TDE-autostart-condition=tdeab2tdeabcrc:Startup:EnableAutostart:true -OnlyShowIn=TDE; diff --git a/kabc/tests/Makefile.am b/kabc/tests/Makefile.am deleted file mode 100644 index 961d12bd4..000000000 --- a/kabc/tests/Makefile.am +++ /dev/null @@ -1,55 +0,0 @@ -# Make sure $(all_includes) remains last! -INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc -I$(top_srcdir)/kab \ - -I$(srcdir)/../vcardparser/ -I$(srcdir)/../vcard/include \ - -I$(srcdir)/../vcard/include/generated \ - -I$(srcdir)/../vcardparser $(all_includes) -LDADD = ../libkabc.la - -METASOURCES = AUTO - -check_PROGRAMS = testlock testldapclient - -testlock_LDFLAGS = $(all_libraries) -testlock_SOURCES = testlock.cpp - -testldapclient_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testldapclient_SOURCES = testldapclient.cpp - -EXTRA_PROGRAMS = testkabc testkabcdlg testdistlist bigread bigwrite testdb \ - testaddressee testaddresseelist testaddressfmt kabcargl testaddresslineedit - -testkabc_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testkabc_SOURCES = testkabc.cpp - -testaddressee_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testaddressee_SOURCES = testaddressee.cpp - -testaddresseelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testaddresseelist_SOURCES = testaddresseelist.cpp - -testaddressfmt_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testaddressfmt_SOURCES = testaddressfmt.cpp - -testkabcdlg_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testkabcdlg_SOURCES = testkabcdlg.cpp - -testdistlist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testdistlist_SOURCES = testdistlist.cpp - -testaddresslineedit_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testaddresslineedit_SOURCES = testaddresslineedit.cpp - -bigread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -bigread_LDADD = ../libkabc.la $(top_builddir)/kabc/plugins/file/libkabc_file.la -bigread_SOURCES = bigread.cpp - -bigwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -bigwrite_LDADD = ../libkabc.la $(top_builddir)/kabc/plugins/file/libkabc_file.la -bigwrite_SOURCES = bigwrite.cpp - -testdb_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testdb_SOURCES = testdb.cpp - -kabcargl_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -kabcargl_SOURCES = kabcargl.cpp - diff --git a/kabc/tests/bigread.cpp b/kabc/tests/bigread.cpp deleted file mode 100644 index 5ea2393dc..000000000 --- a/kabc/tests/bigread.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -#include "addressbook.h" -#include "vcardformat.h" -#include "plugins/file/resourcefile.h" -#if 0 -#include "resourcesql.h" -#endif - -using namespace KABC; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("bigread","BigReadKabc","0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - - TDEApplication app( false, false ); - - AddressBook ab; - - ResourceFile r( "my.kabc", "vcard2" ); - ab.addResource( &r ); - -#if 0 - ResourceSql rsql( &ab, "root", "kde4ever", "localhost" ); - ab.addResource( &rsql ); -#endif - - struct tms start; - - times( &start ); - -#if 0 - kdDebug() << "utime : " << int( start.tms_utime ) << endl; - kdDebug() << "stime : " << int( start.tms_stime ) << endl; - kdDebug() << "cutime: " << int( start.tms_cutime ) << endl; - kdDebug() << "cstime: " << int( start.tms_cstime ) << endl; -#endif - - kdDebug() << "Start load" << endl; - ab.load(); - kdDebug() << "Finished load" << endl; - - struct tms end; - - times( &end ); - -#if 0 - kdDebug() << "utime : " << int( end.tms_utime ) << endl; - kdDebug() << "stime : " << int( end.tms_stime ) << endl; - kdDebug() << "cutime: " << int( end.tms_cutime ) << endl; - kdDebug() << "cstime: " << int( end.tms_cstime ) << endl; -#endif - - kdDebug() << "UTime: " << int( end.tms_utime ) - int( start.tms_utime ) << endl; - kdDebug() << "STime: " << int( end.tms_stime ) - int( start.tms_stime ) << endl; - -// ab.dump(); -} diff --git a/kabc/tests/bigwrite.cpp b/kabc/tests/bigwrite.cpp deleted file mode 100644 index 167f5d44d..000000000 --- a/kabc/tests/bigwrite.cpp +++ /dev/null @@ -1,70 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -#include "addressbook.h" -#include "vcardformat.h" -#include "plugins/file/resourcefile.h" - -using namespace KABC; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("bigwrite","BigWriteKabc","0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - - TDEApplication app( false, false ); - - AddressBook ab; - ResourceFile r( "my.kabc", "vcard" ); - ab.addResource( &r ); - - for( int i = 0; i < 5000; ++i ) { - Addressee a; - a.setGivenName( "number" + TQString::number( i ) ); - a.setFamilyName( "Name" ); - a.insertEmail( TQString::number( i ) + "@domain" ); - - ab.insertAddressee( a ); - } - printf( "\n" ); - - Ticket *t = ab.requestSaveTicket( &r ); - if ( t ) { - struct tms start; - - times( &start ); - -#if 0 - kdDebug() << "utime : " << int( start.tms_utime ) << endl; - kdDebug() << "stime : " << int( start.tms_stime ) << endl; - kdDebug() << "cutime: " << int( start.tms_cutime ) << endl; - kdDebug() << "cstime: " << int( start.tms_cstime ) << endl; -#endif - - if ( !ab.save( t ) ) { - kdDebug() << "Can't save." << endl; - } - - struct tms end; - - times( &end ); - -#if 0 - kdDebug() << "utime : " << int( end.tms_utime ) << endl; - kdDebug() << "stime : " << int( end.tms_stime ) << endl; - kdDebug() << "cutime: " << int( end.tms_cutime ) << endl; - kdDebug() << "cstime: " << int( end.tms_cstime ) << endl; -#endif - - kdDebug() << "UTime: " << int( end.tms_utime ) - int( start.tms_utime ) << endl; - kdDebug() << "STime: " << int( end.tms_stime ) - int( start.tms_stime ) << endl; - - } else { - kdDebug() << "No ticket for save." << endl; - } -} diff --git a/kabc/tests/kabcargl.cpp b/kabc/tests/kabcargl.cpp deleted file mode 100644 index 589c973f2..000000000 --- a/kabc/tests/kabcargl.cpp +++ /dev/null @@ -1,70 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "stdaddressbook.h" - -using namespace KABC; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("kabcargl","Fix broken pre3.0rc3 format","0.1"); - aboutData.addAuthor("Cornelius Schumacher", 0, "schumacher@kde.org"); - - TDECmdLineArgs::init(argc,argv,&aboutData); - - TDEApplication app; - - TQString filename = StdAddressBook::fileName(); - - TQFile f( filename ); - if ( !f.open( IO_ReadOnly ) ) { - kdDebug() << "Error opening file '" << filename << "' for reading." << endl; - return 1; - } - - TQTextStream t( &f ); - t.setEncoding(TQTextStream::UnicodeUTF8); - TQString text = t.read(); - f.close(); - - text = TQString::fromUtf8( text.local8Bit() ); - text.replace( "\n", "\r\n" ); - - if ( !f.open( IO_WriteOnly ) ) { - kdDebug() << "Error opening file '" << filename << "' for writing." << endl; - return 1; - } - - TQTextStream t2( &f ); - t2.setEncoding(TQTextStream::UnicodeUTF8); - t2 << text; - f.close(); -} diff --git a/kabc/tests/testaddressee.cpp b/kabc/tests/testaddressee.cpp deleted file mode 100644 index 09f95d29b..000000000 --- a/kabc/tests/testaddressee.cpp +++ /dev/null @@ -1,57 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "addressbook.h" -#include "plugins/file/resourcefile.h" -#include "formats/binaryformat.h" -#include "vcardformat.h" -#include "phonenumber.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - { "save", "", 0 }, - { "number", "", 0 }, - TDECmdLineLastOption -}; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testaddressee","TestAddressee","0.1"); - TDECmdLineArgs::init(argc, argv, &aboutData); - TDECmdLineArgs::addCmdLineOptions(options); - - TDEApplication app; - TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); - - kdDebug() << "Creating a" << endl; - Addressee a; - - kdDebug() << "tick1" << endl; - a.setGivenName("Hans"); - kdDebug() << "tick2" << endl; - a.setPrefix("Dr."); - - kdDebug() << "Creating b" << endl; - Addressee b( a ); - - kdDebug() << "tack1" << endl; - a.setFamilyName("Wurst"); - kdDebug() << "tack2" << endl; - a.setNickName("hansi"); - - kdDebug() << "Creating c" << endl; - Addressee c = a; - - kdDebug() << "tock1" << endl; - c.setGivenName("Eberhard"); - - a.dump(); - b.dump(); - c.dump(); -} diff --git a/kabc/tests/testaddresseelist.cpp b/kabc/tests/testaddresseelist.cpp deleted file mode 100644 index 10fa4aaef..000000000 --- a/kabc/tests/testaddresseelist.cpp +++ /dev/null @@ -1,196 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "addressbook.h" -#include "addresseelist.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - { "save", "", 0 }, - { "number", "", 0 }, - TDECmdLineLastOption -}; - -int main(int /*argc*/,char /* **argv*/) -{ -/* TDEAboutData aboutData("testaddresseelist","TestAddresseeList","0.1"); - TDECmdLineArgs::init(argc, argv, &aboutData); - TDECmdLineArgs::addCmdLineOptions(options); - - TDEApplication app; - TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); */ - - kdDebug() << "Creating addressees" << endl; - Addressee a, b, c, d, e, f; - a.setGivenName ("Peter"); - a.setFamilyName("Pan"); - a.setFormattedName("Pan, Peter"); - a.setUid("Asdf"); - b.setGivenName ("Phileas"); - b.setFamilyName("Fogg"); - b.setFormattedName("Fogg, Phileas"); - b.setUid("Rsdf"); - c.setGivenName ("Jim"); - c.setFamilyName("Hawkins"); - c.setFormattedName("Hawkins, Jim"); - c.setUid("Fhwn"); - d.setGivenName ("John"); - d.setFamilyName("Silver"); - d.setPrefix ("Long"); - d.setFormattedName("Long John Silver"); - d.setUid("Z2hk"); - e.setGivenName ("Alice"); - e.setFamilyName("Liddel"); - e.setFormattedName("Liddel, Alice"); - e.setUid("kk45"); - f.setGivenName ("Edmond"); - f.setFamilyName("Dantes"); - f.setFormattedName("Dantes, Edmond"); - f.setUid("78ze"); - - kdDebug() << "Adding to list" << endl; - AddresseeList list; - list.append(a); - list.append(b); - list.append(c); - list.append(d); - list.append(e); - list.append(f); - - list.sortBy(FamilyName); - if ( !( (*list.at(0)).uid()=="78ze" - && (*list.at(1)).uid()=="Rsdf" - && (*list.at(2)).uid()=="Fhwn" - && (*list.at(3)).uid()=="kk45" - && (*list.at(4)).uid()=="Asdf" - && (*list.at(5)).uid()=="Z2hk" - ) ) { - kdError() << "SORTING BY FAMILY NAME NOT CORRECT!" << endl; - kdDebug() << "list sorted by family name:" << endl; - list.dump(); - } else { - kdDebug() << "Sorting by family name correct." << endl; - } - list.setReverseSorting(true); - list.sort(); - if ( !( (*list.at(5)).uid()=="78ze" - && (*list.at(4)).uid()=="Rsdf" - && (*list.at(3)).uid()=="Fhwn" - && (*list.at(2)).uid()=="kk45" - && (*list.at(1)).uid()=="Asdf" - && (*list.at(0)).uid()=="Z2hk" - ) ) { - kdError() << "REVERSE SORTING BY FAMILY NAME NOT CORRECT!" << endl; - kdDebug() << "list reverse sorted by family name:" << endl; - list.dump(); - } else { - kdDebug() << "Reverse sorting by family name correct." << endl; - } - - list.setReverseSorting(false); - list.sortBy(FormattedName); - if ( !( (*list.at(0)).uid()=="78ze" - && (*list.at(1)).uid()=="Rsdf" - && (*list.at(2)).uid()=="Fhwn" - && (*list.at(3)).uid()=="kk45" - && (*list.at(4)).uid()=="Z2hk" - && (*list.at(5)).uid()=="Asdf" - ) ) { - kdError() << "SORTING BY FORMATTED NAME NOT CORRECT!" << endl; - kdDebug() << "list sorted by formatted name:" << endl; - list.dump(); - } else { - kdDebug() << "Sorting by formatted name correct." << endl; - } - list.setReverseSorting(true); - list.sort(); - if ( !( (*list.at(5)).uid()=="78ze" - && (*list.at(4)).uid()=="Rsdf" - && (*list.at(3)).uid()=="Fhwn" - && (*list.at(2)).uid()=="kk45" - && (*list.at(1)).uid()=="Z2hk" - && (*list.at(0)).uid()=="Asdf" - ) ) { - kdError() << "REVERSE SORTING BY FORMATTED NAME NOT CORRECT!" << endl; - kdDebug() << "list reverse sorted by formatted name:" << endl; - list.dump(); - } else { - kdDebug() << "Reverse sorting by formatted name correct." << endl; - } - - - list.setReverseSorting(false); - list.sortBy(Uid); - if ( !( (*list.at(0)).uid()=="78ze" - && (*list.at(1)).uid()=="Asdf" - && (*list.at(2)).uid()=="Fhwn" - && (*list.at(3)).uid()=="Rsdf" - && (*list.at(4)).uid()=="Z2hk" - && (*list.at(5)).uid()=="kk45" - ) ) { - kdError() << "SORTING BY UID NOT CORRECT!" << endl; - kdDebug() << "list sorted by Uid:" << endl; - list.dump(); - } else { - kdDebug() << "Sorting by Uid correct." << endl; - } - list.setReverseSorting(true); - list.sortBy(Uid); - if ( !( (*list.at(5)).uid()=="78ze" - && (*list.at(4)).uid()=="Asdf" - && (*list.at(3)).uid()=="Fhwn" - && (*list.at(2)).uid()=="Rsdf" - && (*list.at(1)).uid()=="Z2hk" - && (*list.at(0)).uid()=="kk45" - ) ) { - kdError() << "REVERSE SORTING BY UID NOT CORRECT!" << endl; - kdDebug() << "list sorted by Uid:" << endl; - list.dump(); - } else { - kdDebug() << "Reverse sorting by Uid correct." << endl; - } - - // zero, one or two entries might give errors in a poor sorting - // implementation - kdDebug() << "sorting empty list" << endl; - AddresseeList list2; - list2.sort(); - - kdDebug() << "sorting one entry list" << endl; - list2.append(a); - list2.sort(); - - kdDebug() << "sorting two entry list" << endl; - list2.append(f); - list2.setReverseSorting(false); - list2.sort(); - if ( !( (*list2.at(0)).uid()=="78ze" - && (*list2.at(1)).uid()=="Asdf" - ) ) { - kdError() << "SORTING BY FORMATTED NAME IN A TWO ENTRY LIST NOT CORRECT!" << endl; - kdDebug() << "list sorted by formatted name, two entries:" << endl; - list2.dump(); - } else { - kdDebug() << "Sorting by FormattedName in a two entry list correct." << endl; - } - list2.setReverseSorting(true); - list2.sort(); - if ( !( (*list2.at(1)).uid()=="78ze" - && (*list2.at(0)).uid()=="Asdf" - ) ) { - kdError() << "REVERSE SORTING BY FORMATTED NAME IN A TWO ENTRY LIST NOT CORRECT!" << endl; - kdDebug() << "list reverse sorted by formatted name, two entries:" << endl; - list2.dump(); - } else { - kdDebug() << "Reverse sorting by FormattedName in a two entry list correct." << endl; - } - -} - - diff --git a/kabc/tests/testaddressfmt.cpp b/kabc/tests/testaddressfmt.cpp deleted file mode 100644 index ca13a116c..000000000 --- a/kabc/tests/testaddressfmt.cpp +++ /dev/null @@ -1,63 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include "addressbook.h" -#include "address.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - { "save", "", 0 }, - { "number", "", 0 }, - TDECmdLineLastOption -}; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testaddressfmt","TestAddressFormat","0.1"); - TDECmdLineArgs::init(argc, argv, &aboutData); - TDECmdLineArgs::addCmdLineOptions(options); - - TDEApplication app; - - Address a; - a.setStreet("Lummerlandstr. 1"); - a.setPostalCode("12345"); - a.setLocality("Lummerstadt"); - a.setCountry ("Germany"); - - Address b; - b.setStreet("457 Foobar Ave"); - b.setPostalCode("1A2B3C"); - b.setLocality("Nervousbreaktown"); - b.setRegion("DC"); - b.setCountry("United States of America"); - - Address c; - c.setStreet("Lummerlandstr. 1"); - c.setPostalCode("12345"); - c.setLocality("Lummerstadt"); - c.setCountry ("Deutschland"); - - Address d; - d.setStreet("Lummerlandstr. 1"); - d.setPostalCode("12345"); - d.setLocality("Lummerstadt"); - d.setCountry (""); - - tqDebug( "-------------------------------------\nShould have german address formatting, local country formatting\n" ); - tqDebug( a.formattedAddress("Jim Knopf").latin1() ); - tqDebug( "-------------------------------------\nShould have US address formatting, local country formatting\n" ); - tqDebug( b.formattedAddress("Huck Finn").latin1() ); - tqDebug( "-------------------------------------\nShould have german address formatting, local country formatting\n" ); - tqDebug( c.formattedAddress("Jim Knopf").latin1() ); - tqDebug( "-------------------------------------\nShould have local address formatting, local country formatting\n" ); - tqDebug( d.formattedAddress("Jim Knopf").latin1() ); -} - - diff --git a/kabc/tests/testaddresslineedit.cpp b/kabc/tests/testaddresslineedit.cpp deleted file mode 100644 index 7315aef7e..000000000 --- a/kabc/tests/testaddresslineedit.cpp +++ /dev/null @@ -1,29 +0,0 @@ -#include -#include -#include -#include -#include - -#include "addresslineedit.h" - -using namespace KABC; - -int main( int argc,char **argv ) -{ - TDEAboutData aboutData( "testaddresslineedit", - I18N_NOOP( "Test Address LineEdit" ), "0.1" ); - TDECmdLineArgs::init( argc, argv, &aboutData ); - - TDEApplication app; - - AddressLineEdit *lineEdit = new AddressLineEdit( 0 ); - - lineEdit->show(); - app.setMainWidget( lineEdit ); - - TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) ); - - app.exec(); - - delete lineEdit; -} diff --git a/kabc/tests/testdb.cpp b/kabc/tests/testdb.cpp deleted file mode 100644 index fd4e4f6c1..000000000 --- a/kabc/tests/testdb.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include -#include -#include -#include - -#include "addressbook.h" -#include "vcardformat.h" -#include "resourcesql.h" - -using namespace KABC; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testdb","TestKabcDB","0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - -// TDEApplication app( false, false ); - TDEApplication app; - - AddressBook ab; - - ResourceSql r( &ab, "root", "kde4ever", "localhost" ); - if ( ! r.open() ) { - kdDebug() << "Failed to open resource." << endl; - } - - r.load( &ab ); - - r.close(); - - ab.dump(); -} diff --git a/kabc/tests/testdistlist.cpp b/kabc/tests/testdistlist.cpp deleted file mode 100644 index 0f0e90f90..000000000 --- a/kabc/tests/testdistlist.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -#include "stdaddressbook.h" - -#include "distributionlisteditor.h" -#include "distributionlist.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - {"list ", I18N_NOOP("Show distribution list with name "), 0}, - TDECmdLineLastOption -}; - - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testdistlist",I18N_NOOP("Test Distribution Lists"),"0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - TDECmdLineArgs::addCmdLineOptions( options ); - - TDEApplication app; - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - if (args->isSet("list")) { - TQString name = args->getOption("list"); - - DistributionListManager *manager = - new DistributionListManager( StdAddressBook::self() ); - manager->load(); - DistributionList *list = manager->list( name ); - if ( !list ) { - kdDebug() << "No list with name '" << name << "'" << endl; - return 1; - } else { - kdDebug() << "RESULT: " << list->emails().join(", ") << endl; - return 0; - } - } - - DistributionListEditor *editor = - new DistributionListEditor( StdAddressBook::self(), 0 ); - - editor->show(); - app.setMainWidget(editor); - - TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) ); - - app.exec(); - - delete editor; -} diff --git a/kabc/tests/testkabc.cpp b/kabc/tests/testkabc.cpp deleted file mode 100644 index 3caea88f1..000000000 --- a/kabc/tests/testkabc.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "geo.h" -#include "secrecy.h" -#include "stdaddressbook.h" -#include "timezone.h" -#include "key.h" -#include "agent.h" -#include "vcardconverter.h" - -using namespace KABC; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testkabc",I18N_NOOP("TestKabc"),"0.1"); - TDECmdLineArgs::init(argc, argv, &aboutData); - - TDEApplication app( false, false ); - AddressBook *ab = StdAddressBook::self(); - -#define READ - -#ifdef READ - AddressBook::Iterator it; - for ( it = ab->begin(); it != ab->end(); ++it ) { - TQString vcard; - VCardConverter converter; - converter.addresseeToVCard( *it, vcard ); - kdDebug() << "card=" << vcard << endl; - } -#else - Addressee addr; - - addr.setGivenName("Tobias"); - addr.setFamilyName("Koenig"); - - - Picture pic; - TQImage img; - img.load("/home/tobias/test.png"); -/* - pic.setData(img); - pic.setType(TQImage::imageFormat("/home/tobias/test.png")); -*/ - pic.setUrl("http://www.mypict.de"); - addr.setLogo( pic ); - - ab->insertAddressee( addr ); - - StdAddressBook::save(); -#endif - - return 0; -} diff --git a/kabc/tests/testkabcdlg.cpp b/kabc/tests/testkabcdlg.cpp deleted file mode 100644 index 24225cc1b..000000000 --- a/kabc/tests/testkabcdlg.cpp +++ /dev/null @@ -1,45 +0,0 @@ -#include - -#include -#include -#include -#include -#include - -#include "addresseedialog.h" - -using namespace KABC; - -static const TDECmdLineOptions options[] = -{ - {"multiple", I18N_NOOP("Allow selection of multiple addressees"), 0}, - TDECmdLineLastOption -}; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testkabcdlg",I18N_NOOP("TestKabc"),"0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - TDECmdLineArgs::addCmdLineOptions( options ); - - TDEApplication app; - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - if (args->isSet("multiple")) { - Addressee::List al = AddresseeDialog::getAddressees( 0 ); - Addressee::List::ConstIterator it; - kdDebug() << "Selected Addressees:" << endl; - for( it = al.begin(); it != al.end(); ++it ) { - kdDebug() << " " << (*it).fullEmail() << endl; - } - } else { - Addressee a = AddresseeDialog::getAddressee( 0 ); - - if ( !a.isEmpty() ) { - kdDebug() << "Selected Addressee:" << endl; - a.dump(); - } else { - kdDebug() << "No Addressee selected." << endl; - } - } -} diff --git a/kabc/tests/testldapclient.cpp b/kabc/tests/testldapclient.cpp deleted file mode 100644 index df9fd6226..000000000 --- a/kabc/tests/testldapclient.cpp +++ /dev/null @@ -1,161 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2005 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "testldapclient.h" - -#include -#include -#include - -#include - -#include -#include - -int main(int argc, char *argv[]) -{ - TDEApplication::disableAutoDcopRegistration(); - TDECmdLineArgs::init(argc,argv,"testldapclient", 0, 0, 0, 0); - TDEApplication app; - - TestLDAPClient test; - test.setup(); - test.runAll(); - test.cleanup(); - kdDebug() << "All tests OK." << endl; - return 0; -} - -void TestLDAPClient::setup() -{ -} - -void TestLDAPClient::runAll() -{ - testIntevation(); -} - -bool TestLDAPClient::check(const TQString& txt, TQString a, TQString b) -{ - if (a.isEmpty()) - a = TQString::null; - if (b.isEmpty()) - b = TQString::null; - if (a == b) { - kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl; - } - else { - kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "KO !" << endl; - cleanup(); - exit(1); - } - return true; -} - -void TestLDAPClient::cleanup() -{ - mClient = 0; -} - -void TestLDAPClient::testIntevation() -{ - kdDebug() << k_funcinfo << endl; - mClient = new LdapClient( this ); - - mClient->setHost( "ca.intevation.de" ); - mClient->setPort( "389" ); - mClient->setBase( "o=Intevation GmbH,c=de" ); - - // Same list as in kaddressbook's ldapsearchdialog - TQStringList attrs; - attrs << "l" << "Company" << "co" << "department" << "description" << "mail" << "facsimileTelephoneNumber" << "cn" << "homePhone" << "mobile" << "o" << "pager" << "postalAddress" << "st" << "street" << "title" << "uid" << "telephoneNumber" << "postalCode" << "objectClass"; - // the list from ldapclient.cpp - //attrs << "cn" << "mail" << "givenname" << "sn" << "objectClass"; - mClient->setAttrs( attrs ); - - // Taken from LdapSearch - //TQString mSearchText = TQString::fromUtf8( "Till" ); - //TQString filter = TQString( "&(|(objectclass=person)(objectclass=groupOfNames)(mail=*))(|(cn=%1*)(mail=%2*)(givenName=%3*)(sn=%4*))" ) - // .arg( mSearchText ).arg( mSearchText ).arg( mSearchText ).arg( mSearchText ); - - // For some reason a fromUtf8 broke the search for me (no results). - // But this certainly looks fishy, it might break on non-utf8 systems. - TQString filter = "&(|(objectclass=person)(objectclass=groupofnames)(mail=*))(|(cn=*gypten MDK*)(sn=*gypten MDK*))"; - - connect( mClient, TQT_SIGNAL( result( const KABC::LdapObject& ) ), - this, TQT_SLOT( slotLDAPResult( const KABC::LdapObject& ) ) ); - connect( mClient, TQT_SIGNAL( done() ), - this, TQT_SLOT( slotLDAPDone() ) ); - connect( mClient, TQT_SIGNAL( error( const TQString& ) ), - this, TQT_SLOT( slotLDAPError( const TQString& ) ) ); - mClient->startQuery( filter ); - kapp->eventLoop()->enterLoop(); - delete mClient; mClient = 0; -} - -// from kaddressbook... ugly though... -static TQString asUtf8( const TQByteArray &val ) -{ - if ( val.isEmpty() ) - return TQString::null; - - const char *data = val.data(); - - //TQString::fromUtf8() bug workaround - if ( data[ val.size() - 1 ] == '\0' ) - return TQString::fromUtf8( data, val.size() - 1 ); - else - return TQString::fromUtf8( data, val.size() ); -} - -static TQString join( const KABC::LdapAttrValue& lst, const TQString& sep ) -{ - TQString res; - bool already = false; - for ( KABC::LdapAttrValue::ConstIterator it = lst.begin(); it != lst.end(); ++it ) { - if ( already ) - res += sep; - already = TRUE; - res += asUtf8( *it ); - } - return res; -} - -void TestLDAPClient::slotLDAPResult( const KABC::LdapObject& obj ) -{ - TQString cn = join( obj.attrs[ "cn" ], ", " ); - kdDebug() << " cn:" << cn << endl; - assert( !obj.attrs[ "mail" ].isEmpty() ); - TQString mail = join( obj.attrs[ "mail" ], ", " ); - kdDebug() << " mail:" << mail << endl; - assert( mail.contains( '@' ) ); -} - -void TestLDAPClient::slotLDAPError( const TQString& err ) -{ - kdDebug() << k_funcinfo << err << endl; - ::exit( 1 ); -} - -void TestLDAPClient::slotLDAPDone() -{ - kdDebug() << k_funcinfo << endl; - kapp->eventLoop()->exitLoop(); -} - -#include "testldapclient.moc" diff --git a/kabc/tests/testldapclient.h b/kabc/tests/testldapclient.h deleted file mode 100644 index 1995914c3..000000000 --- a/kabc/tests/testldapclient.h +++ /dev/null @@ -1,51 +0,0 @@ -/* This file is part of the KDE project - Copyright (C) 2005 David Faure - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License version 2 as published by the Free Software Foundation. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef TESTLDAPCLIENT_H -#define TESTLDAPCLIENT_H - -#include - -#include "../ldapclient.h" -typedef KABC::LdapClient LdapClient; - -class TestLDAPClient : public TQObject -{ - Q_OBJECT - -public: - TestLDAPClient() {} - void setup(); - void runAll(); - void cleanup(); - - // tests - void testIntevation(); - -private slots: - void slotLDAPResult( const KABC::LdapObject& ); - void slotLDAPError( const TQString& ); - void slotLDAPDone(); - -private: - bool check(const TQString& txt, TQString a, TQString b); - - LdapClient* mClient; -}; - -#endif diff --git a/kabc/tests/testlock.cpp b/kabc/tests/testlock.cpp deleted file mode 100644 index 632c690a6..000000000 --- a/kabc/tests/testlock.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2003 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "testlock.h" - -#include "stdaddressbook.h" - -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include - -#include -#include - -using namespace KABC; - -LockWidget::LockWidget( const TQString &identifier ) -{ - TQVBoxLayout *topLayout = new TQVBoxLayout( this ); - topLayout->setMargin( KDialog::marginHint() ); - topLayout->setSpacing( KDialog::spacingHint() ); - - if ( identifier.isEmpty() ) { - mLock = 0; - } else { - mLock = new Lock( identifier ); - - int pid = getpid(); - - TQLabel *pidLabel = new TQLabel( "Process ID: " + TQString::number( pid ), - this ); - topLayout->addWidget( pidLabel ); - - TQHBoxLayout *identifierLayout = new TQHBoxLayout( topLayout ); - - TQLabel *resourceLabel = new TQLabel( "Identifier:", this ); - identifierLayout->addWidget( resourceLabel ); - - TQLabel *resourceIdentifier = new TQLabel( identifier, this ); - identifierLayout->addWidget( resourceIdentifier ); - - mStatus = new TQLabel( "Status: Unlocked", this ); - topLayout->addWidget( mStatus ); - - TQPushButton *button = new TQPushButton( "Lock", this ); - topLayout->addWidget( button ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( lock() ) ); - - button = new TQPushButton( "Unlock", this ); - topLayout->addWidget( button ); - connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( unlock() ) ); - } - - mLockView = new TQListView( this ); - topLayout->addWidget( mLockView ); - mLockView->addColumn( "Lock File" ); - mLockView->addColumn( "PID" ); - mLockView->addColumn( "Locking App" ); - - updateLockView(); - - TQPushButton *quitButton = new TQPushButton( "Quit", this ); - topLayout->addWidget( quitButton ); - connect( quitButton, TQT_SIGNAL( clicked() ), TQT_SLOT( close() ) ); - - KDirWatch *watch = KDirWatch::self(); - connect( watch, TQT_SIGNAL( dirty( const TQString & ) ), - TQT_SLOT( updateLockView() ) ); - connect( watch, TQT_SIGNAL( created( const TQString & ) ), - TQT_SLOT( updateLockView() ) ); - connect( watch, TQT_SIGNAL( deleted( const TQString & ) ), - TQT_SLOT( updateLockView() ) ); - watch->addDir( Lock::locksDir() ); - watch->startScan(); -} - -LockWidget::~LockWidget() -{ - delete mLock; -} - -void LockWidget::updateLockView() -{ - mLockView->clear(); - - TQDir dir( Lock::locksDir() ); - - TQStringList files = dir.entryList( "*.lock" ); - - TQStringList::ConstIterator it; - for( it = files.begin(); it != files.end(); ++it ) { - if ( *it == "." || *it == ".." ) continue; - - TQString app; - int pid; - if ( !Lock::readLockFile( dir.filePath( *it ), pid, app ) ) { - kdWarning() << "Unable to open lock file '" << *it << "'" << endl; - } else { - new TQListViewItem( mLockView, *it, TQString::number( pid ), app ); - } - } -} - -void LockWidget::lock() -{ - if ( !mLock->lock() ) { - KMessageBox::sorry( this, mLock->error() ); - } else { - mStatus->setText( "Status: Locked" ); - } -} - -void LockWidget::unlock() -{ - if ( !mLock->unlock() ) { - KMessageBox::sorry( this, mLock->error() ); - } else { - mStatus->setText( "Status: Unlocked" ); - } -} - - -static const TDECmdLineOptions options[] = -{ - { "a", 0, 0 }, - { "addressbook", "Standard address book", 0 }, - { "d", 0, 0 }, - { "diraddressbook", "Standard address book directory resource", 0 }, - { "+identifier", "Identifier of resource to be locked, e.g. filename", 0 }, - TDECmdLineLastOption -}; - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testlock",I18N_NOOP("Test libkabc Lock"),"0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - TDECmdLineArgs::addCmdLineOptions( options ); - - TDEApplication app; - - TQString identifier; - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - if ( args->count() == 1 ) { - identifier = args->arg( 0 ); - } else if ( args->count() != 0 ) { - std::cerr << "Usage: testlock " << std::endl; - return 1; - } - - if ( args->isSet( "addressbook" ) ) { - if ( args->count() == 1 ) { - std::cerr << "Ignoring resource identifier" << std::endl; - } - identifier = StdAddressBook::fileName(); - } - - if ( args->isSet( "diraddressbook" ) ) { - if ( args->count() == 1 ) { - std::cerr << "Ignoring resource identifier" << std::endl; - } - identifier = StdAddressBook::directoryName(); - } - - LockWidget mainWidget( identifier ); - - kapp->setMainWidget( &mainWidget ); - mainWidget.show(); - - return app.exec(); -} - -#include "testlock.moc" diff --git a/kabc/tests/testlock.h b/kabc/tests/testlock.h deleted file mode 100644 index a94d4e8c6..000000000 --- a/kabc/tests/testlock.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2003 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#ifndef KABC_TESTLOCK_H -#define KABC_TESTLOCK_H - -#include "lock.h" - -#include - -class TQLabel; -class TQListView; - -class KABC_EXPORT LockWidget : public TQWidget -{ - Q_OBJECT - public: - LockWidget( const TQString &identifier ); - ~LockWidget(); - - protected slots: - void lock(); - void unlock(); - - void updateLockView(); - - private: - KABC::Lock *mLock; - - TQLabel *mStatus; - TQListView *mLockView; -}; - -#endif diff --git a/kabc/timezone.cpp b/kabc/timezone.cpp deleted file mode 100644 index 59a184c6d..000000000 --- a/kabc/timezone.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include - -#include "timezone.h" - -using namespace KABC; - -TimeZone::TimeZone() : - mOffset( 0 ), mValid( false ) -{ -} - -TimeZone::TimeZone( int offset ) : - mOffset( offset ), mValid( true ) -{ -} - -void TimeZone::setOffset( int offset ) -{ - mOffset = offset; - mValid = true; -} - -int TimeZone::offset() const -{ - return mOffset; -} - -bool TimeZone::isValid() const -{ - return mValid; -} - -bool TimeZone::operator==( const TimeZone &t ) const -{ - if ( !t.isValid() && !isValid() ) return true; - if ( !t.isValid() || !isValid() ) return false; - if ( t.mOffset == mOffset ) return true; - return false; -} - -bool TimeZone::operator!=( const TimeZone &t ) const -{ - if ( !t.isValid() && !isValid() ) return false; - if ( !t.isValid() || !isValid() ) return true; - if ( t.mOffset != mOffset ) return true; - return false; -} - -TQString TimeZone::asString() const -{ - return TQString::number( mOffset ); -} - -TQDataStream &KABC::operator<<( TQDataStream &s, const TimeZone &zone ) -{ - return s << zone.mOffset; -} - -TQDataStream &KABC::operator>>( TQDataStream &s, TimeZone &zone ) -{ - s >> zone.mOffset; - zone.mValid = true; - - return s; -} diff --git a/kabc/timezone.h b/kabc/timezone.h deleted file mode 100644 index 8705797fb..000000000 --- a/kabc/timezone.h +++ /dev/null @@ -1,89 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KABC_TIMEZONE_H -#define KABC_TIMEZONE_H - -#include - -#include - -namespace KABC { - -/** - * @short Time zone information. - * - * This class stores information about a time zone. - */ -class KABC_EXPORT TimeZone -{ - friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const TimeZone & ); - friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, TimeZone & ); - -public: - - /** - * Construct invalid time zone. - */ - TimeZone(); - - /** - * Construct time zone. - * - * @param offset Offset in minutes relative to UTC. - */ - TimeZone( int offset ); - - /** - * Set time zone offset relative to UTC. - * - * @param offset Offset in minutes. - */ - void setOffset( int offset ); - - /** - * Return offset in minutes relative to UTC. - */ - int offset() const; - - /** - * Return, if this time zone object is valid. - */ - bool isValid() const; - - bool operator==( const TimeZone & ) const; - bool operator!=( const TimeZone & ) const; - - /** - * Return string representation of time zone offset. - */ - TQString asString() const; - -private: - int mOffset; // Offset in minutes - - bool mValid; -}; - -KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const TimeZone & ); -KABC_EXPORT TQDataStream &operator>>( TQDataStream &, TimeZone & ); - -} -#endif diff --git a/kabc/vcard/AdrParam.cpp b/kabc/vcard/AdrParam.cpp deleted file mode 100644 index 5ad56f4fb..000000000 --- a/kabc/vcard/AdrParam.cpp +++ /dev/null @@ -1,126 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include -#include -#include - -using namespace VCARD; - -AdrParam::AdrParam() - : Param() -{ -} - -AdrParam::AdrParam(const AdrParam & x) - : Param(x), - adrTypeList_ (x.adrTypeList_) -{ -} - -AdrParam::AdrParam(const TQCString & s) - : Param(s) -{ -} - - AdrParam & -AdrParam::operator = (AdrParam & x) -{ - if (*this == x) return *this; - - adrTypeList_ = x.adrTypeList(); - textParam_ = x.textParam(); - - Param::operator = (x); - return *this; -} - - AdrParam & -AdrParam::operator = (const TQCString & s) -{ - Param::operator = (s); - - adrTypeList_.clear(); - textParam_.truncate(0); - - return *this; -} - - bool -AdrParam::operator == (AdrParam & x) -{ - parse(); - - if (!x.textParam().isEmpty()) - return (x.textParam_ == textParam_); - - if (x.adrTypeList().count() != adrTypeList_.count()) - return false; - - TQStrListIterator it(x.adrTypeList_); - - for (; it.current(); ++it) - if (!adrTypeList_.find(it.current())) - return false; - - return true; -} - -AdrParam::~AdrParam() -{ -} - - void -AdrParam::_parse() -{ - adrTypeList_.clear(); - - if (strRep_.left(4) != "TYPE") { - textParam_ = strRep_; - return; - } - - if (!strRep_.contains('=')) - return; - - RTokenise(strRep_, ",", adrTypeList_); -} - - void -AdrParam::_assemble() -{ - if (!textParam_.isEmpty()) { - strRep_ = textParam_; - return; - } - - TQStrListIterator it(adrTypeList_); - - for (; it.current(); ++it) { - - strRep_ += it.current(); - - if (it.current() != adrTypeList_.last()) - strRep_ += ','; - } -} diff --git a/kabc/vcard/AdrValue.cpp b/kabc/vcard/AdrValue.cpp deleted file mode 100644 index 535ba6980..000000000 --- a/kabc/vcard/AdrValue.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include -#include -#include -#include - -using namespace VCARD; - -AdrValue::AdrValue() - : Value() -{ -} - -AdrValue::AdrValue(const AdrValue & x) - : Value(x), - poBox_ (x.poBox_), - extAddress_ (x.extAddress_), - street_ (x.street_), - locality_ (x.locality_), - region_ (x.region_), - postCode_ (x.postCode_), - countryName_ (x.countryName_) -{ -} - -AdrValue::AdrValue(const TQCString & s) - : Value(s) -{ -} - - AdrValue & -AdrValue::operator = (AdrValue & x) -{ - if (*this == x) return *this; - - poBox_ = x.poBox_; - extAddress_ = x.extAddress_; - street_ = x.street_; - locality_ = x.locality_; - region_ = x.region_; - postCode_ = x.postCode_; - countryName_ = x.countryName_; - - Value::operator = (x); - return *this; -} - - AdrValue & -AdrValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -AdrValue::operator == (AdrValue & x) -{ - parse(); - x.parse(); - - return ( - poBox_ == x.poBox_ && - extAddress_ == x.extAddress_ && - street_ == x.street_ && - locality_ == x.locality_ && - region_ == x.region_ && - postCode_ == x.postCode_ && - countryName_ == x.countryName_); -} - -AdrValue::~AdrValue() -{ -} - - AdrValue * -AdrValue::clone() -{ - return new AdrValue( *this ); -} - - void -AdrValue::_parse() -{ - vDebug("AdrValue::_parse()"); - - TQStrList l; - RTokenise(strRep_, ";", l); - - for (unsigned int i = 0; i < l.count(); i++) { - - switch (i) { - - case 0: poBox_ = l.at(0); break; - case 1: extAddress_ = l.at(1); break; - case 2: street_ = l.at(2); break; - case 3: locality_ = l.at(3); break; - case 4: region_ = l.at(4); break; - case 5: postCode_ = l.at(5); break; - case 6: countryName_ = l.at(6); break; - default: break; - } - } -} - - void -AdrValue::_assemble() -{ - vDebug("AdrValue::_assemble"); - - strRep_ = poBox_; - strRep_ += ";" + extAddress_; - strRep_ += ";" + street_; - strRep_ += ";" + locality_; - strRep_ += ";" + region_; - strRep_ += ";" + postCode_; - strRep_ += ";" + countryName_; -} - diff --git a/kabc/vcard/AgentParam.cpp b/kabc/vcard/AgentParam.cpp deleted file mode 100644 index 9e4531b02..000000000 --- a/kabc/vcard/AgentParam.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -AgentParam::AgentParam() - : Param() -{ -} - -AgentParam::AgentParam(const AgentParam & x) - : Param(x), - refer_ (x.refer_), - uri_ (x.uri_) -{ -} - -AgentParam::AgentParam(const TQCString & s) - : Param(s) -{ -} - - AgentParam & -AgentParam::operator = (AgentParam & x) -{ - if (*this == x) return *this; - - refer_ = x.refer_; - uri_ = x.uri_; - - Param::operator = (x); - return *this; -} - - AgentParam & -AgentParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -AgentParam::operator == (AgentParam & x) -{ - parse(); - - if (refer_) - return (x.refer() && uri_ == x.uri_); - - return !x.refer(); -} - -AgentParam::~AgentParam() -{ -} - - void -AgentParam::_parse() -{ - if (strRep_.isEmpty()) { - refer_ = false; - return; - } - - refer_ = true; - uri_ = strRep_; -} - - void -AgentParam::_assemble() -{ - if (!refer_) { - strRep_.truncate(0); - return; - } - - strRep_ = uri_.asString(); - return; -} diff --git a/kabc/vcard/AgentValue.cpp b/kabc/vcard/AgentValue.cpp deleted file mode 100644 index 7d356f8d7..000000000 --- a/kabc/vcard/AgentValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -AgentValue::AgentValue() - : Value() -{ -} - -AgentValue::AgentValue(const AgentValue & x) - : Value(x) -{ -} - -AgentValue::AgentValue(const TQCString & s) - : Value(s) -{ -} - - AgentValue & -AgentValue::operator = (AgentValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - AgentValue & -AgentValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -AgentValue::operator == (AgentValue & x) -{ - x.parse(); - return false; -} - -AgentValue::~AgentValue() -{ -} - - void -AgentValue::_parse() -{ -} - - void -AgentValue::_assemble() -{ -} - diff --git a/kabc/vcard/CMakeLists.txt b/kabc/vcard/CMakeLists.txt deleted file mode 100644 index 8ad988434..000000000 --- a/kabc/vcard/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${TQT_INCLUDE_DIRS} - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/include/generated - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdecore -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### vcard ##################################### - -set( target vcard ) - -set( ${target}_SRCS - vCard-all.cpp -) - -tde_add_library( ${target} SHARED - SOURCES ${${target}_SRCS} - VERSION 0.0.0 - LINK tdecore-shared - DESTINATION ${LIB_INSTALL_DIR} -) diff --git a/kabc/vcard/ClassValue.cpp b/kabc/vcard/ClassValue.cpp deleted file mode 100644 index 21417f87b..000000000 --- a/kabc/vcard/ClassValue.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -#include - -using namespace VCARD; - -ClassValue::ClassValue() - : Value() -{ -} - -ClassValue::ClassValue(const ClassValue & x) - : Value(x), - classType_(x.classType_) -{ -} - -ClassValue::ClassValue(const TQCString & s) - : Value(s) -{ -} - - ClassValue & -ClassValue::operator = (ClassValue & x) -{ - if (*this == x) return *this; - x.parse(); - - classType_ = x.classType_; - - Value::operator = (x); - return *this; -} - - ClassValue & -ClassValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -ClassValue::operator == (ClassValue & x) -{ - x.parse(); - return ( classType_ == x.classType_ ); -} - -ClassValue::~ClassValue() -{ -} - - ClassValue * -ClassValue::clone() -{ - return new ClassValue( *this ); -} - - void -ClassValue::_parse() -{ - if (tqstricmp(strRep_, "PUBLIC") == 0) - classType_ = Public; - - else if (tqstricmp(strRep_, "PRIVATE") == 0) - classType_ = Private; - - else if (tqstricmp(strRep_, "CONFIDENTIAL") == 0) - classType_ = Confidential; - - else classType_ = Other; -} - - void -ClassValue::_assemble() -{ - switch (classType_) { - - case Public: - strRep_ = "PUBLIC"; - break; - - case Private: - strRep_ = "PRIVATE"; - break; - - case Confidential: - strRep_ = "CONFIDENTIAL"; - break; - - default: - break; - } -} - diff --git a/kabc/vcard/ContentLine.cpp b/kabc/vcard/ContentLine.cpp deleted file mode 100644 index 52bcdf4f5..000000000 --- a/kabc/vcard/ContentLine.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include -#include -#include - -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include -#include -#include - -using namespace VCARD; - -ContentLine::ContentLine() - : Entity(), - value_(0), - paramType_( ParamUnknown ), - valueType_( ValueUnknown ), - entityType_( EntityUnknown ) -{ -} - -ContentLine::ContentLine(const ContentLine & x) - : Entity(x), - group_ (x.group_), - name_ (x.name_), - paramList_(x.paramList_), - value_(x.value_->clone()), - paramType_( x.paramType_ ), - valueType_( x.valueType_ ), - entityType_( x.entityType_ ) -{ -} - -ContentLine::ContentLine(const TQCString & s) - : Entity(s), - value_(0), - paramType_( ParamUnknown ), - valueType_( ValueUnknown ), - entityType_( EntityUnknown ) -{ -} - - ContentLine & -ContentLine::operator = (ContentLine & x) -{ - if (*this == x) return *this; - - paramList_ = x.paramList(); - value_ = x.value_->clone(); - - Entity::operator = (x); - return *this; -} - - ContentLine & -ContentLine::operator = (const TQCString & s) -{ - Entity::operator = (s); - delete value_; - value_ = 0; - return *this; -} - - bool -ContentLine::operator == (ContentLine & x) -{ - x.parse(); - - TQPtrListIterator it(x.paramList()); - - if (!paramList_.find(it.current())) - return false; - - return true; -} - -ContentLine::~ContentLine() -{ - delete value_; - value_ = 0; -} - - void -ContentLine::_parse() -{ - vDebug("parse"); - - // Unqote newlines - strRep_ = strRep_.replace( TQRegExp( "\\\\n" ), "\n" ); - - int split = strRep_.find(':'); - - if (split == -1) { // invalid content line - vDebug("No ':'"); - return; - } - - TQCString firstPart(strRep_.left(split)); - TQCString valuePart(strRep_.mid(split + 1)); - - split = firstPart.find('.'); - - if (split != -1) { - group_ = firstPart.left(split); - firstPart = firstPart.mid(split + 1); - } - - vDebug("Group == " + group_); - vDebug("firstPart == " + firstPart); - vDebug("valuePart == " + valuePart); - - // Now we have the group, the name and param list together and the value. - - TQStrList l; - - RTokenise(firstPart, ";", l); - - if (l.count() == 0) {// invalid - no name ! - vDebug("No name for this content line !"); - return; - } - - name_ = l.at(0); - - // Now we have the name, so the rest of 'l' is the params. - // Remove the name part. - l.remove(0u); - - entityType_ = EntityNameToEntityType(name_); - paramType_ = EntityTypeToParamType(entityType_); - - unsigned int i = 0; - - // For each parameter, create a new parameter of the correct type. - - TQStrListIterator it(l); - - for (; it.current(); ++it, i++) { - - TQCString str = *it; - - split = str.find("="); - if (split < 0 ) { - vDebug("No '=' in parameter."); - continue; - } - - TQCString paraName = str.left(split); - TQCString paraValue = str.mid(split + 1); - - TQStrList paraValues; - RTokenise(paraValue, ",", paraValues); - - TQStrListIterator it2( paraValues ); - - for(; it2.current(); ++it2) { - - Param *p = new Param; - p->setName( paraName ); - p->setValue( *it2 ); - - paramList_.append(p); - } - } - - // Create a new value of the correct type. - - valueType_ = EntityTypeToValueType(entityType_); - -// kdDebug(5710) << "valueType: " << valueType_ << endl; - - switch (valueType_) { - - case ValueSound: value_ = new SoundValue; break; - case ValueAgent: value_ = new AgentValue; break; - case ValueAddress: value_ = new AdrValue; break; - case ValueTel: value_ = new TelValue; break; - case ValueTextBin: value_ = new TextBinValue; break; - case ValueOrg: value_ = new OrgValue; break; - case ValueN: value_ = new NValue; break; - case ValueUTC: value_ = new UTCValue; break; - case ValueURI: value_ = new URIValue; break; - case ValueClass: value_ = new ClassValue; break; - case ValueFloat: value_ = new FloatValue; break; - case ValueImage: value_ = new ImageValue; break; - case ValueDate: value_ = new DateValue; break; - case ValueTextList: value_ = new TextListValue; break; - case ValueGeo: value_ = new GeoValue; break; - case ValueText: - case ValueUnknown: - default: value_ = new TextValue; break; - } - - *value_ = valuePart; -} - - void -ContentLine::_assemble() -{ - vDebug("Assemble (argl) - my name is \"" + name_ + "\""); - strRep_.truncate(0); - - TQCString line; - - if (!group_.isEmpty()) - line += group_ + '.'; - - line += name_; - - vDebug("Adding parameters"); - ParamListIterator it(paramList_); - - for (; it.current(); ++it) - line += ";" + it.current()->asString(); - - vDebug("Adding value"); - if (value_ != 0) - line += ":" + value_->asString(); - else { - vDebug("No value"); - } - - // Quote newlines - line = line.replace( TQRegExp( "\n" ), "\\n" ); - - // Fold lines longer than 72 chars - const int maxLen = 72; - uint cursor = 0; - while( line.length() > ( cursor + 1 ) * maxLen ) { - strRep_ += line.mid( cursor * maxLen, maxLen ); - strRep_ += "\r\n "; - ++cursor; - } - strRep_ += line.mid( cursor * maxLen ); -} - - void -ContentLine::clear() -{ - group_.truncate(0); - name_.truncate(0); - paramList_.clear(); - delete value_; - value_ = 0; - paramType_ = ParamUnknown; - valueType_ = ValueUnknown; - entityType_ = EntityUnknown; -} diff --git a/kabc/vcard/DateParam.cpp b/kabc/vcard/DateParam.cpp deleted file mode 100644 index ffaf4b3f6..000000000 --- a/kabc/vcard/DateParam.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -DateParam::DateParam() - : Param() -{ -} - -DateParam::DateParam(const DateParam & x) - : Param(x) -{ -} - -DateParam::DateParam(const TQCString & s) - : Param(s) -{ -} - - DateParam & -DateParam::operator = (DateParam & x) -{ - if (*this == x) return *this; - - Param::operator = (x); - return *this; -} - - DateParam & -DateParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -DateParam::operator == (DateParam & x) -{ - x.parse(); - - return false; -} - -DateParam::~DateParam() -{ -} - - void -DateParam::_parse() -{ -} - - void -DateParam::_assemble() -{ -} - diff --git a/kabc/vcard/DateValue.cpp b/kabc/vcard/DateValue.cpp deleted file mode 100644 index 9f578a158..000000000 --- a/kabc/vcard/DateValue.cpp +++ /dev/null @@ -1,434 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -#include -#include -#include - -using namespace VCARD; - -DateValue::DateValue() - : Value() -{ - vDebug("DateValue::DateValue()"); -} - -DateValue::DateValue( - unsigned int year, - unsigned int month, - unsigned int day, - unsigned int hour, - unsigned int minute, - unsigned int second, - double secFrac, - bool zonePositive, - unsigned int zoneHour, - unsigned int zoneMinute) - : Value (), - year_ (year), - month_ (month), - day_ (day), - hour_ (hour), - minute_ (minute), - second_ (second), - zoneHour_ (zoneHour), - zoneMinute_ (zoneMinute), - secFrac_ (secFrac), - zonePositive_ (zonePositive), - hasTime_(true) -{ - parsed_ = true; - assembled_ = false; -} - -DateValue::DateValue(const TQDate & d) - : Value (), - year_ (d.year()), - month_ (d.month()), - day_ (d.day()), - hasTime_(false) -{ - parsed_ = true; - assembled_ = false; -} - -DateValue::DateValue(const TQDateTime & d) - : Value (), - year_ (d.date().year()), - month_ (d.date().month()), - day_ (d.date().day()), - hour_ (d.time().hour()), - minute_ (d.time().minute()), - second_ (d.time().second()), - hasTime_(true) -{ - parsed_ = true; - assembled_ = false; -} - -DateValue::DateValue(const DateValue & x) - : Value(x) -{ - year_ = x.year_; - month_ = x.month_; - day_ = x.day_; - hour_ = x.hour_; - minute_ = x.minute_; - second_ = x.second_; - zoneHour_ = x.zoneHour_; - zoneMinute_ = x.zoneMinute_; - secFrac_ = x.secFrac_; - hasTime_ = x.hasTime_; -} - -DateValue::DateValue(const TQCString & s) - : Value(s) -{ -} - - DateValue & -DateValue::operator = (DateValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - DateValue & -DateValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -DateValue::operator == (DateValue & x) -{ - x.parse(); - return false; -} - -DateValue::~DateValue() -{ -} - - DateValue * -DateValue::clone() -{ - return new DateValue( *this ); -} - - void -DateValue::_parse() -{ - vDebug("DateValue::_parse()"); - - // date = date-full-year ["-"] date-month ["-"] date-mday - // time = time-hour [":"] time-minute [":"] time-second [":"] - // [time-secfrac] [time-zone] - - int timeSep = strRep_.find('T'); - - TQCString dateStr; - TQCString timeStr; - - if (timeSep == -1) { - - dateStr = strRep_; - vDebug("Has date string \"" + dateStr + "\""); - - } else { - - dateStr = strRep_.left(timeSep); - vDebug("Has date string \"" + dateStr + "\""); - - timeStr = strRep_.mid(timeSep + 1); - vDebug("Has time string \"" + timeStr + "\""); - } - - /////////////////////////////////////////////////////////////// DATE - - dateStr.replace(TQRegExp("-"), ""); - - kdDebug(5710) << "dateStr: " << dateStr << endl; - - year_ = dateStr.left(4).toInt(); - month_ = dateStr.mid(4, 2).toInt(); - day_ = dateStr.right(2).toInt(); - - if (timeSep == -1) { - hasTime_ = false; - return; // No time, done. - } - else - hasTime_ = true; - - /////////////////////////////////////////////////////////////// TIME - - /////////////////////////////////////////////////////////////// ZONE - - int zoneSep = timeStr.find('Z'); - - if (zoneSep != -1 && timeStr.length() - zoneSep > 3) { - - TQCString zoneStr(timeStr.mid(zoneSep + 1)); - vDebug("zoneStr == " + zoneStr); - - zonePositive_ = (zoneStr[0] == '+'); - zoneHour_ = zoneStr.mid(1, 2).toInt(); - zoneMinute_ = zoneStr.right(2).toInt(); - - timeStr.remove(zoneSep, timeStr.length() - zoneSep); - } - - //////////////////////////////////////////////////// SECOND FRACTION - - int secFracSep = timeStr.findRev(','); - - if (secFracSep != -1 && zoneSep != -1) { // zoneSep checked to avoid errors. - TQCString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep); - secFrac_ = quirkafleeg.toDouble(); - } - - /////////////////////////////////////////////////////////////// HMS - - timeStr.replace(TQRegExp(":"), ""); - - hour_ = timeStr.left(2).toInt(); - minute_ = timeStr.mid(2, 2).toInt(); - second_ = timeStr.mid(4, 2).toInt(); -} - - void -DateValue::_assemble() -{ - vDebug("DateValue::_assemble"); - - TQCString year; - TQCString month; - TQCString day; - - year.setNum( year_ ); - month.setNum( month_ ); - day.setNum( day_ ); - - if ( month.length() < 2 ) month.prepend( "0" ); - if ( day.length() < 2 ) day.prepend( "0" ); - - strRep_ = year + '-' + month + '-' + day; - - if ( hasTime_ ) { - TQCString hour; - TQCString minute; - TQCString second; - - hour.setNum( hour_ ); - minute.setNum( minute_ ); - second.setNum( second_ ); - - if ( hour.length() < 2 ) hour.prepend( "0" ); - if ( minute.length() < 2 ) minute.prepend( "0" ); - if ( second.length() < 2 ) second.prepend( "0" ); - - strRep_ += 'T' + hour + ':' + minute + ':' + second + 'Z'; - } -} - - unsigned int -DateValue::year() -{ - parse(); - return year_; -} - - unsigned int -DateValue::month() -{ - parse(); - return month_; -} - - unsigned int -DateValue::day() -{ - parse(); - return day_; -} - unsigned int -DateValue::hour() -{ - parse(); - return hour_; -} - - unsigned int -DateValue::minute() -{ - parse(); - return minute_; -} - - unsigned int -DateValue::second() -{ - parse(); - return second_; -} - - double -DateValue::secondFraction() -{ - parse(); - return secFrac_; -} - - bool -DateValue::zonePositive() -{ - parse(); - return zonePositive_; -} - - unsigned int -DateValue::zoneHour() -{ - parse(); - return zoneHour_; -} - - unsigned int -DateValue::zoneMinute() -{ - parse(); - return zoneMinute_; -} - - void -DateValue::setYear(unsigned int i) -{ - year_ = i; - assembled_ = false; -} - - void -DateValue::setMonth(unsigned int i) -{ - month_ = i; - assembled_ = false; -} - - void -DateValue::setDay(unsigned int i) -{ - day_ = i; - assembled_ = false; -} - - void -DateValue::setHour(unsigned int i) -{ - hour_ = i; - assembled_ = false; -} - - void -DateValue::setMinute(unsigned int i) -{ - minute_ = i; - assembled_ = false; -} - - void -DateValue::setSecond(unsigned int i) -{ - second_ = i; - assembled_ = false; -} - - void -DateValue::setSecondFraction(double d) -{ - secFrac_ = d; - assembled_ = false; -} - - void -DateValue::setZonePositive(bool b) -{ - zonePositive_ = b; - assembled_ = false; -} - - void -DateValue::setZoneHour(unsigned int i) -{ - zoneHour_ = i; - assembled_ = false; -} - - void -DateValue::setZoneMinute(unsigned int i) -{ - zoneMinute_ = i; - assembled_ = false; -} - - TQDate -DateValue::qdate() -{ - parse(); - TQDate d(year_, month_, day_); - return d; -} - - TQTime -DateValue::qtime() -{ - parse(); - TQTime t(hour_, minute_, second_); -// t.setMs(1 / secFrac_); - return t; -} - - TQDateTime -DateValue::qdt() -{ - parse(); - TQDateTime dt; - dt.setDate(qdate()); - dt.setTime(qtime()); - return dt; -} - - bool -DateValue::hasTime() -{ - parse(); - return hasTime_; -} - diff --git a/kabc/vcard/EmailParam.cpp b/kabc/vcard/EmailParam.cpp deleted file mode 100644 index 7daf19ccc..000000000 --- a/kabc/vcard/EmailParam.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include -#include -#include - -using namespace VCARD; - -EmailParam::EmailParam() - : Param() -{ - vDebug("ctor"); -} - -EmailParam::EmailParam(const EmailParam & x) - : Param(x), - emailType_ (x.emailType_), - pref_ (x.pref_) -{ -} - -EmailParam::EmailParam(const TQCString & s) - : Param(s) -{ -} - - EmailParam & -EmailParam::operator = (EmailParam & x) -{ - if (*this == x) return *this; - - emailType_ = x.emailType(); - pref_ = x.pref_; - - Param::operator = (x); - return *this; -} - - EmailParam & -EmailParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -EmailParam::operator == (EmailParam & x) -{ - parse(); - - if (pref_) - return (x.pref_ && x.emailType() == emailType_); - - return !x.pref(); -} - -EmailParam::~EmailParam() -{ -} - - void -EmailParam::_parse() -{ -#if 0 - Param::parseToList(); - - SubParamListIterator it(subParamList_); - - pref_ = true; - emailType_ = ""; - - for (; it.current(); ++it) { - - if (tqstricmp(it.current()->name(), "TYPE") == 0) { - emailType_ = it.current()->value(); - continue; - } - - if (tqstricmp(it.current()->name(), "PREF") == 0) { - pref_ = true; - } - } -#endif -} - - void -EmailParam::_assemble() -{ - strRep_ = "TYPE="; - strRep_ += emailType_; - - if (pref_) - strRep_ += ",PREF"; -} - diff --git a/kabc/vcard/Entity.cpp b/kabc/vcard/Entity.cpp deleted file mode 100644 index 5eaf6a1d0..000000000 --- a/kabc/vcard/Entity.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -using namespace VCARD; - -Entity::Entity() - : parsed_ (false), - assembled_ (true) -{ - // empty -} - -Entity::Entity(const Entity & e) - : strRep_ (e.strRep_), - parsed_ (e.parsed_), - assembled_ (e.assembled_) -{ - // empty -} - -Entity::Entity(const TQCString & s) - : strRep_ (s), - parsed_ (false), - assembled_ (true) -{ - // empty -} - - Entity & -Entity::operator = (const Entity & e) -{ - if (this == &e) return *this; - - strRep_ = e.strRep_; - parsed_ = e.parsed_; - assembled_ = e.assembled_; - - return *this; -} - - Entity & -Entity::operator = (const TQCString & s) -{ - strRep_ = s; - parsed_ = false; - assembled_ = true; - - return *this; -} - - bool -Entity::operator == (Entity & e) -{ - return asString() == e.asString(); -} - - bool -Entity::operator != (Entity & e) -{ - return !(*this == e); -} - - bool -Entity::operator == (const TQCString & s) -{ - return asString() == s; -} - - bool -Entity::operator != (const TQCString & s) -{ - return !(*this == s); -} - -Entity::~Entity() -{ - // empty -} - - TQCString -Entity::asString() -{ -// vDebug("Entity::asString()"); - assemble(); - - return strRep_; -} - - void -Entity::parse() -{ -// vDebug( "Entity::parse()" ); - - if (!parsed_) _parse(); - - parsed_ = true; - assembled_ = false; -} - - void -Entity::assemble() -{ -// vDebug( "Entity::assemble()" ); - - if (assembled_) return; - - parse(); - _assemble(); - - assembled_ = true; -} - diff --git a/kabc/vcard/Enum.cpp b/kabc/vcard/Enum.cpp deleted file mode 100644 index bcb48f98a..000000000 --- a/kabc/vcard/Enum.cpp +++ /dev/null @@ -1,490 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include -#include - -#include - -using namespace VCARD; - -// There are 31 possible types, not including extensions. -// URI is a custom field designed to store the upstream URI for each contact -// in order to handle certain limited CardDAV systems such as Zimbra - const TQCString -VCARD::paramNames [] = -{ - "NAME", - "PROFILE", - "SOURCE", - "FN", - "N", - "NICKNAME", - "PHOTO", - "BDAY", - "ADR", - "LABEL", - "TEL", - "EMAIL", - "MAILER", - "TZ", - "GEO", - "TITLE", - "ROLE", - "LOGO", - "AGENT", - "ORG", - "CATEGORIES", - "NOTE", - "PRODID", - "REV", - "SORT-STRING", - "SOUND", - "UID", - "URL", - "VERSION", - "CLASS", - "KEY", - "URI" -}; - - const ParamType -VCARD::paramTypesTable[] = { - ParamNone, // NAME - ParamNone, // PROFILE - ParamSource, // SOURCE - ParamText, // FN - ParamText, // N - ParamText, // NICKNAME - ParamImage, // PHOTO (inline/refer) - ParamDate, // BDAY ("VALUE = "date-time/date) - ParamAddrText, // ADR (adr-param/text-param) - ParamAddrText, // LABEL (adr-param/text-param) - ParamTel, // TEL - ParamEmail, // EMAIL - ParamText, // MAILER - ParamNone, // TZ - ParamNone, // GEO - ParamText, // TITLE - ParamText, // ROLE - ParamImage, // LOGO - ParamAgent, // AGENT - ParamText, // ORG - ParamText, // CATEGORIES - ParamText, // NOTE - ParamNone, // PRODID - ParamDate, // REV - ParamText, // SORT-STRING - ParamSound, // SOUND - ParamNone, // UID - ParamNone, // URL - ParamNone, // VERSION - ParamNone, // CLASS - ParamTextBin, // KEY - ParamTextNS, // X - ParamNone // URI -}; - - ParamType -VCARD::EntityTypeToParamType(EntityType e) -{ - ParamType t(ParamUnknown); - - switch (e) { - - //---------------------------------------------------------------// - case EntityAgent: t = ParamAgent; break; - //---------------------------------------------------------------// - case EntitySound: t = ParamSound; break; - //---------------------------------------------------------------// - case EntitySource: t = ParamSource; break; - //---------------------------------------------------------------// - case EntityTelephone: t = ParamTel; break; - //---------------------------------------------------------------// - case EntityEmail: t = ParamEmail; break; - //---------------------------------------------------------------// - case EntityKey: t = ParamTextBin; break; - //---------------------------------------------------------------// - case EntityExtension: t = ParamTextNS; break; - //---------------------------------------------------------------// - case EntityAddress: - case EntityLabel: t = ParamAddrText; break; - //---------------------------------------------------------------// - case EntityBirthday: - case EntityRevision: t = ParamDate; break; - //---------------------------------------------------------------// - case EntityPhoto: - case EntityLogo: t = ParamImage; break; - //---------------------------------------------------------------// - case EntityOrganisation: - case EntityTitle: - case EntityRole: - case EntityFullName: - case EntityMailer: - case EntityN: - case EntitySortString: - case EntityNickname: - case EntityCategories: - case EntityNote: t = ParamText; break; - //---------------------------------------------------------------// - case EntityProductID: - case EntityTimeZone: - case EntityUID: - case EntityURL: - case EntityClass: - case EntityGeo: - case EntityName: - case EntityVersion: - case EntityProfile: - case EntityURI: - default: t = ParamNone; break; - //---------------------------------------------------------------// - - } - - return t; -} - - ValueType -VCARD::EntityTypeToValueType(EntityType e) -{ - ValueType t(ValueUnknown); - - switch (e) { - - //---------------------------------------------------------------// - case EntitySound: t = ValueSound; break; - //---------------------------------------------------------------// - case EntityAgent: t = ValueAgent; break; - //---------------------------------------------------------------// - case EntityAddress: t = ValueAddress; break; - //---------------------------------------------------------------// - case EntityTelephone: t = ValueTel; break; - //---------------------------------------------------------------// - case EntityKey: t = ValueTextBin; break; - //---------------------------------------------------------------// - case EntityOrganisation: t = ValueOrg; break; - //---------------------------------------------------------------// - case EntityN: t = ValueN; break; - //---------------------------------------------------------------// - case EntityTimeZone: t = ValueUTC; break; - //---------------------------------------------------------------// - case EntityClass: t = ValueClass; break; - //---------------------------------------------------------------// - case EntityGeo: t = ValueGeo; break; - //---------------------------------------------------------------// - case EntitySource: - case EntityURL: t = ValueURI; break; - //---------------------------------------------------------------// - case EntityPhoto: - case EntityLogo: t = ValueImage; break; - //---------------------------------------------------------------// - case EntityBirthday: - case EntityRevision: t = ValueDate; break; - //---------------------------------------------------------------// - case EntityCategories: - case EntityNickname: t = ValueTextList; break; - //---------------------------------------------------------------// - case EntityLabel: - case EntityExtension: - case EntityEmail: - case EntityTitle: - case EntityRole: - case EntityFullName: - case EntityMailer: - case EntityProductID: - case EntityName: - case EntitySortString: - case EntityVersion: - case EntityProfile: - case EntityUID: - case EntityNote: - case EntityURI: - default: t = ValueText; break; - //---------------------------------------------------------------// - - } - - return t; -} - - TQCString -VCARD::EntityTypeToParamName(EntityType e) -{ - if ( e > EntityUnknown ) e = EntityUnknown; - return paramNames[ int( e ) ]; -} - - EntityType -VCARD::EntityNameToEntityType(const TQCString & s) -{ - if (s.isEmpty()) return EntityUnknown; - - EntityType t(EntityUnknown); - - switch (s[0]) { - - case 'A': - if (s == "ADR") - t = EntityAddress; - else if (s == "AGENT") - t = EntityAgent; - break; - - case 'B': - if (s == "BDAY") - t = EntityBirthday; - break; - - case 'C': - if (s == "CATEGORIES") - t = EntityCategories; - else if (s == "CLASS") - t = EntityClass; - break; - - case 'E': - if (s == "EMAIL") - t = EntityEmail; - break; - - case 'F': - if (s == "FN") - t = EntityFullName; - break; - - case 'G': - if (s == "GEO") - t = EntityGeo; - break; - - case 'K': - if (s == "KEY") - t = EntityKey; - break; - - case 'L': - if (s == "LABEL") - t = EntityLabel; - else if (s == "LOGO") - t = EntityLogo; - break; - - case 'M': - if (s == "MAILER") - t = EntityMailer; - break; - - case 'N': - if (s == "N") - t = EntityN; - else if (s == "NAME") - t = EntityName; - else if (s == "NICKNAME") - t = EntityNickname; - else if (s == "NOTE") - t = EntityNote; - break; - - case 'O': - if (s == "ORG") - t = EntityOrganisation; - break; - - case 'P': - if (s == "PHOTO") - t = EntityPhoto; - else if (s == "PRODID") - t = EntityProductID; - else if (s == "PROFILE") - t = EntityProfile; - break; - - case 'R': - if (s == "REV") - t = EntityRevision; - else if (s == "ROLE") - t = EntityRole; - break; - - case 'S': - if (s == "SORT-STRING") - t = EntitySortString; - else if (s == "SOUND") - t = EntitySound; - else if (s == "SOURCE") - t = EntitySource; - break; - - case 'T': - if (s == "TEL") - t = EntityTelephone; - else if (s == "TITLE") - t = EntityTitle; - else if (s == "TZ") - t = EntityTimeZone; - break; - - case 'U': - if (s == "UID") - t = EntityUID; - else if (s == "URL") - t = EntityURL; - else if (s == "URI") - t = EntityURI; - case 'V': - if (s == "VERSION") - t = EntityVersion; - break; - - case 'X': - if (s.left(2) == "X-") - t = EntityExtension; - break; - - default: - - t = EntityUnknown; - } - - return t; -} - -// The copyright notice below refers to the base64 codec functions used below, -// which are modified from the original sources. - -/* - * Original version Copyright 1988 by The Leland Stanford Junior University - * Copyright 1998 by the University of Washington - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notices appear in all copies and that both the - * above copyright notices and this permission notice appear in supporting - * documentation, and that the name of the University of Washington or The - * Leland Stanford Junior University not be used in advertising or publicity - * pertaining to distribution of the software without specific, written prior - * permission. This software is made available "as is", and - * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY - * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE, - * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND - * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF - * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY - * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER - * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF - * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - * - */ - -static char B64[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; - -// the mime base64 disctionary used for decoding -static signed char b64dec[] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 30 - -1, -1, -1,-19, -1, -1, -1,-16, -4, -4, // 40 -19 == '+' -16 == '/' - -4, -4, -4, -4, -4, -4, -4, -4, -1, -1, // 50 -4 == '0' - -1, 0, -1, -1, -1, 65, 65, 65, 65, 65, // 60 0 == '=' 65 == 'A' - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, // 70 - 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, // 80 - 65, -1, -1, -1, -1, -1, -1, 71, 71, 71, // 90 71 == 'a' - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, // 100 - 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, // 110 - 71, 71, 71, -1, -1, -1, -1, -1, -1, -1, // 120 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 130 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 140 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 150 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 160 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 170 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 180 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 190 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 200 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 210 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 220 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 230 - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 240 - -1, -1, -1, -1, -1, -1, -1 // 250 -}; - - char * -VCARD::decodeBase64(const char * s, unsigned long srcl, unsigned long & len) -{ - register unsigned char c; - register unsigned long e(0); - len = 0; - unsigned const char * src = (unsigned const char *)s; - char * ret = new char[srcl + (srcl / 4 + 1)]; - register char *d = ret; - while (srcl--) { // Critical loop - c = *src++; - int dec = b64dec[c]; - if (dec == -1) continue; - if (c == '=') { - switch (e++) { - case 3: e = 0; break; - case 2: if (*src == '=') break; - default: delete [] ret; ret = 0; return 0; break; - } - continue; - } - c -= dec; - if (e == 0) { *d = c << 2; ++e; continue; } - switch (e) { - case 1: *d |= c >> 4; *++d = c << 4; break; - case 2: *d |= c >> 2; *++d = c << 6; break; - case 3: *d++ |= c; e = 0; continue; break; - } - ++e; - } - len = d - (char *)ret; - return ret; -} - - - char * -VCARD::encodeBase64(const char * src, unsigned long srcl, unsigned long & destl) -{ - register const unsigned char *s = (unsigned char *)src; - register unsigned long i = ((srcl + 2) / 3) * 4; - destl = i += 2 * ((i / 60) + 1); - i = 0; - char * ret = new char[destl]; - register unsigned char *d((unsigned char *)ret); - while (srcl != 0) { // Critical loop - *d++ = B64[s[0] >> 2]; - *d++ = B64[((s[0] << 4) + (--srcl == 0 ? 0 : s[1] >> 4)) & 0x3f]; - *d++ = srcl == 0 ? '=' : - B64[((s[1] << 2) + (--srcl == 0 ? 0 : s[2] >> 6)) & 0x3f]; - *d++ = srcl == 0 ? '=' : B64[s[2] & 0x3f]; - if (srcl != 0) srcl--; - if (++i == 15) { i = 0; *d++ = '\r'; *d++ = '\n'; } - s += 3; - } - *d = '\r'; *++d = '\n'; *++d = '\0'; - return ret; -} - diff --git a/kabc/vcard/FloatValue.cpp b/kabc/vcard/FloatValue.cpp deleted file mode 100644 index ac1f2c6b5..000000000 --- a/kabc/vcard/FloatValue.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -FloatValue::FloatValue() - : Value() -{ -} - -FloatValue::FloatValue(float f) - : Value (), - value_ (f) -{ - parsed_ = true; -} - -FloatValue::FloatValue(const FloatValue & x) - : Value(x) -{ - value_ = x.value_; -} - -FloatValue::FloatValue(const TQCString & s) - : Value(s) -{ -} - - FloatValue & -FloatValue::operator = (FloatValue & x) -{ - if (*this == x) return *this; - - x.parse(); - value_ = x.value_; - - Value::operator = (x); - return *this; -} - - FloatValue & -FloatValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -FloatValue::operator == (FloatValue & x) -{ - x.parse(); - return (value_ == x.value_); -} - -FloatValue::~FloatValue() -{ -} - - void -FloatValue::_parse() -{ - bool negative(false); - - if (strRep_[0] == '-' || strRep_[1] == '+') { - - if (strRep_[0] == '-') - negative = true; - - strRep_.remove(0, 1); - } - - value_ = strRep_.toFloat(); - if (negative) - value_ = -value_; -} - - void -FloatValue::_assemble() -{ - strRep_ = TQCString().setNum(value_); -} - - float -FloatValue::value() -{ - parse(); - return value_; -} - - void -FloatValue::setValue(float f) -{ - parsed_ = true; - value_ = f; -} - diff --git a/kabc/vcard/GeoValue.cpp b/kabc/vcard/GeoValue.cpp deleted file mode 100644 index 2bac28c1e..000000000 --- a/kabc/vcard/GeoValue.cpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - This file is part of libvcard. - Copyright (c) 2002 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include - -#include - -#include - -using namespace VCARD; - -GeoValue::GeoValue() - : Value() -{ -} - -GeoValue::GeoValue(const GeoValue & x) - : Value(x), latitude_(x.latitude_), longitude_(x.longitude_) -{ -} - -GeoValue::GeoValue(const TQCString & s) - : Value(s) -{ -} - - GeoValue & -GeoValue::operator = (GeoValue & x) -{ - if (*this == x) return *this; - - latitude_ = x.latitude_; - longitude_ = x.longitude_; - - Value::operator = (x); - return *this; -} - - GeoValue & -GeoValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -GeoValue::operator == (GeoValue & x) -{ - x.parse(); - - if ( latitude_ != x.latitude_ ) return false; - if ( longitude_ != x.longitude_ ) return false; - - return true; -} - -GeoValue::~GeoValue() -{ -} - - GeoValue * -GeoValue::clone() -{ - return new GeoValue( *this ); -} - - void -GeoValue::_parse() -{ - int semiColon = strRep_.find( ";" ); - - if ( semiColon == -1 ) // invalid - return; - - latitude_ = strRep_.left( semiColon ).toFloat(); - longitude_ = strRep_.mid( semiColon + 1, strRep_.length() - semiColon ).toFloat(); -} - - void -GeoValue::_assemble() -{ - strRep_.sprintf( "%.6f;%.6f", latitude_, longitude_ ); -} diff --git a/kabc/vcard/ImageParam.cpp b/kabc/vcard/ImageParam.cpp deleted file mode 100644 index 69611eeab..000000000 --- a/kabc/vcard/ImageParam.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -ImageParam::ImageParam() - : Param() -{ -} - -ImageParam::ImageParam(const ImageParam & x) - : Param(x) -{ -} - -ImageParam::ImageParam(const TQCString & s) - : Param(s) -{ -} - - ImageParam & -ImageParam::operator = (ImageParam & x) -{ - if (*this == x) return *this; - - Param::operator = (x); - return *this; -} - - ImageParam & -ImageParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -ImageParam::operator == (ImageParam & x) -{ - x.parse(); - return false; -} - -ImageParam::~ImageParam() -{ -} - - void -ImageParam::_parse() -{ -} - - void -ImageParam::_assemble() -{ -} - diff --git a/kabc/vcard/ImageValue.cpp b/kabc/vcard/ImageValue.cpp deleted file mode 100644 index 5d8d29bb7..000000000 --- a/kabc/vcard/ImageValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -ImageValue::ImageValue() - : Value() -{ -} - -ImageValue::ImageValue(const ImageValue & x) - : Value(x) -{ -} - -ImageValue::ImageValue(const TQCString & s) - : Value(s) -{ -} - - ImageValue & -ImageValue::operator = (ImageValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - ImageValue & -ImageValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -ImageValue::operator == (ImageValue & x) -{ - x.parse(); - return false; -} - -ImageValue::~ImageValue() -{ -} - - void -ImageValue::_parse() -{ -} - - void -ImageValue::_assemble() -{ -} - diff --git a/kabc/vcard/ImgValue.cpp b/kabc/vcard/ImgValue.cpp deleted file mode 100644 index 42889acd8..000000000 --- a/kabc/vcard/ImgValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -ImgValue::ImgValue() - : Value() -{ -} - -ImgValue::ImgValue(const ImgValue & x) - : Value(x) -{ -} - -ImgValue::ImgValue(const TQCString & s) - : Value(s) -{ -} - - ImgValue & -ImgValue::operator = (ImgValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - ImgValue & -ImgValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -ImgValue::operator == (ImgValue & x) -{ - x.parse(); - return false; -} - -ImgValue::~ImgValue() -{ -} - - void -ImgValue::_parse() -{ -} - - void -ImgValue::_assemble() -{ -} - diff --git a/kabc/vcard/LangValue.cpp b/kabc/vcard/LangValue.cpp deleted file mode 100644 index f7e5a759e..000000000 --- a/kabc/vcard/LangValue.cpp +++ /dev/null @@ -1,127 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -#include - -using namespace VCARD; - -LangValue::LangValue() - : Value() -{ -} - -LangValue::LangValue(const LangValue & x) - : Value(x) -{ -} - -LangValue::LangValue(const TQCString & s) - : Value(s) -{ -} - - LangValue & -LangValue::operator = (LangValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - LangValue & -LangValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -LangValue::operator == (LangValue & x) -{ - x.parse(); - return false; -} - -LangValue::~LangValue() -{ -} - - void -LangValue::_parse() -{ - TQStrList l; - RTokenise(strRep_, "-", l); - - if (l.count() == 0) return; - - primary_ = l.at(0); - - l.remove(0u); - - subtags_ = l; -} - - void -LangValue::_assemble() -{ - strRep_ = primary_; - - TQStrListIterator it(subtags_); - - for (; it.current(); ++it) - strRep_ += TQCString('-') + it.current(); -} - - TQCString -LangValue::primary() -{ - parse(); - return primary_; -} - - TQStrList -LangValue::subtags() -{ - parse(); - return subtags_; -} - - void -LangValue::setPrimary(const TQCString & s) -{ - parse(); - primary_ = s; -} - - void -LangValue::setSubTags(const TQStrList & l) -{ - parse(); - subtags_ = l; -} - diff --git a/kabc/vcard/Makefile.am b/kabc/vcard/Makefile.am deleted file mode 100644 index e8a33c3a9..000000000 --- a/kabc/vcard/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -INCLUDES = \ - -I$(srcdir)/include \ - -I$(srcdir)/include/generated \ - $(all_includes) - -### KDE 4.0: either make noinst or rename to something like libkvcard -lib_LTLIBRARIES = libvcard.la - -libvcard_la_SOURCES = vCard-all.cpp -libvcard_la_LDFLAGS = $(all_libraries) -libvcard_la_LIBADD = $(LIB_TDECORE) $(LIB_QT) - -check_PROGRAMS = testwrite testread - -testwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testwrite_LDADD = libvcard.la -testwrite_SOURCES = testwrite.cpp - -testread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testread_LDADD = libvcard.la -testread_SOURCES = testread.cpp diff --git a/kabc/vcard/NValue.cpp b/kabc/vcard/NValue.cpp deleted file mode 100644 index e63268134..000000000 --- a/kabc/vcard/NValue.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include -#include -#include -#include - -using namespace VCARD; - -NValue::NValue() - : Value() -{ - vDebug("ctor"); -} - -NValue::NValue(const NValue & x) - : Value(x), - family_ (x.family_), - given_ (x.given_), - middle_ (x.middle_), - prefix_ (x.prefix_), - suffix_ (x.suffix_) -{ -} - -NValue::NValue(const TQCString & s) - : Value(s) -{ - vDebug("ctor"); -} - - NValue & -NValue::operator = (NValue & x) -{ - if (*this == x) return *this; - - family_ = x.family_; - given_ = x.given_; - middle_ = x.middle_; - prefix_ = x.prefix_; - suffix_ = x.suffix_; - - Value::operator = (x); - return *this; -} - - NValue & -NValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -NValue::operator == (NValue & x) -{ - x.parse(); - - return ( - family_ == x.family_ && - given_ == x.given_ && - middle_ == x.middle_ && - prefix_ == x.prefix_ && - suffix_ == x.suffix_); -} - -NValue::~NValue() -{ -} - - NValue * -NValue::clone() -{ - return new NValue( *this ); -} - - void -NValue::_parse() -{ - TQStrList l; - RTokenise(strRep_, ";", l); - - for (unsigned int i = 0; i < l.count(); i++) { - - switch (i) { - case 0: family_ = l.at(0); break; - case 1: given_ = l.at(1); break; - case 2: middle_ = l.at(2); break; - case 3: prefix_ = l.at(3); break; - case 4: suffix_ = l.at(4); break; - default: break; - } - } -} - - void -NValue::_assemble() -{ - strRep_ = family_; - strRep_ += ";" + given_; - strRep_ += ";" + middle_; - strRep_ += ";" + prefix_; - strRep_ += ";" + suffix_; -} - diff --git a/kabc/vcard/OrgValue.cpp b/kabc/vcard/OrgValue.cpp deleted file mode 100644 index 94ca18243..000000000 --- a/kabc/vcard/OrgValue.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -#include - -using namespace VCARD; - -OrgValue::OrgValue() - : Value() -{ -} - -OrgValue::OrgValue(const OrgValue & x) - : Value(x) -{ -} - -OrgValue::OrgValue(const TQCString & s) - : Value(s) -{ -} - - OrgValue & -OrgValue::operator = (OrgValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - OrgValue & -OrgValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -OrgValue::operator == (OrgValue & x) -{ - x.parse(); - return false; -} - -OrgValue::~OrgValue() -{ -} - - void -OrgValue::_parse() -{ - RTokenise(strRep_, ";", valueList_); -} - - void -OrgValue::_assemble() -{ - bool first(true); - - TQStrListIterator it(valueList_); - - for (; it.current(); ++it) { - if (!first) strRep_ += ';'; - strRep_ += it.current(); - first = false; - } -} - - unsigned int -OrgValue::numValues() -{ - parse(); - return valueList_.count(); -} - - TQCString -OrgValue::value(unsigned int i) -{ - parse(); - return valueList_.at(i); -} - diff --git a/kabc/vcard/Param.cpp b/kabc/vcard/Param.cpp deleted file mode 100644 index 8c5ad9e2c..000000000 --- a/kabc/vcard/Param.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -#include - -using namespace VCARD; - -Param::Param() - : Entity(), - name_(""), - value_("") -{ -} - -Param::Param(const Param & x) - : Entity(x), - name_(x.name_), - value_(x.value_) -{ -} - -Param::Param(const TQCString & s) - : Entity(s), - name_(""), - value_("") -{ -} - - Param & -Param::operator = (Param & x) -{ - if (*this == x) return *this; - - Entity::operator = (x); - name_ = x.name_; - value_ = x.value_; - - return *this; -} - - Param & -Param::operator = (const TQCString & s) -{ - Entity::operator = (s); - return *this; -} - - bool -Param::operator == (Param & x) -{ - x.parse(); - return false; -} - -Param::~Param() -{ -} - - void -Param::_parse() -{ -} - - void -Param::_assemble() -{ - strRep_ = name_ + "=" + value_; -} - -Param::Param(const TQCString &name, const TQCString &value) - : Entity(), - name_(name), - value_(value) -{ - parsed_ = true; - assembled_ = false; -} - - void -Param::setName(const TQCString & name) -{ - name_ = name; - - assembled_ = false; -} - - void -Param::setValue(const TQCString & value) -{ - value_ = value; - - assembled_ = false; -} - - TQCString -Param::name() -{ - return name_; -} - - TQCString -Param::value() -{ - return value_; -} diff --git a/kabc/vcard/PhoneNumberValue.cpp b/kabc/vcard/PhoneNumberValue.cpp deleted file mode 100644 index 02a1266fe..000000000 --- a/kabc/vcard/PhoneNumberValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -PhoneNumberValue::PhoneNumberValue() - : Value() -{ -} - -PhoneNumberValue::PhoneNumberValue(const PhoneNumberValue & x) - : Value(x) -{ -} - -PhoneNumberValue::PhoneNumberValue(const TQCString & s) - : Value(s) -{ -} - - PhoneNumberValue & -PhoneNumberValue::operator = (PhoneNumberValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - PhoneNumberValue & -PhoneNumberValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -PhoneNumberValue::operator == (PhoneNumberValue & x) -{ - x.parse(); - return false; -} - -PhoneNumberValue::~PhoneNumberValue() -{ -} - - void -PhoneNumberValue::_parse() -{ -} - - void -PhoneNumberValue::_assemble() -{ -} - diff --git a/kabc/vcard/README b/kabc/vcard/README deleted file mode 100644 index 18a9daf4a..000000000 --- a/kabc/vcard/README +++ /dev/null @@ -1,15 +0,0 @@ -libvcard (C) 1999 Rik Hemsley -Written for the KDE project. - -This software is licensed under the MIT license. - -A vCard 3.0 parser based on the same principles that librmm (from Empath) uses. - -It's small and very fast due to parsing and assembly of object being lazy. - -There is a base64 codec declared in Enum.h - -Feedback welcome. - -Rik - diff --git a/kabc/vcard/RToken.cpp b/kabc/vcard/RToken.cpp deleted file mode 100644 index 582a9e1c7..000000000 --- a/kabc/vcard/RToken.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* - - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include -#include -#include -#include - -namespace VCARD -{ - - TQ_UINT32 -RTokenise(const char * str, const char * delim, TQStrList & l) -{ - // FIXME no stderr ! - l.clear(); - - if (!delim || !str || strlen(delim) == 0 || strlen(str) == 0) return 0; - - char * len = (char *)(str + strlen(str)); // End of string. - - register char * rstart = new char[strlen(str) + 1]; - register char * r = rstart; - - - register const char * i = str; // Cursor. - - while (i <= len) { - - if (*i == '\\') { // Escaped chars go straight through. - *r++ = *i++; - if (i <= len) - *r++ = *i++; - continue; - } - - if (strchr(delim, *i) != 0) { - // We hit a delimiter. If we have some text, make a new token. - // This has the effect that multiple delimiters are collapsed. - // cs: We mustn't collapse multiple delimiters, otherwise we - // lose empty fields. - *r = '\0'; -// if (r != rstart) { - l.append(rstart); -// } - r = rstart; - ++i; - continue; - } - - *r++ = *i++; - } - - // Catch last token -// if (r != rstart) { - *r = '\0'; - l.append(rstart); -// } - - r = 0; - - delete [] rstart; - - return l.count(); -} - -} diff --git a/kabc/vcard/SoundValue.cpp b/kabc/vcard/SoundValue.cpp deleted file mode 100644 index 5be75d358..000000000 --- a/kabc/vcard/SoundValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -SoundValue::SoundValue() - : Value() -{ -} - -SoundValue::SoundValue(const SoundValue & x) - : Value(x) -{ -} - -SoundValue::SoundValue(const TQCString & s) - : Value(s) -{ -} - - SoundValue & -SoundValue::operator = (SoundValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - SoundValue & -SoundValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -SoundValue::operator == (SoundValue & x) -{ - x.parse(); - return false; -} - -SoundValue::~SoundValue() -{ -} - - void -SoundValue::_parse() -{ -} - - void -SoundValue::_assemble() -{ -} - diff --git a/kabc/vcard/SourceParam.cpp b/kabc/vcard/SourceParam.cpp deleted file mode 100644 index 6a0e772ac..000000000 --- a/kabc/vcard/SourceParam.cpp +++ /dev/null @@ -1,112 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -SourceParam::SourceParam() - : Param(), - type_(SourceParam::TypeUnknown) -{ -} - -SourceParam::SourceParam(const SourceParam & x) - : Param(x), - type_ (x.type_), - par_ (x.par_), - val_ (x.val_) -{ -} - -SourceParam::SourceParam(const TQCString & s) - : Param(s), - type_(SourceParam::TypeUnknown) -{ -} - - SourceParam & -SourceParam::operator = (SourceParam & x) -{ - if (*this == x) return *this; - type_ = x.type(); - par_ = x.par(); - val_ = x.val(); - - Param::operator = (x); - return *this; -} - - SourceParam & -SourceParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -SourceParam::operator == (SourceParam & x) -{ - x.parse(); - return false; -} - -SourceParam::~SourceParam() -{ -} - - void -SourceParam::_parse() -{ - int i = strRep_.find('='); - if (i == -1) // Invalid - return; - - par_ = strRep_.left(i); - val_ = strRep_.right(strRep_.length() - i - 1); - - if (tqstricmp(par_, "VALUE") == 0 && tqstricmp(val_, "uri") == 0) - type_ = TypeValue; - else if (tqstricmp(par_, "CONTEXT") == 0 && tqstricmp(val_, "word") == 0) - type_ = TypeContext; - else if (tqstrnicmp(par_, "X-", 2) == 0) { - type_ = TypeX; - } - else type_ = TypeUnknown; - -} - - void -SourceParam::_assemble() -{ - if (type_ == TypeValue) - strRep_ = "VALUE=uri"; - else if (type_ == TypeContext) - strRep_ = "CONTEXT=word"; - else if (type_ == TypeX) - strRep_ = par_ + "=" + val_; - else strRep_ = ""; -} - diff --git a/kabc/vcard/TelParam.cpp b/kabc/vcard/TelParam.cpp deleted file mode 100644 index 072b1dc81..000000000 --- a/kabc/vcard/TelParam.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -TelParam::TelParam() - : Param() -{ -} - -TelParam::TelParam(const TelParam & x) - : Param(x) -{ -} - -TelParam::TelParam(const TQCString & s) - : Param(s) -{ -} - - TelParam & -TelParam::operator = (TelParam & x) -{ - if (*this == x) return *this; - - Param::operator = (x); - return *this; -} - - TelParam & -TelParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -TelParam::operator == (TelParam & x) -{ - x.parse(); - return false; -} - -TelParam::~TelParam() -{ -} - - void -TelParam::_parse() -{ -} - - void -TelParam::_assemble() -{ -} - diff --git a/kabc/vcard/TelValue.cpp b/kabc/vcard/TelValue.cpp deleted file mode 100644 index c9c1b85aa..000000000 --- a/kabc/vcard/TelValue.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -TelValue::TelValue() - : Value() -{ -} - -TelValue::TelValue(const TelValue & x) - : Value(x) -{ -} - -TelValue::TelValue(const TQCString & s) - : Value(s) -{ -} - - TelValue & -TelValue::operator = (TelValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - TelValue & -TelValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -TelValue::operator == (TelValue & x) -{ - x.parse(); - return false; -} - -TelValue::~TelValue() -{ -} - - void -TelValue::_parse() -{ -} - - void -TelValue::_assemble() -{ -} - diff --git a/kabc/vcard/TextBinParam.cpp b/kabc/vcard/TextBinParam.cpp deleted file mode 100644 index 4e0ebadff..000000000 --- a/kabc/vcard/TextBinParam.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -TextBinParam::TextBinParam() - : Param() -{ -} - -TextBinParam::TextBinParam(const TextBinParam & x) - : Param(x) -{ -} - -TextBinParam::TextBinParam(const TQCString & s) - : Param(s) -{ -} - - TextBinParam & -TextBinParam::operator = (TextBinParam & x) -{ - if (*this == x) return *this; - - Param::operator = (x); - return *this; -} - - TextBinParam & -TextBinParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -TextBinParam::operator == (TextBinParam & x) -{ - x.parse(); - return false; -} - -TextBinParam::~TextBinParam() -{ -} - - void -TextBinParam::_parse() -{ -} - - void -TextBinParam::_assemble() -{ -} - diff --git a/kabc/vcard/TextBinValue.cpp b/kabc/vcard/TextBinValue.cpp deleted file mode 100644 index e7da0b7c6..000000000 --- a/kabc/vcard/TextBinValue.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include -#include - -using namespace VCARD; - -TextBinValue::TextBinValue() - : Value() -{ -} - -TextBinValue::TextBinValue(const TextBinValue & x) - : Value(x) -{ - mIsBinary_ = x.mIsBinary_; - mData_ = x.mData_; - mUrl_ = x.mUrl_; -} - -TextBinValue::TextBinValue(const TQCString & s) - : Value(s) -{ -} - - TextBinValue & -TextBinValue::operator = (TextBinValue & x) -{ - if (*this == x) return *this; - - mIsBinary_ = x.mIsBinary_; - mData_ = x.mData_; - mUrl_ = x.mUrl_; - - Value::operator = (x); - return *this; -} - - TextBinValue & -TextBinValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -TextBinValue::operator == (TextBinValue & x) -{ - x.parse(); - - if ( mIsBinary_ != x.mIsBinary_ ) return false; - if ( mData_ != x.mData_ ) return false; - if ( mUrl_ != x.mUrl_ ) return false; - - return true; -} - -TextBinValue::~TextBinValue() -{ -} - - TextBinValue * -TextBinValue::clone() -{ - return new TextBinValue( *this ); -} - - void -TextBinValue::_parse() -{ -} - - void -TextBinValue::_assemble() -{ - if ( mIsBinary_ ) { - strRep_ = KCodecs::base64Encode( mData_ ); - } else - strRep_ = mUrl_.utf8(); -} - diff --git a/kabc/vcard/TextListValue.cpp b/kabc/vcard/TextListValue.cpp deleted file mode 100644 index 2bec2e181..000000000 --- a/kabc/vcard/TextListValue.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -#include - -using namespace VCARD; - -TextListValue::TextListValue() - : Value() -{ -} - -TextListValue::TextListValue(const TextListValue & x) - : Value(x) -{ -} - -TextListValue::TextListValue(const TQCString & s) - : Value(s) -{ -} - - TextListValue & -TextListValue::operator = (TextListValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - TextListValue & -TextListValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -TextListValue::operator == (TextListValue & x) -{ - x.parse(); - return false; -} - -TextListValue::~TextListValue() -{ -} - - void -TextListValue::_parse() -{ - RTokenise(strRep_, ";", valueList_); -} - - void -TextListValue::_assemble() -{ - bool first(true); - - TQStrListIterator it(valueList_); - - for (; it.current(); ++it) { - if (!first) strRep_ += ';'; - strRep_ += it.current(); - first = false; - } -} - - unsigned int -TextListValue::numValues() -{ - parse(); - return valueList_.count(); -} - - TQCString -TextListValue::value(unsigned int i) -{ - parse(); - return valueList_.at(i); -} - diff --git a/kabc/vcard/TextParam.cpp b/kabc/vcard/TextParam.cpp deleted file mode 100644 index b353483ec..000000000 --- a/kabc/vcard/TextParam.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -TextParam::TextParam() - : Param() -{ -} - -TextParam::TextParam(const TextParam & x) - : Param(x) -{ -} - -TextParam::TextParam(const TQCString & s) - : Param(s) -{ -} - - TextParam & -TextParam::operator = (TextParam & x) -{ - if (*this == x) return *this; - - Param::operator = (x); - return *this; -} - - TextParam & -TextParam::operator = (const TQCString & s) -{ - Param::operator = (s); - return *this; -} - - bool -TextParam::operator == (TextParam & x) -{ - x.parse(); - - return false; -} - -TextParam::~TextParam() -{ -} - - void -TextParam::_parse() -{ -} - - void -TextParam::_assemble() -{ -} - diff --git a/kabc/vcard/TextValue.cpp b/kabc/vcard/TextValue.cpp deleted file mode 100644 index cf8e0673f..000000000 --- a/kabc/vcard/TextValue.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -TextValue::TextValue() - : Value() -{ -} - -TextValue::TextValue(const TextValue & x) - : Value(x) -{ -} - -TextValue::TextValue(const TQCString & s) - : Value(s) -{ -} - - TextValue & -TextValue::operator = (TextValue & x) -{ - if (*this == x) return *this; - - Value::operator = (x); - return *this; -} - - TextValue & -TextValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -TextValue::operator == (TextValue & x) -{ - return strRep_ == x.strRep_; -} - -TextValue::~TextValue() -{ -} - - TextValue * -TextValue::clone() -{ - return new TextValue( *this ); -} - - void -TextValue::_parse() -{ -} - - void -TextValue::_assemble() -{ -} - diff --git a/kabc/vcard/URIValue.cpp b/kabc/vcard/URIValue.cpp deleted file mode 100644 index bba8db0fa..000000000 --- a/kabc/vcard/URIValue.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -URIValue::URIValue() - : Value() -{ -} - -URIValue::URIValue(const TQCString & scheme, const TQCString & schemeSpecificPart) - : Value(), - scheme_ (scheme), - schemeSpecificPart_ (schemeSpecificPart) -{ - parsed_ = true; -} - -URIValue::URIValue(const URIValue & x) - : Value (x), - scheme_ (x.scheme_), - schemeSpecificPart_ (x.schemeSpecificPart_) -{ -} - -URIValue::URIValue(const TQCString & s) - : Value(s) -{ -} - - URIValue & -URIValue::operator = (URIValue & x) -{ - if (*this == x) return *this; - - scheme_ = x.scheme_; - schemeSpecificPart_ = x.schemeSpecificPart_; - - Value::operator = (x); - return *this; -} - - URIValue & -URIValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -URIValue::operator == (URIValue & x) -{ - x.parse(); - return ( - (scheme_ == x.scheme_) && - (schemeSpecificPart_ == x.schemeSpecificPart_)); - - return false; -} - -URIValue::~URIValue() -{ -} - - void -URIValue::_parse() -{ - int split = strRep_.find(':'); - if (split == -1) - return; - - scheme_ = strRep_.left(split); - schemeSpecificPart_ = strRep_.mid(split + 1); -} - - void -URIValue::_assemble() -{ - strRep_ = scheme_ + ':' + schemeSpecificPart_; -} - - TQCString -URIValue::scheme() -{ - parse(); - return scheme_; -} - - TQCString -URIValue::schemeSpecificPart() -{ - parse(); - return schemeSpecificPart_; -} - - void -URIValue::setScheme(const TQCString & s) -{ - parse(); - scheme_ = s; -} - - void -URIValue::setSchemeSpecificPart(const TQCString & s) -{ - parse(); - schemeSpecificPart_ = s; -} - diff --git a/kabc/vcard/UTCValue.cpp b/kabc/vcard/UTCValue.cpp deleted file mode 100644 index 30473661f..000000000 --- a/kabc/vcard/UTCValue.cpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include - -using namespace VCARD; - -UTCValue::UTCValue() - : Value() -{ -} - -UTCValue::UTCValue(const UTCValue & x) - : Value(x), positive_(x.positive_), hour_(x.hour_), minute_(x.minute_) - -{ -} - -UTCValue::UTCValue(const TQCString & s) - : Value(s) -{ -} - - UTCValue & -UTCValue::operator = (UTCValue & x) -{ - if (*this == x) return *this; - - positive_ = x.positive_; - hour_ = x.hour_; - minute_ = x.minute_; - - Value::operator = (x); - return *this; -} - - UTCValue & -UTCValue::operator = (const TQCString & s) -{ - Value::operator = (s); - return *this; -} - - bool -UTCValue::operator == (UTCValue & x) -{ - x.parse(); - - if (positive_ != x.positive_) return false; - if (hour_ != x.hour_) return false; - if (minute_ != x.minute_) return false; - - return true; -} - -UTCValue::~UTCValue() -{ -} - - UTCValue * -UTCValue::clone() -{ - return new UTCValue( *this ); -} - - void -UTCValue::_parse() -{ - if ( strRep_.isEmpty() ) - return; - - positive_ = ( strRep_[0] == '+' ); - - int colon = strRep_.find( ':' ); - - if ( colon == -1 ) // Not valid. - return; - - hour_ = strRep_.mid( 1, 2 ).toInt(); - minute_ = strRep_.right( 2 ).toInt(); -} - - void -UTCValue::_assemble() -{ - strRep_.sprintf( "%c%.2i:%.2i", (positive_ ? '+' : '-'), hour_, minute_ ); -} - diff --git a/kabc/vcard/VCard.cpp b/kabc/vcard/VCard.cpp deleted file mode 100644 index eb3f57f6e..000000000 --- a/kabc/vcard/VCard.cpp +++ /dev/null @@ -1,283 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include -#include - -#include -#include -#include -#include - -#include - -using namespace VCARD; - -VCard::VCard() - : Entity() -{ - contentLineList_.setAutoDelete( true ); -} - -VCard::VCard(const VCard & x) - : Entity(x), - group_(x.group_), - contentLineList_(x.contentLineList_) -{ -} - -VCard::VCard(const TQCString & s) - : Entity(s) -{ -} - - VCard & -VCard::operator = (VCard & x) -{ - if (*this == x) return *this; - - group_ = x.group(); - contentLineList_ = x.contentLineList_; - - Entity::operator = (x); - return *this; -} - - VCard & -VCard::operator = (const TQCString & s) -{ - Entity::operator = (s); - return *this; -} - - bool -VCard::operator == (VCard & x) -{ - x.parse(); - return false; -} - -VCard::~VCard() -{ -} - - void -VCard::_parse() -{ - vDebug("parse() called"); - TQStrList l; - - RTokenise(strRep_, "\r\n", l); - - if (l.count() < 3) { // Invalid VCARD ! - vDebug("Invalid vcard"); - return; - } - - // Get the first line - TQCString beginLine = TQCString(l.at(0)).stripWhiteSpace(); - - vDebug("Begin line == \"" + beginLine + "\""); - - // Remove extra blank lines - while (TQCString(l.last()).isEmpty()) - l.remove(l.last()); - - // Now we know this is the last line - TQCString endLine = l.last(); - - // Trash the first and last lines as we have seen them. - l.remove(0u); - l.remove(l.last()); - - /////////////////////////////////////////////////////////////// - // FIRST LINE - - int split = beginLine.find(':'); - - if (split == -1) { // invalid, no BEGIN - vDebug("No split"); - return; - } - - TQCString firstPart(beginLine.left(split)); - TQCString valuePart(beginLine.mid(split + 1)); - - split = firstPart.find('.'); - - if (split != -1) { - group_ = firstPart.left(split); - firstPart = firstPart.right(firstPart.length() - split - 1); - } - - if (tqstrnicmp(firstPart, "BEGIN", 5) != 0) { // No BEGIN ! - vDebug("No BEGIN"); - return; - } - - if (tqstrnicmp(valuePart, "VCARD", 5) != 0) { // Not a vcard ! - vDebug("No VCARD"); - return; - } - - /////////////////////////////////////////////////////////////// - // CONTENT LINES - // - vDebug("Content lines"); - - // Handle folded lines. - - TQStrList refolded; - - TQStrListIterator it(l); - - TQCString cur; - - for (; it.current(); ++it) { - - cur = it.current(); - - ++it; - - while ( - it.current() && - it.current()[0] == ' ' && - strlen(it.current()) != 1) - { - cur += it.current() + 1; - ++it; - } - - --it; - - refolded.append(cur); - } - - TQStrListIterator it2(refolded); - - for (; it2.current(); ++it2) { - - vDebug("New contentline using \"" + TQCString(it2.current()) + "\""); - ContentLine * cl = new ContentLine(it2.current()); - - cl->parse(); - - contentLineList_.append(cl); - } - - /////////////////////////////////////////////////////////////// - // LAST LINE - - split = endLine.find(':'); - - if (split == -1) // invalid, no END - return; - - firstPart = endLine.left(split); - valuePart = endLine.right(firstPart.length() - split - 1); - - split = firstPart.find('.'); - - if (split != -1) { - group_ = firstPart.left(split); - firstPart = firstPart.right(firstPart.length() - split - 1); - } - - if (tqstricmp(firstPart, "END") != 0) // No END ! - return; - - if (tqstricmp(valuePart, "VCARD") != 0) // Not a vcard ! - return; -} - - void -VCard::_assemble() -{ - vDebug("Assembling vcard"); - strRep_ = "BEGIN:VCARD\r\n"; - strRep_ += "VERSION:3.0\r\n"; - - TQPtrListIterator it(contentLineList_); - - for (; it.current(); ++it) - strRep_ += it.current()->asString() + "\r\n"; - - strRep_ += "END:VCARD\r\n"; -} - - bool -VCard::has(EntityType t) -{ - parse(); - return contentLine(t) == 0 ? false : true; -} - - bool -VCard::has(const TQCString & s) -{ - parse(); - return contentLine(s) == 0 ? false : true; -} - - void -VCard::add(const ContentLine & cl) -{ - parse(); - ContentLine * c = new ContentLine(cl); - contentLineList_.append(c); -} - - void -VCard::add(const TQCString & s) -{ - parse(); - ContentLine * c = new ContentLine(s); - contentLineList_.append(c); -} - - ContentLine * -VCard::contentLine(EntityType t) -{ - parse(); - TQPtrListIterator it(contentLineList_); - - for (; it.current(); ++it) - if (it.current()->entityType() == t) - return it.current(); - - return 0; -} - - ContentLine * -VCard::contentLine(const TQCString & s) -{ - parse(); - TQPtrListIterator it(contentLineList_); - - for (; it.current(); ++it) - if (it.current()->entityType() == EntityNameToEntityType(s)) - return it.current(); - - return 0; -} - diff --git a/kabc/vcard/VCardEntity.cpp b/kabc/vcard/VCardEntity.cpp deleted file mode 100644 index 1f8cea5b1..000000000 --- a/kabc/vcard/VCardEntity.cpp +++ /dev/null @@ -1,119 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include - -#include -#include - -using namespace VCARD; - -VCardEntity::VCardEntity() - : Entity() -{ -} - -VCardEntity::VCardEntity(const VCardEntity & x) - : Entity(x) -{ -} - -VCardEntity::VCardEntity(const TQCString & s) - : Entity(s) -{ -} - - VCardEntity & -VCardEntity::operator = (VCardEntity & x) -{ - if (*this == x) return *this; - - Entity::operator = (x); - return *this; -} - - VCardEntity & -VCardEntity::operator = (const TQCString & s) -{ - Entity::operator = (s); - return *this; -} - - bool -VCardEntity::operator == (VCardEntity & x) -{ - x.parse(); - return false; -} - -VCardEntity::~VCardEntity() -{ -} - - void -VCardEntity::_parse() -{ - vDebug("parse"); - TQCString s(strRep_); - - int i = s.find(TQRegExp("BEGIN:VCARD", false)); - - while (i != -1) { - - i = s.find(TQRegExp("BEGIN:VCARD", false), 11); - - TQCString cardStr(s.left(i)); - - VCard * v = new VCard(cardStr); - - cardList_.append(v); - - v->parse(); - - s.remove(0, i); - } -} - - void -VCardEntity::_assemble() -{ - VCardListIterator it(cardList_); - - for (; it.current(); ++it) - strRep_ += it.current()->asString() + "\r\n"; // One CRLF for luck. -} - - VCardList & -VCardEntity::cardList() -{ - parse(); - return cardList_; -} - - void -VCardEntity::setCardList(const VCardList & l) -{ - parse(); - cardList_ = l; -} - diff --git a/kabc/vcard/Value.cpp b/kabc/vcard/Value.cpp deleted file mode 100644 index c95c0712b..000000000 --- a/kabc/vcard/Value.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#include -#include - -using namespace VCARD; - -Value::Value() - : Entity() -{ -} - -Value::Value(const Value & x) - : Entity(x) -{ -} - -Value::Value(const TQCString & s) - : Entity(s) -{ -} - - Value & -Value::operator = (Value & x) -{ - if (*this == x) return *this; - - Entity::operator = (x); - return *this; -} - - Value & -Value::operator = (const TQCString & s) -{ - Entity::operator = (s); - return *this; -} - - bool -Value::operator == (Value & x) -{ - x.parse(); - return false; -} - -Value::~Value() -{ -} - - void -Value::_parse() -{ -} - - void -Value::_assemble() -{ - vDebug("Value::_assemble()"); -} - diff --git a/kabc/vcard/include/VCard.h b/kabc/vcard/include/VCard.h deleted file mode 100644 index 17b50e8f2..000000000 --- a/kabc/vcard/include/VCard.h +++ /dev/null @@ -1,43 +0,0 @@ -#ifndef VCARD_H -#define VCARD_H - -#include "VCardAdrParam.h" -#include "VCardAdrValue.h" -#include "VCardAgentParam.h" -#include "VCardAgentValue.h" -#include "VCardClassValue.h" -#include "VCardContentLine.h" -#include "VCardDateParam.h" -#include "VCardDateValue.h" -#include "VCardDefines.h" -#include "VCardEmailParam.h" -#include "VCardEntity.h" -#include "VCardEnum.h" -#include "VCardFloatValue.h" -#include "VCardGeoValue.h" -#include "VCardGroup.h" -#include "VCardImageParam.h" -#include "VCardImageValue.h" -#include "VCardImgValue.h" -#include "VCardLangValue.h" -#include "VCardNValue.h" -#include "VCardOrgValue.h" -#include "VCardParam.h" -#include "VCardPhoneNumberValue.h" -#include "VCardRToken.h" -#include "VCardSoundValue.h" -#include "VCardSourceParam.h" -#include "VCardTelParam.h" -#include "VCardTelValue.h" -#include "VCardTextBinParam.h" -#include "VCardTextBinValue.h" -#include "VCardTextListValue.h" -#include "VCardTextParam.h" -#include "VCardTextValue.h" -#include "VCardURIValue.h" -#include "VCardUTCValue.h" -#include "VCardVCard.h" -#include "VCardVCardEntity.h" -#include "VCardValue.h" - -#endif diff --git a/kabc/vcard/include/VCardAdrParam.h b/kabc/vcard/include/VCardAdrParam.h deleted file mode 100644 index d40165f4a..000000000 --- a/kabc/vcard/include/VCardAdrParam.h +++ /dev/null @@ -1,64 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef ADRPARAM_H -#define ADRPARAM_H - -#include -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT AdrParam : public Param -{ - -#include "AdrParam-generated.h" - - TQStrList adrTypeList() - { parse(); return adrTypeList_; } - - TQCString textParam() - { parse(); return textParam_; } - - void setAdrTypeList(const TQStrList & l) - { adrTypeList_ = l; assembled_ = false; } - - void setTextParam(const TQCString & s) - { textParam_ = s; assembled_ = false; } - - enum AdrType { - AdrDom, AdrIntl, AdrPostal, AdrParcel, AdrHome, AdrWork, AdrPref, - AdrIANA, AdrX - }; - - private: - - TQStrList adrTypeList_; - TQCString textParam_; -}; -} - -#endif diff --git a/kabc/vcard/include/VCardAdrValue.h b/kabc/vcard/include/VCardAdrValue.h deleted file mode 100644 index 94ed93aee..000000000 --- a/kabc/vcard/include/VCardAdrValue.h +++ /dev/null @@ -1,83 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef ADRVALUE_H -#define ADRVALUE_H - -#include -#include - -namespace VCARD -{ - -class KVCARD_EXPORT AdrValue : public Value -{ - -#include "AdrValue-generated.h" - - AdrValue *clone(); - - void setPOBox(const TQCString & s) - { poBox_ = s; assembled_ = false; } - - void setExtAddress(const TQCString & s) - { extAddress_ = s; assembled_ = false; } - - void setStreet(const TQCString & s) - { street_ = s; assembled_ = false; } - - void setLocality(const TQCString & s) - { locality_ = s; assembled_ = false; } - - void setRegion(const TQCString & s) - { region_ = s; assembled_ = false; } - - void setPostCode(const TQCString & s) - { postCode_ = s; assembled_ = false; } - - void setCountryName(const TQCString & s) - { countryName_ = s; assembled_ = false; } - - TQCString poBox() { parse(); return poBox_; } - TQCString extAddress() { parse(); return extAddress_; } - TQCString street() { parse(); return street_; } - TQCString locality() { parse(); return locality_; } - TQCString region() { parse(); return region_; } - TQCString postCode() { parse(); return postCode_; } - TQCString countryName() { parse(); return countryName_; } - - private: - - TQCString poBox_; - TQCString extAddress_; - TQCString street_; - TQCString locality_; - TQCString region_; - TQCString postCode_; - TQCString countryName_; -}; - -} - -#endif - diff --git a/kabc/vcard/include/VCardAgentParam.h b/kabc/vcard/include/VCardAgentParam.h deleted file mode 100644 index 90c3bd528..000000000 --- a/kabc/vcard/include/VCardAgentParam.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef AGENTPARAM_H -#define AGENTPARAM_H - -#include - -#include -#include - -namespace VCARD -{ - -class KVCARD_EXPORT AgentParam : public Param -{ - -#include "AgentParam-generated.h" - - bool refer() - { parse(); return refer_; } - - URIValue uri() - { parse(); return uri_; } - - void setRefer(bool b) - { refer_ = b; assembled_ = false; } - - void setURI(const TQCString & s) - { uri_ = s; assembled_ = false; } - - private: - - bool refer_; - URIValue uri_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardAgentValue.h b/kabc/vcard/include/VCardAgentValue.h deleted file mode 100644 index dd68145c9..000000000 --- a/kabc/vcard/include/VCardAgentValue.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef AGENTVALUE_H -#define AGENTVALUE_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT AgentValue : public Value -{ - -#include "AgentValue-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardClassValue.h b/kabc/vcard/include/VCardClassValue.h deleted file mode 100644 index 5de79167b..000000000 --- a/kabc/vcard/include/VCardClassValue.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef CLASSVALUE_H -#define CLASSVALUE_H - -#include - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT ClassValue : public Value -{ - -#include "ClassValue-generated.h" - - enum ClassType { - Public, Private, Confidential, Other - }; - - ClassValue *clone(); - - void setType( int type ) { classType_ = type; assembled_ = false; parsed_ = true; } - int type() { parse(); return classType_; } - - private: - int classType_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardContentLine.h b/kabc/vcard/include/VCardContentLine.h deleted file mode 100644 index ea59444a0..000000000 --- a/kabc/vcard/include/VCardContentLine.h +++ /dev/null @@ -1,77 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef CONTENTLINE_H -#define CONTENTLINE_H - -#include - -#include "VCardEnum.h" -#include "VCardEntity.h" -#include "VCardParam.h" -#include "VCardValue.h" - -namespace VCARD -{ - -class KVCARD_EXPORT ContentLine : public Entity -{ - -#include "ContentLine-generated.h" - - TQCString group() { parse(); return group_; } - TQCString name() { parse(); return name_; } - Value * value() { parse(); return value_; } - ParamList paramList() { parse(); return paramList_; } - ParamType paramType() { parse(); return paramType_; } - ValueType valueType() { parse(); return valueType_; } - EntityType entityType() { parse(); return entityType_; } - - void setGroup (const TQCString & s) - { group_ = s; assembled_ = false; } - - void setName (const TQCString & s) - { name_ = s; assembled_ = false; } - - void setValue (Value *s) - { value_ = s; assembled_ = false; } - - void setParamList (const ParamList & l) - { paramList_ = l; assembled_ = false; } - - void clear (); - - private: - - TQCString group_; - TQCString name_; - TQPtrList paramList_; - Value * value_; - - ParamType paramType_; - ValueType valueType_; - EntityType entityType_; -}; -} - -#endif diff --git a/kabc/vcard/include/VCardDateParam.h b/kabc/vcard/include/VCardDateParam.h deleted file mode 100644 index 410eae6b7..000000000 --- a/kabc/vcard/include/VCardDateParam.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef DATEPARAM_H -#define DATEPARAM_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT DateParam : public Param -{ - -#include "DateParam-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardDateValue.h b/kabc/vcard/include/VCardDateValue.h deleted file mode 100644 index 4f2e2fe7f..000000000 --- a/kabc/vcard/include/VCardDateValue.h +++ /dev/null @@ -1,99 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef DATEVALUE_H -#define DATEVALUE_H - -#include -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT DateValue : public Value -{ -#include "DateValue-generated.h" - - DateValue( - unsigned int year, - unsigned int month, - unsigned int day, - unsigned int hour = 0, - unsigned int minute = 0, - unsigned int second = 0, - double secFrac = 0, - bool zonePositive = true, - unsigned int zoneHour = 0, - unsigned int zoneMinute = 0); - - DateValue(const TQDate &); - DateValue(const TQDateTime &); - - DateValue *clone(); - - bool hasTime(); - - unsigned int year(); - unsigned int month(); - unsigned int day(); - unsigned int hour(); - unsigned int minute(); - unsigned int second(); - double secondFraction(); - bool zonePositive(); - unsigned int zoneHour(); - unsigned int zoneMinute(); - - void setYear (unsigned int); - void setMonth (unsigned int); - void setDay (unsigned int); - void setHour (unsigned int); - void setMinute (unsigned int); - void setSecond (unsigned int); - void setSecondFraction (double); - void setZonePositive (bool); - void setZoneHour (unsigned int); - void setZoneMinute (unsigned int); - - TQDate qdate(); - TQTime qtime(); - TQDateTime qdt(); - - private: - - unsigned int year_, month_, day_, - hour_, minute_, second_, - zoneHour_, zoneMinute_; - - double secFrac_; - - bool zonePositive_; - - bool hasTime_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardDefines.h b/kabc/vcard/include/VCardDefines.h deleted file mode 100644 index e778bc24f..000000000 --- a/kabc/vcard/include/VCardDefines.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1998 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef VCARD_DEFINES_H -#define VCARD_DEFINES_H - -#include - -#ifdef VCARD_DEBUG -#define vDebug(a) kdDebug(5710) << a << endl; -#else -#define vDebug(a) -#endif - -#if 0 -#ifndef NDEBUG -# include -# include -# ifdef __GNUG__ -# define vDebug(a) cerr << className() << ":" << __FUNCTION__ << " (" \ - << __LINE__ << "): " << TQCString((a)).data() << endl; -# else -# define vDebug(a) cerr << className() << ": " \ - << TQCString((a)).data() << endl; -# endif -#else -# define vDebug(a) -#endif -#endif - -#endif // Included this file - diff --git a/kabc/vcard/include/VCardEmailParam.h b/kabc/vcard/include/VCardEmailParam.h deleted file mode 100644 index 1fe558afd..000000000 --- a/kabc/vcard/include/VCardEmailParam.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef EMAILPARAM_H -#define EMAILPARAM_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT EmailParam : public Param -{ - -#include "EmailParam-generated.h" - - TQCString emailType() { parse(); return emailType_; } - bool pref() { parse(); return pref_; } - - void setEmailType(const TQCString & s) - { emailType_ = s; assembled_ = false; } - - void setPref(bool b) - { pref_ = b; assembled_ = false; } - - private: - - TQCString emailType_; - bool pref_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardEntity.h b/kabc/vcard/include/VCardEntity.h deleted file mode 100644 index e87c5f1a6..000000000 --- a/kabc/vcard/include/VCardEntity.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef ENTITY_H -#define ENTITY_H - -#include -#include - -namespace VCARD -{ - -class KVCARD_EXPORT Entity -{ - public: - - Entity(); - Entity(const Entity & e); - Entity(const TQCString & s); - - virtual Entity & operator = (const Entity & e); - virtual Entity & operator = (const TQCString & s); - - virtual bool operator == (Entity & e); - virtual bool operator != (Entity & e); - virtual bool operator == (const TQCString & s); - virtual bool operator != (const TQCString & s); - - virtual ~Entity(); - - TQCString asString(); - - virtual void parse(); - virtual void assemble(); - - virtual void _parse() = 0; - virtual void _assemble() = 0; - - protected: - - TQCString strRep_; - bool parsed_; - bool assembled_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardEnum.h b/kabc/vcard/include/VCardEnum.h deleted file mode 100644 index 4552ccdbc..000000000 --- a/kabc/vcard/include/VCardEnum.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef ENUM_H -#define ENUM_H - -#include - -#include - -namespace VCARD -{ - -extern const TQCString paramNames []; - -enum EntityType { - EntityName, - EntityProfile, - EntitySource, - EntityFullName, - EntityN, - EntityNickname, - EntityPhoto, - EntityBirthday, - EntityAddress, - EntityLabel, - EntityTelephone, - EntityEmail, - EntityMailer, - EntityTimeZone, - EntityGeo, - EntityTitle, - EntityRole, - EntityLogo, - EntityAgent, - EntityOrganisation, - EntityCategories, - EntityNote, - EntityProductID, - EntityRevision, - EntitySortString, - EntitySound, - EntityUID, - EntityURI, - EntityURL, - EntityVersion, - EntityClass, - EntityKey, - EntityExtension, - EntityUnknown -}; - -enum ValueType { - ValueSound, - ValueAgent, - ValueAddress, - ValueTel, - ValueTextBin, - ValueOrg, - ValueN, - ValueUTC, - ValueURI, - ValueClass, - ValueFloat, - ValueImage, - ValueDate, - ValueTextList, - ValueText, - ValueGeo, - ValueUnknown -}; - -enum ParamType { - ParamUnknown, - ParamNone, - ParamSource, - ParamText, - ParamImage, - ParamDate, - ParamAddrText, - ParamTel, - ParamEmail, - ParamMailer, - ParamAgent, - ParamTextBin, - ParamTextNS, - ParamSound -}; - -extern const ParamType paramTypesTable[]; - -KVCARD_EXPORT ParamType EntityTypeToParamType(EntityType); -KVCARD_EXPORT ValueType EntityTypeToValueType(EntityType); -KVCARD_EXPORT TQCString EntityTypeToParamName(EntityType); -KVCARD_EXPORT EntityType EntityNameToEntityType(const TQCString &); - -KVCARD_EXPORT char * encodeBase64(const char *, unsigned long, unsigned long &); -KVCARD_EXPORT char * decodeBase64(const char *, unsigned long, unsigned long &); - -} - -#endif - diff --git a/kabc/vcard/include/VCardFloatValue.h b/kabc/vcard/include/VCardFloatValue.h deleted file mode 100644 index 45a6823be..000000000 --- a/kabc/vcard/include/VCardFloatValue.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef FLOATVALUE_H -#define FLOATVALUE_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT FloatValue : public Value -{ - -#include "FloatValue-generated.h" - - FloatValue(float); - - float value(); - void setValue(float); - - private: - - float value_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardGeoValue.h b/kabc/vcard/include/VCardGeoValue.h deleted file mode 100644 index 4228587a4..000000000 --- a/kabc/vcard/include/VCardGeoValue.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of libvcard. - Copyright (c) 2002 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef GEOVALUE_H -#define GEOVALUE_H - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT GeoValue : public Value -{ - -#include "GeoValue-generated.h" - - GeoValue *clone(); - - void setLatitude( float lat ) { latitude_ = lat; assembled_ = false; } - void setLongitude( float lon ) { longitude_ = lon; assembled_ = false; } - - float latitude() { parse(); return latitude_; } - float longitude() { parse(); return longitude_; } - - private: - float latitude_; - float longitude_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardGroup.h b/kabc/vcard/include/VCardGroup.h deleted file mode 100644 index ce884f100..000000000 --- a/kabc/vcard/include/VCardGroup.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef GROUP_H -#define GROUP_H - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT Group : public Entity -{ -#include "Group-generated.h" -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardImageParam.h b/kabc/vcard/include/VCardImageParam.h deleted file mode 100644 index 10ab8a3f5..000000000 --- a/kabc/vcard/include/VCardImageParam.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef IMGPARAM_H -#define IMGPARAM_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT ImageParam : public Param -{ - -#include "ImageParam-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardImageValue.h b/kabc/vcard/include/VCardImageValue.h deleted file mode 100644 index 45fbcad9c..000000000 --- a/kabc/vcard/include/VCardImageValue.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef IMAGEVALUE_H -#define IMAGEVALUE_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT ImageValue : public Value -{ - -#include "ImageValue-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardImgValue.h b/kabc/vcard/include/VCardImgValue.h deleted file mode 100644 index 7d4bbfa2d..000000000 --- a/kabc/vcard/include/VCardImgValue.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef IMGVALUE_H -#define IMGVALUE_H - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT ImgValue : public Value -{ -#include "ImgValue-generated.h" -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardLangValue.h b/kabc/vcard/include/VCardLangValue.h deleted file mode 100644 index 7767d52fa..000000000 --- a/kabc/vcard/include/VCardLangValue.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef LANGVALUE_H -#define LANGVALUE_H - -#include -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT LangValue : public Value -{ -#include "LangValue-generated.h" - - TQCString primary(); - TQStrList subtags(); - - void setPrimary(const TQCString &); - void setSubTags(const TQStrList &); - - TQCString primary_; - TQStrList subtags_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardNValue.h b/kabc/vcard/include/VCardNValue.h deleted file mode 100644 index 9db37fbbc..000000000 --- a/kabc/vcard/include/VCardNValue.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef NVALUE_H -#define NVALUE_H - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT NValue : public Value -{ -#include "NValue-generated.h" - NValue *clone(); - - TQCString family() { parse(); return family_; } - TQCString given() { parse(); return given_; } - TQCString middle() { parse(); return middle_; } - TQCString prefix() { parse(); return prefix_; } - TQCString suffix() { parse(); return suffix_; } - - void setFamily (const TQCString & s) { family_ = s; assembled_ = false; } - void setGiven (const TQCString & s) { given_ = s; assembled_ = false; } - void setMiddle (const TQCString & s) { middle_ = s; assembled_ = false; } - void setPrefix (const TQCString & s) { prefix_ = s; assembled_ = false; } - void setSuffix (const TQCString & s) { suffix_ = s; assembled_ = false; } - - private: - - TQCString family_, given_, middle_, prefix_, suffix_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardOrgValue.h b/kabc/vcard/include/VCardOrgValue.h deleted file mode 100644 index a2bd803e5..000000000 --- a/kabc/vcard/include/VCardOrgValue.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef ORGVALUE_H -#define ORGVALUE_H - -#include -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT OrgValue : public Value -{ - -#include "OrgValue-generated.h" - - unsigned int numValues(); - TQCString value(unsigned int); - - private: - - TQStrList valueList_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardParam.h b/kabc/vcard/include/VCardParam.h deleted file mode 100644 index 93d70f06b..000000000 --- a/kabc/vcard/include/VCardParam.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef PARAM_H -#define PARAM_H - -#include -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT Param : public Entity -{ - -#include "Param-generated.h" - - Param(const TQCString &name, const TQCString &value); - - void setName(const TQCString &); - void setValue(const TQCString &); - - TQCString name(); - TQCString value(); - - private: - - TQCString name_; - TQCString value_; -}; - -typedef TQPtrList ParamList; -typedef TQPtrListIterator ParamListIterator; - -} - -#endif diff --git a/kabc/vcard/include/VCardPhoneNumberValue.h b/kabc/vcard/include/VCardPhoneNumberValue.h deleted file mode 100644 index 3f9e106ca..000000000 --- a/kabc/vcard/include/VCardPhoneNumberValue.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef PHONENUMBERVALUE_H -#define PHONENUMBERVALUE_H - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT PhoneNumberValue : public Value -{ -#include "PhoneNumberValue-generated.h" -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardRToken.h b/kabc/vcard/include/VCardRToken.h deleted file mode 100644 index 17a3943d3..000000000 --- a/kabc/vcard/include/VCardRToken.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef RTOKEN_H -#define RTOKEN_H - -#include - -#include - -namespace VCARD -{ - -KVCARD_EXPORT TQ_UINT32 RTokenise(const char * str, const char * delim, TQStrList & l); - -} - -#endif - diff --git a/kabc/vcard/include/VCardSndValue.h b/kabc/vcard/include/VCardSndValue.h deleted file mode 100644 index 09a3a8238..000000000 --- a/kabc/vcard/include/VCardSndValue.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef SNDVALUE_H -#define SNDVALUE_H - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT SndValue : public Value -{ -#include "SndValue-generated.h" -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardSoundValue.h b/kabc/vcard/include/VCardSoundValue.h deleted file mode 100644 index 61858f058..000000000 --- a/kabc/vcard/include/VCardSoundValue.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef SOUNDVALUE_H -#define SOUNDVALUE_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT SoundValue : public Value -{ - -#include "SoundValue-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardSourceParam.h b/kabc/vcard/include/VCardSourceParam.h deleted file mode 100644 index 1d9d03d47..000000000 --- a/kabc/vcard/include/VCardSourceParam.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef SOURCEPARAM_H -#define SOURCEPARAM_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT SourceParam : public Param -{ - -#include "SourceParam-generated.h" - - enum SourceParamType { TypeUnknown, TypeValue, TypeContext, TypeX }; - - SourceParamType type() { parse(); return type_;} - TQCString par() { parse(); return par_; } - TQCString val() { parse(); return val_; } - - void setType(SourceParamType t) { type_ = t; assembled_ = false; } - void setPar(const TQCString & s) { par_ = s; assembled_ = false; } - void setVal(const TQCString & s) { val_ = s; assembled_ = false; } - - private: - - SourceParamType type_; - // May be "VALUE = uri" or "CONTEXT = word" or "x-name = *SAFE-CHAR" - TQCString par_, val_; // Sub-parameter, value -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTelParam.h b/kabc/vcard/include/VCardTelParam.h deleted file mode 100644 index 9eea5da2f..000000000 --- a/kabc/vcard/include/VCardTelParam.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TELPARAM_H -#define TELPARAM_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT TelParam : public Param -{ -#include "TelParam-generated.h" - - enum TelType { - TelHome, TelWork, TelPref, TelVoice, TelFex, TelMsg, TelCell, - TelPager, TelBBS, TelModem, TelCar, TelISDN, TelVideo, TelPCS, - TelIANA, TelX - }; - - private: - - TQPtrList types_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTelValue.h b/kabc/vcard/include/VCardTelValue.h deleted file mode 100644 index 043a45aa9..000000000 --- a/kabc/vcard/include/VCardTelValue.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TELVALUE_H -#define TELVALUE_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT TelValue : public Value -{ - -#include "TelValue-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTextBinParam.h b/kabc/vcard/include/VCardTextBinParam.h deleted file mode 100644 index 5a681ad48..000000000 --- a/kabc/vcard/include/VCardTextBinParam.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TEXTBINPARAM_H -#define TEXTBINPARAM_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT TextBinParam : public Param -{ - -#include "TextBinParam-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTextBinValue.h b/kabc/vcard/include/VCardTextBinValue.h deleted file mode 100644 index 316fa7832..000000000 --- a/kabc/vcard/include/VCardTextBinValue.h +++ /dev/null @@ -1,67 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TEXTBINVALUE_H -#define TEXTBINVALUE_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT TextBinValue : public Value -{ - -#include "TextBinValue-generated.h" - - TextBinValue *clone(); - - bool isBinary() { parse(); return mIsBinary_; } - TQByteArray data() { parse(); return mData_; } - TQString url() { parse(); return mUrl_; } - - void setData( const TQByteArray &data ) - { - mData_ = data; - mIsBinary_ = true; - assembled_ = false; - } - - void setUrl( const TQString &url ) - { - mUrl_ = url; - mIsBinary_ = false; - assembled_ = false; - } - - private: - int mIsBinary_; - TQByteArray mData_; - TQString mUrl_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTextListValue.h b/kabc/vcard/include/VCardTextListValue.h deleted file mode 100644 index 53760c75a..000000000 --- a/kabc/vcard/include/VCardTextListValue.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TEXTLISTVALUE_H -#define TEXTLISTVALUE_H - -#include - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT TextListValue : public Value -{ - -#include "TextListValue-generated.h" - - unsigned int numValues(); - TQCString value(unsigned int); - - private: - - TQStrList valueList_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTextParam.h b/kabc/vcard/include/VCardTextParam.h deleted file mode 100644 index d593c0578..000000000 --- a/kabc/vcard/include/VCardTextParam.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TEXTPARAM_H -#define TEXTPARAM_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT TextParam : public Param -{ - -#include "TextParam-generated.h" - - private: -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardTextValue.h b/kabc/vcard/include/VCardTextValue.h deleted file mode 100644 index 66eed32a8..000000000 --- a/kabc/vcard/include/VCardTextValue.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef TEXTVALUE_H -#define TEXTVALUE_H - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT TextValue : public Value -{ -#include "TextValue-generated.h" - - TextValue *clone(); -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardURIValue.h b/kabc/vcard/include/VCardURIValue.h deleted file mode 100644 index 696887774..000000000 --- a/kabc/vcard/include/VCardURIValue.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef URIVALUE_H -#define URIVALUE_H - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT URIValue : public Value -{ -#include "URIValue-generated.h" - - URIValue(const TQCString & scheme, const TQCString & schemeSpecificPart); - - TQCString scheme(); - TQCString schemeSpecificPart(); - - void setScheme (const TQCString &); - void setSchemeSpecificPart (const TQCString &); - - private: - - TQCString scheme_; - TQCString schemeSpecificPart_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardUTCValue.h b/kabc/vcard/include/VCardUTCValue.h deleted file mode 100644 index cb09ccf00..000000000 --- a/kabc/vcard/include/VCardUTCValue.h +++ /dev/null @@ -1,58 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef UTCVALUE_H -#define UTCVALUE_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT UTCValue : public Value -{ - -#include "UTCValue-generated.h" - - UTCValue *clone(); - - void setPositive( int p ) { positive_ = p; assembled_ = false; } - void setHour( int h ) { hour_ = h; assembled_ = false; } - void setMinute( int m ) { minute_ = m; assembled_ = false; } - - bool positive() { parse(); return positive_; } - unsigned int hour() { parse(); return hour_; } - unsigned int minute() { parse(); return minute_; } - - private: - - bool positive_; - unsigned int hour_; - unsigned int minute_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardVCard.h b/kabc/vcard/include/VCardVCard.h deleted file mode 100644 index 53563e8c0..000000000 --- a/kabc/vcard/include/VCardVCard.h +++ /dev/null @@ -1,63 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef VCARD_VCARD_H -#define VCARD_VCARD_H - -#include -#include - -#include -#include -#include - -namespace VCARD -{ - -class KVCARD_EXPORT VCard : public Entity -{ - -#include "VCard-generated.h" - - bool has(EntityType); - bool has(const TQCString &); - - void add(const ContentLine &); - void add(const TQCString &); - - ContentLine * contentLine(EntityType); - ContentLine * contentLine(const TQCString &); - - TQCString group() { parse(); return group_; } - - TQPtrList contentLineList() { parse(); return contentLineList_; } - - private: - - TQCString group_; - TQPtrList contentLineList_; -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardVCardEntity.h b/kabc/vcard/include/VCardVCardEntity.h deleted file mode 100644 index 422790c22..000000000 --- a/kabc/vcard/include/VCardVCardEntity.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef VCARD_ENTITY_H -#define VCARD_ENTITY_H - -#include -#include - -#include -#include -#include - -namespace VCARD -{ - -typedef TQPtrList VCardList; -typedef TQPtrListIterator VCardListIterator; - -class KVCARD_EXPORT VCardEntity : public Entity -{ - -#include "VCardEntity-generated.h" - - void setCardList(const VCardList & l); - VCardList & cardList(); - - private: - - VCardList cardList_; - -}; - -} - -#endif diff --git a/kabc/vcard/include/VCardValue.h b/kabc/vcard/include/VCardValue.h deleted file mode 100644 index 3c167d70a..000000000 --- a/kabc/vcard/include/VCardValue.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - libvcard - vCard parsing library for vCard version 3.0 - - Copyright (C) 1999 Rik Hemsley rik@kde.org - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to - deal in the Software without restriction, including without limitation the - rights to use, copy, modify, merge, publish, distribute, sublicense, and/or - sell copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -#ifndef VALUE_H -#define VALUE_H - -#include - -#include - -namespace VCARD -{ - -class KVCARD_EXPORT Value : public Entity -{ -#include "Value-generated.h" - - virtual Value *clone() { return new Value( *this ); } -}; - -typedef TQPtrList ValueList; -typedef TQPtrListIterator ValueListIterator; - -} - -#endif diff --git a/kabc/vcard/include/generated/AdrParam-generated.h b/kabc/vcard/include/generated/AdrParam-generated.h deleted file mode 100644 index 1afdcd36a..000000000 --- a/kabc/vcard/include/generated/AdrParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -AdrParam(); -AdrParam(const AdrParam&); -AdrParam(const TQCString&); -AdrParam & operator = (AdrParam&); -AdrParam & operator = (const TQCString&); -bool operator ==(AdrParam&); -bool operator !=(AdrParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {AdrParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~AdrParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "AdrParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/AdrValue-generated.h b/kabc/vcard/include/generated/AdrValue-generated.h deleted file mode 100644 index 9882d1186..000000000 --- a/kabc/vcard/include/generated/AdrValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -AdrValue(); -AdrValue(const AdrValue&); -AdrValue(const TQCString&); -AdrValue & operator = (AdrValue&); -AdrValue & operator = (const TQCString&); -bool operator ==(AdrValue&); -bool operator !=(AdrValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {AdrValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~AdrValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "AdrValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/AgentParam-generated.h b/kabc/vcard/include/generated/AgentParam-generated.h deleted file mode 100644 index 07b87d106..000000000 --- a/kabc/vcard/include/generated/AgentParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -AgentParam(); -AgentParam(const AgentParam&); -AgentParam(const TQCString&); -AgentParam & operator = (AgentParam&); -AgentParam & operator = (const TQCString&); -bool operator ==(AgentParam&); -bool operator !=(AgentParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {AgentParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~AgentParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "AgentParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/AgentValue-generated.h b/kabc/vcard/include/generated/AgentValue-generated.h deleted file mode 100644 index e2866bb8f..000000000 --- a/kabc/vcard/include/generated/AgentValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -AgentValue(); -AgentValue(const AgentValue&); -AgentValue(const TQCString&); -AgentValue & operator = (AgentValue&); -AgentValue & operator = (const TQCString&); -bool operator ==(AgentValue&); -bool operator !=(AgentValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {AgentValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~AgentValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "AgentValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ClassValue-generated.h b/kabc/vcard/include/generated/ClassValue-generated.h deleted file mode 100644 index e10c65568..000000000 --- a/kabc/vcard/include/generated/ClassValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ClassValue(); -ClassValue(const ClassValue&); -ClassValue(const TQCString&); -ClassValue & operator = (ClassValue&); -ClassValue & operator = (const TQCString&); -bool operator ==(ClassValue&); -bool operator !=(ClassValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ClassValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ClassValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "ClassValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ContentLine-generated.h b/kabc/vcard/include/generated/ContentLine-generated.h deleted file mode 100644 index ad2ac7649..000000000 --- a/kabc/vcard/include/generated/ContentLine-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ContentLine(); -ContentLine(const ContentLine&); -ContentLine(const TQCString&); -ContentLine & operator = (ContentLine&); -ContentLine & operator = (const TQCString&); -bool operator ==(ContentLine&); -bool operator !=(ContentLine& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ContentLine a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ContentLine(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "ContentLine"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/DateParam-generated.h b/kabc/vcard/include/generated/DateParam-generated.h deleted file mode 100644 index 75e7ad72d..000000000 --- a/kabc/vcard/include/generated/DateParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -DateParam(); -DateParam(const DateParam&); -DateParam(const TQCString&); -DateParam & operator = (DateParam&); -DateParam & operator = (const TQCString&); -bool operator ==(DateParam&); -bool operator !=(DateParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {DateParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~DateParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "DateParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/DateValue-generated.h b/kabc/vcard/include/generated/DateValue-generated.h deleted file mode 100644 index cf0eb40d8..000000000 --- a/kabc/vcard/include/generated/DateValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -DateValue(); -DateValue(const DateValue&); -DateValue(const TQCString&); -DateValue & operator = (DateValue&); -DateValue & operator = (const TQCString&); -bool operator ==(DateValue&); -bool operator !=(DateValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {DateValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~DateValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "DateValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/EmailParam-generated.h b/kabc/vcard/include/generated/EmailParam-generated.h deleted file mode 100644 index 46ae1f80f..000000000 --- a/kabc/vcard/include/generated/EmailParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -EmailParam(); -EmailParam(const EmailParam&); -EmailParam(const TQCString&); -EmailParam & operator = (EmailParam&); -EmailParam & operator = (const TQCString&); -bool operator ==(EmailParam&); -bool operator !=(EmailParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {EmailParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~EmailParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "EmailParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/FloatValue-generated.h b/kabc/vcard/include/generated/FloatValue-generated.h deleted file mode 100644 index 155f52ae1..000000000 --- a/kabc/vcard/include/generated/FloatValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -FloatValue(); -FloatValue(const FloatValue&); -FloatValue(const TQCString&); -FloatValue & operator = (FloatValue&); -FloatValue & operator = (const TQCString&); -bool operator ==(FloatValue&); -bool operator !=(FloatValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {FloatValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~FloatValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "FloatValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/GeoValue-generated.h b/kabc/vcard/include/generated/GeoValue-generated.h deleted file mode 100644 index b525e8c21..000000000 --- a/kabc/vcard/include/generated/GeoValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -GeoValue(); -GeoValue(const GeoValue&); -GeoValue(const TQCString&); -GeoValue & operator = (GeoValue&); -GeoValue & operator = (const TQCString&); -bool operator ==(GeoValue&); -bool operator !=(GeoValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {GeoValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~GeoValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "GeoValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/Group-generated.h b/kabc/vcard/include/generated/Group-generated.h deleted file mode 100644 index 38e1c2a3a..000000000 --- a/kabc/vcard/include/generated/Group-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -Group(); -Group(const Group&); -Group(const TQCString&); -Group & operator = (Group&); -Group & operator = (const TQCString&); -bool operator ==(Group&); -bool operator !=(Group& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {Group a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~Group(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "Group"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ImageParam-generated.h b/kabc/vcard/include/generated/ImageParam-generated.h deleted file mode 100644 index 78a5a97cf..000000000 --- a/kabc/vcard/include/generated/ImageParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ImageParam(); -ImageParam(const ImageParam&); -ImageParam(const TQCString&); -ImageParam & operator = (ImageParam&); -ImageParam & operator = (const TQCString&); -bool operator ==(ImageParam&); -bool operator !=(ImageParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ImageParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ImageParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "ImageParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ImageValue-generated.h b/kabc/vcard/include/generated/ImageValue-generated.h deleted file mode 100644 index 882081fbc..000000000 --- a/kabc/vcard/include/generated/ImageValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ImageValue(); -ImageValue(const ImageValue&); -ImageValue(const TQCString&); -ImageValue & operator = (ImageValue&); -ImageValue & operator = (const TQCString&); -bool operator ==(ImageValue&); -bool operator !=(ImageValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ImageValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ImageValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "ImageValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ImgParam-generated.h b/kabc/vcard/include/generated/ImgParam-generated.h deleted file mode 100644 index 04132c857..000000000 --- a/kabc/vcard/include/generated/ImgParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ImgParam(); -ImgParam(const ImgParam&); -ImgParam(const TQCString&); -ImgParam & operator = (ImgParam&); -ImgParam & operator = (const TQCString&); -bool operator ==(ImgParam&); -bool operator !=(ImgParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ImgParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ImgParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -virtual const char * className() const { return "ImgParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ImgValue-generated.h b/kabc/vcard/include/generated/ImgValue-generated.h deleted file mode 100644 index 0774de9bf..000000000 --- a/kabc/vcard/include/generated/ImgValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -ImgValue(); -ImgValue(const ImgValue&); -ImgValue(const TQCString&); -ImgValue & operator = (ImgValue&); -ImgValue & operator = (const TQCString&); -bool operator ==(ImgValue&); -bool operator !=(ImgValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {ImgValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~ImgValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -virtual const char * className() const { return "ImgValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/LangValue-generated.h b/kabc/vcard/include/generated/LangValue-generated.h deleted file mode 100644 index c4930c59e..000000000 --- a/kabc/vcard/include/generated/LangValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -LangValue(); -LangValue(const LangValue&); -LangValue(const TQCString&); -LangValue & operator = (LangValue&); -LangValue & operator = (const TQCString&); -bool operator ==(LangValue&); -bool operator !=(LangValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {LangValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~LangValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "LangValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/NValue-generated.h b/kabc/vcard/include/generated/NValue-generated.h deleted file mode 100644 index d78715ec0..000000000 --- a/kabc/vcard/include/generated/NValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -NValue(); -NValue(const NValue&); -NValue(const TQCString&); -NValue & operator = (NValue&); -NValue & operator = (const TQCString&); -bool operator ==(NValue&); -bool operator !=(NValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {NValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~NValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "NValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/Name-generated.h b/kabc/vcard/include/generated/Name-generated.h deleted file mode 100644 index 17d56e680..000000000 --- a/kabc/vcard/include/generated/Name-generated.h +++ /dev/null @@ -1,22 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -V_Name(); -V_Name(const V_Name&); -V_Name(const TQCString&); -V_Name & operator = (V_Name&); -V_Name & operator = (const TQCString&); -bool operator ==(V_Name&); -bool operator !=(V_Name& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {V_Name a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~V_Name(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/OrgValue-generated.h b/kabc/vcard/include/generated/OrgValue-generated.h deleted file mode 100644 index 661ecf5a3..000000000 --- a/kabc/vcard/include/generated/OrgValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -OrgValue(); -OrgValue(const OrgValue&); -OrgValue(const TQCString&); -OrgValue & operator = (OrgValue&); -OrgValue & operator = (const TQCString&); -bool operator ==(OrgValue&); -bool operator !=(OrgValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {OrgValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~OrgValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "OrgValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/Param-generated.h b/kabc/vcard/include/generated/Param-generated.h deleted file mode 100644 index bf63e7166..000000000 --- a/kabc/vcard/include/generated/Param-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -Param(); -Param(const Param&); -Param(const TQCString&); -Param & operator = (Param&); -Param & operator = (const TQCString&); -bool operator ==(Param&); -bool operator !=(Param& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {Param a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~Param(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "Param"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ParamName-generated.h b/kabc/vcard/include/generated/ParamName-generated.h deleted file mode 100644 index 60b1e12d5..000000000 --- a/kabc/vcard/include/generated/ParamName-generated.h +++ /dev/null @@ -1,22 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -V_ParamName(); -V_ParamName(const V_ParamName&); -V_ParamName(const TQCString&); -V_ParamName & operator = (V_ParamName&); -V_ParamName & operator = (const TQCString&); -bool operator ==(V_ParamName&); -bool operator !=(V_ParamName& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {V_ParamName a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~V_ParamName(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/ParamValue-generated.h b/kabc/vcard/include/generated/ParamValue-generated.h deleted file mode 100644 index f31a166c6..000000000 --- a/kabc/vcard/include/generated/ParamValue-generated.h +++ /dev/null @@ -1,22 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -V_ParamValue(); -V_ParamValue(const V_ParamValue&); -V_ParamValue(const TQCString&); -V_ParamValue & operator = (V_ParamValue&); -V_ParamValue & operator = (const TQCString&); -bool operator ==(V_ParamValue&); -bool operator !=(V_ParamValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {V_ParamValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~V_ParamValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/PhoneNumberValue-generated.h b/kabc/vcard/include/generated/PhoneNumberValue-generated.h deleted file mode 100644 index f0eb6b4f4..000000000 --- a/kabc/vcard/include/generated/PhoneNumberValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -PhoneNumberValue(); -PhoneNumberValue(const PhoneNumberValue&); -PhoneNumberValue(const TQCString&); -PhoneNumberValue & operator = (PhoneNumberValue&); -PhoneNumberValue & operator = (const TQCString&); -bool operator ==(PhoneNumberValue&); -bool operator !=(PhoneNumberValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {PhoneNumberValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~PhoneNumberValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "PhoneNumberValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/SoundValue-generated.h b/kabc/vcard/include/generated/SoundValue-generated.h deleted file mode 100644 index 64081be0b..000000000 --- a/kabc/vcard/include/generated/SoundValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -SoundValue(); -SoundValue(const SoundValue&); -SoundValue(const TQCString&); -SoundValue & operator = (SoundValue&); -SoundValue & operator = (const TQCString&); -bool operator ==(SoundValue&); -bool operator !=(SoundValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {SoundValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~SoundValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "SoundValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/SourceParam-generated.h b/kabc/vcard/include/generated/SourceParam-generated.h deleted file mode 100644 index e3b13bca1..000000000 --- a/kabc/vcard/include/generated/SourceParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -SourceParam(); -SourceParam(const SourceParam&); -SourceParam(const TQCString&); -SourceParam & operator = (SourceParam&); -SourceParam & operator = (const TQCString&); -bool operator ==(SourceParam&); -bool operator !=(SourceParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {SourceParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~SourceParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "SourceParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TelParam-generated.h b/kabc/vcard/include/generated/TelParam-generated.h deleted file mode 100644 index 9f8f24270..000000000 --- a/kabc/vcard/include/generated/TelParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TelParam(); -TelParam(const TelParam&); -TelParam(const TQCString&); -TelParam & operator = (TelParam&); -TelParam & operator = (const TQCString&); -bool operator ==(TelParam&); -bool operator !=(TelParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TelParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TelParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TelParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TelValue-generated.h b/kabc/vcard/include/generated/TelValue-generated.h deleted file mode 100644 index 600da7727..000000000 --- a/kabc/vcard/include/generated/TelValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TelValue(); -TelValue(const TelValue&); -TelValue(const TQCString&); -TelValue & operator = (TelValue&); -TelValue & operator = (const TQCString&); -bool operator ==(TelValue&); -bool operator !=(TelValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TelValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TelValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TelValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextBinParam-generated.h b/kabc/vcard/include/generated/TextBinParam-generated.h deleted file mode 100644 index 37dc56e55..000000000 --- a/kabc/vcard/include/generated/TextBinParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextBinParam(); -TextBinParam(const TextBinParam&); -TextBinParam(const TQCString&); -TextBinParam & operator = (TextBinParam&); -TextBinParam & operator = (const TQCString&); -bool operator ==(TextBinParam&); -bool operator !=(TextBinParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextBinParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextBinParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextBinParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextBinValue-generated.h b/kabc/vcard/include/generated/TextBinValue-generated.h deleted file mode 100644 index 4c9580421..000000000 --- a/kabc/vcard/include/generated/TextBinValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextBinValue(); -TextBinValue(const TextBinValue&); -TextBinValue(const TQCString&); -TextBinValue & operator = (TextBinValue&); -TextBinValue & operator = (const TQCString&); -bool operator ==(TextBinValue&); -bool operator !=(TextBinValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextBinValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextBinValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextBinValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextListValue-generated.h b/kabc/vcard/include/generated/TextListValue-generated.h deleted file mode 100644 index 8babb0d9f..000000000 --- a/kabc/vcard/include/generated/TextListValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextListValue(); -TextListValue(const TextListValue&); -TextListValue(const TQCString&); -TextListValue & operator = (TextListValue&); -TextListValue & operator = (const TQCString&); -bool operator ==(TextListValue&); -bool operator !=(TextListValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextListValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextListValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextListValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextNSParam-generated.h b/kabc/vcard/include/generated/TextNSParam-generated.h deleted file mode 100644 index bd8e74b07..000000000 --- a/kabc/vcard/include/generated/TextNSParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextNSParam(); -TextNSParam(const TextNSParam&); -TextNSParam(const TQCString&); -TextNSParam & operator = (TextNSParam&); -TextNSParam & operator = (const TQCString&); -bool operator ==(TextNSParam&); -bool operator !=(TextNSParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextNSParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextNSParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextNSParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextParam-generated.h b/kabc/vcard/include/generated/TextParam-generated.h deleted file mode 100644 index 54ae611a5..000000000 --- a/kabc/vcard/include/generated/TextParam-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextParam(); -TextParam(const TextParam&); -TextParam(const TQCString&); -TextParam & operator = (TextParam&); -TextParam & operator = (const TQCString&); -bool operator ==(TextParam&); -bool operator !=(TextParam& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextParam a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextParam(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextParam"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/TextValue-generated.h b/kabc/vcard/include/generated/TextValue-generated.h deleted file mode 100644 index 5b56b54a7..000000000 --- a/kabc/vcard/include/generated/TextValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -TextValue(); -TextValue(const TextValue&); -TextValue(const TQCString&); -TextValue & operator = (TextValue&); -TextValue & operator = (const TQCString&); -bool operator ==(TextValue&); -bool operator !=(TextValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {TextValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~TextValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "TextValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/URIValue-generated.h b/kabc/vcard/include/generated/URIValue-generated.h deleted file mode 100644 index 5a691e6d6..000000000 --- a/kabc/vcard/include/generated/URIValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -URIValue(); -URIValue(const URIValue&); -URIValue(const TQCString&); -URIValue & operator = (URIValue&); -URIValue & operator = (const TQCString&); -bool operator ==(URIValue&); -bool operator !=(URIValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {URIValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~URIValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "URIValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/UTCValue-generated.h b/kabc/vcard/include/generated/UTCValue-generated.h deleted file mode 100644 index 0c6edfb46..000000000 --- a/kabc/vcard/include/generated/UTCValue-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -UTCValue(); -UTCValue(const UTCValue&); -UTCValue(const TQCString&); -UTCValue & operator = (UTCValue&); -UTCValue & operator = (const TQCString&); -bool operator ==(UTCValue&); -bool operator !=(UTCValue& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {UTCValue a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~UTCValue(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "UTCValue"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/VCard-generated.h b/kabc/vcard/include/generated/VCard-generated.h deleted file mode 100644 index 4f36d11da..000000000 --- a/kabc/vcard/include/generated/VCard-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -VCard(); -VCard(const VCard&); -VCard(const TQCString&); -VCard & operator = (VCard&); -VCard & operator = (const TQCString&); -bool operator ==(VCard&); -bool operator !=(VCard& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {VCard a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~VCard(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "VCard"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/VCardEntity-generated.h b/kabc/vcard/include/generated/VCardEntity-generated.h deleted file mode 100644 index 4e973e62a..000000000 --- a/kabc/vcard/include/generated/VCardEntity-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -VCardEntity(); -VCardEntity(const VCardEntity&); -VCardEntity(const TQCString&); -VCardEntity & operator = (VCardEntity&); -VCardEntity & operator = (const TQCString&); -bool operator ==(VCardEntity&); -bool operator !=(VCardEntity& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {VCardEntity a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~VCardEntity(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "VCardEntity"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/Value-generated.h b/kabc/vcard/include/generated/Value-generated.h deleted file mode 100644 index 935d137b6..000000000 --- a/kabc/vcard/include/generated/Value-generated.h +++ /dev/null @@ -1,23 +0,0 @@ -// XXX Automatically generated. DO NOT EDIT! XXX // - -public: -Value(); -Value(const Value&); -Value(const TQCString&); -Value & operator = (Value&); -Value & operator = (const TQCString&); -bool operator ==(Value&); -bool operator !=(Value& x) {return !(*this==x);} -bool operator ==(const TQCString& s) {Value a(s);return(*this==a);} -bool operator != (const TQCString& s) {return !(*this == s);} - -virtual ~Value(); -void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} - -void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} - -void _parse(); -void _assemble(); -const char * className() const { return "Value"; } - -// End of automatically generated code // diff --git a/kabc/vcard/include/generated/generate b/kabc/vcard/include/generated/generate deleted file mode 100755 index 926dbf136..000000000 --- a/kabc/vcard/include/generated/generate +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -cat headerBodies | awk -f generateHeaders.awk diff --git a/kabc/vcard/include/generated/generateHeaders.awk b/kabc/vcard/include/generated/generateHeaders.awk deleted file mode 100755 index 471db11b4..000000000 --- a/kabc/vcard/include/generated/generateHeaders.awk +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/awk -f - -{ - outfile = $1 "-generated.h" - name = $1 - - OFS="" - - print "// XXX Automatically generated. DO NOT EDIT! XXX //\n" > outfile - print "// WARNING! All changes made in this file will be lost!\n" > outfile - - if ($2 == "v") { pre = "virtual " } else { pre = "" } - - print "public:" >> outfile - print name "();" >> outfile - print name "(const " name "&);" >> outfile - print name "(const QCString&);" >> outfile - print pre name " & operator = (" name "&);" >> outfile - print pre name " & operator = (const QCString&);" >> outfile - print pre "bool operator ==(" name "&);" >> outfile - print pre "bool operator !=(" name "& x) {return !(*this==x);}" \ - >> outfile - print pre "bool operator ==(const QCString& s) {" name " a(s);" \ - "return(*this==a);} " >> outfile - print pre "bool operator != (const QCString& s) {return !(*this == s);}\n" \ - >> outfile - print "virtual ~" name "();" >> outfile - print pre "void parse() " \ - "{if(!parsed_) _parse();parsed_=true;assembled_=false;}\n" \ - >> outfile - print pre "void assemble() " \ - "{if(assembled_) return;parse();_assemble();assembled_=true;}\n" \ - >> outfile - print pre "void _parse();" >> outfile - print pre "void _assemble();" >> outfile - print pre "const char * className() const { return \"" name "\"; }" \ - >> outfile - - print "\n// End of automatically generated code //" >> outfile -} - diff --git a/kabc/vcard/include/generated/headerBodies b/kabc/vcard/include/generated/headerBodies deleted file mode 100644 index 5e77b2b5e..000000000 --- a/kabc/vcard/include/generated/headerBodies +++ /dev/null @@ -1,34 +0,0 @@ -AdrParam Param -AdrValue Value -AgentParam Param -ContentLine Entity -DateParam Param -DateValue Value -EmailParam Param -GeoValue Value -Group Entity -ImageParam Param -ImageValue Value -LangValue Value -NValue Value -Param Entity -PhoneNumberValue Value -SourceParam Param -TelParam Param -TextParam Param -TextNSParam Param -TextValue Value -TextBinParam Param -URIValue Value -VCard Entity -VCardEntity Entity -Value Entity -SoundValue Value -AgentValue Value -TelValue Value -TextBinValue Value -OrgValue Value -UTCValue Value -ClassValue Value -FloatValue Value -TextListValue Value diff --git a/kabc/vcard/testread.cpp b/kabc/vcard/testread.cpp deleted file mode 100644 index 3a33c7d54..000000000 --- a/kabc/vcard/testread.cpp +++ /dev/null @@ -1,129 +0,0 @@ -#include -#include -#include - -#include -#include - -#include - -using namespace std; - -int main(int argc, char * argv[]) -{ - if (argc != 2) { - cerr << "Usage: " << argv[0] << " " << endl; - exit(1); - } - - TQFile f(argv[1]); - - TQCString str; - - if (!f.open(IO_ReadOnly)) { - cerr << "Couldn't open file \"" << argv[1] << endl; - exit(1); - } - - TQTextStream t(&f); - - while (!t.eof()) - str += t.readLine().utf8() + '\n'; - - using namespace VCARD; - - // Iterate through all vCards in the file. - - cout << "--------- begin ----------" << endl; - cout << str.data(); - cout << "--------- end ----------" << endl; - - VCardEntity e(str); - - VCardListIterator it(e.cardList()); - - for (; it.current(); ++it) { - - cerr << "****************** VCARD ********************" << endl; - - // Create a vcard using the string representation. - VCard & v (*it.current()); - - if (v.has(EntityEmail)) { - cerr << "Email parameter found" << endl; - - TQCString s = v.contentLine(EntityEmail)->value()->asString(); - - cerr << "Email value == " << s << endl; - } - - if (v.has(EntityNickname)) { - cerr << "Nickname parameter found" << endl; - - cerr << "Nickname value == " << - v.contentLine(EntityNickname)->value()->asString() << - endl; - } - - if (v.has(EntityRevision)) { - - cerr << "Revision parameter found" << endl; - - DateValue * d = - (DateValue *) - v.contentLine(EntityRevision)->value(); - - assert(d != 0); - - cerr << "Revision date: " << endl; - cerr << "Day : " << d->day() << endl; - cerr << "Month : " << d->month() << endl; - cerr << "Year : " << d->year() << endl; - - if (d->hasTime()) { - cerr << "Revision date has a time component" << endl; - cerr << "Revision time: " << endl; - cerr << "Hour : " << d->hour() << endl; - cerr << "Minute : " << d->minute() << endl; - cerr << "Second : " << d->second() << endl; - - } - else cerr << "Revision date does NOT have a time component" << endl; - } - - if (v.has(EntityURL)) { - cerr << "URL Parameter found" << endl; - - cerr << "URL Value == " << - v.contentLine(EntityURL)->value()->asString() << - endl; - - URIValue * urlVal = - (URIValue *)v.contentLine(EntityURL)->value(); - - assert(urlVal != 0); - - cerr << "URL scheme == " << - urlVal->scheme() << endl; - - cerr << "URL scheme specific part == " << - urlVal->schemeSpecificPart() << endl; - } - - if (v.has(EntityN)) { - cerr << "N Parameter found" << endl; - - NValue * n = - (NValue *)(v.contentLine(EntityN)->value()); - - cerr << "Family name == " << n->family() << endl; - cerr << "Given name == " << n->given() << endl; - cerr << "Middle name == " << n->middle() << endl; - cerr << "Prefix == " << n->prefix() << endl; - cerr << "Suffix == " << n->suffix() << endl; - } - - cerr << "***************** END VCARD ******************" << endl; - } -} - diff --git a/kabc/vcard/testwrite.cpp b/kabc/vcard/testwrite.cpp deleted file mode 100644 index 67f8eb20a..000000000 --- a/kabc/vcard/testwrite.cpp +++ /dev/null @@ -1,41 +0,0 @@ -#include -#include -#include -#include -#include - -#include - -int main(int argc,char **argv) -{ - TDEAboutData aboutData("testwrite",I18N_NOOP("TestWritevCard"),"0.1"); - TDECmdLineArgs::init(argc,argv,&aboutData); - - TDEApplication app; - - kdDebug() << "Test Write VCard" << endl; - - using namespace VCARD; - - VCard v; - - ContentLine cl1; - cl1.setName(EntityTypeToParamName(EntityName)); - cl1.setValue(new TextValue("Hans Wurst")); - v.add(cl1); - - ContentLine cl2; - cl2.setName(EntityTypeToParamName(EntityTelephone)); - cl2.setValue(new TelValue("12345")); - ParamList p; - p.append( new TelParam("home") ); - p.append( new TelParam("fax") ); - cl2.setParamList( p ); - v.add(cl2); - - TQCString str = v.asString(); - - kdDebug() << "--- VCard begin ---" << endl - << str - << "--- VCard end ---" << endl; -} diff --git a/kabc/vcard/vCard-all.cpp b/kabc/vcard/vCard-all.cpp deleted file mode 100644 index 07bbcd2bb..000000000 --- a/kabc/vcard/vCard-all.cpp +++ /dev/null @@ -1,37 +0,0 @@ -#include "AdrParam.cpp" -#include "AdrValue.cpp" -#include "AgentParam.cpp" -#include "AgentValue.cpp" -#include "ClassValue.cpp" -#include "ContentLine.cpp" -#include "DateParam.cpp" -#include "DateValue.cpp" -#include "EmailParam.cpp" -#include "Entity.cpp" -#include "Enum.cpp" -#include "FloatValue.cpp" -#include "GeoValue.cpp" -#include "ImageParam.cpp" -#include "ImageValue.cpp" -#include "ImgValue.cpp" -#include "LangValue.cpp" -#include "NValue.cpp" -#include "OrgValue.cpp" -#include "Param.cpp" -#include "PhoneNumberValue.cpp" -#include "RToken.cpp" -#include "SoundValue.cpp" -#include "SourceParam.cpp" -#include "TelParam.cpp" -#include "TelValue.cpp" -#include "TextBinParam.cpp" -#include "TextBinValue.cpp" -#include "TextListValue.cpp" -#include "TextParam.cpp" -#include "TextValue.cpp" -#include "URIValue.cpp" -#include "UTCValue.cpp" -#include "VCard.cpp" -#include "VCardEntity.cpp" -#include "Value.cpp" - diff --git a/kabc/vcard21parser.cpp b/kabc/vcard21parser.cpp deleted file mode 100644 index 8a3bfcaea..000000000 --- a/kabc/vcard21parser.cpp +++ /dev/null @@ -1,608 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Mark Westcott - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include -#include - -#include "vcard21parser.h" -#include "vcardconverter.h" - -using namespace KABC; - -bool VCardLineX::isValid() const -{ - // Invalid: if it is "begin:vcard" or "end:vcard" - if ( name == VCARD_BEGIN_N || name == VCARD_END_N ) - return false; - - if ( name[0] == 'x' && name[1] == '-' ) // A custom x- line - return true; - - // This is long but it makes it a bit faster (and saves me from using - // a tree which is probably the ideal situation, but a bit memory heavy) - switch( name[0] ) { - case 'a': - if ( name == VCARD_ADR && qualified && - (qualifiers.contains(VCARD_ADR_DOM) || - qualifiers.contains(VCARD_ADR_INTL) || - qualifiers.contains(VCARD_ADR_POSTAL) || - qualifiers.contains(VCARD_ADR_HOME) || - qualifiers.contains(VCARD_ADR_WORK) || - qualifiers.contains(VCARD_ADR_PREF) - ) ) - return true; - - if ( name == VCARD_AGENT ) - return true; - break; - - case 'b': - if ( name == VCARD_BDAY ) - return true; - break; - - case 'c': - if ( name == VCARD_CATEGORIES ) - return true; - if ( name == VCARD_CLASS && qualified && - (qualifiers.contains(VCARD_CLASS_PUBLIC) || - qualifiers.contains(VCARD_CLASS_PRIVATE) || - qualifiers.contains(VCARD_CLASS_CONFIDENTIAL) - ) ) - return true; - break; - - case 'e': - if ( name == VCARD_EMAIL && qualified && - (qualifiers.contains(VCARD_EMAIL_INTERNET) || - qualifiers.contains(VCARD_EMAIL_PREF) || - qualifiers.contains(VCARD_EMAIL_X400) - ) ) - return true; - break; - - case 'f': - if ( name == VCARD_FN ) - return true; - break; - - case 'g': - if ( name == VCARD_GEO ) - return true; - break; - - case 'k': - if ( name == VCARD_KEY && qualified && - (qualifiers.contains(VCARD_KEY_X509) || - qualifiers.contains(VCARD_KEY_PGP) - ) ) - return true; - break; - - case 'l': - if ( name == VCARD_LABEL ) - return true; - if ( name == VCARD_LOGO ) - return true; - break; - - case 'm': - if ( name == VCARD_MAILER ) - return true; - break; - - case 'n': - if ( name == VCARD_N ) - return true; - if ( name == VCARD_NAME ) - return true; - if ( name == VCARD_NICKNAME ) - return true; - if ( name == VCARD_NOTE ) - return true; - break; - - case 'o': - if ( name == VCARD_ORG ) - return true; - break; - - case 'p': - if ( name == VCARD_PHOTO ) - return true; - if ( name == VCARD_PROFILE ) - return true; - if ( name == VCARD_PRODID ) - return true; - break; - - case 'r': - if ( name == VCARD_ROLE ) - return true; - if ( name == VCARD_REV ) - return true; - break; - - case 's': - if ( name == VCARD_SOURCE ) - return true; - if ( name == VCARD_SOUND ) - return true; - break; - - case 't': - if ( name == VCARD_TEL && qualified && - (qualifiers.contains(VCARD_TEL_HOME) || - qualifiers.contains(VCARD_TEL_WORK) || - qualifiers.contains(VCARD_TEL_PREF) || - qualifiers.contains(VCARD_TEL_VOICE) || - qualifiers.contains(VCARD_TEL_FAX) || - qualifiers.contains(VCARD_TEL_MSG) || - qualifiers.contains(VCARD_TEL_CELL) || - qualifiers.contains(VCARD_TEL_PAGER) || - qualifiers.contains(VCARD_TEL_BBS) || - qualifiers.contains(VCARD_TEL_MODEM) || - qualifiers.contains(VCARD_TEL_CAR) || - qualifiers.contains(VCARD_TEL_ISDN) || - qualifiers.contains(VCARD_TEL_VIDEO) || - qualifiers.contains(VCARD_TEL_PCS) - ) ) - return true; - if ( name == VCARD_TZ ) - return true; - if ( name == VCARD_TITLE ) - return true; - break; - - case 'u': - if ( name == VCARD_URL ) - return true; - if ( name == VCARD_UID ) - return true; - break; - - case 'v': - if ( name == VCARD_VERSION ) - return true; - break; - default: - break; - } - - return false; -} - - -VCard21Parser::VCard21Parser() -{ -} - -VCard21Parser::~VCard21Parser() -{ -} - -void VCard21Parser::readFromString(KABC::AddressBook *addressbook, const TQString &data) -{ - KABC::Addressee mAddressee = readFromString(data); - addressbook->insertAddressee(mAddressee); -} - -KABC::Addressee VCard21Parser::readFromString( const TQString &data) -{ - KABC::Addressee addressee; - VCard21ParserImpl *vCard = VCard21ParserImpl::parseVCard(data); - TQString tmpStr; - - // Check if parsing failed - if (vCard == 0) - { - kdDebug() << "Parsing failed" << endl; - return addressee; - } - //set the addressees name and formated name - TQStringList tmpList = vCard->getValues(VCARD_N); - TQString formattedName = ""; - if (tmpList.count() > 0) - addressee.setFamilyName(tmpList[0]); - if (tmpList.count() > 1) - addressee.setGivenName(tmpList[1]); - if (tmpList.count() > 2) - addressee.setAdditionalName(tmpList[2]); - if (tmpList.count() > 3) - addressee.setPrefix(tmpList[3]); - if (tmpList.count() > 4) - addressee.setSuffix(tmpList[4]); - - tmpStr = (vCard->getValue(VCARD_FN)); - if (!tmpStr.isEmpty()) - addressee.setFormattedName(tmpStr); - - //set the addressee's nick name - tmpStr = vCard->getValue(VCARD_NICKNAME); - addressee.setNickName(tmpStr); - //set the addressee's organization - tmpStr = vCard->getValue(VCARD_ORG); - addressee.setOrganization(tmpStr); - //set the addressee's title - tmpStr = vCard->getValue(VCARD_TITLE); - addressee.setTitle(tmpStr); - //set the addressee's email - we can only deal with two. The preferenced one and one other. - tmpStr = vCard->getValue(VCARD_EMAIL, VCARD_EMAIL_INTERNET); - addressee.insertEmail(tmpStr, false); - tmpStr = vCard->getValue(VCARD_EMAIL,VCARD_EMAIL_PREF); - addressee.insertEmail(tmpStr, true); - //set the addressee's url - tmpStr = vCard->getValue(VCARD_URL); - if (tmpStr.isEmpty()) tmpStr = vCard->getValue(VCARD_URL, VCARD_ADR_WORK); - if (tmpStr.isEmpty()) tmpStr = vCard->getValue(VCARD_URL, VCARD_ADR_HOME); - if (!tmpStr.isEmpty()) { - addressee.setUrl(KURL(tmpStr)); - } - - //set the addressee's birthday - tmpStr = vCard->getValue(VCARD_BDAY); - addressee.setBirthday(VCardStringToDate(tmpStr)); - - //set the addressee's phone numbers - for ( TQValueListIterator i = vCard->_vcdata->begin();i != vCard->_vcdata->end(); ++i ) { - if ( (*i).name == VCARD_TEL ) { - int type = 0; - if ( (*i).qualified ) { - if ( (*i).qualifiers.contains( VCARD_TEL_HOME ) ) - type |= PhoneNumber::Home; - if ( (*i).qualifiers.contains( VCARD_TEL_WORK ) ) - type |= PhoneNumber::Work; - if ( (*i).qualifiers.contains( VCARD_TEL_PREF ) ) - type |= PhoneNumber::Pref; - // if ( (*i).qualifiers.contains( VCARD_TEL_VOICE ) ) - // type |= PhoneNumber::Voice; - if ( (*i).qualifiers.contains( VCARD_TEL_FAX ) ) - type |= PhoneNumber::Fax; - if ( (*i).qualifiers.contains( VCARD_TEL_MSG ) ) - type |= PhoneNumber::Msg; - if ( (*i).qualifiers.contains( VCARD_TEL_CELL ) ) - type |= PhoneNumber::Cell; - if ( (*i).qualifiers.contains( VCARD_TEL_PAGER ) ) - type |= PhoneNumber::Pager; - if ( (*i).qualifiers.contains( VCARD_TEL_BBS ) ) - type |= PhoneNumber::Bbs; - if ( (*i).qualifiers.contains( VCARD_TEL_MODEM ) ) - type |= PhoneNumber::Modem; - if ( (*i).qualifiers.contains( VCARD_TEL_CAR ) ) - type |= PhoneNumber::Car; - if ( (*i).qualifiers.contains( VCARD_TEL_ISDN ) ) - type |= PhoneNumber::Isdn; - if ( (*i).qualifiers.contains( VCARD_TEL_VIDEO ) ) - type |= PhoneNumber::Video; - if ( (*i).qualifiers.contains( VCARD_TEL_PCS ) ) - type |= PhoneNumber::Pcs; - } - addressee.insertPhoneNumber( PhoneNumber( (*i).parameters[ 0 ], type ) ); - } - } - - //set the addressee's addresses - for ( TQValueListIterator i = vCard->_vcdata->begin();i != vCard->_vcdata->end(); ++i ) { - if ( (*i).name == VCARD_ADR ) { - int type = 0; - if ( (*i).qualified ) { - if ( (*i).qualifiers.contains( VCARD_ADR_DOM ) ) - type |= Address::Dom; - if ( (*i).qualifiers.contains( VCARD_ADR_INTL ) ) - type |= Address::Intl; - if ( (*i).qualifiers.contains( VCARD_ADR_POSTAL ) ) - type |= Address::Postal; - if ( (*i).qualifiers.contains( VCARD_ADR_PARCEL ) ) - type |= Address::Parcel; - if ( (*i).qualifiers.contains( VCARD_ADR_HOME ) ) - type |= Address::Home; - if ( (*i).qualifiers.contains( VCARD_ADR_WORK ) ) - type |= Address::Work; - if ( (*i).qualifiers.contains( VCARD_ADR_PREF ) ) - type |= Address::Pref; - } - addressee.insertAddress( readAddressFromQStringList( (*i).parameters, type ) ); - } - } - - //set the addressee's delivery label - tmpStr = vCard->getValue(VCARD_LABEL); - if (!tmpStr.isEmpty()) { - tmpStr.replace("\r\n","\n"); - Address tmpAddress; - tmpAddress.setLabel(tmpStr); - addressee.insertAddress(tmpAddress); - } - - //set the addressee's notes - tmpStr = vCard->getValue(VCARD_NOTE); - tmpStr.replace("\r\n","\n"); - addressee.setNote(tmpStr); - - //set the addressee's timezone - tmpStr = vCard->getValue(VCARD_TZ); - TimeZone tmpZone(tmpStr.toInt()); - addressee.setTimeZone(tmpZone); - - //set the addressee's geographical position - tmpList = vCard->getValues(VCARD_GEO); - if (tmpList.count()==2) - { - tmpStr = tmpList[0]; - float glat = tmpStr.toFloat(); - tmpStr = tmpList[1]; - float glong = tmpStr.toFloat(); - Geo tmpGeo(glat,glong); - addressee.setGeo(tmpGeo); - } - - //set the last revision date - tmpStr = vCard->getValue(VCARD_REV); - addressee.setRevision(VCardStringToDate(tmpStr)); - - //set the role of the addressee - tmpStr = vCard->getValue(VCARD_ROLE); - addressee.setRole(tmpStr); - - delete vCard; - - return addressee; -} - - - -KABC::Address VCard21Parser::readAddressFromQStringList ( const TQStringList &data, const int type ) -{ - KABC::Address mAddress; - mAddress.setType( type ); - - if ( data.count() > 0 ) - mAddress.setPostOfficeBox( data[0] ); - if ( data.count() > 1 ) - mAddress.setExtended( data[1] ); - if ( data.count() > 2 ) - mAddress.setStreet( data[2] ); - if ( data.count() > 3 ) - mAddress.setLocality( data[3] ); - if ( data.count() > 4 ) - mAddress.setRegion( data[4] ); - if ( data.count() > 5 ) - mAddress.setPostalCode( data[5] ); - if ( data.count() > 6 ) - mAddress.setCountry( data[6] ); - - return mAddress; -} - - -VCard21ParserImpl *VCard21ParserImpl::parseVCard( const TQString& vc, int *err ) -{ - int _err = 0; - int _state = VC_STATE_BEGIN; - - TQValueList *vcdata; - TQValueList lines; - - vcdata = new TQValueList; - - lines = TQStringList::split( TQRegExp( "[\x0d\x0a]" ), vc ); - - // for each line in the vCard - for ( TQStringList::Iterator j = lines.begin(); j != lines.end(); ++j ) { - VCardLineX _vcl; - - // take spaces off the end - ugly but necessary hack - for ( int g = (*j).length()-1; g > 0 && (*j)[g].isSpace(); --g ) - (*j)[g] = 0; - - // first token: - // verify state, update if necessary - if ( _state & VC_STATE_BEGIN) { - if ( !tqstricmp( (*j).latin1(), VCARD_BEGIN ) ) { - _state = VC_STATE_BODY; - continue; - } else { - _err = VC_ERR_NO_BEGIN; - break; - } - } else if ( _state & VC_STATE_BODY ) { - if ( !tqstricmp( (*j).latin1(), VCARD_END ) ) { - _state |= VC_STATE_END; - break; - } - - // split into two tokens - int colon = (*j).find( ':' ); - if ( colon < 0 ) { - _err = VC_ERR_INVALID_LINE; - break; - } - - TQString key = (*j).left( colon ); - TQString value = (*j).mid( colon + 1 ); - - // check for qualifiers and - // set name, qualified, qualifier(s) - TQStringList keyTokens = TQStringList::split( ';', key ); - bool qp = false, first_pass = true; - bool b64 = false; - - if ( keyTokens.count() > 0 ) { - _vcl.qualified = false; - _vcl.name = keyTokens[ 0 ].lower(); - - for ( TQStringList::Iterator z = keyTokens.begin(); z != keyTokens.end(); ++z ) { - TQString zz = (*z).lower(); - if ( zz == VCARD_QUOTED_PRINTABLE || zz == VCARD_ENCODING_QUOTED_PRINTABLE ) { - qp = true; - } else if ( zz == VCARD_BASE64 ) { - b64 = true; - } else if ( !first_pass ) { - _vcl.qualified = true; - _vcl.qualifiers.append( zz ); - } - first_pass = false; - } - } else { - _err = VC_ERR_INVALID_LINE; - } - - if ( _err != 0 ) - break; - - if ( _vcl.name == VCARD_VERSION ) - _state |= VC_STATE_HAVE_VERSION; - - if ( _vcl.name == VCARD_N || _vcl.name == VCARD_FN ) - _state |= VC_STATE_HAVE_N; - - // second token: - // split into tokens by ; - // add to parameters vector - if ( b64 ) { - if ( value[ value.length() - 1 ] != '=' ) - do { - value += *( ++j ); - } while ( (*j)[ (*j).length() - 1 ] != '=' ); - } else { - if ( qp ) { // join any split lines - while ( value[ value.length() - 1 ] == '=' ) { - value.remove( value.length() - 1, 1 ); - value.append(*( ++j )); - } - } - _vcl.parameters = TQStringList::split( ';', value, true ); - if ( qp ) { // decode the quoted printable - for ( TQStringList::Iterator z = _vcl.parameters.begin(); z != _vcl.parameters.end(); ++z ) - *z = KCodecs::quotedPrintableDecode( TQCString((*z).latin1()) ); - } - } - } else { - _err = VC_ERR_INTERNAL; - break; - } - - // validate VCardLineX - if ( !_vcl.isValid() ) { - _err = VC_ERR_INVALID_LINE; - break; - } - - // add to vector - vcdata->append( _vcl ); - } - - // errors to check at the last minute (exit state related) - if ( _err == 0 ) { - if ( !( _state & VC_STATE_END ) ) // we have to have an end!! - _err = VC_ERR_NO_END; - - if ( !( _state & VC_STATE_HAVE_N ) || // we have to have the mandatories! - !( _state & VC_STATE_HAVE_VERSION ) ) - _err = VC_ERR_MISSING_MANDATORY; - } - - // set the error message if we can, and only return an object - // if the vCard was valid. - if ( err ) - *err = _err; - - if ( _err != 0 ) { - delete vcdata; - return 0; - } - - return new VCard21ParserImpl( vcdata ); -} - -VCard21ParserImpl::VCard21ParserImpl() - : _vcdata( 0 ) -{ -} - -VCard21ParserImpl::VCard21ParserImpl(TQValueList *_vcd) - : _vcdata(_vcd) -{ -} - -VCard21ParserImpl::~VCard21ParserImpl() -{ - delete _vcdata; - _vcdata = 0; -} - -TQString VCard21ParserImpl::getValue(const TQString& name, const TQString& qualifier) -{ - TQString failed; - const TQString lowname = name.lower(); - const TQString lowqualifier = qualifier.lower(); - - for (TQValueListIterator i = _vcdata->begin();i != _vcdata->end();++i) { - if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) { - if ((*i).parameters.count() > 0) - return (*i).parameters[0]; - else return failed; - } - } - return failed; -} - - -TQString VCard21ParserImpl::getValue(const TQString& name) -{ - TQString failed; - const TQString lowname = name.lower(); - - for (TQValueListIterator i = _vcdata->begin();i != _vcdata->end();++i) { - if ((*i).name == lowname && !(*i).qualified) { - if ((*i).parameters.count() > 0) - return (*i).parameters[0]; - else return failed; - } - } - return failed; -} - - -TQStringList VCard21ParserImpl::getValues(const TQString& name) -{ - const TQString lowname = name.lower(); - for (TQValueListIterator i = _vcdata->begin();i != _vcdata->end();++i) { - if ((*i).name == lowname && !(*i).qualified) - return (*i).parameters; - } - // failed. - return TQStringList(); -} - -TQStringList VCard21ParserImpl::getValues(const TQString& name, const TQString& qualifier) -{ - const TQString lowname = name.lower(); - const TQString lowqualifier = qualifier.lower(); - for (TQValueListIterator i = _vcdata->begin();i != _vcdata->end();++i) { - if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) - return (*i).parameters; - } - // failed. - return TQStringList(); -} - - diff --git a/kabc/vcard21parser.h b/kabc/vcard21parser.h deleted file mode 100644 index 0eb66fa93..000000000 --- a/kabc/vcard21parser.h +++ /dev/null @@ -1,221 +0,0 @@ -/* - This file is part of libkabc. - - Copyright (c) 2002 Mark Westcott - Copyright (c) 2000 George Staikos - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KABC_VCARD21FORMAT_H -#define KABC_VCARD21FORMAT_H - -#include -#include -#include -#include -#include -#include - -#include "addressee.h" -#include "addressbook.h" -#include "phonenumber.h" - - -#define VCARD_BEGIN "begin:vcard" -#define VCARD_END "end:vcard" -#define VCARD_BEGIN_N "begin" -#define VCARD_END_N "end" -#define VCARD_VERSION "version" - -#define VCARD_FN "fn" -#define VCARD_N "n" - -// optional -#define VCARD_NAME "name" -#define VCARD_NICKNAME "nickname" -#define VCARD_PHOTO "photo" -#define VCARD_BDAY "bday" -#define VCARD_ADR "adr" - -// types -#define VCARD_ADR_DOM "dom" -#define VCARD_ADR_INTL "intl" -#define VCARD_ADR_POSTAL "postal" -#define VCARD_ADR_PARCEL "parcel" -#define VCARD_ADR_HOME "home" -#define VCARD_ADR_WORK "work" -#define VCARD_ADR_PREF "pref" -// values -#define VCARD_ADR_POBOX "PO Box" -#define VCARD_ADR_EXTADR "Extended Address" -#define VCARD_ADR_STREET "Street" -#define VCARD_ADR_LOCALITY "Locality" -#define VCARD_ADR_REGION "Region" -#define VCARD_ADR_POSTCODE "Postal Code" -#define VCARD_ADR_COUNTRY "Country Name" -#define VCARD_LABEL "label" -#define VCARD_PROFILE "profile" -#define VCARD_SOURCE "source" -#define VCARD_TEL "tel" -// types -#define VCARD_TEL_HOME "home" -#define VCARD_TEL_WORK "work" -#define VCARD_TEL_PREF "pref" -#define VCARD_TEL_VOICE "voice" -#define VCARD_TEL_FAX "fax" -#define VCARD_TEL_MSG "msg" -#define VCARD_TEL_CELL "cell" -#define VCARD_TEL_PAGER "pager" -#define VCARD_TEL_BBS "bbs" -#define VCARD_TEL_MODEM "modem" -#define VCARD_TEL_CAR "car" -#define VCARD_TEL_ISDN "isdn" -#define VCARD_TEL_VIDEO "video" -#define VCARD_TEL_PCS "pcs" -#define VCARD_EMAIL "email" -// types -#define VCARD_EMAIL_PREF "pref" -#define VCARD_EMAIL_INTERNET "internet" -#define VCARD_EMAIL_X400 "x400" -#define VCARD_TZ "tz" -#define VCARD_GEO "geo" -#define VCARD_MAILER "mailer" -#define VCARD_TITLE "title" -#define VCARD_ROLE "role" -#define VCARD_LOGO "logo" -#define VCARD_AGENT "agent" -#define VCARD_ORG "org" -#define VCARD_CATEGORIES "categories" -#define VCARD_NOTE "note" -#define VCARD_PRODID "prodid" -#define VCARD_REV "rev" -#define VCARD_SOUND "sound" -#define VCARD_UID "uid" -#define VCARD_URL "url" -#define VCARD_CLASS "class" -#define VCARD_CLASS_PUBLIC "public" -#define VCARD_CLASS_PRIVATE "private" -#define VCARD_CLASS_CONFIDENTIAL "confidential" -#define VCARD_KEY "key" -// types -#define VCARD_KEY_X509 "x509" -#define VCARD_KEY_PGP "pgp" - -#define VCARD_QUOTED_PRINTABLE "quoted-printable" -// this one is a temporary hack until we support TYPE=VALUE -#define VCARD_ENCODING_QUOTED_PRINTABLE "encoding=quoted-printable" -#define VCARD_BASE64 "base64" - -#define VC_STATE_BEGIN 1 -#define VC_STATE_BODY 2 -#define VC_STATE_END 4 -#define VC_STATE_HAVE_N 8 -#define VC_STATE_HAVE_VERSION 16 - -#define VC_ERR_NO_BEGIN 1 -#define VC_ERR_NO_END 2 -#define VC_ERR_INVALID_LINE 3 -#define VC_ERR_INTERNAL 4 -#define VC_ERR_INVALID_NAME 5 -#define VC_ERR_MISSING_MANDATORY 6 - -namespace KABC { - -class AddressBook; - -/** - @deprecated use VCardConverter instead. - */ -class KABC_EXPORT_DEPRECATED VCard21Parser -{ -public: - - /** - * Constructor. - */ - VCard21Parser(); - - /** - * Destructor. - */ - virtual ~VCard21Parser(); - - /** - * Parses a string in vcard2.1 format and saves the single addressees - * to the address book. - * - * @param ab The address book. - * @param str The vcard string. - */ - void readFromString( KABC::AddressBook *ab, const TQString &str ); - - /** - * FIXME: we need a writeToString method - * TQString writeToString (KABC::AddressBook *); - */ - - /** - * Parses a string in vcard2.1 format and returns the inherent addressee. - */ - KABC::Addressee readFromString( const TQString &data); - - /** - * Helper method to store a address. - * - * @param data A string list, that is filled with 'street', 'house number' ... - * @param type The type of the returned address. - */ - static KABC::Address readAddressFromQStringList (const TQStringList &data, const int type); -}; - -} - -/** - * @short Helper class - */ -class KABC_EXPORT VCardLineX -{ -public: - TQString name; - bool qualified; - TQValueList qualifiers; - TQValueList parameters; - bool isValid() const; -}; - -/** - * @short Helper class - */ -class KABC_EXPORT VCard21ParserImpl -{ - friend class VCardLineX; - -public: - VCard21ParserImpl(); - virtual ~VCard21ParserImpl(); - static VCard21ParserImpl *parseVCard(const TQString& vc, int *err = NULL); - TQString getValue(const TQString& name, const TQString& qualifier); - TQString getValue(const TQString& name); - TQStringList getValues(const TQString& name, const TQString& qualifier); - TQStringList getValues(const TQString& name); - - TQValueList *_vcdata; - -private: - VCard21ParserImpl (TQValueList *_vcd); -}; - -#endif diff --git a/kabc/vcardconverter.cpp b/kabc/vcardconverter.cpp deleted file mode 100644 index d575b019c..000000000 --- a/kabc/vcardconverter.cpp +++ /dev/null @@ -1,129 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "vcard21parser.h" -#include "vcardformatimpl.h" -#include "vcardtool.h" - -#include "vcardconverter.h" - -using namespace KABC; - -struct VCardConverter::VCardConverterData -{ - VCard21Parser vcard21parser; - VCardFormatImpl vcard30parser; -}; - -VCardConverter::VCardConverter() - : d( new VCardConverterData ) -{ -} - -VCardConverter::~VCardConverter() -{ - delete d; - d = 0; -} - -TQString VCardConverter::createVCard( const Addressee &addr, Version version ) -{ - Addressee::List list; - list.append( addr ); - - return createVCards( list, version ); -} - -TQString VCardConverter::createVCards( Addressee::List list, Version version ) -{ - VCardTool tool; - - return tool.createVCards( list, ( version == v3_0 ? VCard::v3_0 : VCard::v2_1 ) ); -} - -Addressee VCardConverter::parseVCard( const TQString& vcard ) -{ - Addressee::List list = parseVCards( vcard ); - - return list[ 0 ]; -} - -Addressee::List VCardConverter::parseVCards( const TQString& vcard ) -{ - VCardTool tool; - - return tool.parseVCards( vcard ); -} - -// ---------------------------- deprecated stuff ---------------------------- // - -bool VCardConverter::vCardToAddressee( const TQString &str, Addressee &addr, Version version ) -{ - if ( version == v2_1 ) { - addr = d->vcard21parser.readFromString( str ); - return true; - } - - if ( version == v3_0 ) - return d->vcard30parser.readFromString( str, addr ); - - return false; -} - -bool VCardConverter::addresseeToVCard( const Addressee &addr, TQString &str, Version version ) -{ - if ( version == v2_1 ) - return false; - - if ( version == v3_0 ) - return d->vcard30parser.writeToString( addr, str ); - - return false; -} - - -/* Helper functions */ - -TQString KABC::dateToVCardString( const TQDateTime &dateTime ) -{ - return dateTime.toString("yyyyMMddThhmmssZ"); -} - -TQString KABC::dateToVCardString( const TQDate &date ) -{ - return date.toString("yyyyMMdd"); -} - -TQDateTime KABC::VCardStringToDate( const TQString &dateString ) -{ - TQDate date; - TQTime time; - TQString d( dateString ); - - d = d.remove('-').remove(':'); - - if (d.length()>=8) - date = TQDate( d.mid(0,4).toUInt(), d.mid(4,2).toUInt(), d.mid(6,2).toUInt() ); - if (d.length()>9 && d[8].upper()=='T') - time = TQTime( d.mid(9,2).toUInt(), d.mid(11,2).toUInt(), d.mid(13,2).toUInt() ); - - return TQDateTime( date, time ); -} - diff --git a/kabc/vcardconverter.h b/kabc/vcardconverter.h deleted file mode 100644 index ab09279f2..000000000 --- a/kabc/vcardconverter.h +++ /dev/null @@ -1,163 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2002 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KABC_VCARDCONVERTER_H -#define KABC_VCARDCONVERTER_H - -#include - -#include "addressee.h" - -namespace KABC { - -/** - @short Class to converting contact objects into vCard format and vice versa. - - This class implements reading and writing of contact using from/to the - vCard format. Currently vCard version 2.1 and 3.0 is supported. - - Example: - - \code - - TQFile file( "myfile.vcf" ); - file.open( IO_ReadOnly ); - - TQString data = file.readAll(); - - VCardConverter converter; - Addressee::List list = converter.parseVCards( data ); - - // print formatted name of first contact - tqDebug( "name=%s", list[ 0 ].formattedName().latin1() ); - - \endcode -*/ -class KABC_EXPORT VCardConverter -{ - public: - - /** - @li v2_1 - VCard format version 2.1 - @li v3_0 - VCard format version 3.0 - */ - enum Version - { - v2_1, - v3_0 - }; - - /** - Constructor. - */ - VCardConverter(); - - /** - Destructor. - */ - ~VCardConverter(); - - /** - Creates a string in vCard format which contains the given - contact. - - @param addr The contact object - @param version The version of the generated vCard format - */ - TQString createVCard( const Addressee &addr, Version version = v3_0 ); - - /** - Creates a string in vCard format which contains the given - list of contact. - - @param list The list of contact objects - @param version The version of the generated vCard format - */ - // FIXME: Add error handling - TQString createVCards( Addressee::List list, Version version = v3_0 ); - - // FIXME: Add "createVCards( AddressBook * )" - - /** - Parses a string in vCard format and returns the first contact. - */ - Addressee parseVCard( const TQString& vcard ); - - /** - Parses a string in vCard format and returns a list of contact objects. - */ - // FIXME: Add error handling - Addressee::List parseVCards( const TQString& vcard ); - - // FIXME: Add "bool parseVCards( AddressBook *, const TQString &vcard )" - - /** - @deprecated - */ - bool vCardToAddressee( const TQString&, Addressee &, Version version = v3_0 ) KDE_DEPRECATED; - - /** - @deprecated - */ - bool addresseeToVCard( const Addressee&, TQString&, Version version = v3_0 ) KDE_DEPRECATED; - - private: - /** - Split a string and replaces escaped separators on the fly with - unescaped ones. - */ - TQStringList splitString( const TQChar &sep, const TQString &value ); - - struct VCardConverterData; - VCardConverterData *d; -}; - - -/** - Helper functions - */ - -/** - * Converts a TQDateTime to a date string as it is used in VCard and LDIF files. - * The return value is in the form "yyyyMMddThhmmssZ" (e.g. "20031201T120000Z") - * @param dateTime date and time to be converted - * @since 3.2 - */ -KABC_EXPORT TQString dateToVCardString( const TQDateTime &dateTime ); - -/** - * Converts a TQDate to a short date string as it is used in VCard and LDIF files. - * The return value is in the form "yyyyMMdd" (e.g. "20031201") - * @param date date to be converted - * @since 3.2 - */ -KABC_EXPORT TQString dateToVCardString( const TQDate &date ); - -/** - * Converts a date string as it is used in VCard and LDIF files to a TQDateTime value. - * If the date string does not contain a time value, it will be returned as 00:00:00. - * (e.g. "20031201T120000" will return a TQDateTime for 2003-12-01 at 12:00) - * @param dateString string representing the date and time. - * @since 3.2 - */ -KABC_EXPORT TQDateTime VCardStringToDate( const TQString &dateString ); - -} -#endif diff --git a/kabc/vcardformat.cpp b/kabc/vcardformat.cpp deleted file mode 100644 index 147aa4259..000000000 --- a/kabc/vcardformat.cpp +++ /dev/null @@ -1,59 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "vcardformatimpl.h" - -#include "vcardformat.h" - -using namespace KABC; - -VCardFormat::VCardFormat() -{ - mImpl = new VCardFormatImpl; -} - -VCardFormat::~VCardFormat() -{ - delete mImpl; -} - -bool VCardFormat::load( AddressBook *addressBook, const TQString &fileName ) -{ - TQFile f( fileName ); - if ( !f.open( IO_ReadOnly ) ) return false; - - bool result = mImpl->loadAll( addressBook, 0, &f ); - - f.close(); - - return result; -} - -bool VCardFormat::save( AddressBook *addressBook, const TQString &fileName ) -{ - TQFile f( fileName ); - if ( !f.open( IO_WriteOnly ) ) return false; - - mImpl->saveAll( addressBook, 0, &f ); - - f.close(); - - return true; -} diff --git a/kabc/vcardformat.h b/kabc/vcardformat.h deleted file mode 100644 index 8194056cb..000000000 --- a/kabc/vcardformat.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#ifndef KABC_VCARDFORMAT_H -#define KABC_VCARDFORMAT_H - -#include - -#include "format.h" - -namespace KABC { - -class AddressBook; -class VCardFormatImpl; - -/** - @deprecated use VCardFormatPlugin instead. - */ -class KABC_EXPORT_DEPRECATED VCardFormat : public Format { - public: - VCardFormat(); - virtual ~VCardFormat(); - - bool load( AddressBook *, const TQString &fileName ); - bool save( AddressBook *, const TQString &fileName ); - - private: - VCardFormatImpl *mImpl; -}; - -} - -#endif diff --git a/kabc/vcardformatimpl.cpp b/kabc/vcardformatimpl.cpp deleted file mode 100644 index ebaf337b0..000000000 --- a/kabc/vcardformatimpl.cpp +++ /dev/null @@ -1,1001 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ -#include -#include - -#include -#include -#include -#include - -#include - -#include "addressbook.h" -#include "vcardformatimpl.h" - -using namespace KABC; -using namespace VCARD; - -bool VCardFormatImpl::load( Addressee &addressee, TQFile *file ) -{ - kdDebug(5700) << "VCardFormat::load()" << endl; - - TQByteArray fdata = file->readAll(); - TQCString data(fdata.data(), fdata.size()+1); - - VCardEntity e( data ); - - VCardListIterator it( e.cardList() ); - - if ( it.current() ) { - VCARD::VCard v(*it.current()); - loadAddressee( addressee, v ); - return true; - } - - return false; -} - -bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, TQFile *file ) -{ - kdDebug(5700) << "VCardFormat::loadAll()" << endl; - - TQByteArray fdata = file->readAll(); - TQCString data(fdata.data(), fdata.size()+1); - - VCardEntity e( data ); - - VCardListIterator it( e.cardList() ); - - for (; it.current(); ++it) { - VCARD::VCard v(*it.current()); - Addressee addressee; - loadAddressee( addressee, v ); - addressee.setResource( resource ); - addressBook->insertAddressee( addressee ); - } - - return true; -} - -void VCardFormatImpl::save( const Addressee &addressee, TQFile *file ) -{ - VCardEntity vcards; - VCardList vcardlist; - vcardlist.setAutoDelete( true ); - - VCARD::VCard *v = new VCARD::VCard; - - saveAddressee( addressee, v, false ); - - vcardlist.append( v ); - vcards.setCardList( vcardlist ); - - TQCString vcardData = vcards.asString(); - file->writeBlock( (const char*)vcardData, vcardData.length() ); -} - -void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, TQFile *file ) -{ - VCardEntity vcards; - VCardList vcardlist; - vcardlist.setAutoDelete( true ); - - AddressBook::Iterator it; - for ( it = ab->begin(); it != ab->end(); ++it ) { - if ( (*it).resource() == resource ) { - VCARD::VCard *v = new VCARD::VCard; - saveAddressee( (*it), v, false ); - (*it).setChanged( false ); - vcardlist.append( v ); - } - } - - vcards.setCardList( vcardlist ); - - TQCString vcardData = vcards.asString(); - file->writeBlock( (const char*)vcardData, vcardData.length() ); -} - -bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCARD::VCard &v ) -{ - TQPtrList contentLines = v.contentLineList(); - ContentLine *cl; - - for( cl = contentLines.first(); cl; cl = contentLines.next() ) { - TQCString n = cl->name(); - if ( n.left( 2 ) == "X-" ) { - n = n.mid( 2 ); - int posDash = n.find( "-" ); - addressee.insertCustom( TQString::fromUtf8( n.left( posDash ) ), - TQString::fromUtf8( n.mid( posDash + 1 ) ), - TQString::fromUtf8( cl->value()->asString() ) ); - continue; - } - - EntityType type = cl->entityType(); - switch( type ) { - - case EntityUID: - addressee.setUid( readTextValue( cl ) ); - break; - - case EntityURI: - addressee.setUri( readTextValue( cl ) ); - break; - - case EntityEmail: - addressee.insertEmail( readTextValue( cl ) ); - break; - - case EntityName: - addressee.setName( readTextValue( cl ) ); - break; - - case EntityFullName: - addressee.setFormattedName( readTextValue( cl ) ); - break; - - case EntityURL: - addressee.setUrl( KURL( readTextValue( cl ) ) ); - break; - - case EntityNickname: - addressee.setNickName( readTextValue( cl ) ); - break; - - case EntityLabel: - // not yet supported by kabc - break; - - case EntityMailer: - addressee.setMailer( readTextValue( cl ) ); - break; - - case EntityTitle: - addressee.setTitle( readTextValue( cl ) ); - break; - - case EntityRole: - addressee.setRole( readTextValue( cl ) ); - break; - - case EntityOrganisation: - addressee.setOrganization( readTextValue( cl ) ); - break; - - case EntityNote: - addressee.setNote( readTextValue( cl ) ); - break; - - case EntityProductID: - addressee.setProductId( readTextValue( cl ) ); - break; - - case EntitySortString: - addressee.setSortString( readTextValue( cl ) ); - break; - - case EntityN: - readNValue( cl, addressee ); - break; - - case EntityAddress: - addressee.insertAddress( readAddressValue( cl ) ); - break; - - case EntityTelephone: - addressee.insertPhoneNumber( readTelephoneValue( cl ) ); - break; - - case EntityCategories: - addressee.setCategories( TQStringList::split( ",", readTextValue( cl ) ) ); - break; - - case EntityBirthday: - addressee.setBirthday( readDateValue( cl ) ); - break; - - case EntityRevision: - addressee.setRevision( readDateTimeValue( cl ) ); - break; - - case EntityGeo: - addressee.setGeo( readGeoValue( cl ) ); - break; - - case EntityTimeZone: - addressee.setTimeZone( readUTCValue( cl ) ); - break; - - case EntityVersion: - break; - - case EntityClass: - addressee.setSecrecy( readClassValue( cl ) ); - break; - - case EntityKey: - addressee.insertKey( readKeyValue( cl ) ); - break; - - case EntityPhoto: - addressee.setPhoto( readPictureValue( cl, EntityPhoto, addressee ) ); - break; - - case EntityLogo: - addressee.setLogo( readPictureValue( cl, EntityLogo, addressee ) ); - break; - - case EntityAgent: - addressee.setAgent( readAgentValue( cl ) ); - break; - - case EntitySound: - addressee.setSound( readSoundValue( cl, addressee ) ); - break; - - default: - kdDebug(5700) << "VCardFormat::load(): Unsupported entity: " - << int( type ) << ": " << cl->asString() << endl; - break; - } - } - - for( cl = contentLines.first(); cl; cl = contentLines.next() ) { - EntityType type = cl->entityType(); - if ( type == EntityLabel ) { - int type = readAddressParam( cl ); - Address address = addressee.address( type ); - if ( address.isEmpty() ) - address.setType( type ); - - address.setLabel( TQString::fromUtf8( cl->value()->asString() ) ); - addressee.insertAddress( address ); - } - } - - return true; -} - -void VCardFormatImpl::saveAddressee( const Addressee &addressee, VCARD::VCard *v, bool intern ) -{ - ContentLine cl; - TQString value; - - addTextValue( v, EntityName, addressee.name() ); - addTextValue( v, EntityUID, addressee.uid() ); - addTextValue( v, EntityURI, addressee.uri() ); - addTextValue( v, EntityFullName, addressee.formattedName() ); - - TQStringList emails = addressee.emails(); - TQStringList::ConstIterator it4; - for( it4 = emails.begin(); it4 != emails.end(); ++it4 ) { - addTextValue( v, EntityEmail, *it4 ); - } - - TQStringList customs = addressee.customs(); - TQStringList::ConstIterator it5; - for( it5 = customs.begin(); it5 != customs.end(); ++it5 ) { - addCustomValue( v, *it5 ); - } - - addTextValue( v, EntityURL, addressee.url().url() ); - - addNValue( v, addressee ); - - addTextValue( v, EntityNickname, addressee.nickName() ); - addTextValue( v, EntityMailer, addressee.mailer() ); - addTextValue( v, EntityTitle, addressee.title() ); - addTextValue( v, EntityRole, addressee.role() ); - addTextValue( v, EntityOrganisation, addressee.organization() ); - addTextValue( v, EntityNote, addressee.note() ); - addTextValue( v, EntityProductID, addressee.productId() ); - addTextValue( v, EntitySortString, addressee.sortString() ); - - Address::List addresses = addressee.addresses(); - Address::List::ConstIterator it3; - for( it3 = addresses.begin(); it3 != addresses.end(); ++it3 ) { - addAddressValue( v, *it3 ); - addLabelValue( v, *it3 ); - } - - PhoneNumber::List phoneNumbers = addressee.phoneNumbers(); - PhoneNumber::List::ConstIterator it2; - for( it2 = phoneNumbers.begin(); it2 != phoneNumbers.end(); ++it2 ) { - addTelephoneValue( v, *it2 ); - } - - Key::List keys = addressee.keys(); - Key::List::ConstIterator it6; - for( it6 = keys.begin(); it6 != keys.end(); ++it6 ) { - addKeyValue( v, *it6 ); - } - - addTextValue( v, EntityCategories, addressee.categories().join(",") ); - - addDateValue( v, EntityBirthday, TQT_TQDATE_OBJECT(addressee.birthday().date()) ); - addDateTimeValue( v, EntityRevision, TQT_TQDATETIME_OBJECT(addressee.revision()) ); - addGeoValue( v, addressee.geo() ); - addUTCValue( v, addressee.timeZone() ); - - addClassValue( v, addressee.secrecy() ); - - addPictureValue( v, EntityPhoto, addressee.photo(), addressee, intern ); - addPictureValue( v, EntityLogo, addressee.logo(), addressee, intern ); - - addAgentValue( v, addressee.agent() ); - - addSoundValue( v, addressee.sound(), addressee, intern ); -} - -void VCardFormatImpl::addCustomValue( VCARD::VCard *v, const TQString &txt ) -{ - if ( txt.isEmpty() ) return; - - ContentLine cl; - cl.setName( "X-" + txt.left( txt.find( ":" ) ).utf8() ); - TQString value = txt.mid( txt.find( ":" ) + 1 ); - if ( value.isEmpty() ) - return; - cl.setValue( new TextValue( value.utf8() ) ); - v->add(cl); -} - -void VCardFormatImpl::addTextValue( VCARD::VCard *v, EntityType type, const TQString &txt ) -{ - if ( txt.isEmpty() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( type ) ); - cl.setValue( new TextValue( txt.utf8() ) ); - v->add(cl); -} - -void VCardFormatImpl::addDateValue( VCARD::VCard *vcard, EntityType type, - const TQDate &date ) -{ - if ( !date.isValid() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( type ) ); - - DateValue *v = new DateValue( date ); - cl.setValue( v ); - vcard->add(cl); -} - -void VCardFormatImpl::addDateTimeValue( VCARD::VCard *vcard, EntityType type, - const TQDateTime &dateTime ) -{ - if ( !dateTime.isValid() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( type ) ); - - DateValue *v = new DateValue( dateTime ); - cl.setValue( v ); - vcard->add(cl); -} - -void VCardFormatImpl::addAddressValue( VCARD::VCard *vcard, const Address &a ) -{ - if ( a.isEmpty() ) - return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityAddress ) ); - - AdrValue *v = new AdrValue; - v->setPOBox( a.postOfficeBox().utf8() ); - v->setExtAddress( a.extended().utf8() ); - v->setStreet( a.street().utf8() ); - v->setLocality( a.locality().utf8() ); - v->setRegion( a.region().utf8() ); - v->setPostCode( a.postalCode().utf8() ); - v->setCountryName( a.country().utf8() ); - cl.setValue( v ); - - addAddressParam( &cl, a.type() ); - - vcard->add( cl ); -} - -void VCardFormatImpl::addLabelValue( VCARD::VCard *vcard, const Address &a ) -{ - if ( a.label().isEmpty() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityLabel ) ); - cl.setValue( new TextValue( a.label().utf8() ) ); - - addAddressParam( &cl, a.type() ); - - vcard->add( cl ); -} - -void VCardFormatImpl::addAddressParam( ContentLine *cl, int type ) -{ - ParamList params; - if ( type & Address::Dom ) params.append( new Param( "TYPE", "dom" ) ); - if ( type & Address::Intl ) params.append( new Param( "TYPE", "intl" ) ); - if ( type & Address::Parcel ) params.append( new Param( "TYPE", "parcel" ) ); - if ( type & Address::Postal ) params.append( new Param( "TYPE", "postal" ) ); - if ( type & Address::Work ) params.append( new Param( "TYPE", "work" ) ); - if ( type & Address::Home ) params.append( new Param( "TYPE", "home" ) ); - if ( type & Address::Pref ) params.append( new Param( "TYPE", "pref" ) ); - cl->setParamList( params ); -} - -void VCardFormatImpl::addGeoValue( VCARD::VCard *vcard, const Geo &geo ) -{ - if ( !geo.isValid() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityGeo ) ); - - GeoValue *v = new GeoValue; - v->setLatitude( geo.latitude() ); - v->setLongitude( geo.longitude() ); - - cl.setValue( v ); - vcard->add(cl); -} - -void VCardFormatImpl::addUTCValue( VCARD::VCard *vcard, const TimeZone &tz ) -{ - if ( !tz.isValid() ) return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityTimeZone ) ); - - UTCValue *v = new UTCValue; - - v->setPositive( tz.offset() >= 0 ); - v->setHour( (tz.offset() / 60) * ( tz.offset() >= 0 ? 1 : -1 ) ); - v->setMinute( (tz.offset() % 60) * ( tz.offset() >= 0 ? 1 : -1 ) ); - - cl.setValue( v ); - vcard->add(cl); -} - -void VCardFormatImpl::addClassValue( VCARD::VCard *vcard, const Secrecy &secrecy ) -{ - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityClass ) ); - - ClassValue *v = new ClassValue; - switch ( secrecy.type() ) { - case Secrecy::Public: - v->setType( (int)ClassValue::Public ); - break; - case Secrecy::Private: - v->setType( (int)ClassValue::Private ); - break; - case Secrecy::Confidential: - v->setType( (int)ClassValue::Confidential ); - break; - } - - cl.setValue( v ); - vcard->add(cl); -} - - -Address VCardFormatImpl::readAddressValue( ContentLine *cl ) -{ - Address a; - AdrValue *v = (AdrValue *)cl->value(); - a.setPostOfficeBox( TQString::fromUtf8( v->poBox() ) ); - a.setExtended( TQString::fromUtf8( v->extAddress() ) ); - a.setStreet( TQString::fromUtf8( v->street() ) ); - a.setLocality( TQString::fromUtf8( v->locality() ) ); - a.setRegion( TQString::fromUtf8( v->region() ) ); - a.setPostalCode( TQString::fromUtf8( v->postCode() ) ); - a.setCountry( TQString::fromUtf8( v->countryName() ) ); - - a.setType( readAddressParam( cl ) ); - - return a; -} - -int VCardFormatImpl::readAddressParam( ContentLine *cl ) -{ - int type = 0; - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "TYPE" ) { - if ( (*it)->value() == "dom" ) type |= Address::Dom; - else if ( (*it)->value() == "intl" ) type |= Address::Intl; - else if ( (*it)->value() == "parcel" ) type |= Address::Parcel; - else if ( (*it)->value() == "postal" ) type |= Address::Postal; - else if ( (*it)->value() == "work" ) type |= Address::Work; - else if ( (*it)->value() == "home" ) type |= Address::Home; - else if ( (*it)->value() == "pref" ) type |= Address::Pref; - } - } - return type; -} - -void VCardFormatImpl::addNValue( VCARD::VCard *vcard, const Addressee &a ) -{ - ContentLine cl; - cl.setName(EntityTypeToParamName( EntityN ) ); - NValue *v = new NValue; - v->setFamily( TQString(a.familyName()).utf8() ); - v->setGiven( TQString(a.givenName()).utf8() ); - v->setMiddle( TQString(a.additionalName()).utf8() ); - v->setPrefix( TQString(a.prefix()).utf8() ); - v->setSuffix( TQString(a.suffix()).utf8() ); - - cl.setValue( v ); - vcard->add(cl); -} - -void VCardFormatImpl::readNValue( ContentLine *cl, Addressee &a ) -{ - NValue *v = (NValue *)cl->value(); - a.setFamilyName( TQString::fromUtf8( v->family() ) ); - a.setGivenName( TQString::fromUtf8( v->given() ) ); - a.setAdditionalName( TQString::fromUtf8( v->middle() ) ); - a.setPrefix( TQString::fromUtf8( v->prefix() ) ); - a.setSuffix( TQString::fromUtf8( v->suffix() ) ); -} - -void VCardFormatImpl::addTelephoneValue( VCARD::VCard *v, const PhoneNumber &p ) -{ - if ( p.number().isEmpty() ) - return; - - ContentLine cl; - cl.setName(EntityTypeToParamName(EntityTelephone)); - cl.setValue(new TelValue( p.number().utf8() )); - - ParamList params; - if( p.type() & PhoneNumber::Home ) params.append( new Param( "TYPE", "home" ) ); - if( p.type() & PhoneNumber::Work ) params.append( new Param( "TYPE", "work" ) ); - if( p.type() & PhoneNumber::Msg ) params.append( new Param( "TYPE", "msg" ) ); - if( p.type() & PhoneNumber::Pref ) params.append( new Param( "TYPE", "pref" ) ); - if( p.type() & PhoneNumber::Voice ) params.append( new Param( "TYPE", "voice" ) ); - if( p.type() & PhoneNumber::Fax ) params.append( new Param( "TYPE", "fax" ) ); - if( p.type() & PhoneNumber::Cell ) params.append( new Param( "TYPE", "cell" ) ); - if( p.type() & PhoneNumber::Video ) params.append( new Param( "TYPE", "video" ) ); - if( p.type() & PhoneNumber::Bbs ) params.append( new Param( "TYPE", "bbs" ) ); - if( p.type() & PhoneNumber::Modem ) params.append( new Param( "TYPE", "modem" ) ); - if( p.type() & PhoneNumber::Car ) params.append( new Param( "TYPE", "car" ) ); - if( p.type() & PhoneNumber::Isdn ) params.append( new Param( "TYPE", "isdn" ) ); - if( p.type() & PhoneNumber::Pcs ) params.append( new Param( "TYPE", "pcs" ) ); - if( p.type() & PhoneNumber::Pager ) params.append( new Param( "TYPE", "pager" ) ); - cl.setParamList( params ); - - v->add(cl); -} - -PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl ) -{ - PhoneNumber p; - TelValue *value = (TelValue *)cl->value(); - p.setNumber( TQString::fromUtf8( value->asString() ) ); - - int type = 0; - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "TYPE" ) { - if ( (*it)->value() == "home" ) type |= PhoneNumber::Home; - else if ( (*it)->value() == "work" ) type |= PhoneNumber::Work; - else if ( (*it)->value() == "msg" ) type |= PhoneNumber::Msg; - else if ( (*it)->value() == "pref" ) type |= PhoneNumber::Pref; - else if ( (*it)->value() == "voice" ) type |= PhoneNumber::Voice; - else if ( (*it)->value() == "fax" ) type |= PhoneNumber::Fax; - else if ( (*it)->value() == "cell" ) type |= PhoneNumber::Cell; - else if ( (*it)->value() == "video" ) type |= PhoneNumber::Video; - else if ( (*it)->value() == "bbs" ) type |= PhoneNumber::Bbs; - else if ( (*it)->value() == "modem" ) type |= PhoneNumber::Modem; - else if ( (*it)->value() == "car" ) type |= PhoneNumber::Car; - else if ( (*it)->value() == "isdn" ) type |= PhoneNumber::Isdn; - else if ( (*it)->value() == "pcs" ) type |= PhoneNumber::Pcs; - else if ( (*it)->value() == "pager" ) type |= PhoneNumber::Pager; - } - } - p.setType( type ); - - return p; -} - -TQString VCardFormatImpl::readTextValue( ContentLine *cl ) -{ - VCARD::Value *value = cl->value(); - if ( value ) { - return TQString::fromUtf8( value->asString() ); - } else { - kdDebug(5700) << "No value: " << cl->asString() << endl; - return TQString::null; - } -} - -TQDate VCardFormatImpl::readDateValue( ContentLine *cl ) -{ - DateValue *dateValue = (DateValue *)cl->value(); - if ( dateValue ) - return dateValue->qdate(); - else - return TQDate(); -} - -TQDateTime VCardFormatImpl::readDateTimeValue( ContentLine *cl ) -{ - DateValue *dateValue = (DateValue *)cl->value(); - if ( dateValue ) - return dateValue->qdt(); - else - return TQDateTime(); -} - -Geo VCardFormatImpl::readGeoValue( ContentLine *cl ) -{ - GeoValue *geoValue = (GeoValue *)cl->value(); - if ( geoValue ) { - Geo geo( geoValue->latitude(), geoValue->longitude() ); - return geo; - } else - return Geo(); -} - -TimeZone VCardFormatImpl::readUTCValue( ContentLine *cl ) -{ - UTCValue *utcValue = (UTCValue *)cl->value(); - if ( utcValue ) { - TimeZone tz; - tz.setOffset(((utcValue->hour()*60)+utcValue->minute())*(utcValue->positive() ? 1 : -1)); - return tz; - } else - return TimeZone(); -} - -Secrecy VCardFormatImpl::readClassValue( ContentLine *cl ) -{ - ClassValue *classValue = (ClassValue *)cl->value(); - if ( classValue ) { - Secrecy secrecy; - switch ( classValue->type() ) { - case ClassValue::Public: - secrecy.setType( Secrecy::Public ); - break; - case ClassValue::Private: - secrecy.setType( Secrecy::Private ); - break; - case ClassValue::Confidential: - secrecy.setType( Secrecy::Confidential ); - break; - } - - return secrecy; - } else - return Secrecy(); -} - -void VCardFormatImpl::addKeyValue( VCARD::VCard *vcard, const Key &key ) -{ - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityKey ) ); - - ParamList params; - if ( key.isBinary() ) { - cl.setValue( new TextValue( KCodecs::base64Encode( key.binaryData() ) ) ); - params.append( new Param( "ENCODING", "b" ) ); - } else { - cl.setValue( new TextValue( key.textData().utf8() ) ); - } - - switch ( key.type() ) { - case Key::X509: - params.append( new Param( "TYPE", "X509" ) ); - break; - case Key::PGP: - params.append( new Param( "TYPE", "PGP" ) ); - break; - case Key::Custom: - params.append( new Param( "TYPE", key.customTypeString().utf8() ) ); - break; - } - - cl.setParamList( params ); - vcard->add( cl ); -} - -Key VCardFormatImpl::readKeyValue( VCARD::ContentLine *cl ) -{ - Key key; - bool isBinary = false; - TextValue *v = (TextValue *)cl->value(); - - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) - isBinary = true; - if ( (*it)->name() == "TYPE" ) { - if ( (*it)->value().isEmpty() ) - continue; - if ( (*it)->value() == "X509" ) - key.setType( Key::X509 ); - else if ( (*it)->value() == "PGP" ) - key.setType( Key::PGP ); - else { - key.setType( Key::Custom ); - key.setCustomTypeString( TQString::fromUtf8( (*it)->value() ) ); - } - } - } - - - if ( isBinary ) { - TQByteArray data; - KCodecs::base64Decode( v->asString().stripWhiteSpace(), data ); - key.setBinaryData( data ); - } else { - key.setTextData( TQString::fromUtf8( v->asString() ) ); - } - - return key; -} - - -void VCardFormatImpl::addAgentValue( VCARD::VCard *vcard, const Agent &agent ) -{ - if ( agent.isIntern() && !agent.addressee() ) - return; - - if ( !agent.isIntern() && agent.url().isEmpty() ) - return; - - ContentLine cl; - cl.setName( EntityTypeToParamName( EntityAgent ) ); - - ParamList params; - if ( agent.isIntern() ) { - TQString vstr; - Addressee *addr = agent.addressee(); - if ( addr ) { - writeToString( (*addr), vstr ); - vstr.replace( ":", "\\:" ); - vstr.replace( ",", "\\," ); - vstr.replace( ";", "\\;" ); - vstr.replace( "\r\n", "\\n" ); - cl.setValue( new TextValue( vstr.utf8() ) ); - } else - return; - } else { - cl.setValue( new TextValue( agent.url().utf8() ) ); - params.append( new Param( "VALUE", "uri" ) ); - } - - cl.setParamList( params ); - vcard->add( cl ); -} - -Agent VCardFormatImpl::readAgentValue( VCARD::ContentLine *cl ) -{ - Agent agent; - bool isIntern = true; - TextValue *v = (TextValue *)cl->value(); - - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "VALUE" && (*it)->value() == "uri" ) - isIntern = false; - } - - if ( isIntern ) { - TQString vstr = TQString::fromUtf8( v->asString() ); - vstr.replace( "\\n", "\r\n" ); - vstr.replace( "\\:", ":" ); - vstr.replace( "\\,", "," ); - vstr.replace( "\\;", ";" ); - Addressee *addr = new Addressee; - readFromString( vstr, *addr ); - agent.setAddressee( addr ); - } else { - agent.setUrl( TQString::fromUtf8( v->asString() ) ); - } - - return agent; -} - -void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType type, const Picture &pic, const Addressee &addr, bool intern ) -{ - ContentLine cl; - cl.setName( EntityTypeToParamName( type ) ); - - if ( pic.isIntern() && pic.data().isNull() ) - return; - - if ( !pic.isIntern() && pic.url().isEmpty() ) - return; - - ParamList params; - if ( pic.isIntern() ) { - TQImage img = pic.data(); - if ( intern ) { // only for vCard export we really write the data inline - TQByteArray data; - TQDataStream s( data, IO_WriteOnly ); - s.setVersion( 4 ); // to produce valid png files - s << img; - cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); - } else { // save picture in cache - TQString dir; - if ( type == EntityPhoto ) - dir = "photos"; - if ( type == EntityLogo ) - dir = "logos"; - - img.save( locateLocal( "data", "kabc/" + dir + "/" + addr.uid() ), pic.type().utf8() ); - cl.setValue( new TextValue( "" ) ); - } - params.append( new Param( "ENCODING", "b" ) ); - if ( !pic.type().isEmpty() ) - params.append( new Param( "TYPE", pic.type().utf8() ) ); - } else { - cl.setValue( new TextValue( pic.url().utf8() ) ); - params.append( new Param( "VALUE", "uri" ) ); - } - - cl.setParamList( params ); - vcard->add( cl ); -} - -Picture VCardFormatImpl::readPictureValue( VCARD::ContentLine *cl, VCARD::EntityType type, const Addressee &addr ) -{ - Picture pic; - bool isInline = false; - TQString picType; - TextValue *v = (TextValue *)cl->value(); - - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) - isInline = true; - if ( (*it)->name() == "TYPE" && !(*it)->value().isEmpty() ) - picType = TQString::fromUtf8( (*it)->value() ); - } - - if ( isInline ) { - TQImage img; - if ( v->asString() == "" ) { // no picture inline stored => picture is in cache - TQString dir; - if ( type == EntityPhoto ) - dir = "photos"; - if ( type == EntityLogo ) - dir = "logos"; - - img.load( locateLocal( "data", "kabc/" + dir + "/" + addr.uid() ) ); - } else { - TQByteArray data; - KCodecs::base64Decode( v->asString(), data ); - img.loadFromData( data ); - } - pic.setData( img ); - pic.setType( picType ); - } else { - pic.setUrl( TQString::fromUtf8( v->asString() ) ); - } - - return pic; -} - -void VCardFormatImpl::addSoundValue( VCARD::VCard *vcard, const Sound &sound, const Addressee &addr, bool intern ) -{ - ContentLine cl; - cl.setName( EntityTypeToParamName( EntitySound ) ); - - if ( sound.isIntern() && sound.data().isNull() ) - return; - - if ( !sound.isIntern() && sound.url().isEmpty() ) - return; - - ParamList params; - if ( sound.isIntern() ) { - TQByteArray data = sound.data(); - if ( intern ) { // only for vCard export we really write the data inline - cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); - } else { // save sound in cache - TQFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) ); - if ( file.open( IO_WriteOnly ) ) { - file.writeBlock( data ); - } - cl.setValue( new TextValue( "" ) ); - } - params.append( new Param( "ENCODING", "b" ) ); - } else { - cl.setValue( new TextValue( sound.url().utf8() ) ); - params.append( new Param( "VALUE", "uri" ) ); - } - - cl.setParamList( params ); - vcard->add( cl ); -} - -Sound VCardFormatImpl::readSoundValue( VCARD::ContentLine *cl, const Addressee &addr ) -{ - Sound sound; - bool isInline = false; - TextValue *v = (TextValue *)cl->value(); - - ParamList params = cl->paramList(); - ParamListIterator it( params ); - for( ; it.current(); ++it ) { - if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) - isInline = true; - } - - if ( isInline ) { - TQByteArray data; - if ( v->asString() == "" ) { // no sound inline stored => sound is in cache - TQFile file( locateLocal( "data", "kabc/sounds/" + addr.uid() ) ); - if ( file.open( IO_ReadOnly ) ) { - data = file.readAll(); - file.close(); - } - } else { - KCodecs::base64Decode( v->asString(), data ); - } - sound.setData( data ); - } else { - sound.setUrl( TQString::fromUtf8( v->asString() ) ); - } - - return sound; -} - -bool VCardFormatImpl::readFromString( const TQString &vcard, Addressee &addressee ) -{ - VCardEntity e( vcard.utf8() ); - VCardListIterator it( e.cardList() ); - - if ( it.current() ) { - VCARD::VCard v(*it.current()); - loadAddressee( addressee, v ); - return true; - } - - return false; -} - -bool VCardFormatImpl::writeToString( const Addressee &addressee, TQString &vcard ) -{ - VCardEntity vcards; - VCardList vcardlist; - vcardlist.setAutoDelete( true ); - - VCARD::VCard *v = new VCARD::VCard; - - saveAddressee( addressee, v, true ); - - vcardlist.append( v ); - vcards.setCardList( vcardlist ); - vcard = TQString::fromUtf8( vcards.asString() ); - - return true; -} diff --git a/kabc/vcardformatimpl.h b/kabc/vcardformatimpl.h deleted file mode 100644 index 78c466a86..000000000 --- a/kabc/vcardformatimpl.h +++ /dev/null @@ -1,106 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KABC_VCARDFORMATIMPL_H -#define KABC_VCARDFORMATIMPL_H - -#include -#include - -#include "address.h" -#include "addressee.h" - -#ifdef __CYGWIN__ -#include -#else -#include -#endif - -namespace KABC { - -class AddressBook; - -/** - @deprecated use VCardFormatPlugin instead. - */ -class KABC_EXPORT_DEPRECATED VCardFormatImpl -{ - public: - bool load( Addressee &, TQFile *file ); - bool loadAll( AddressBook *, Resource *, TQFile *file ); - void save( const Addressee &, TQFile *file ); - void saveAll( AddressBook *, Resource *, TQFile *file ); - - bool readFromString( const TQString &vcard, Addressee &addr ); - bool writeToString( const Addressee &addressee, TQString &vcard ); - - protected: - bool loadAddressee( Addressee &, VCARD::VCard & ); - void saveAddressee( const Addressee &, VCARD::VCard *, bool intern ); - - void addTextValue (VCARD::VCard *, VCARD::EntityType, const TQString & ); - TQString readTextValue( VCARD::ContentLine * ); - - void addDateValue( VCARD::VCard *, VCARD::EntityType, const TQDate & ); - TQDate readDateValue( VCARD::ContentLine * ); - - void addDateTimeValue( VCARD::VCard *, VCARD::EntityType, const TQDateTime & ); - TQDateTime readDateTimeValue( VCARD::ContentLine * ); - - void addAddressValue( VCARD::VCard *, const Address & ); - Address readAddressValue( VCARD::ContentLine * ); - - void addLabelValue( VCARD::VCard *, const Address & ); - - void addTelephoneValue( VCARD::VCard *, const PhoneNumber & ); - PhoneNumber readTelephoneValue( VCARD::ContentLine * ); - - void addNValue( VCARD::VCard *, const Addressee & ); - void readNValue( VCARD::ContentLine *, Addressee & ); - - void addCustomValue( VCARD::VCard *, const TQString & ); - - void addAddressParam( VCARD::ContentLine *, int ); - int readAddressParam( VCARD::ContentLine * ); - - void addGeoValue( VCARD::VCard *, const Geo & ); - Geo readGeoValue( VCARD::ContentLine * ); - - void addUTCValue( VCARD::VCard *, const TimeZone & ); - TimeZone readUTCValue( VCARD::ContentLine * ); - - void addClassValue( VCARD::VCard *, const Secrecy & ); - Secrecy readClassValue( VCARD::ContentLine * ); - - void addKeyValue( VCARD::VCard *, const Key & ); - Key readKeyValue( VCARD::ContentLine * ); - - void addPictureValue( VCARD::VCard *, VCARD::EntityType, const Picture &, const Addressee &, bool ); - Picture readPictureValue( VCARD::ContentLine *, VCARD::EntityType, const Addressee &addr ); - - void addSoundValue( VCARD::VCard *, const Sound &, const Addressee &, bool ); - Sound readSoundValue( VCARD::ContentLine *, const Addressee &addr ); - - void addAgentValue( VCARD::VCard *, const Agent & ); - Agent readAgentValue( VCARD::ContentLine * ); -}; - -} -#endif diff --git a/kabc/vcardformatplugin.cpp b/kabc/vcardformatplugin.cpp deleted file mode 100644 index 6194cd0fe..000000000 --- a/kabc/vcardformatplugin.cpp +++ /dev/null @@ -1,120 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include - -#include "address.h" -#include "addressee.h" -#include "vcardconverter.h" - -#include "vcardformatplugin.h" - -using namespace KABC; - -VCardFormatPlugin::VCardFormatPlugin() -{ -} - -VCardFormatPlugin::~VCardFormatPlugin() -{ -} - -bool VCardFormatPlugin::load( Addressee &addressee, TQFile *file ) -{ - TQString data; - - TQTextStream t( file ); - t.setEncoding( TQTextStream::Latin1 ); - data = t.read(); - - VCardConverter converter; - Addressee::List l = converter.parseVCards( data ); - - if ( ! l.first().isEmpty() ) { - addressee = l.first(); - return true; - } - - return false; -} - -bool VCardFormatPlugin::loadAll( AddressBook*, Resource *resource, TQFile *file ) -{ - TQString data; - - TQTextStream t( file ); - t.setEncoding( TQTextStream::Latin1 ); - data = t.read(); - - VCardConverter converter; - - Addressee::List l = converter.parseVCards( data ); - - Addressee::List::iterator itr; - for ( itr = l.begin(); itr != l.end(); ++itr) { - Addressee addressee = *itr; - addressee.setResource( resource ); - addressee.setChanged( false ); - resource->insertAddressee( addressee ); - } - - return true; -} - -void VCardFormatPlugin::save( const Addressee &addressee, TQFile *file ) -{ - VCardConverter converter ; - Addressee::List vcardlist; - - - vcardlist.append( addressee ); - - TQTextStream t( file ); - t.setEncoding( TQTextStream::UnicodeUTF8 ); - t << converter.createVCards( vcardlist ); -} - -void VCardFormatPlugin::saveAll( AddressBook*, Resource *resource, TQFile *file ) -{ - VCardConverter converter; - Addressee::List vcardlist; - - Resource::Iterator it; - for ( it = resource->begin(); it != resource->end(); ++it ) { - (*it).setChanged( false ); - vcardlist.append( *it ); - } - - TQTextStream t( file ); - t.setEncoding( TQTextStream::UnicodeUTF8 ); - t << converter.createVCards( vcardlist ); -} - -bool VCardFormatPlugin::checkFormat( TQFile *file ) const -{ - TQString line; - - file->readLine( line, 1024 ); - line = line.stripWhiteSpace(); - if ( line == "BEGIN:VCARD" ) - return true; - else - return false; -} diff --git a/kabc/vcardformatplugin.h b/kabc/vcardformatplugin.h deleted file mode 100644 index 5ac7e49c2..000000000 --- a/kabc/vcardformatplugin.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2001 Cornelius Schumacher - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KABC_VCARDFORMATPLUGIN_H -#define KABC_VCARDFORMATPLUGIN_H - -#include "formatplugin.h" - -namespace KABC { - -class AddressBook; -class Addressee; - -/** - @short Interface of vCard backend for address book. - - This class implements the file format interface of address book entries for - the vCard format. -*/ -class KABC_EXPORT VCardFormatPlugin : public FormatPlugin -{ - public: - VCardFormatPlugin(); - virtual ~VCardFormatPlugin(); - - bool load( Addressee &, TQFile *file ); - bool loadAll( AddressBook *, Resource *, TQFile *file ); - void save( const Addressee &, TQFile *file ); - void saveAll( AddressBook *, Resource *, TQFile *file ); - - bool checkFormat( TQFile *file ) const; - - private: - struct VCardFormatPrivate; - VCardFormatPrivate *d; -}; - -} -#endif diff --git a/kabc/vcardparser/CMakeLists.txt b/kabc/vcardparser/CMakeLists.txt deleted file mode 100644 index 2c6fa112a..000000000 --- a/kabc/vcardparser/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -################################################# -# -# (C) 2010 Serghei Amelian -# serghei (DOT) amelian (AT) gmail.com -# -# Improvements and feedback are welcome -# -# This file is released under GPL >= 2 -# -################################################# - -include_directories( - ${TQT_INCLUDE_DIRS} - ${CMAKE_BINARY_DIR}/tdecore - ${CMAKE_SOURCE_DIR}/tdecore -) - -link_directories( - ${TQT_LIBRARY_DIRS} -) - - -##### headers ################################### - -install( FILES - vcard.h vcardline.h vcardparser.h - DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) - - -##### vcards #################################### - -set( target vcards ) - -set( ${target}_SRCS - vcard.cpp vcardline.cpp vcardparser.cpp -) - -tde_add_library( ${target} STATIC_PIC - SOURCES ${${target}_SRCS} -) diff --git a/kabc/vcardparser/Makefile.am b/kabc/vcardparser/Makefile.am deleted file mode 100644 index 53e4e42ab..000000000 --- a/kabc/vcardparser/Makefile.am +++ /dev/null @@ -1,31 +0,0 @@ -INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc $(all_includes) - -noinst_LTLIBRARIES = libvcards.la -libvcards_la_SOURCES = vcard.cpp vcardline.cpp vcardparser.cpp - -vcardsincludedir = $(includedir)/kabc -vcardsinclude_HEADERS = vcard.h vcardline.h vcardparser.h - -check_PROGRAMS = testread testwrite testread2 - -testread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testread_LDADD = libvcards.la $(top_builddir)/kabc/libkabc.la -testread_SOURCES = testread.cpp - -testread2_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testread2_LDADD = libvcards.la $(top_builddir)/kabc/libkabc.la -testread2_SOURCES = testread2.cpp testutils.cpp - -testwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor -testwrite_LDADD = libvcards.la $(top_builddir)/kabc/libkabc.la -testwrite_SOURCES = testwrite.cpp - -TESTFILES = vcard1.vcf vcard2.vcf vcard3.vcf vcard4.vcf vcard6.vcf vcard7.vcf - -check-local: testread - rm -f FAILED; \ - for i in $(TESTFILES); \ - do perl $(top_srcdir)/kabc/vcardparser/checkvcard.pl \ - $(top_srcdir)/kabc/vcardparser/tests/$$i; \ - done; \ - [ ! -e FAILED ] diff --git a/kabc/vcardparser/README.testing b/kabc/vcardparser/README.testing deleted file mode 100644 index a7794931d..000000000 --- a/kabc/vcardparser/README.testing +++ /dev/null @@ -1,15 +0,0 @@ -For testing the vcardparser there are some test files and a small testsuite -automatically checking for regressions. The tests directory contains some vCard -files and correpsonding reference output files (with an additional ".ref" -suffix). For running the geression test do "make check". This will compile some -test programs, parse the test files, write them out as vCard again and compare -the output to the reference file. The check fails, if there are unexpected -differences and shows which lines differed. - -For creating a new test put a vCard file to be parsed into the tests directory. -Create a reference file by running "testread" on the test file. It will put out -the parsed data as vCard again on stdout. Carefully check the output, manually -correct any errors and save the result as reference file in the tests directory. -Now add the filename to the TESTFILES variable in Makefile.am and run "make -check". If the check fails adapt the reference file or fix the bugs in the -parser, whatever is appropriate. diff --git a/kabc/vcardparser/checkvcard.pl b/kabc/vcardparser/checkvcard.pl deleted file mode 100755 index 67160ea4a..000000000 --- a/kabc/vcardparser/checkvcard.pl +++ /dev/null @@ -1,75 +0,0 @@ -#!/usr/bin/perl - -if ( @ARGV != 1 ) { - print STDERR "Missing arg: filename\n"; - exit 1; -} - -$file = $ARGV[0]; - -if ( !open( IN, "$file" ) ) { - print STDERR "Unable to open '$file'\n"; - exit 1; -} - -while( ) { - if (/^VERSION:(.*)$/ ) { - $version = $1; - if ( $version eq "2.1" ) { $options = "--vcard21"; } - } -} - -close IN; - -$ref = "$file.ref"; - -if ( !open( REF, "$ref" ) ) { - print STDERR "Unable to open $ref\n"; - exit 1; -} - -while( ) { - push @ref, $_; -} - -close REF; - -if ( !open( READ, "./testread $file $options 2> /dev/null |" ) ) { - print STDERR "Unable to open testread\n"; - exit 1; -} - -print "Checking '$file':\n"; - -$gotsomething = 0; -$error = 0; -$i = 0; -while( ) { - $gotsomething = 1; - $out = $_; - $ref = @ref[$i++]; - - if ( $out ne $ref ) { - if ( $ref =~ /^UID/ && $out =~ /^UID/ ) { next; } - $error++; - print " Expected : $ref"; - print " Parser output : $out"; - } -} - -close READ; - -if ( $gotsomething == 0 ) { - print "\n FAILED: testread didn't output anything\n"; - system "touch FAILED"; - exit 1; -} -if ( $error > 0 ) { - print "\n FAILED: $error errors found.\n"; - system "touch FAILED"; - exit 1; -} else { - print " OK\n"; -} - -exit 0; diff --git a/kabc/vcardparser/testread.cpp b/kabc/vcardparser/testread.cpp deleted file mode 100644 index 6c3405ef9..000000000 --- a/kabc/vcardparser/testread.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* - This file is part of libkabc. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include - -#include -#include - -#include -#include -#include -#include -#include -#include - -#include "vcardconverter.h" -#include "vcard.h" - -static const TDECmdLineOptions options[] = -{ - {"vcard21", I18N_NOOP("vCard 2.1"), 0}, - {"+inputfile", I18N_NOOP("Input file"), 0}, - TDECmdLineLastOption -}; - -int main( int argc, char **argv ) -{ - TDEApplication::disableAutoDcopRegistration(); - - TDEAboutData aboutData( "testread", "vCard test reader", "0.1" ); - aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); - - TDECmdLineArgs::init( argc, argv, &aboutData ); - TDECmdLineArgs::addCmdLineOptions( options ); - - TDEApplication app( false, false ); - - TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); - - if ( args->count() != 1 ) { - std::cerr << "Missing argument" << std::endl; - return 1; - } - - TQString inputFile( args->arg( 0 ) ); - - TQFile file( inputFile ); - if ( !file.open( IO_ReadOnly ) ) { - tqDebug( "Unable to open file '%s' for reading!", file.name().latin1() ); - return 1; - } - - TQString text; - - TQTextStream s( &file ); - s.setEncoding( TQTextStream::Latin1 ); - text = s.read(); - file.close(); - - KABC::VCardConverter converter; - KABC::Addressee::List list = converter.parseVCards( text ); - - if ( args->isSet( "vcard21" ) ) { - text = converter.createVCards( list, KABC::VCardConverter::v2_1 ); // uses version 2.1 - } else { - text = converter.createVCards( list ); // uses version 3.0 - } - - std::cout << text.utf8(); - - return 0; -} diff --git a/kabc/vcardparser/testread2.cpp b/kabc/vcardparser/testread2.cpp deleted file mode 100644 index ba73081e7..000000000 --- a/kabc/vcardparser/testread2.cpp +++ /dev/null @@ -1,42 +0,0 @@ -#include "testutils.h" -#include -#include -#include - -using namespace KABC; - -int -main() -{ - Addressee::List l = vCardsAsAddresseeList(); - TQString vcards = vCardsAsText(); - - VCardConverter vct; - - Addressee::List parsed = vct.parseVCards( vcards ); - - if ( l.size() != parsed.size() ) { - kdDebug()<<"\tSize - FAILED : "< -#include -#include - -using namespace KABC; - -Addressee -vcard1() -{ - Addressee addr; - - addr.setName( "Frank Dawson" ); - addr.setOrganization( "Lotus Development Corporation" ); - addr.setUrl( KURL( "http://home.earthlink.net/~fdawson") ); - addr.insertEmail( "fdawson@earthlink.net" ); - addr.insertEmail( "Frank_Dawson@Lotus.com", true ); - addr.insertPhoneNumber( PhoneNumber("+1-919-676-9515",PhoneNumber::Voice|PhoneNumber::Msg - |PhoneNumber::Work ) ); - addr.insertPhoneNumber( PhoneNumber("+1-919-676-9564",PhoneNumber::Fax |PhoneNumber::Work )); - Address a( Address::Work | Address::Postal | Address::Parcel ); - a.setStreet( "6544 Battleford Drive" ); - a.setLocality( "Raleigh" ); - a.setRegion( "NC" ); - a.setPostalCode( "27613-3502" ); - a.setCountry( "U.S.A." ); - addr.insertAddress( a ); - return addr; -} - -Addressee -vcard2() -{ - Addressee addr; - - addr.setName( "Tim Howes" ); - addr.setOrganization( "Netscape Communications Corp." ); - addr.insertEmail( "howes@netscape.com" ); - addr.insertPhoneNumber( PhoneNumber("+1-415-937-3419",PhoneNumber::Voice|PhoneNumber::Msg - |PhoneNumber::Work) ); - addr.insertPhoneNumber( PhoneNumber("+1-415-528-4164",PhoneNumber::Fax |PhoneNumber::Work) ); - Address a( Address::Work ); - a.setStreet( "501 E. Middlefield Rd." ); - a.setLocality( "Mountain View" ); - a.setRegion( "CA" ); - a.setPostalCode( "94043" ); - a.setCountry( "U.S.A." ); - addr.insertAddress( a ); - return addr; -} - -Addressee -vcard3() -{ - Addressee addr; - - addr.setName( "ian geiser" ); - addr.setOrganization( "Source eXtreme" ); - addr.insertEmail( "geiseri@yahoo.com" ); - addr.setTitle( "VP of Engineering" ); - return addr; -} - - -QString -vcardAsText( const TQString& location ) -{ - TQString line; - TQFile file( location ); - if ( file.open( IO_ReadOnly ) ) { - TQTextStream stream( &file ); - if ( !stream.eof() ) { - line = stream.read(); - } - file.close(); - } - return line; -} - -Addressee::List -vCardsAsAddresseeList() -{ - Addressee::List l; - - l.append( vcard1() ); - l.append( vcard2() ); - l.append( vcard3() ); - - return l; -} - -QString -vCardsAsText() -{ - TQString vcards = vcardAsText( "tests/vcard1.vcf" ); - vcards += vcardAsText( "tests/vcard2.vcf" ); - vcards += vcardAsText( "tests/vcard3.vcf" ); - - return vcards; -} diff --git a/kabc/vcardparser/testutils.h b/kabc/vcardparser/testutils.h deleted file mode 100644 index 4f2024177..000000000 --- a/kabc/vcardparser/testutils.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef TESTUTILS_H -#define TESTUTILS_H - -#include -#include - -KABC::Addressee vcard1(); -KABC::Addressee vcard2(); -KABC::Addressee vcard3(); -KABC::Addressee::List vCardsAsAddresseeList(); -TQString vCardAsText( const TQString& location ); -TQString vCardsAsText(); - -#endif diff --git a/kabc/vcardparser/testwrite.cpp b/kabc/vcardparser/testwrite.cpp deleted file mode 100644 index 5a58bd8a8..000000000 --- a/kabc/vcardparser/testwrite.cpp +++ /dev/null @@ -1,134 +0,0 @@ -/* - This file is part of libkabc. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include - -#include "vcardconverter.h" - -int main( int argc, char **argv ) -{ - TDEAboutData aboutData( "testwrite", "vCard test writer", "0.1" ); - - TDECmdLineArgs::init( argc, argv, &aboutData ); - - TDEApplication app( false, false ); - - - KABC::Addressee addressee; - - addressee.setNameFromString( "Mr. Tobias Koenig Jr." ); - addressee.setNickName( "tokoe" ); - addressee.setBirthday( TQDate( 1982, 7, 19 ) ); - addressee.setMailer( "mutt1.2" ); - addressee.setTimeZone( KABC::TimeZone( +2 ) ); - - KABC::Geo geo; - geo.setLatitude( 30 ); - geo.setLongitude( 51 ); - addressee.setGeo( geo ); - - addressee.setTitle( "nerd" ); - addressee.setRole( "Maintainer" ); - addressee.setOrganization( "KDE" ); - addressee.setNote( "nerver\ntouch a running system" ); - addressee.setProductId( "testId" ); - addressee.setRevision( TQDateTime::currentDateTime() ); - addressee.setSortString( "koenig" ); - addressee.setUrl( KURL( "http://wgess16.dyndns.org") ); - addressee.setSecrecy( KABC::Secrecy( KABC::Secrecy::Confidential ) ); -/* - TQImage img; - img.load( "testimg.png", "PNG" ); - KABC::Picture photo; - photo.setData( img ); - addressee.setPhoto( photo ); - - TQImage img2; - img2.load( "testimg.png", "PNG" ); - KABC::Picture logo; - logo.setData( img2 ); - addressee.setLogo( logo ); - - TQFile soundFile( "testsound.wav" ); - soundFile.open( IO_ReadOnly ); - TQByteArray data = soundFile.readAll(); - soundFile.close(); - KABC::Sound sound; - sound.setData( data ); - addressee.setSound( sound ); -*/ - addressee.insertEmail( "tokoe@kde.org", true ); - addressee.insertEmail( "tokoe82@yahoo.de", true ); - - KABC::PhoneNumber phone1( "3541523475", KABC::PhoneNumber::Pref | KABC::PhoneNumber::Home ); - KABC::PhoneNumber phone2( "+46745673475", KABC::PhoneNumber::Work ); - addressee.insertPhoneNumber( phone1 ); - addressee.insertPhoneNumber( phone2 ); - - KABC::Key key( "secret key", KABC::Key::X509 ); - addressee.insertKey( key ); - - TQStringList categories; - categories << "Friends" << "School" << "KDE"; - addressee.setCategories( categories ); - - KABC::Address a( KABC::Address::Work | KABC::Address::Postal | KABC::Address::Parcel ); - a.setStreet( "6544 Battleford Drive" ); - a.setLocality( "Raleigh" ); - a.setRegion( "NC" ); - a.setPostalCode( "27613-3502" ); - a.setCountry( "U.S.A." ); - addressee.insertAddress( a ); - - addressee.insertCustom( "1hsdf", "ertuer", "iurt" ); - addressee.insertCustom( "2hsdf", "ertuer", "iurt" ); - addressee.insertCustom( "3hsdf", "ertuer", "iurt" ); - - KABC::Addressee::List list; - for ( int i = 0; i < 1000; ++i ) { - KABC::Addressee addr = addressee; - addr.setUid( TQString::number( i ) ); - list.append( addr ); - } - - KABC::VCardConverter converter; - TQString txt = converter.createVCards( list ); - - TQFile file( "out.vcf" ); - file.open( IO_WriteOnly ); - - TQTextStream s( &file ); - s.setEncoding( TQTextStream::UnicodeUTF8 ); - s << txt; - file.close(); - - return 0; -} diff --git a/kabc/vcardparser/vcard.cpp b/kabc/vcardparser/vcard.cpp deleted file mode 100644 index 30a8e1c49..000000000 --- a/kabc/vcardparser/vcard.cpp +++ /dev/null @@ -1,109 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "vcard.h" - -using namespace KABC; - -VCard::VCard() -{ -} - -VCard::VCard( const VCard& vcard ) -{ - mLineMap = vcard.mLineMap; -} - -VCard::~VCard() -{ -} - -VCard& VCard::operator=( const VCard& vcard ) -{ - if ( &vcard == this ) - return *this; - - mLineMap = vcard.mLineMap; - - return *this; -} - -void VCard::clear() -{ - mLineMap.clear(); -} - -TQStringList VCard::identifiers() const -{ - return mLineMap.keys(); -} - -void VCard::addLine( const VCardLine& line ) -{ - mLineMap[ line.identifier() ].append( line ); -} - -VCardLine::List VCard::lines( const TQString& identifier ) const -{ - LineMap::ConstIterator it = mLineMap.find( identifier ); - if ( it == mLineMap.end() ) - return VCardLine::List(); - - return *it; -} - -VCardLine VCard::line( const TQString& identifier ) const -{ - LineMap::ConstIterator it = mLineMap.find( identifier ); - if ( it == mLineMap.end() ) - return VCardLine(); - - if ( (*it).isEmpty() ) - return VCardLine(); - else - return (*it).first(); -} - -void VCard::setVersion( Version version ) -{ - mLineMap.erase( "VERSION" ); - - VCardLine line; - line.setIdentifier( "VERSION" ); - if ( version == v2_1 ) - line.setIdentifier( "2.1" ); - else if ( version == v3_0 ) - line.setIdentifier( "3.0" ); - - mLineMap[ "VERSION" ].append( line ); -} - -VCard::Version VCard::version() const -{ - LineMap::ConstIterator versionEntry = mLineMap.find( "VERSION" ); - if ( versionEntry == mLineMap.end() ) - return v3_0; - - VCardLine line = ( *versionEntry )[ 0 ]; - if ( line.value() == "2.1" ) - return v2_1; - else - return v3_0; -} diff --git a/kabc/vcardparser/vcard.h b/kabc/vcardparser/vcard.h deleted file mode 100644 index 6afeeda26..000000000 --- a/kabc/vcardparser/vcard.h +++ /dev/null @@ -1,91 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef VCARDPARSER_VCARD_H -#define VCARDPARSER_VCARD_H - -#include "vcardline.h" -#include -#include -#include - -namespace KABC { - -class VCard -{ - public: - typedef TQValueList List; - typedef TQMap< TQString, VCardLine::List > LineMap; - - enum Version { v2_1, v3_0 }; - - VCard(); - VCard( const VCard& ); - - ~VCard(); - - VCard& operator=( const VCard& ); - - /** - * Removes all lines from the vCard. - */ - void clear(); - - /** - * Returns a list of all identifiers that exists in the - * vCard. - */ - TQStringList identifiers() const; - - /** - * Adds a VCardLine to the VCard - */ - void addLine( const VCardLine& line ); - - /** - * Returns all lines of the vcard with a special identifier. - */ - VCardLine::List lines( const TQString& identifier ) const; - - /** - * Returns only the first line of the vcard with a special identifier. - */ - VCardLine line( const TQString& identifier ) const; - - /** - * Set the version of the vCard. - */ - void setVersion( Version version ); - - /** - * Returns the version of this vCard. - */ - Version version() const; - - private: - LineMap mLineMap; - - class VCardPrivate; - VCardPrivate *d; -}; - -} - -#endif diff --git a/kabc/vcardparser/vcardline.cpp b/kabc/vcardparser/vcardline.cpp deleted file mode 100644 index 6680cf7d0..000000000 --- a/kabc/vcardparser/vcardline.cpp +++ /dev/null @@ -1,151 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include "vcardline.h" - -using namespace KABC; - -class VCardLine::VCardLinePrivate -{ - public: - TQString mGroup; -}; - -VCardLine::VCardLine() - : d( 0 ) -{ -} - -VCardLine::VCardLine( const TQString &identifier ) - : d( 0 ) -{ - mIdentifier = identifier; -} - -VCardLine::VCardLine( const TQString &identifier, const TQVariant &value ) - : d( 0 ) -{ - mIdentifier = identifier; - mValue = value; -} - -VCardLine::VCardLine( const VCardLine& line ) - : d( 0 ) -{ - mParamMap = line.mParamMap; - mValue = line.mValue; - mIdentifier = line.mIdentifier; -} - -VCardLine::~VCardLine() -{ - delete d; - d = 0; -} - -VCardLine& VCardLine::operator=( const VCardLine& line ) -{ - if ( &line == this ) - return *this; - - mParamMap = line.mParamMap; - mValue = line.mValue; - mIdentifier = line.mIdentifier; - - return *this; -} - -void VCardLine::setIdentifier( const TQString& identifier ) -{ - mIdentifier = identifier; -} - -TQString VCardLine::identifier() const -{ - return mIdentifier; -} - -void VCardLine::setValue( const TQVariant& value ) -{ - mValue = value; -} - -TQVariant VCardLine::value() const -{ - return mValue; -} - -void VCardLine::setGroup( const TQString& group ) -{ - if ( !d ) - d = new VCardLinePrivate(); - - d->mGroup = group; -} - -TQString VCardLine::group() const -{ - if ( d ) - return d->mGroup; - else - return TQString(); -} - -bool VCardLine::hasGroup() const -{ - if ( !d ) - return false; - else - return d->mGroup.isEmpty(); -} - -TQStringList VCardLine::parameterList() const -{ - return mParamMap.keys(); -} - -void VCardLine::addParameter( const TQString& param, const TQString& value ) -{ - TQStringList &list = mParamMap[ param ]; - if ( list.findIndex( value ) == -1 ) // not included yet - list.append( value ); -} - -TQStringList VCardLine::parameters( const TQString& param ) const -{ - ParamMap::ConstIterator it = mParamMap.find( param ); - if ( it == mParamMap.end() ) - return TQStringList(); - else - return *it; -} - -TQString VCardLine::parameter( const TQString& param ) const -{ - ParamMap::ConstIterator it = mParamMap.find( param ); - if ( it == mParamMap.end() ) - return TQString::null; - else { - if ( (*it).isEmpty() ) - return TQString::null; - else - return (*it).first(); - } -} diff --git a/kabc/vcardparser/vcardline.h b/kabc/vcardparser/vcardline.h deleted file mode 100644 index 92fe743f6..000000000 --- a/kabc/vcardparser/vcardline.h +++ /dev/null @@ -1,115 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef VCARDLINE_H -#define VCARDLINE_H - -#include -#include -#include -#include -#include - -namespace KABC { - -class VCardLine -{ - public: - typedef TQValueList List; - typedef TQMap ParamMap; - - VCardLine(); - VCardLine( const TQString &identifier ); - VCardLine( const TQString &identifier, const TQVariant &value ); - VCardLine( const VCardLine& ); - - ~VCardLine(); - - VCardLine& operator=( const VCardLine& ); - - /** - * Sets the identifier of this line e.g. UID, FN, CLASS - */ - void setIdentifier( const TQString& identifier ); - - /** - * Returns the identifier of this line. - */ - TQString identifier() const; - - /** - * Sets the value of of this line. - */ - void setValue( const TQVariant& value ); - - /** - * Returns the value of this line. - */ - TQVariant value() const; - - /** - * Sets the group the line belongs to. - */ - void setGroup( const TQString& group ); - - /** - * Returns the group the line belongs to. - */ - TQString group() const; - - /** - * Returns whether the line belongs to a group. - */ - bool hasGroup() const; - - /** - * Returns all parameters. - */ - TQStringList parameterList() const; - - /** - * Add a new parameter to the line. - */ - void addParameter( const TQString& param, const TQString& value ); - - /** - * Returns the values of a special parameter. - * You can get a list of all parameters with paramList(). - */ - TQStringList parameters( const TQString& param ) const; - - /** - * Returns only the first value of a special parameter. - * You can get a list of all parameters with paramList(). - */ - TQString parameter( const TQString& param ) const; - - private: - ParamMap mParamMap; - TQString mIdentifier; - TQVariant mValue; - - class VCardLinePrivate; - VCardLinePrivate *d; -}; - -} - -#endif diff --git a/kabc/vcardparser/vcardparser.cpp b/kabc/vcardparser/vcardparser.cpp deleted file mode 100644 index aed9ebd39..000000000 --- a/kabc/vcardparser/vcardparser.cpp +++ /dev/null @@ -1,297 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include - -#include - -#include "vcardparser.h" - -#define FOLD_WIDTH 75 - -using namespace KABC; - -static TQString backslash( "\\\\" ); -static TQString comma( "\\," ); -static TQString newline( "\\n" ); -static TQString cr( "\\r" ); - -static void addEscapes( TQString &str ) -{ - str.replace( '\\', backslash ); - str.replace( ',', comma ); - str.replace( '\r', cr ); - str.replace( '\n', newline ); -} - -static void removeEscapes( TQString &str ) -{ - str.replace( cr, "\\r" ); - str.replace( newline, "\n" ); - str.replace( comma, "," ); - str.replace( backslash, "\\" ); -} - -VCardParser::VCardParser() -{ -} - -VCardParser::~VCardParser() -{ -} - -VCard::List VCardParser::parseVCards( const TQString& text ) -{ - static TQRegExp sep( "[\x0d\x0a]" ); - - VCard currentVCard; - VCard::List vCardList; - TQString currentLine; - - const TQStringList lines = TQStringList::split( sep, text ); - TQStringList::ConstIterator it; - - bool inVCard = false; - TQStringList::ConstIterator linesEnd( lines.end() ); - for ( it = lines.begin(); it != linesEnd; ++it ) { - - if ( (*it).isEmpty() ) // empty line - continue; - - if ( (*it)[ 0 ] == ' ' || (*it)[ 0 ] == '\t' ) { // folded line => append to previous - currentLine += TQString( *it ).remove( 0, 1 ); - continue; - } else { - if ( inVCard && !currentLine.isEmpty() ) { // now parse the line - int colon = currentLine.find( ':' ); - if ( colon == -1 ) { // invalid line - currentLine = (*it); - continue; - } - - VCardLine vCardLine; - const TQString key = currentLine.left( colon ).stripWhiteSpace(); - TQString value = currentLine.mid( colon + 1 ); - - TQStringList params = TQStringList::split( ';', key ); - - // check for group - if ( params[0].find( '.' ) != -1 ) { - const TQStringList groupList = TQStringList::split( '.', params[0] ); - vCardLine.setGroup( groupList[0] ); - vCardLine.setIdentifier( groupList[1] ); - } else - vCardLine.setIdentifier( params[0] ); - - if ( params.count() > 1 ) { // find all parameters - TQStringList::ConstIterator paramIt = params.begin(); - for ( ++paramIt; paramIt != params.end(); ++paramIt ) { - TQStringList pair = TQStringList::split( '=', *paramIt ); - if ( pair.size() == 1 ) { - // correct the 2.1 'standard' - if ( pair[0].lower() == "quoted-printable" ) { - pair[0] = "encoding"; - pair[1] = "quoted-printable"; - } else if ( pair[0].lower() == "base64" ) { - pair[0] = "encoding"; - pair[1] = "base64"; - } else { - pair.prepend( "type" ); - } - } - // This is pretty much a faster pair[1].contains( ',' )... - if ( pair[1].find( ',' ) != -1 ) { // parameter in type=x,y,z format - const TQStringList args = TQStringList::split( ',', pair[ 1 ] ); - TQStringList::ConstIterator argIt; - for ( argIt = args.begin(); argIt != args.end(); ++argIt ) - vCardLine.addParameter( pair[0].lower(), *argIt ); - } else - vCardLine.addParameter( pair[0].lower(), pair[1] ); - } - } - - removeEscapes( value ); - - TQByteArray output; - bool wasBase64Encoded = false; - - params = vCardLine.parameterList(); - if ( params.findIndex( "encoding" ) != -1 ) { // have to decode the data - TQByteArray input; - input = TQCString(value.latin1()); - if ( vCardLine.parameter( "encoding" ).lower() == "b" || - vCardLine.parameter( "encoding" ).lower() == "base64" ) { - KCodecs::base64Decode( input, output ); - wasBase64Encoded = true; - } - else if ( vCardLine.parameter( "encoding" ).lower() == "quoted-printable" ) { - // join any qp-folded lines - while ( value.at( value.length() - 1 ) == '=' && it != linesEnd ) { - value = value.remove( value.length() - 1, 1 ) + (*it); - ++it; - } - input = TQCString(value.latin1()); - KCodecs::quotedPrintableDecode( input, output ); - } - } else { - output = TQCString(value.latin1()); - } - - if ( params.findIndex( "charset" ) != -1 ) { // have to convert the data - TQTextCodec *codec = - TQTextCodec::codecForName( vCardLine.parameter( "charset" ).latin1() ); - if ( codec ) { - vCardLine.setValue( codec->toUnicode( output ) ); - } else { - vCardLine.setValue( TQString(TQString::fromUtf8( output )) ); - } - } else if ( wasBase64Encoded ) { - vCardLine.setValue( output ); - } else { // if charset not given, assume it's in UTF-8 (as used in previous KDE versions) - vCardLine.setValue( TQString(TQString::fromUtf8( output )) ); - } - - currentVCard.addLine( vCardLine ); - } - - // we do not save the start and end tag as vcardline - if ( (*it).lower().startsWith( "begin:vcard" ) ) { - inVCard = true; - currentLine.setLength( 0 ); - currentVCard.clear(); // flush vcard - continue; - } - - if ( (*it).lower().startsWith( "end:vcard" ) ) { - inVCard = false; - vCardList.append( currentVCard ); - currentLine.setLength( 0 ); - currentVCard.clear(); // flush vcard - continue; - } - - currentLine = (*it); - } - } - - return vCardList; -} - -TQString VCardParser::createVCards( const VCard::List& list ) -{ - TQString text; - TQString textLine; - TQString encodingType; - TQStringList idents; - TQStringList params; - TQStringList values; - TQStringList::ConstIterator identIt; - TQStringList::Iterator paramIt; - TQStringList::ConstIterator valueIt; - - VCardLine::List lines; - VCardLine::List::ConstIterator lineIt; - VCard::List::ConstIterator cardIt; - - bool hasEncoding; - - text.reserve( list.size() * 300 ); // reserve memory to be more efficient - - // iterate over the cards - VCard::List::ConstIterator listEnd( list.end() ); - for ( cardIt = list.begin(); cardIt != listEnd; ++cardIt ) { - text.append( "BEGIN:VCARD\r\n" ); - - idents = (*cardIt).identifiers(); - for ( identIt = idents.constBegin(); identIt != idents.constEnd(); ++identIt ) { - lines = (*cardIt).lines( (*identIt) ); - - // iterate over the lines - for ( lineIt = lines.constBegin(); lineIt != lines.constEnd(); ++lineIt ) { - if ( !(*lineIt).value().asString().isEmpty() ) { - if ((*lineIt).identifier() != TQString("URI")) { - if ( (*lineIt).hasGroup() ) - textLine = (*lineIt).group() + "." + (*lineIt).identifier(); - else - textLine = (*lineIt).identifier(); - - params = (*lineIt).parameterList(); - hasEncoding = false; - if ( params.count() > 0 ) { // we have parameters - for ( paramIt = params.begin(); paramIt != params.end(); ++paramIt ) { - if ( (*paramIt) == "encoding" ) { - hasEncoding = true; - encodingType = (*lineIt).parameter( "encoding" ).lower(); - } - - values = (*lineIt).parameters( *paramIt ); - for ( valueIt = values.constBegin(); valueIt != values.constEnd(); ++valueIt ) { - textLine.append( ";" + (*paramIt).upper() ); - if ( !(*valueIt).isEmpty() ) - textLine.append( "=" + (*valueIt) ); - } - } - } - - if ( hasEncoding ) { // have to encode the data - TQByteArray input, output; - if ( encodingType == "b" ) { - input = (*lineIt).value().toByteArray(); - KCodecs::base64Encode( input, output ); - } else if ( encodingType == "quoted-printable" ) { - input = (*lineIt).value().toString().utf8(); - input.resize( input.size() - 1 ); // strip \0 - KCodecs::quotedPrintableEncode( input, output, false ); - } - - TQString value( output ); - addEscapes( value ); - textLine.append( ":" + value ); - } else { - TQString value( (*lineIt).value().asString() ); - addEscapes( value ); - textLine.append( ":" + value ); - } - - if ( textLine.length() > FOLD_WIDTH ) { // we have to fold the line - for ( uint i = 0; i <= ( textLine.length() / FOLD_WIDTH ); ++i ) - text.append( ( i == 0 ? "" : " " ) + textLine.mid( i * FOLD_WIDTH, FOLD_WIDTH ) + "\r\n" ); - } else - text.append( textLine + "\r\n" ); - } - else { - // URIs can be full of weird symbols, etc. so bypass all checks - textLine = (*lineIt).identifier(); - TQString value( (*lineIt).value().asString() ); - addEscapes( value ); - textLine.append( ":" + value ); - text.append( textLine + "\r\n" ); - } - } - } - } - - text.append( "END:VCARD\r\n" ); - text.append( "\r\n" ); - } - - return text; -} diff --git a/kabc/vcardparser/vcardparser.h b/kabc/vcardparser/vcardparser.h deleted file mode 100644 index da5fdd46e..000000000 --- a/kabc/vcardparser/vcardparser.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef VCARDPARSER_H -#define VCARDPARSER_H - -#include "vcard.h" - -namespace KABC { - -class VCardParser -{ - public: - VCardParser(); - ~VCardParser(); - - static VCard::List parseVCards( const TQString& text ); - static TQString createVCards( const VCard::List& list ); - - private: - class VCardParserPrivate; - VCardParserPrivate *d; -}; - -} - -#endif diff --git a/kabc/vcardtool.cpp b/kabc/vcardtool.cpp deleted file mode 100644 index 295360a03..000000000 --- a/kabc/vcardtool.cpp +++ /dev/null @@ -1,896 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#include -#include -#include - -#include "agent.h" -#include "key.h" -#include "picture.h" -#include "secrecy.h" -#include "sound.h" - -#include "vcardtool.h" - -using namespace KABC; - -static bool needsEncoding( const TQString &value ) -{ - uint length = value.length(); - for ( uint i = 0; i < length; ++i ) { - char c = value.at( i ).latin1(); - if ( (c < 33 || c > 126) && c != ' ' && c != '=' ) - return true; - } - - return false; -} - -VCardTool::VCardTool() -{ - mAddressTypeMap.insert( "dom", Address::Dom ); - mAddressTypeMap.insert( "intl", Address::Intl ); - mAddressTypeMap.insert( "postal", Address::Postal ); - mAddressTypeMap.insert( "parcel", Address::Parcel ); - mAddressTypeMap.insert( "home", Address::Home ); - mAddressTypeMap.insert( "work", Address::Work ); - mAddressTypeMap.insert( "pref", Address::Pref ); - - mPhoneTypeMap.insert( "HOME", PhoneNumber::Home ); - mPhoneTypeMap.insert( "WORK", PhoneNumber::Work ); - mPhoneTypeMap.insert( "MSG", PhoneNumber::Msg ); - mPhoneTypeMap.insert( "PREF", PhoneNumber::Pref ); - mPhoneTypeMap.insert( "VOICE", PhoneNumber::Voice ); - mPhoneTypeMap.insert( "FAX", PhoneNumber::Fax ); - mPhoneTypeMap.insert( "CELL", PhoneNumber::Cell ); - mPhoneTypeMap.insert( "VIDEO", PhoneNumber::Video ); - mPhoneTypeMap.insert( "BBS", PhoneNumber::Bbs ); - mPhoneTypeMap.insert( "MODEM", PhoneNumber::Modem ); - mPhoneTypeMap.insert( "CAR", PhoneNumber::Car ); - mPhoneTypeMap.insert( "ISDN", PhoneNumber::Isdn ); - mPhoneTypeMap.insert( "PCS", PhoneNumber::Pcs ); - mPhoneTypeMap.insert( "PAGER", PhoneNumber::Pager ); -} - -VCardTool::~VCardTool() -{ -} - -// TODO: make list a const& -TQString VCardTool::createVCards( Addressee::List list, VCard::Version version ) -{ - VCard::List vCardList; - - Addressee::List::ConstIterator addrIt; - Addressee::List::ConstIterator listEnd( list.constEnd() ); - for ( addrIt = list.constBegin(); addrIt != listEnd; ++addrIt ) { - VCard card; - TQStringList::ConstIterator strIt; - - // ADR + LABEL - const Address::List addresses = (*addrIt).addresses(); - for ( Address::List::ConstIterator it = addresses.begin(); it != addresses.end(); ++it ) { - TQStringList address; - - bool isEmpty = ( (*it).postOfficeBox().isEmpty() && - (*it).extended().isEmpty() && - (*it).street().isEmpty() && - (*it).locality().isEmpty() && - (*it).region().isEmpty() && - (*it).postalCode().isEmpty() && - (*it).country().isEmpty() ); - - address.append( (*it).postOfficeBox().replace( ';', "\\;" ) ); - address.append( (*it).extended().replace( ';', "\\;" ) ); - address.append( (*it).street().replace( ';', "\\;" ) ); - address.append( (*it).locality().replace( ';', "\\;" ) ); - address.append( (*it).region().replace( ';', "\\;" ) ); - address.append( (*it).postalCode().replace( ';', "\\;" ) ); - address.append( (*it).country().replace( ';', "\\;" ) ); - - VCardLine adrLine( "ADR", address.join( ";" ) ); - if ( version == VCard::v2_1 && needsEncoding( address.join( ";" ) ) ) { - adrLine.addParameter( "charset", "UTF-8" ); - adrLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - - VCardLine labelLine( "LABEL", (*it).label() ); - if ( version == VCard::v2_1 && needsEncoding( (*it).label() ) ) { - labelLine.addParameter( "charset", "UTF-8" ); - labelLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - - bool hasLabel = !(*it).label().isEmpty(); - TQMap::ConstIterator typeIt; - for ( typeIt = mAddressTypeMap.constBegin(); typeIt != mAddressTypeMap.constEnd(); ++typeIt ) { - if ( typeIt.data() & (*it).type() ) { - adrLine.addParameter( "TYPE", typeIt.key() ); - if ( hasLabel ) - labelLine.addParameter( "TYPE", typeIt.key() ); - } - } - - if ( !isEmpty ) - card.addLine( adrLine ); - if ( hasLabel ) - card.addLine( labelLine ); - } - - // AGENT - card.addLine( createAgent( version, (*addrIt).agent() ) ); - - // BDAY - card.addLine( VCardLine( "BDAY", createDateTime( TQT_TQDATETIME_OBJECT((*addrIt).birthday()) ) ) ); - - // CATEGORIES - if ( version == VCard::v3_0 ) { - TQStringList categories = (*addrIt).categories(); - TQStringList::Iterator catIt; - for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) - (*catIt).replace( ',', "\\," ); - - VCardLine catLine( "CATEGORIES", categories.join( "," ) ); - if ( version == VCard::v2_1 && needsEncoding( categories.join( "," ) ) ) { - catLine.addParameter( "charset", "UTF-8" ); - catLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - - card.addLine( catLine ); - } - - // CLASS - if ( version == VCard::v3_0 ) { - card.addLine( createSecrecy( (*addrIt).secrecy() ) ); - } - - // EMAIL - const TQStringList emails = (*addrIt).emails(); - bool pref = true; - for ( strIt = emails.begin(); strIt != emails.end(); ++strIt ) { - VCardLine line( "EMAIL", *strIt ); - if ( pref == true && emails.count() > 1 ) { - line.addParameter( "TYPE", "PREF" ); - pref = false; - } - card.addLine( line ); - } - - // FN - VCardLine fnLine( "FN", TQString((*addrIt).formattedName()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).formattedName() ) ) { - fnLine.addParameter( "charset", "UTF-8" ); - fnLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( fnLine ); - - // GEO - Geo geo = (*addrIt).geo(); - if ( geo.isValid() ) { - TQString str; - str.sprintf( "%.6f;%.6f", geo.latitude(), geo.longitude() ); - card.addLine( VCardLine( "GEO", str ) ); - } - - // KEY - const Key::List keys = (*addrIt).keys(); - Key::List::ConstIterator keyIt; - for ( keyIt = keys.begin(); keyIt != keys.end(); ++keyIt ) - card.addLine( createKey( *keyIt ) ); - - // LOGO - card.addLine( createPicture( "LOGO", (*addrIt).logo() ) ); - - // MAILER - VCardLine mailerLine( "MAILER", TQString((*addrIt).mailer()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).mailer() ) ) { - mailerLine.addParameter( "charset", "UTF-8" ); - mailerLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( mailerLine ); - - // N - TQStringList name; - name.append( (*addrIt).familyName().replace( ';', "\\;" ) ); - name.append( (*addrIt).givenName().replace( ';', "\\;" ) ); - name.append( (*addrIt).additionalName().replace( ';', "\\;" ) ); - name.append( (*addrIt).prefix().replace( ';', "\\;" ) ); - name.append( (*addrIt).suffix().replace( ';', "\\;" ) ); - - VCardLine nLine( "N", name.join( ";" ) ); - if ( version == VCard::v2_1 && needsEncoding( name.join( ";" ) ) ) { - nLine.addParameter( "charset", "UTF-8" ); - nLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( nLine ); - - // NAME - VCardLine nameLine( "NAME", TQString((*addrIt).name()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).name() ) ) { - nameLine.addParameter( "charset", "UTF-8" ); - nameLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( nameLine ); - - // NICKNAME - if ( version == VCard::v3_0 ) - card.addLine( VCardLine( "NICKNAME", TQString((*addrIt).nickName()) ) ); - - // NOTE - VCardLine noteLine( "NOTE", TQString((*addrIt).note()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).note() ) ) { - noteLine.addParameter( "charset", "UTF-8" ); - noteLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( noteLine ); - - // ORG - TQStringList organization; - organization.append( ( *addrIt ).organization().replace( ';', "\\;" ) ); - if ( !( *addrIt ).department().isEmpty() ) - organization.append( ( *addrIt ).department().replace( ';', "\\;" ) ); - VCardLine orgLine( "ORG", organization.join( ";" ) ); - if ( version == VCard::v2_1 && needsEncoding( organization.join( ";" ) ) ) { - orgLine.addParameter( "charset", "UTF-8" ); - orgLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( orgLine ); - - // PHOTO - card.addLine( createPicture( "PHOTO", (*addrIt).photo() ) ); - - // PROID - if ( version == VCard::v3_0 ) - card.addLine( VCardLine( "PRODID", TQString((*addrIt).productId()) ) ); - - // REV - card.addLine( VCardLine( "REV", createDateTime( TQT_TQDATETIME_OBJECT((*addrIt).revision()) ) ) ); - - // ROLE - VCardLine roleLine( "ROLE", TQString((*addrIt).role()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).role() ) ) { - roleLine.addParameter( "charset", "UTF-8" ); - roleLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( roleLine ); - - // SORT-STRING - if ( version == VCard::v3_0 ) - card.addLine( VCardLine( "SORT-STRING", TQString((*addrIt).sortString()) ) ); - - // SOUND - card.addLine( createSound( (*addrIt).sound() ) ); - - // TEL - const PhoneNumber::List phoneNumbers = (*addrIt).phoneNumbers(); - PhoneNumber::List::ConstIterator phoneIt; - for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { - VCardLine line( "TEL", (*phoneIt).number() ); - - TQMap::ConstIterator typeIt; - for ( typeIt = mPhoneTypeMap.constBegin(); typeIt != mPhoneTypeMap.constEnd(); ++typeIt ) { - if ( typeIt.data() & (*phoneIt).type() ) - line.addParameter( "TYPE", typeIt.key() ); - } - - card.addLine( line ); - } - - // TITLE - VCardLine titleLine( "TITLE", TQString((*addrIt).title()) ); - if ( version == VCard::v2_1 && needsEncoding( (*addrIt).title() ) ) { - titleLine.addParameter( "charset", "UTF-8" ); - titleLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( titleLine ); - - // TZ - TimeZone timeZone = (*addrIt).timeZone(); - if ( timeZone.isValid() ) { - TQString str; - - int neg = 1; - if ( timeZone.offset() < 0 ) - neg = -1; - - str.sprintf( "%c%02d:%02d", ( timeZone.offset() >= 0 ? '+' : '-' ), - ( timeZone.offset() / 60 ) * neg, - ( timeZone.offset() % 60 ) * neg ); - - card.addLine( VCardLine( "TZ", str ) ); - } - - // UID - card.addLine( VCardLine( "UID", (*addrIt).uid() ) ); - - // UID - card.addLine( VCardLine( "URI", (*addrIt).uri() ) ); - - // URL - card.addLine( VCardLine( "URL", (*addrIt).url().url() ) ); - - // VERSION - if ( version == VCard::v2_1 ) - card.addLine( VCardLine( "VERSION", "2.1" ) ); - if ( version == VCard::v3_0 ) - card.addLine( VCardLine( "VERSION", "3.0" ) ); - - // X- - const TQStringList customs = (*addrIt).customs(); - for ( strIt = customs.begin(); strIt != customs.end(); ++strIt ) { - TQString identifier = "X-" + (*strIt).left( (*strIt).find( ":" ) ); - TQString value = (*strIt).mid( (*strIt).find( ":" ) + 1 ); - if ( value.isEmpty() ) - continue; - - VCardLine line( identifier, value ); - if ( version == VCard::v2_1 && needsEncoding( value ) ) { - line.addParameter( "charset", "UTF-8" ); - line.addParameter( "encoding", "QUOTED-PRINTABLE" ); - } - card.addLine( line ); - } - - vCardList.append( card ); - } - - return VCardParser::createVCards( vCardList ); -} - -Addressee::List VCardTool::parseVCards( const TQString& vcard ) -{ - static const TQChar semicolonSep( ';' ); - static const TQChar commaSep( ',' ); - TQString identifier; - - Addressee::List addrList; - const VCard::List vCardList = VCardParser::parseVCards( vcard ); - - VCard::List::ConstIterator cardIt; - VCard::List::ConstIterator listEnd( vCardList.end() ); - for ( cardIt = vCardList.begin(); cardIt != listEnd; ++cardIt ) { - Addressee addr; - - const TQStringList idents = (*cardIt).identifiers(); - TQStringList::ConstIterator identIt; - TQStringList::ConstIterator identEnd( idents.end() ); - for ( identIt = idents.begin(); identIt != identEnd; ++identIt ) { - const VCardLine::List lines = (*cardIt).lines( (*identIt) ); - VCardLine::List::ConstIterator lineIt; - - // iterate over the lines - for ( lineIt = lines.begin(); lineIt != lines.end(); ++lineIt ) { - identifier = (*lineIt).identifier().lower(); - // ADR - if ( identifier == "adr" ) { - Address address; - const TQStringList addrParts = splitString( semicolonSep, (*lineIt).value().asString() ); - if ( addrParts.count() > 0 ) - address.setPostOfficeBox( addrParts[ 0 ] ); - if ( addrParts.count() > 1 ) - address.setExtended( addrParts[ 1 ] ); - if ( addrParts.count() > 2 ) - address.setStreet( addrParts[ 2 ] ); - if ( addrParts.count() > 3 ) - address.setLocality( addrParts[ 3 ] ); - if ( addrParts.count() > 4 ) - address.setRegion( addrParts[ 4 ] ); - if ( addrParts.count() > 5 ) - address.setPostalCode( addrParts[ 5 ] ); - if ( addrParts.count() > 6 ) - address.setCountry( addrParts[ 6 ] ); - - int type = 0; - - const TQStringList types = (*lineIt).parameters( "type" ); - for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) - type += mAddressTypeMap[ (*it).lower() ]; - - address.setType( type ); - addr.insertAddress( address ); - } - - // AGENT - else if ( identifier == "agent" ) - addr.setAgent( parseAgent( *lineIt ) ); - - // BDAY - else if ( identifier == "bday" ) - addr.setBirthday( parseDateTime( (*lineIt).value().asString() ) ); - - // CATEGORIES - else if ( identifier == "categories" ) { - const TQStringList categories = splitString( commaSep, (*lineIt).value().asString() ); - addr.setCategories( categories ); - } - - // CLASS - else if ( identifier == "class" ) - addr.setSecrecy( parseSecrecy( *lineIt ) ); - - // EMAIL - else if ( identifier == "email" ) { - const TQStringList types = (*lineIt).parameters( "type" ); - addr.insertEmail( (*lineIt).value().asString(), types.findIndex( "PREF" ) != -1 ); - } - - // FN - else if ( identifier == "fn" ) - addr.setFormattedName( (*lineIt).value().asString() ); - - // GEO - else if ( identifier == "geo" ) { - Geo geo; - - const TQStringList geoParts = TQStringList::split( ';', (*lineIt).value().asString(), true ); - geo.setLatitude( geoParts[ 0 ].toFloat() ); - geo.setLongitude( geoParts[ 1 ].toFloat() ); - - addr.setGeo( geo ); - } - - // KEY - else if ( identifier == "key" ) - addr.insertKey( parseKey( *lineIt ) ); - - // LABEL - else if ( identifier == "label" ) { - int type = 0; - - const TQStringList types = (*lineIt).parameters( "type" ); - for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) - type += mAddressTypeMap[ (*it).lower() ]; - - bool available = false; - KABC::Address::List addressList = addr.addresses(); - KABC::Address::List::Iterator it; - for ( it = addressList.begin(); it != addressList.end(); ++it ) { - if ( (*it).type() == type ) { - (*it).setLabel( (*lineIt).value().asString() ); - addr.insertAddress( *it ); - available = true; - break; - } - } - - if ( !available ) { // a standalone LABEL tag - KABC::Address address( type ); - address.setLabel( (*lineIt).value().asString() ); - addr.insertAddress( address ); - } - } - - // LOGO - else if ( identifier == "logo" ) - addr.setLogo( parsePicture( *lineIt ) ); - - // MAILER - else if ( identifier == "mailer" ) - addr.setMailer( (*lineIt).value().asString() ); - - // N - else if ( identifier == "n" ) { - const TQStringList nameParts = splitString( semicolonSep, (*lineIt).value().asString() ); - if ( nameParts.count() > 0 ) - addr.setFamilyName( nameParts[ 0 ] ); - if ( nameParts.count() > 1 ) - addr.setGivenName( nameParts[ 1 ] ); - if ( nameParts.count() > 2 ) - addr.setAdditionalName( nameParts[ 2 ] ); - if ( nameParts.count() > 3 ) - addr.setPrefix( nameParts[ 3 ] ); - if ( nameParts.count() > 4 ) - addr.setSuffix( nameParts[ 4 ] ); - } - - // NAME - else if ( identifier == "name" ) - addr.setName( (*lineIt).value().asString() ); - - // NICKNAME - else if ( identifier == "nickname" ) - addr.setNickName( (*lineIt).value().asString() ); - - // NOTE - else if ( identifier == "note" ) - addr.setNote( (*lineIt).value().asString() ); - - // ORGANIZATION - else if ( identifier == "org" ) { - const TQStringList orgParts = splitString( semicolonSep, (*lineIt).value().asString() ); - if ( orgParts.count() > 0 ) - addr.setOrganization( orgParts[ 0 ] ); - if ( orgParts.count() > 1 ) - addr.setDepartment( orgParts[ 1 ] ); - } - - // PHOTO - else if ( identifier == "photo" ) - addr.setPhoto( parsePicture( *lineIt ) ); - - // PROID - else if ( identifier == "prodid" ) - addr.setProductId( (*lineIt).value().asString() ); - - // REV - else if ( identifier == "rev" ) - addr.setRevision( parseDateTime( (*lineIt).value().asString() ) ); - - // ROLE - else if ( identifier == "role" ) - addr.setRole( (*lineIt).value().asString() ); - - // SORT-STRING - else if ( identifier == "sort-string" ) - addr.setSortString( (*lineIt).value().asString() ); - - // SOUND - else if ( identifier == "sound" ) - addr.setSound( parseSound( *lineIt ) ); - - // TEL - else if ( identifier == "tel" ) { - PhoneNumber phone; - phone.setNumber( (*lineIt).value().asString() ); - - int type = 0; - - const TQStringList types = (*lineIt).parameters( "type" ); - for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) - type += mPhoneTypeMap[(*it).upper()]; - - phone.setType( type ); - - addr.insertPhoneNumber( phone ); - } - - // TITLE - else if ( identifier == "title" ) - addr.setTitle( (*lineIt).value().asString() ); - - // TZ - else if ( identifier == "tz" ) { - TimeZone tz; - const TQString date = (*lineIt).value().asString(); - - int hours = date.mid( 1, 2).toInt(); - int minutes = date.mid( 4, 2 ).toInt(); - int offset = ( hours * 60 ) + minutes; - offset = offset * ( date[ 0 ] == '+' ? 1 : -1 ); - - tz.setOffset( offset ); - addr.setTimeZone( tz ); - } - - // UID - else if ( identifier == "uid" ) - addr.setUid( (*lineIt).value().asString() ); - - // URI - else if ( identifier == "uri" ) - addr.setUri( (*lineIt).value().asString() ); - - // URL - else if ( identifier == "url" ) - addr.setUrl( KURL( (*lineIt).value().asString() ) ); - - // X- - else if ( identifier.startsWith( "x-" ) ) { - const TQString key = (*lineIt).identifier().mid( 2 ); - int dash = key.find( "-" ); - addr.insertCustom( key.left( dash ), key.mid( dash + 1 ), (*lineIt).value().asString() ); - } - } - } - - addrList.append( addr ); - } - - return addrList; -} - -TQDateTime VCardTool::parseDateTime( const TQString &str ) -{ - TQDateTime dateTime; - - if ( str.find( '-' ) == -1 ) { // is base format (yyyymmdd) - dateTime.setDate( TQDate( str.left( 4 ).toInt(), str.mid( 4, 2 ).toInt(), - str.mid( 6, 2 ).toInt() ) ); - - if ( str.find( 'T' ) ) // has time information yyyymmddThh:mm:ss - dateTime.setTime( TQTime( str.mid( 11, 2 ).toInt(), str.mid( 14, 2 ).toInt(), - str.mid( 17, 2 ).toInt() ) ); - - } else { // is extended format yyyy-mm-dd - dateTime.setDate( TQDate( str.left( 4 ).toInt(), str.mid( 5, 2 ).toInt(), - str.mid( 8, 2 ).toInt() ) ); - - if ( str.find( 'T' ) ) // has time information yyyy-mm-ddThh:mm:ss - dateTime.setTime( TQTime( str.mid( 11, 2 ).toInt(), str.mid( 14, 2 ).toInt(), - str.mid( 17, 2 ).toInt() ) ); - } - - return dateTime; -} - -TQString VCardTool::createDateTime( const TQDateTime &dateTime ) -{ - TQString str; - - if ( dateTime.date().isValid() ) { - str.sprintf( "%4d-%02d-%02d", dateTime.date().year(), dateTime.date().month(), - dateTime.date().day() ); - if ( dateTime.time().isValid() ) { - TQString tmp; - tmp.sprintf( "T%02d:%02d:%02dZ", dateTime.time().hour(), dateTime.time().minute(), - dateTime.time().second() ); - str += tmp; - } - } - - return str; -} - -Picture VCardTool::parsePicture( const VCardLine &line ) -{ - Picture pic; - - const TQStringList params = line.parameterList(); - if ( params.findIndex( "encoding" ) != -1 ) { - TQImage img; - img.loadFromData( line.value().asByteArray() ); - pic.setData( img ); - } else if ( params.findIndex( "value" ) != -1 ) { - if ( line.parameter( "value" ).lower() == "uri" ) - pic.setUrl( line.value().asString() ); - } - - if ( params.findIndex( "type" ) != -1 ) - pic.setType( line.parameter( "type" ) ); - - return pic; -} - -VCardLine VCardTool::createPicture( const TQString &identifier, const Picture &pic ) -{ - VCardLine line( identifier ); - - if ( pic.isIntern() ) { - if ( !pic.data().isNull() ) { - TQByteArray input; - TQBuffer buffer( input ); - buffer.open( IO_WriteOnly ); - - TQImageIO iio( &buffer, "JPEG" ); - iio.setImage( pic.data() ); - iio.setQuality( 100 ); - iio.write(); - - line.setValue( input ); - line.addParameter( "encoding", "b" ); - line.addParameter( "type", "image/jpeg" ); - } - } else if ( !pic.url().isEmpty() ) { - line.setValue( pic.url() ); - line.addParameter( "value", "URI" ); - } - - return line; -} - -Sound VCardTool::parseSound( const VCardLine &line ) -{ - Sound snd; - - const TQStringList params = line.parameterList(); - if ( params.findIndex( "encoding" ) != -1 ) - snd.setData( line.value().asByteArray() ); - else if ( params.findIndex( "value" ) != -1 ) { - if ( line.parameter( "value" ).lower() == "uri" ) - snd.setUrl( line.value().asString() ); - } - -/* TODO: support sound types - if ( params.contains( "type" ) ) - snd.setType( line.parameter( "type" ) ); -*/ - - return snd; -} - -VCardLine VCardTool::createSound( const Sound &snd ) -{ - VCardLine line( "SOUND" ); - - if ( snd.isIntern() ) { - if ( !snd.data().isEmpty() ) { - line.setValue( snd.data() ); - line.addParameter( "encoding", "b" ); - // TODO: need to store sound type!!! - } - } else if ( !snd.url().isEmpty() ) { - line.setValue( snd.url() ); - line.addParameter( "value", "URI" ); - } - - return line; -} - -Key VCardTool::parseKey( const VCardLine &line ) -{ - Key key; - - const TQStringList params = line.parameterList(); - if ( params.findIndex( "encoding" ) != -1 ) - key.setBinaryData( line.value().asByteArray() ); - else - key.setTextData( line.value().asString() ); - - if ( params.findIndex( "type" ) != -1 ) { - if ( line.parameter( "type" ).lower() == "x509" ) - key.setType( Key::X509 ); - else if ( line.parameter( "type" ).lower() == "pgp" ) - key.setType( Key::PGP ); - else { - key.setType( Key::Custom ); - key.setCustomTypeString( line.parameter( "type" ) ); - } - } - - return key; -} - -VCardLine VCardTool::createKey( const Key &key ) -{ - VCardLine line( "KEY" ); - - if ( key.isBinary() ) { - if ( !key.binaryData().isEmpty() ) { - line.setValue( key.binaryData() ); - line.addParameter( "encoding", "b" ); - } - } else if ( !key.textData().isEmpty() ) - line.setValue( key.textData() ); - - if ( key.type() == Key::X509 ) - line.addParameter( "type", "X509" ); - else if ( key.type() == Key::PGP ) - line.addParameter( "type", "PGP" ); - else if ( key.type() == Key::Custom ) - line.addParameter( "type", key.customTypeString() ); - - return line; -} - -Secrecy VCardTool::parseSecrecy( const VCardLine &line ) -{ - Secrecy secrecy; - - if ( line.value().asString().lower() == "public" ) - secrecy.setType( Secrecy::Public ); - if ( line.value().asString().lower() == "private" ) - secrecy.setType( Secrecy::Private ); - if ( line.value().asString().lower() == "confidential" ) - secrecy.setType( Secrecy::Confidential ); - - return secrecy; -} - -VCardLine VCardTool::createSecrecy( const Secrecy &secrecy ) -{ - VCardLine line( "CLASS" ); - - int type = secrecy.type(); - - if ( type == Secrecy::Public ) - line.setValue( "PUBLIC" ); - else if ( type == Secrecy::Private ) - line.setValue( "PRIVATE" ); - else if ( type == Secrecy::Confidential ) - line.setValue( "CONFIDENTIAL" ); - - return line; -} - -Agent VCardTool::parseAgent( const VCardLine &line ) -{ - Agent agent; - - const TQStringList params = line.parameterList(); - if ( params.findIndex( "value" ) != -1 ) { - if ( line.parameter( "value" ).lower() == "uri" ) - agent.setUrl( line.value().asString() ); - } else { - TQString str = line.value().asString(); - str.replace( "\\n", "\r\n" ); - str.replace( "\\N", "\r\n" ); - str.replace( "\\;", ";" ); - str.replace( "\\:", ":" ); - str.replace( "\\,", "," ); - - const Addressee::List list = parseVCards( str ); - if ( list.count() > 0 ) { - Addressee *addr = new Addressee; - *addr = list[ 0 ]; - agent.setAddressee( addr ); - } - } - - return agent; -} - -VCardLine VCardTool::createAgent( VCard::Version version, const Agent &agent ) -{ - VCardLine line( "AGENT" ); - - if ( agent.isIntern() ) { - if ( agent.addressee() != 0 ) { - Addressee::List list; - list.append( *agent.addressee() ); - - TQString str = createVCards( list, version ); - str.replace( "\r\n", "\\n" ); - str.replace( ";", "\\;" ); - str.replace( ":", "\\:" ); - str.replace( ",", "\\," ); - line.setValue( str ); - } - } else if ( !agent.url().isEmpty() ) { - line.setValue( agent.url() ); - line.addParameter( "value", "URI" ); - } - - return line; -} - -TQStringList VCardTool::splitString( const TQChar &sep, const TQString &str ) -{ - TQStringList list; - TQString value( str ); - - int start = 0; - int pos = value.find( sep, start ); - - while ( pos != -1 ) { - if ( value[ pos - 1 ] != '\\' ) { - if ( pos > start && pos <= (int)value.length() ) - list << value.mid( start, pos - start ); - else - list << TQString::null; - - start = pos + 1; - pos = value.find( sep, start ); - } else { - if ( pos != 0 ) { - value.replace( pos - 1, 2, sep ); - pos = value.find( sep, pos ); - } else - pos = value.find( sep, pos + 1 ); - } - } - - int l = value.length() - 1; - if ( value.mid( start, l - start + 1 ).length() > 0 ) - list << value.mid( start, l - start + 1 ); - else - list << TQString::null; - - return list; -} diff --git a/kabc/vcardtool.h b/kabc/vcardtool.h deleted file mode 100644 index fbf959613..000000000 --- a/kabc/vcardtool.h +++ /dev/null @@ -1,88 +0,0 @@ -/* - This file is part of libkabc. - Copyright (c) 2003 Tobias Koenig - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Library General Public - License as published by the Free Software Foundation; either - version 2 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Library General Public License for more details. - - You should have received a copy of the GNU Library General Public License - along with this library; see the file COPYING.LIB. If not, write to - the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, - Boston, MA 02110-1301, USA. -*/ - -#ifndef KABC_VCARDTOOL_H -#define KABC_VCARDTOOL_H - -#include "addressee.h" -#include "vcardparser.h" - -class TQDateTime; - -namespace KABC { - -class Agent; -class Key; -class Picture; -class Secrecy; -class Sound; - -class KABC_EXPORT VCardTool -{ - public: - VCardTool(); - ~VCardTool(); - - /** - Creates a string that contains the addressees from the list in - the vCard format. - */ - TQString createVCards( Addressee::List list, VCard::Version version = VCard::v3_0 ); - - /** - Parses the string and returns a list of addressee objects. - */ - Addressee::List parseVCards( const TQString& vcard ); - - private: - /** - Split a string and replaces escaped separators on the fly with - unescaped ones. - */ - TQStringList splitString( const TQChar &sep, const TQString &value ); - - TQDateTime parseDateTime( const TQString &str ); - TQString createDateTime( const TQDateTime &dateTime ); - - Picture parsePicture( const VCardLine &line ); - VCardLine createPicture( const TQString &identifier, const Picture &pic ); - - Sound parseSound( const VCardLine &line ); - VCardLine createSound( const Sound &snd ); - - Key parseKey( const VCardLine &line ); - VCardLine createKey( const Key &key ); - - Secrecy parseSecrecy( const VCardLine &line ); - VCardLine createSecrecy( const Secrecy &secrecy ); - - Agent parseAgent( const VCardLine &line ); - VCardLine createAgent( VCard::Version version, const Agent &agent ); - - TQMap mAddressTypeMap; - TQMap mPhoneTypeMap; - - class VCardToolPrivate; - VCardToolPrivate *d; -}; - -} - -#endif diff --git a/kate/part/kateautoindent.cpp b/kate/part/kateautoindent.cpp index d904e16ce..9bbe317df 100644 --- a/kate/part/kateautoindent.cpp +++ b/kate/part/kateautoindent.cpp @@ -27,7 +27,7 @@ #include "katejscript.h" #include "kateview.h" -#include +#include #include #include diff --git a/kate/part/katebookmarks.cpp b/kate/part/katebookmarks.cpp index 5a1a085c2..f29ec9915 100644 --- a/kate/part/katebookmarks.cpp +++ b/kate/part/katebookmarks.cpp @@ -23,7 +23,7 @@ #include "katedocument.h" #include "kateview.h" -#include +#include #include #include #include diff --git a/kate/part/katebuffer.cpp b/kate/part/katebuffer.cpp index 7d930570d..61f81fadf 100644 --- a/kate/part/katebuffer.cpp +++ b/kate/part/katebuffer.cpp @@ -31,7 +31,7 @@ #include "kateautoindent.h" #include -#include +#include #include #include diff --git a/kate/part/katecmds.cpp b/kate/part/katecmds.cpp index ad8943328..09dd46f13 100644 --- a/kate/part/katecmds.cpp +++ b/kate/part/katecmds.cpp @@ -32,7 +32,7 @@ #include "../interfaces/katecmd.h" #include -#include +#include #include #include diff --git a/kate/part/kateconfig.cpp b/kate/part/kateconfig.cpp index 9c8e0856f..ed4eaacd2 100644 --- a/kate/part/kateconfig.cpp +++ b/kate/part/kateconfig.cpp @@ -29,9 +29,9 @@ #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/kate/part/katedialogs.cpp b/kate/part/katedialogs.cpp index 03257735c..1b8ce89eb 100644 --- a/kate/part/katedialogs.cpp +++ b/kate/part/katedialogs.cpp @@ -53,15 +53,15 @@ #include #include #include -#include -#include +#include +#include #include #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -72,7 +72,7 @@ #include #include #include -#include +#include #include #include diff --git a/kate/part/katedocument.cpp b/kate/part/katedocument.cpp index 1928ec225..e42bfb0bd 100644 --- a/kate/part/katedocument.cpp +++ b/kate/part/katedocument.cpp @@ -49,24 +49,24 @@ #include -#include -#include +#include +#include #include #include #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include diff --git a/kate/part/katedocument.h b/kate/part/katedocument.h index a2a2c6408..adc0dc92a 100644 --- a/kate/part/katedocument.h +++ b/kate/part/katedocument.h @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include diff --git a/kate/part/katedocumenthelpers.cpp b/kate/part/katedocumenthelpers.cpp index e50906b0d..b2e43758f 100644 --- a/kate/part/katedocumenthelpers.cpp +++ b/kate/part/katedocumenthelpers.cpp @@ -25,7 +25,7 @@ #include "kateview.h" #include -#include +#include KateBrowserExtension::KateBrowserExtension( KateDocument* doc ) : KParts::BrowserExtension( doc, "katepartbrowserextension" ), diff --git a/kate/part/katefactory.cpp b/kate/part/katefactory.cpp index eb760aaff..d6a9e0d59 100644 --- a/kate/part/katefactory.cpp +++ b/kate/part/katefactory.cpp @@ -34,7 +34,7 @@ #include "../interfaces/katecmd.h" #include -#include +#include #include #include diff --git a/kate/part/katefiletype.cpp b/kate/part/katefiletype.cpp index f0b01ef2d..281bf7e2d 100644 --- a/kate/part/katefiletype.cpp +++ b/kate/part/katefiletype.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include diff --git a/kate/part/katefont.cpp b/kate/part/katefont.cpp index 29955d7e2..c00953469 100644 --- a/kate/part/katefont.cpp +++ b/kate/part/katefont.cpp @@ -21,7 +21,7 @@ #include "katefont.h" -#include +#include #include diff --git a/kate/part/katehighlight.cpp b/kate/part/katehighlight.cpp index f6d5ae315..119b718fb 100644 --- a/kate/part/katehighlight.cpp +++ b/kate/part/katehighlight.cpp @@ -33,16 +33,16 @@ #include "kateconfig.h" #include -#include +#include #include #include -#include +#include #include #include -#include +#include #include #include -#include +#include #include #include diff --git a/kate/part/katejscript.cpp b/kate/part/katejscript.cpp index f3a5cd548..cab335312 100644 --- a/kate/part/katejscript.cpp +++ b/kate/part/katejscript.cpp @@ -35,8 +35,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/kate/part/kateluaindentscript.cpp b/kate/part/kateluaindentscript.cpp index 46cf531a7..375b0b7d4 100644 --- a/kate/part/kateluaindentscript.cpp +++ b/kate/part/kateluaindentscript.cpp @@ -32,8 +32,8 @@ #include #include -#include -#include +#include +#include extern "C" { #include diff --git a/kate/part/kateprinter.cpp b/kate/part/kateprinter.cpp index 6f22b2407..e66119747 100644 --- a/kate/part/kateprinter.cpp +++ b/kate/part/kateprinter.cpp @@ -35,7 +35,7 @@ #include #include // for spacingHint() #include -#include +#include #include #include #include // for loginName diff --git a/kate/part/kateschema.cpp b/kate/part/kateschema.cpp index 388513f17..5b71c92e8 100644 --- a/kate/part/kateschema.cpp +++ b/kate/part/kateschema.cpp @@ -27,7 +27,7 @@ #include "kateview.h" #include "katerenderer.h" -#include +#include #include #include #include @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kate/part/katesearch.cpp b/kate/part/katesearch.cpp index 9d0dc896b..930e4d906 100644 --- a/kate/part/katesearch.cpp +++ b/kate/part/katesearch.cpp @@ -31,9 +31,9 @@ #include "kateconfig.h" #include "katehighlight.h" -#include +#include #include -#include +#include #include #include #include diff --git a/kate/part/katespell.cpp b/kate/part/katespell.cpp index fc7e943cf..494e52894 100644 --- a/kate/part/katespell.cpp +++ b/kate/part/katespell.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include KateSpell::KateSpell( KateView* view ) : TQObject( view ) diff --git a/kate/part/katesyntaxdocument.cpp b/kate/part/katesyntaxdocument.cpp index d90f5de73..700daa9da 100644 --- a/kate/part/katesyntaxdocument.cpp +++ b/kate/part/katesyntaxdocument.cpp @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/kate/part/katetextline.cpp b/kate/part/katetextline.cpp index 6c701e1ed..005892607 100644 --- a/kate/part/katetextline.cpp +++ b/kate/part/katetextline.cpp @@ -23,7 +23,7 @@ #include "katetextline.h" #include "katerenderer.h" -#include +#include #include diff --git a/kate/part/kateview.cpp b/kate/part/kateview.cpp index 92d1bb97e..821cb0faf 100644 --- a/kate/part/kateview.cpp +++ b/kate/part/kateview.cpp @@ -57,10 +57,10 @@ #include #include #include -#include -#include +#include +#include #include -#include +#include #include #include #include @@ -68,7 +68,7 @@ #include #include #include -#include +#include #include #include diff --git a/kate/part/kateviewhelpers.cpp b/kate/part/kateviewhelpers.cpp index e8df70aa8..dd52451b0 100644 --- a/kate/part/kateviewhelpers.cpp +++ b/kate/part/kateviewhelpers.cpp @@ -33,10 +33,10 @@ #include "kateviewinternal.h" #include -#include -#include +#include +#include #include -#include +#include #include #include diff --git a/kate/part/kateviewinternal.cpp b/kate/part/kateviewinternal.cpp index a687c5523..c2b0ca4db 100644 --- a/kate/part/kateviewinternal.cpp +++ b/kate/part/kateviewinternal.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include diff --git a/kate/part/test_regression.cpp b/kate/part/test_regression.cpp index a503020c3..1b6decfe3 100644 --- a/kate/part/test_regression.cpp +++ b/kate/part/test_regression.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include diff --git a/kate/plugins/autobookmarker/autobookmarker.cpp b/kate/plugins/autobookmarker/autobookmarker.cpp index 495233d40..3f87f1580 100644 --- a/kate/plugins/autobookmarker/autobookmarker.cpp +++ b/kate/plugins/autobookmarker/autobookmarker.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kate/plugins/insertfile/insertfileplugin.cpp b/kate/plugins/insertfile/insertfileplugin.cpp index 567262a64..e2e3d354a 100644 --- a/kate/plugins/insertfile/insertfileplugin.cpp +++ b/kate/plugins/insertfile/insertfileplugin.cpp @@ -28,10 +28,10 @@ #include #include #include -#include -#include +#include +#include #include -#include +#include #include #include diff --git a/kate/plugins/isearch/ISearchPlugin.cpp b/kate/plugins/isearch/ISearchPlugin.cpp index a36c9dc60..7cb01ccc9 100644 --- a/kate/plugins/isearch/ISearchPlugin.cpp +++ b/kate/plugins/isearch/ISearchPlugin.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kate/plugins/kdatatool/kate_kdatatool.cpp b/kate/plugins/kdatatool/kate_kdatatool.cpp index d3b762b8e..e14cd9249 100644 --- a/kate/plugins/kdatatool/kate_kdatatool.cpp +++ b/kate/plugins/kdatatool/kate_kdatatool.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include //END includes diff --git a/kate/plugins/wordcompletion/docwordcompletion.cpp b/kate/plugins/wordcompletion/docwordcompletion.cpp index 4a3d34207..26dce06d0 100644 --- a/kate/plugins/wordcompletion/docwordcompletion.cpp +++ b/kate/plugins/wordcompletion/docwordcompletion.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kded/kbuildimageiofactory.cpp b/kded/kbuildimageiofactory.cpp index 267af31f6..b5873cad8 100644 --- a/kded/kbuildimageiofactory.cpp +++ b/kded/kbuildimageiofactory.cpp @@ -20,10 +20,10 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include +#include #include #include -#include +#include #include #include diff --git a/kded/kbuildprotocolinfofactory.cpp b/kded/kbuildprotocolinfofactory.cpp index f3fe698d4..921e55ab9 100644 --- a/kded/kbuildprotocolinfofactory.cpp +++ b/kded/kbuildprotocolinfofactory.cpp @@ -21,11 +21,11 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include +#include #include #include #include -#include +#include #include KBuildProtocolInfoFactory::KBuildProtocolInfoFactory() : diff --git a/kded/kbuildservicefactory.cpp b/kded/kbuildservicefactory.cpp index 7d9406d36..6f127caf2 100644 --- a/kded/kbuildservicefactory.cpp +++ b/kded/kbuildservicefactory.cpp @@ -23,10 +23,10 @@ #include "kresourcelist.h" #include "kmimetype.h" -#include +#include #include #include -#include +#include #include #include diff --git a/kded/kbuildservicegroupfactory.cpp b/kded/kbuildservicegroupfactory.cpp index 76f27ba57..3903a6b39 100644 --- a/kded/kbuildservicegroupfactory.cpp +++ b/kded/kbuildservicegroupfactory.cpp @@ -21,11 +21,11 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include +#include #include #include #include -#include +#include #include KBuildServiceGroupFactory::KBuildServiceGroupFactory() : diff --git a/kded/kbuildservicetypefactory.cpp b/kded/kbuildservicetypefactory.cpp index 351b7847a..da2863347 100644 --- a/kded/kbuildservicetypefactory.cpp +++ b/kded/kbuildservicetypefactory.cpp @@ -21,11 +21,11 @@ #include "tdesycocadict.h" #include "kresourcelist.h" -#include +#include #include #include #include -#include +#include #include #include diff --git a/kded/kded.cpp b/kded/kded.cpp index b6e6b523f..947d3b816 100644 --- a/kded/kded.cpp +++ b/kded/kded.cpp @@ -38,8 +38,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/kded/khostname.cpp b/kded/khostname.cpp index 7585e0ad0..c78152b97 100644 --- a/kded/khostname.cpp +++ b/kded/khostname.cpp @@ -30,9 +30,9 @@ #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/kded/tde-menu.cpp b/kded/tde-menu.cpp index 4ad6bc3db..4cf7a843e 100644 --- a/kded/tde-menu.cpp +++ b/kded/tde-menu.cpp @@ -26,8 +26,8 @@ #include "tdeaboutdata.h" #include "tdeapplication.h" #include "tdecmdlineargs.h" -#include "kglobal.h" -#include "klocale.h" +#include "tdeglobal.h" +#include "tdelocale.h" #include "kservice.h" #include "kservicegroup.h" #include "kstandarddirs.h" diff --git a/kded/tdebuildsycoca.cpp b/kded/tdebuildsycoca.cpp index aa03c2c94..4325162f7 100644 --- a/kded/tdebuildsycoca.cpp +++ b/kded/tdebuildsycoca.cpp @@ -42,12 +42,12 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include @@ -55,7 +55,7 @@ #ifdef KBUILDSYCOCA_GUI // KBUILDSYCOCA_GUI is used on win32 to build // GUI version of tdebuildsycoca, so-called "tdebuildsycocaw". # include -# include +# include bool silent; bool showprogress; #endif diff --git a/kded/vfolder_menu.cpp b/kded/vfolder_menu.cpp index e2dc603ba..408c6af9a 100644 --- a/kded/vfolder_menu.cpp +++ b/kded/vfolder_menu.cpp @@ -23,7 +23,7 @@ #include // getenv #include -#include +#include #include #include #include diff --git a/kdewidgets/CMakeLists.txt b/kdewidgets/CMakeLists.txt index a0a6f29df..19768e7ef 100644 --- a/kdewidgets/CMakeLists.txt +++ b/kdewidgets/CMakeLists.txt @@ -61,6 +61,6 @@ add_custom_command( OUTPUT kdewidgets.cpp tde_add_kpart( ${target} AUTOMOC SOURCES ${${target}_SRCS} - LINK kabc-shared + LINK tdeabc-shared DESTINATION ${PLUGIN_INSTALL_DIR}/plugins/designer ) diff --git a/kdewidgets/kde.widgets b/kdewidgets/kde.widgets index c81df5394..81b5ba82a 100644 --- a/kdewidgets/kde.widgets +++ b/kdewidgets/kde.widgets @@ -272,7 +272,7 @@ Group=Display (KDE) ConstructorArgs=(parent, 210, 16) [KABC::LdapConfigWidget] -IncludeFile=kabc/ldapconfigwidget.h +IncludeFile=tdeabc/ldapconfigwidget.h ToolTip=A widget which allows the user to set up LDAP connection parameters Group=Input (KDE) ConstructorArgs=(KABC::LdapConfigWidget::W_ALL, parent, name) diff --git a/kdewidgets/tests/test.widgets b/kdewidgets/tests/test.widgets index 30758f69e..aa5ade889 100644 --- a/kdewidgets/tests/test.widgets +++ b/kdewidgets/tests/test.widgets @@ -261,7 +261,7 @@ Group=Display (KDE) ConstructorArgs=(parent, 210, 16) [KABC::AddressLineEdit] -IncludeFile=kabc/addresslineedit.h +IncludeFile=tdeabc/addresslineedit.h ToolTip=A lineedit with LDAP and kabc completion. Group=Input (KDE) ConstructorArgs=(parent, true, name) diff --git a/kdoctools/meinproc.cpp b/kdoctools/meinproc.cpp index d0a1b7323..51f0b913a 100644 --- a/kdoctools/meinproc.cpp +++ b/kdoctools/meinproc.cpp @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/kdoctools/tdeio_help.cpp b/kdoctools/tdeio_help.cpp index d9f306b43..7b9d2a36e 100644 --- a/kdoctools/tdeio_help.cpp +++ b/kdoctools/tdeio_help.cpp @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/kdoctools/xslt.cpp b/kdoctools/xslt.cpp index 2eb03cfbc..498e6b2c8 100644 --- a/kdoctools/xslt.cpp +++ b/kdoctools/xslt.cpp @@ -12,7 +12,7 @@ #include #include #include "tdeio_help.h" -#include +#include #include #include #include diff --git a/kimgio/dds.cpp b/kimgio/dds.cpp index d174bf893..22251002c 100644 --- a/kimgio/dds.cpp +++ b/kimgio/dds.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include // sqrtf diff --git a/kimgio/eps.cpp b/kimgio/eps.cpp index d839ffe30..bcf916836 100644 --- a/kimgio/eps.cpp +++ b/kimgio/eps.cpp @@ -6,7 +6,7 @@ #include #include #include -#include +#include #include #include "eps.h" diff --git a/kimgio/exr.cpp b/kimgio/exr.cpp index c28cb799b..563c151a2 100644 --- a/kimgio/exr.cpp +++ b/kimgio/exr.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include diff --git a/kimgio/gimp.h b/kimgio/gimp.h index 114ffdc0f..7da1a45f8 100644 --- a/kimgio/gimp.h +++ b/kimgio/gimp.h @@ -21,7 +21,7 @@ * */ -#include +#include /* * These are the constants and functions I extracted from The GIMP source diff --git a/kimgio/hdr.cpp b/kimgio/hdr.cpp index 82cba5c12..5f1832f02 100644 --- a/kimgio/hdr.cpp +++ b/kimgio/hdr.cpp @@ -14,7 +14,7 @@ #include #include -#include +#include typedef TQ_UINT8 uchar; diff --git a/kimgio/jp2.cpp b/kimgio/jp2.cpp index 2200c948c..5de8fff8e 100644 --- a/kimgio/jp2.cpp +++ b/kimgio/jp2.cpp @@ -12,7 +12,7 @@ #ifdef HAVE_STDINT_H #include #endif -#include +#include #include #include #include diff --git a/kinit/autostart.cpp b/kinit/autostart.cpp index 4e4ad1f56..ccdbd3d97 100644 --- a/kinit/autostart.cpp +++ b/kinit/autostart.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include diff --git a/kinit/kinit.cpp b/kinit/kinit.cpp index f6b4a3e59..1dc03002d 100644 --- a/kinit/kinit.cpp +++ b/kinit/kinit.cpp @@ -54,11 +54,11 @@ #include #include #include -#include +#include #include #include #include -#include +#include #ifdef HAVE_SYS_PRCTL_H #include @@ -68,7 +68,7 @@ #endif #if defined Q_WS_X11 && ! defined K_WS_QTONLY -#include // schroder +#include // schroder #endif #include diff --git a/kinit/tdelauncher.cpp b/kinit/tdelauncher.cpp index 7b75bfaf5..f7ca08678 100644 --- a/kinit/tdelauncher.cpp +++ b/kinit/tdelauncher.cpp @@ -32,16 +32,16 @@ #include #include #include -#include -#include +#include +#include #include #include #include -#include +#include #include #if defined Q_WS_X11 && ! defined K_WS_QTONLY -#include // schroder +#include // schroder #endif diff --git a/kinit/tdelauncher_main.cpp b/kinit/tdelauncher_main.cpp index d59cfb86f..747050668 100644 --- a/kinit/tdelauncher_main.cpp +++ b/kinit/tdelauncher_main.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "tdelauncher_cmds.h" diff --git a/knewstuff/downloaddialog.cpp b/knewstuff/downloaddialog.cpp index ccbde83d6..8c31712cb 100644 --- a/knewstuff/downloaddialog.cpp +++ b/knewstuff/downloaddialog.cpp @@ -21,12 +21,12 @@ #include "downloaddialog.h" #include "downloaddialog.moc" -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/knewstuff/engine.cpp b/knewstuff/engine.cpp index a22750f8b..2b33e85f5 100644 --- a/knewstuff/engine.cpp +++ b/knewstuff/engine.cpp @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include #include #include "knewstuff.h" diff --git a/knewstuff/entry.cpp b/knewstuff/entry.cpp index 56dd375f4..00f7df522 100644 --- a/knewstuff/entry.cpp +++ b/knewstuff/entry.cpp @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include using namespace KNS; diff --git a/knewstuff/ghns.cpp b/knewstuff/ghns.cpp index dfe86a2a4..0702f16bb 100644 --- a/knewstuff/ghns.cpp +++ b/knewstuff/ghns.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/knewstuff/knewstuff.cpp b/knewstuff/knewstuff.cpp index 07034b454..b652ba4a8 100644 --- a/knewstuff/knewstuff.cpp +++ b/knewstuff/knewstuff.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include "engine.h" diff --git a/knewstuff/knewstuffbutton.cpp b/knewstuff/knewstuffbutton.cpp index 3ad0d6ac6..3baa83397 100644 --- a/knewstuff/knewstuffbutton.cpp +++ b/knewstuff/knewstuffbutton.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include #include "downloaddialog.h" #include "knewstuffbutton.h" diff --git a/knewstuff/knewstuffgeneric.cpp b/knewstuff/knewstuffgeneric.cpp index aa94559b9..ef6a37456 100644 --- a/knewstuff/knewstuffgeneric.cpp +++ b/knewstuff/knewstuffgeneric.cpp @@ -24,11 +24,11 @@ #include #include -#include +#include #include #include #include -#include +#include #include #include "entry.h" diff --git a/knewstuff/knewstuffsecure.cpp b/knewstuff/knewstuffsecure.cpp index b61924243..67374800e 100644 --- a/knewstuff/knewstuffsecure.cpp +++ b/knewstuff/knewstuffsecure.cpp @@ -18,10 +18,10 @@ //kde includes #include #include -#include +#include #include -#include -#include +#include +#include #include #include #include diff --git a/knewstuff/provider.cpp b/knewstuff/provider.cpp index d5da6bdde..20f1668f7 100644 --- a/knewstuff/provider.cpp +++ b/knewstuff/provider.cpp @@ -21,9 +21,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/knewstuff/providerdialog.cpp b/knewstuff/providerdialog.cpp index ddc0b2ef3..f71558ecd 100644 --- a/knewstuff/providerdialog.cpp +++ b/knewstuff/providerdialog.cpp @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include #include "engine.h" #include "provider.h" diff --git a/knewstuff/security.cpp b/knewstuff/security.cpp index d9ad85a7c..d161c2969 100644 --- a/knewstuff/security.cpp +++ b/knewstuff/security.cpp @@ -22,9 +22,9 @@ //kde includes #include #include -#include +#include #include -#include +#include #include #include diff --git a/knewstuff/tdehotnewstuff.cpp b/knewstuff/tdehotnewstuff.cpp index 87d735330..fb9e92a9b 100644 --- a/knewstuff/tdehotnewstuff.cpp +++ b/knewstuff/tdehotnewstuff.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/knewstuff/testnewstuff.cpp b/knewstuff/testnewstuff.cpp index 82b6d18f7..3494c5230 100644 --- a/knewstuff/testnewstuff.cpp +++ b/knewstuff/testnewstuff.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/knewstuff/uploaddialog.cpp b/knewstuff/uploaddialog.cpp index 98f8f60c7..f4b3dd50e 100644 --- a/knewstuff/uploaddialog.cpp +++ b/knewstuff/uploaddialog.cpp @@ -27,10 +27,10 @@ #include #include -#include +#include #include #include -#include +#include #include #include #include diff --git a/kstyles/highcontrast/config/highcontrastconfig.cpp b/kstyles/highcontrast/config/highcontrastconfig.cpp index 9de7f1bfd..f271113ca 100644 --- a/kstyles/highcontrast/config/highcontrastconfig.cpp +++ b/kstyles/highcontrast/config/highcontrastconfig.cpp @@ -28,8 +28,8 @@ DEALINGS IN THE SOFTWARE. #include #include #include -#include -#include +#include +#include #include "highcontrastconfig.h" diff --git a/kstyles/klegacy/klegacystyle.cpp b/kstyles/klegacy/klegacystyle.cpp index 5c083632e..a169de874 100644 --- a/kstyles/klegacy/klegacystyle.cpp +++ b/kstyles/klegacy/klegacystyle.cpp @@ -24,7 +24,7 @@ #include "klegacystyle.h" #include "klegacystyle.moc" -#include +#include #include #define INCLUDE_MENUITEM_DEF diff --git a/kstyles/klegacy/plugin.cpp b/kstyles/klegacy/plugin.cpp index 5d3a58492..558b54e73 100644 --- a/kstyles/klegacy/plugin.cpp +++ b/kstyles/klegacy/plugin.cpp @@ -1,5 +1,5 @@ #include "klegacystyle.h" -#include +#include extern "C" { TDEStyle* allocate(); diff --git a/kstyles/kthemestyle/kthemestyle.cpp b/kstyles/kthemestyle/kthemestyle.cpp index 4cc374e5d..a164821b1 100644 --- a/kstyles/kthemestyle/kthemestyle.cpp +++ b/kstyles/kthemestyle/kthemestyle.cpp @@ -53,7 +53,7 @@ Port version 0.9.7 #include #include #include -#include +#include #include #include #include diff --git a/kstyles/plastik/config/plastitdeconf.cpp b/kstyles/plastik/config/plastitdeconf.cpp index 8d3e4acfd..38cda2426 100644 --- a/kstyles/plastik/config/plastitdeconf.cpp +++ b/kstyles/plastik/config/plastitdeconf.cpp @@ -30,8 +30,8 @@ DEALINGS IN THE SOFTWARE. #include #include #include -#include -#include +#include +#include #include #include diff --git a/kstyles/utils/installtheme/main.cpp b/kstyles/utils/installtheme/main.cpp index 274c2d335..3ce63dfdf 100644 --- a/kstyles/utils/installtheme/main.cpp +++ b/kstyles/utils/installtheme/main.cpp @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/kstyles/web/plugin.cpp b/kstyles/web/plugin.cpp index 6ab10ebd8..bd4371ce3 100644 --- a/kstyles/web/plugin.cpp +++ b/kstyles/web/plugin.cpp @@ -1,4 +1,4 @@ -#include +#include #include "webstyle.h" extern "C" diff --git a/kstyles/web/webstyle.cpp b/kstyles/web/webstyle.cpp index d96688ee0..b3b461954 100644 --- a/kstyles/web/webstyle.cpp +++ b/kstyles/web/webstyle.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include #include #include diff --git a/libtdemid/deviceman.cc b/libtdemid/deviceman.cc index b8210af6d..fec0ff090 100644 --- a/libtdemid/deviceman.cc +++ b/libtdemid/deviceman.cc @@ -67,7 +67,7 @@ #if 1 #include -#include +#include #include #endif diff --git a/libtdescreensaver/main.cpp b/libtdescreensaver/main.cpp index f9d8ccb17..073d7845d 100644 --- a/libtdescreensaver/main.cpp +++ b/libtdescreensaver/main.cpp @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/networkstatus/connectionmanager.cpp b/networkstatus/connectionmanager.cpp index c37214ecd..f36220886 100644 --- a/networkstatus/connectionmanager.cpp +++ b/networkstatus/connectionmanager.cpp @@ -20,8 +20,8 @@ */ #include -#include -#include +#include +#include #include #include "clientiface_stub.h" diff --git a/networkstatus/networkstatusindicator.cpp b/networkstatus/networkstatusindicator.cpp index 957d6f739..a77f1c1fd 100644 --- a/networkstatus/networkstatusindicator.cpp +++ b/networkstatus/networkstatusindicator.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "connectionmanager.h" diff --git a/tdeabc/CMakeLists.txt b/tdeabc/CMakeLists.txt new file mode 100644 index 000000000..e0ec832d0 --- /dev/null +++ b/tdeabc/CMakeLists.txt @@ -0,0 +1,123 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( vcard ) +add_subdirectory( vcardparser ) +add_subdirectory( formats ) +add_subdirectory( plugins ) + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/vcard/include + ${CMAKE_CURRENT_SOURCE_DIR}/vcard/include/generated + ${CMAKE_CURRENT_SOURCE_DIR}/vcardparser + + # external includes + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/kab +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + address.h addressbook.h addresseedialog.h + agent.h distributionlist.h distributionlistdialog.h + distributionlisteditor.h errorhandler.h field.h + format.h formatfactory.h formatplugin.h geo.h key.h + phonenumber.h picture.h plugin.h resource.h secrecy.h + resourceselectdialog.h sound.h stdaddressbook.h + timezone.h vcardconverter.h vcardformat.h lock.h + vcardformatplugin.h ldifconverter.h addresslineedit.h + ldapclient.h addresseelist.h locknull.h ldif.h + ldapurl.h ldapconfigwidget.h sortmode.h + ${CMAKE_CURRENT_BINARY_DIR}/addressee.h + DESTINATION ${INCLUDE_INSTALL_DIR}/tdeabc ) + + +##### other data ################################ + +install( FILES tdeab2tdeabc.desktop DESTINATION ${AUTOSTART_INSTALL_DIR} ) +install( FILES kabc_manager.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources ) +install( FILES countrytransl.map DESTINATION ${DATA_INSTALL_DIR}/tdeabc ) + + +##### generated files ########################### +# FIXME this hack make compatibility with out-of-source mode + +file( COPY + scripts/makeaddressee scripts/addressee.src.cpp + scripts/addressee.src.h scripts/entrylist scripts/field.src.cpp + DESTINATION scripts ) + +add_custom_command( + OUTPUT addressee.cpp addressee.h field.cpp + COMMAND perl + ARGS makeaddressee + DEPENDS scripts/addressee.src.cpp scripts/addressee.src.h scripts/entrylist scripts/field.src.cpp + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/scripts +) + + +##### tdeabc ###################################### + +set( target tdeabc ) + +set( ${target}_SRCS + address.cpp addressbook.cpp addressee.cpp addresseedialog.cpp + agent.cpp distributionlist.cpp distributionlistdialog.cpp + distributionlisteditor.cpp errorhandler.cpp field.cpp + formatfactory.cpp geo.cpp key.cpp phonenumber.cpp + picture.cpp plugin.cpp resource.cpp resourceselectdialog.cpp + secrecy.cpp sound.cpp stdaddressbook.cpp timezone.cpp + vcard21parser.cpp vcardconverter.cpp vcardformat.cpp + vcardformatimpl.cpp vcardformatplugin.cpp ldifconverter.cpp + addresslineedit.cpp ldapclient.cpp addresseelist.cpp + vcardtool.cpp addresseehelper.cpp lock.cpp locknull.cpp + ldif.cpp ldapurl.cpp ldapconfigwidget.cpp sortmode.cpp + addresseehelper.skel +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 1.2.0 + LINK vcards-static vcard-shared tdeio-shared tderesources-shared + DEPENDENCIES addressee.h dcopidl + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### tdeab2tdeabc ################################## + +set( target tdeab2tdeabc ) + +set( ${target}_SRCS + tdeab2tdeabc.cpp +) + +tde_add_executable( ${target} + SOURCES ${${target}_SRCS} + LINK kab-static tdeabc-shared + DESTINATION ${BIN_INSTALL_DIR} +) diff --git a/tdeabc/HACKING b/tdeabc/HACKING new file mode 100644 index 000000000..429ae0865 --- /dev/null +++ b/tdeabc/HACKING @@ -0,0 +1,100 @@ +Coding Style +============ + +See http://korganizer.kde.org/hacking.html for an HTML version. + +Formatting +---------- + +- No Tabs. +- Indent with 2 spaces. +- A line must not have more than 80 chars. +- Put Spaces between brackets and arguments of functions. +- For if, else, while and similar statements put the brackets on the same line + as the statement. +- Function and class definitions have their brackets on separate lines. + +Example: + +void MyClass::myFunction() +{ + if ( blah == fasel ) { + blubbVariable = arglValue; + } else { + blubbVariable = oerxValue; + } +} + + +Header Formatting +----------------- + +- General formatting rules apply. +- Access modifiers are indented. +- Put curly brackets of class definition on its own line. +- Double inclusion protection defines are all upper case letters and are + composed of the namespace (if available), the classname and a H suffix + separated by underscores. +- Inside a namespace there is no indentation. + +Example: + +#ifndef XKJ_MYCLASS_H +#define XKJ_MYCLASS_H + +namespace XKJ { + +class MyClass +{ + public: + MyClass(); + + private: + int mMyInt; +}; + +} + +#endif + + +API docs +-------- + +- Each public function must have a Doxygen compatible comment in the header +- Use C-style comments without additional asterisks +- Indent correctly. +- Comments should be grammatically correct, e.g. sentences start with uppercase + letters and end with a full stop. +- Be concise. + +Example: + + /** + This function makes tea. + + @param cups number of cups. + @result tea + */ + Tea makeTea( int cups ); + + +Class and File Names +-------------------- + +- Put classes in files, which have the same name as the class, but only + lower-case letters. +- Designer-generated files should have a name classname_base.ui and shoul + contain a class called ClassnameBase. +- Classes inheriting from designer-generated classes have the same name as the + generated class, but without the Base suffix. + +Class and Variable Names +------------------------ + +- For class, variable, function names seperate multiple words by upper-casing + the words precedeed by other words. +- Class names start with an upper-case letter. +- Function names start with a lower-case letter. +- Variable names start with a lower-case letter. +- Member variables of a class start with "m" followed by an upper-case letter. diff --git a/tdeabc/HOWTO b/tdeabc/HOWTO new file mode 100644 index 000000000..3941b2033 --- /dev/null +++ b/tdeabc/HOWTO @@ -0,0 +1,372 @@ +The KDE Address Book Framework +=============================== + +The KDE address book framework tries to provide an easy to use and powerful +mechanism to handle contacts in all KDE applications. + +If you want to make use of it, this small introduction to programming +with libkabc may be helpful. + + +General Concepts +================= + +In libkabc the storage and management of contacts is devided in 2 layers. + +****************** +Management Layer * +****************** + + .-------------------. + | KABC::AddressBook | + .--------------------------------. + | KABC::Addressee | => Iterators + | KABC::Addressee | + | KABC::Addressee | => Search functions + | ... | + `--------------------------------' + | + - - - - - - - - - - - | - - - - - - - - - - - - - + | +*************** | +Storage Layer * | +*************** | ....................... + | . . - Network + .---------------. | . .---------------. . + | ResourceFile |----+-----| ResourceLDAP | . + `---------------' | . `---------------' . + .---------------. | . .---------------. . + | ResourceDir |----+-----| ResourceNet | . + `---------------' . `---------------' . + . . + ....................... + + +The Management Layer +--------------------- +The Management Layer consists of the two classes KABC::AddressBook and +KABC::Addressee. KABC::AddressBook is a container for KABC::Addressee objects +and provides 2 kinds of access methods. +1) Iterators + With iterators you can iterate over each of the contacts of the + address book and perform an action on it + +2) Search functions + With search functions you can search for contacts with special attributes + such as "all contacts with the name 'Harald'" + +The class KABC::Addressee represents a single contact and contains all data +a vCard could store (as specified in RFC 2426). + +The Storage Layer +------------------ +The Storage Layer consists of the class KABC::Resource and its derived classes. +These classes are used by KABC::AddressBook to load and store the contacts to +the single backends. +At the moment libkabc provides 4 types of resources: +1) ResourceFile + - stores all contacts in a single file + +2) ResourceDir + - stores each contact in its own file with the unique identifier of the + contact as a filename, will all of the files together in one directory + +3) ResourceLDAP + - stores all of the contacts on a LDAP server + +4) ResourceNet + - stores all contacts in a single file, which can be accessable via HTTP, + FTP, Fish, WebDAV, POP3, IMAP or whatever the KIO frame work supports + +In general the developer does not have to take how to save the single contacts. +He just has to plug one of the above mentioned resources into KABC::AddressBook +and perform a save action. + +Examples +========= +Like a picture, C/C++ code is worth a 1000 words I'd like to give you a +lot of examples now, how to use libkabc for several tasks: + + +Using KABC::StdAddressBook and Iterators +----------------------------------------- +Normally you have to plugin the resources manually into the addressbook object +and call the load() function before you can access the contacts, but there is +a special class KABC::StdAddressBook, which loads all resources of the standard +address book of the user automatically. You can use it the following way: + + + #include + + 1: KABC::AddressBook *ab = KABC::StdAddressBook::self(); + 2: KABC::AddressBook::Iterator it; + 3: for ( it = ab->begin(); it != ab->end(); ++it ) { + 4: KABC::Addressee addr = (*it); + 5: + 6: kdDebug() << "Name = " << addr.formattedName() << endl; + 7: } + +The above example prints out the names of all the contacts in the user's address +book. In line 1 you retrieve a pointer to the user's standard address book +(provided by KABC::StdAddressBook via a singleton design pattern). +In line 2 an iterator is defined, which is used in line 3 to iterate over the +whole address book. The assignment in line 4 is intended only to show more +clearly how iterators function. +You could also use (*it).formattedName() directly. In line 6 the formatted name +of the current contact is printed out to stderr. +As you can see that's all magic, and it's quite easy ;) + + +Using KABC::AddressBook manually +--------------------------------- +In some cases you don't want to load the user's standard address book, but, +for example, just a single vCard. For this purpose you have to use the +class KABC::AddressBook and handle the resource stuff manually. +The following code will create a file resource and save a contact into it: + + + #include + #include + + 1: KABC::AddressBook ab; + 2: + 3: // create a file resource + 4: KABC::Resource *res = new KABC::ResourceFile( "/home/user/myvcard.vcf", "vcard" ); + 5: + 6: if ( !ab.addResource( res ) ) { + 7: kdDebug() << "Unable to open resource" << endl; + 8: return 1; + 9: } +10: +11: if ( !ab.load() ) { +12: kdDebug() << "Unable to load address book!" << endl; +13: return 2; +14: } +15: +16: KABC::Addressee addr; +17: addr.setNameFromString( "Otto Harald Meyer" ); +18: addr.setBirthday( QDate( 1982, 07, 19 ) ); +19: addr.setNickName( "otto" ); +20: addr.setMailer( "kmail" ); +21: +22: // TZ +23: KABC::TimeZone tz( 60 ); // takes time shift in minutes as argument +24: addr.setTimeZone( tz ); +25: +26: // GEO +27: KABC::Geo geo( 52.5, 13.36 ); // takes latitude and longitude as argument +28: addr.setGeo( geo ); +29: +30: addr.setTitle( "dude, the" ); +31: addr.setRole( "developer" ); +32: addr.setOrganization( "KDE e.V." ); +33: addr.setNote( "Yet another senseless note..." ); +34: addr.setUrl( KURL( "http://kaddressbook.org" ) ); +35: +36: // CLASS +37: KABC::Secrecy secrecy( KABC::Secrecy::Confidential ); +38: addr.setSecrecy( secrecy ); +39: +40: // PHOTO or LOGO +41: KABC::Picture photo; +42: QImage img; +43: if ( img.load( "face.png", "PNG" ) ) { +44: photo.setData( img ); +45: photo.setType( "image/png" ); +46: addr.setPhoto( photo ); +47: } +48: +49: addr.insertEmail( "otto@kde.se", true ); // preferred email +50: addr.insertEmail( "otti@yahoo.com", false ); +51: +52: // TEL +53: KABC::PhoneNumber phoneHome( "0351 5466738", KABC::PhoneNumber::Home ); +54: KABC::PhoneNumber phoneWork( "0351 2335411", KABC::PhoneNumber::Work ); +55: addr.insertPhoneNumber( phoneHome ); +56: addr.insertPhoneNumber( phoneWork ); +57: +58: // ADR +59: KABC::Address homeAddr( KABC::Address::Home ); +60: homeAddr.setStreet( "Milliwaystreet 42" ); +61: homeAddr.setLocality( "London" ); +62: homeAddr.setRegion( "Saxony" ); +63: homeAddr.setPostalCode( "43435" ); +64: homeAddr.setCountry( "Germany" ); +65: addr.insertAddress( homeAddr ); +66: +67: addr.insertCategory( "LUG-Dresden-Members" ); +68: +69: addr.insertCustom( "KADDRESSBOOK", "X-Anniversary", "21.04.2009" ); +70: +71: ab.insertAddressee( addr ); // will be assigned to the standard resource +72: // automatically +73: +74: KABC::Ticket *ticket = ab.requestSaveTicket( res ); +75: if ( !ticket ) { +76: kdError() << "Resource is locked by other application!" << endl; +77: } else { +78: if ( !ab.save( ticket ) ) { +79: kdError() << "Saving failed!" << endl; +80: ab.releaseSaveTicket( ticket ); +81: } +82: +83: } +84: +85: return 0; + +In line 1 the KABC::AddressBook is created. In line 4 you creat the +KABC::ResourceFile (which will handle the loading/saving). +The resource takes 2 arguments, the first is the file name and the +second one the file format. At the moment libkabc supports two file formats: +1) vCard, as specified in RFC 2426 +2) Binary, which increases performance during loading and saving + +In line 6 we try to plug the resource into the addressbook. The addressbook +class tries to open the resource immediately and returns whether opening was +successful. We add here only one resource, but you can add as many resources +as you want. + +In line 11 we try to load all contacts from the backends into the address book. +As before, it returns whether opening was successful. + +In line 16 a KABC::Addressee is created, which we will fill now with data, +before inserting it into the KABC::AddressBook. +The setNameFromString() function in the following line takes a string as +argument and tries to parse it into the single name components such as: given +name, family name, additional names, honoric prefix and honoric suffix. +You can set these values manually as well by calling + addr.setGivenName( "Otto" ); +and + addr.setFamilyName( "Meyer" ); +etc. etc. + +In line 23 we use the class KABC::TimeZone to store the timezone. This class +takes the time shift in minutes. + +In line 27 the KABC::Geo class is used for storing the geographical +information. The arguments are the latitude and longitude as float values. + +KABC::Secrecy in line 37 represents the CLASS entity of a vCard and can take +KABC::Secrecy::Public, KABC::Secrecy::Private or KABC::Secrecy::Confidential +as argument. + +In line 41 we make use of KABC::Picture class to store the photo of the +contact. This class can contain either an URL or the raw image data in form +of a QImage, in this example we use the latter. + +In line 43 we try to load the image "face.png" from the local directory and +assign this QImage to the KABC::Picture class via the setData() function. +Additionally we set the type of the picture to "image/png". + +From 49 - 50 we insert 2 email addresses with the first one as preferred +(second argument is true). + +In 53 and the following 3 lines we add two telephone numbers. For this purpose +libkabc provides the KABC::PhoneNumber class, which takes the phone number in +string representation as first argument and the type as second. The types can +be combined, so 'KABC::PhoneNumber::Home | KABC::PhoneNumber::Fax' would be +the Home Fax. + +In line 59 we create a KABC::Address object and set the single parts in the +following lines. + +In line 67 we assign the contact to a special category. + +A contact can also contain custom entries, which are not specified in the API, +so you can add custom values with insertCustom() as shown in line 69. +The first argument of this function should be the name of the application, so +2 applications which use the same custom entry accidentally, do not overwrite +the data for each other. The second argument contains the name of the +custom entry and the third argument the value in string representation. + +In line 71 we finally insert the KABC::Addressee object into the +KABC::AddressBook. Since we have only one resource loaded, the contact is +automatically assigned to this resource. If you have several writeable +resources loaded, you should ask the user which resource the contact shall +belong to and assign the selected resource to the contact with + KABC::Addressee.setResource( KABC::Resource *resource ); +before inserting it into the address book. + +To prevent multiple access to one resource and possible resulting data loss +we have to lock the resource before saving our changes. +For this purpose KABC::AddressBook provides the function + requestSaveTicket( KABC::Resource* ) +which takes a pointer to the resource which shall be saved as argument and +returns a so called 'Save Ticket' if locking succeeded or a null pointer +if the resource is already locked by another application. + +So when we retrieved a valid ticket in line 74, we try to save our changes in +line 78. +The KABC::AddressBook::save() function takes the save ticket as argument and +returns whether saving succeeded. It also releases the save ticket when successful. + +Important! +If the save() call fails, you have to release the save ticket manually, as is +done in line 80, otherwise possible locks, created by the resources, won't be +removed. + +You can see also, that manual use is quite easy for the KABC::AddressBook class +and for the ResourceFile. For more information about the API of KABC::Addressee +please take a look at the official API documentation or the header files. + + +Distribution Lists +------------------- +libkabc provides so called distribution lists to group contacts. These lists +just store the uid of contacts, so they can be used for every kind of contact +grouping. There are 2 classes which handle the whole distribution list tasks, +KABC::DistributionListManager and KABC::DistributionList. The first one keeps +track of all available distribution lists and the latter one is the +representation of one list. + + + #include + #include + + 1: KABC::DistributionListManager manager( KABC::StdAddressBook::self() ); + 2: + 3: // load the lists + 4: manager.load(); + 5: + 6: QStringList listNames = manager.listNames(); + 7: QStringList::Iterator it; + 8: for ( it = listNames.begin(); it != listNames.end(); ++it ) { + 9: KABC::DistributionList *list = manager.list( *it ); +10: kdDebug() << list->name() << endl; +11: +12: QStringList emails = list->emails(); +13: QStringList::Iterator eit; +14: for ( eit = emails.begin(); eit != emails.end(); ++eit ) +15: kdDebug() << QString( "\t%1" ).arg( (*eit).latin1() ) << endl; +16: } + +In the first line a KABC::DistributionListManager is created. The manager takes +a pointer to a KABC::AddressBook, because he has to resolve the stored uids to +currently available email addresses. +In line 4 the manager loads all distribution lists from the central config file +$HOME/.trinity/share/apps/tdeabc/distlists. +The next line queries the names of all available distribution lists, which are +used in line 9 to retrieve a pointer to the specific list. +Now that you have a KABC::DistributionList object, you can performe the +following actions on it: + - set / get the name + - insert an entry + - remove an entry + - get a list of all email addresses + - get a list of all entries (which includes the uids) + +In line 12 we query all email addresses of every resource and print them out. + + contains also the declaration for the class +KABC::DistributionListWatcher. This class exists only once per application and +its only job is to emit a signal as soon as the distribution list file has +changed. So to make your application aware of changes use the following code: + + + #include + + 1: connect( KABC::DistributionListWatcher::self(), SIGNAL( changed() ), + 2: this, SLOT( slotDistributionListChanged() ) ); + +You see, as usual, easy ;) + diff --git a/tdeabc/Makefile.am b/tdeabc/Makefile.am new file mode 100644 index 000000000..57e72aec2 --- /dev/null +++ b/tdeabc/Makefile.am @@ -0,0 +1,72 @@ +SUBDIRS = vcard vcardparser . formats plugins scripts tests + +# Make sure $(all_includes) remains last! +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc -I$(top_srcdir)/kab \ + -I$(srcdir)/vcard/include -I$(srcdir)/vcardparser/ \ + -I$(srcdir)/vcard/include/generated \ + -I$(srcdir)/vcardparser $(all_includes) + +field.cpp: addressee.h addressee.cpp +addressee.cpp: addressee.h +addressee.cpp addressee.h field.cpp: \ + $(srcdir)/scripts/makeaddressee \ + $(srcdir)/scripts/addressee.src.cpp \ + $(srcdir)/scripts/addressee.src.h \ + $(srcdir)/scripts/entrylist \ + $(srcdir)/scripts/field.src.cpp + mysrcdir=`cd $(srcdir)/scripts && pwd` ;\ + cd scripts && $(PERL) $$mysrcdir/makeaddressee + +CLEANFILES = addressee.h addressee.cpp field.cpp + +lib_LTLIBRARIES = libkabc.la +libkabc_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 3:0:2 -no-undefined +libkabc_la_LIBADD = vcard/libvcard.la vcardparser/libvcards.la $(LIB_KIO) \ + $(top_builddir)/tderesources/libtderesources.la $(LIB_QT) $(top_builddir)/dcop/libDCOP.la $(LIB_TDEUI) $(LIB_TDECORE) +libkabc_la_COMPILE_FIRST = addressee.h + +libkabc_la_SOURCES = \ + address.cpp addressbook.cpp addressee.cpp addresseedialog.cpp agent.cpp \ + distributionlist.cpp distributionlistdialog.cpp distributionlisteditor.cpp \ + errorhandler.cpp field.cpp formatfactory.cpp geo.cpp key.cpp \ + phonenumber.cpp picture.cpp plugin.cpp resource.cpp \ + resourceselectdialog.cpp secrecy.cpp sound.cpp stdaddressbook.cpp \ + timezone.cpp vcard21parser.cpp vcardconverter.cpp vcardformat.cpp \ + vcardformatimpl.cpp vcardformatplugin.cpp ldifconverter.cpp addresslineedit.cpp \ + ldapclient.cpp addresseelist.cpp vcardtool.cpp addresseehelper.cpp \ + addresseehelper.skel lock.cpp locknull.cpp ldif.cpp ldapurl.cpp ldapconfigwidget.cpp \ + sortmode.cpp + + +kabcincludedir = $(includedir)/kabc +kabcinclude_HEADERS = address.h addressbook.h addressee.h addresseedialog.h \ + agent.h distributionlist.h distributionlistdialog.h distributionlisteditor.h \ + errorhandler.h field.h format.h formatfactory.h formatplugin.h geo.h key.h \ + phonenumber.h picture.h plugin.h resource.h \ + resourceselectdialog.h secrecy.h sound.h stdaddressbook.h timezone.h \ + vcardconverter.h vcardformat.h vcardformatplugin.h ldifconverter.h \ + addresslineedit.h ldapclient.h addresseelist.h lock.h locknull.h ldif.h \ + ldapurl.h ldapconfigwidget.h sortmode.h + +METASOURCES = AUTO + +bin_PROGRAMS = tdeab2tdeabc + +tdeab2tdeabc_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +tdeab2tdeabc_LDADD = libkabc.la ../kab/libkab.la +tdeab2tdeabc_SOURCES = tdeab2tdeabc.cpp + +autostart_DATA = tdeab2tdeabc.desktop +autostartdir = $(datadir)/autostart + +manager_DATA = kabc_manager.desktop +managerdir = $(kde_servicesdir)/tderesources + +DOXYGEN_REFERENCES = tdecore tdeui + +map_DATA = countrytransl.map +mapdir = $(kde_datadir)/kabc + +EXTRA_DIST = $(map_DATA) + +include ../admin/Doxyfile.am diff --git a/tdeabc/README b/tdeabc/README new file mode 100644 index 000000000..46d21b9b6 --- /dev/null +++ b/tdeabc/README @@ -0,0 +1,28 @@ +LIBKABC - new address book API for KDE + +PURPOSE: + +libkabc provides an API for address book data. This can be used by all KDE +application using data of this type, e.g. KAddressBook, KMail, KOrganizer, +KPilot etc. It is meant as replacement for libkab (in tdebase/kab). + +FEATURES: + +- Value based interface, addressbook entry data is implicitly shared. +- Address book entries are identified by a unique id. +- vCard backend (RFC 2425 / RFC 2426). +- Locking mechanism to support concurrent access to the address book by + multiple processes. +- Notification on change of addressbook by other process. +- Dialog for selecting address book entries, supports mouse and keyboard + selection, supports automatic name completion. +- GUI client for viewing, modifying address book data. This is aimed at + developers not end users. +- Tool for converting data, written with libkab, to libkabc format. +- Multiple backends (resources) for storing entries e.g. LDAP + +AUTHOR: Cornelius Schumacher + +LICENCE: LPGL + +DATE: 13 Oct 2001 diff --git a/tdeabc/README.AddressFormat b/tdeabc/README.AddressFormat new file mode 100644 index 000000000..8079e4914 --- /dev/null +++ b/tdeabc/README.AddressFormat @@ -0,0 +1,66 @@ +Address formats can be a tricky thing. libkabc tries very hard to perfectly fit +the needs of ~95% of users and to be at least sufficient for the other 5%. + +The formatting of an address depends on the destination country as well as on +the origin country of a letter. Basically, the part indicating the destination +country follows the rules of the country of origin, all the rest follows the +rules of the destination country. So we need to store for every country a) the +country positioning and b) the address formatting. + +Address formats should usually be stored in a country's entry.desktop. There we +store the country position in field "AddressCountryPosition" and the address +format in a field "AddressFormat". Note that for most countries one field +"AddressFormat" is sufficient for personal as well as company addresses +(because personal addresses look just like business addresses without company); +however, in some countries (eg. Hungary) business addresses differ in their +structure. In this case you have the possibility of adding another field +"BusinessAddressFormat" which will be preferred for formatting of business +addresses; if libkabc can't find such a field, it will fall back to +"AddressFormat". (Please use BusinessAddressFormat ONLY if you really need to) + +The format consists mainly of tags that will be replaced by address fields. +The list of tags may grow in the future, the format *might* change in the near +future, but I hope not. + +Any comments very very welcome to kde-pim@kde.org or to jost@schenck.de. + +-Jost. + +Fields AddressFormat and BusinessAddressFormat +------------------------------------------------ +%n = real name +%N = REAL NAME +%cm = company +%CM = COMPANY +%s = street +%S = STREET +%z = zip code +%l = location +%L = LOCATION +%r = region +%R = REGION +%p = post office box +%, = conditional comma+whitespace, + will be left out if the value left or right of it is purged +%w = conditional whitespace, + will be left out if the value left or right of it is purged +%0(...) = the text inside the brackets will be completely purged if not + at least one tag inside it evaluates to something. Example: when the + address doesn't have a postbox, the string %0(PO Box %p) will not + evaluate to "PO Box " but to an empty string. +\n = newline + +Field AddressCountryPosition +------------------------------------------------ +below = country name below rest of address +BELOW = country name below in capital letters +above = country name above rest of address +ABOVE = country name above in capital letters + +Some Tips +------------------------------------------------ +- You sometimes have three fields in a line which can all be empty. If you eg. +separate them all with conditional whitespace (same goes for cond. comma) like +in "%z%w%r%w%l" and only the middle value (here: region) is empty, there will +be no whitespace at all between the outer values (here: zipcode and location). +To avoid this, combine two of these values with purge brackets: %0(%z%w%r)%w%l. diff --git a/tdeabc/TODO b/tdeabc/TODO new file mode 100644 index 000000000..13f75b6bb --- /dev/null +++ b/tdeabc/TODO @@ -0,0 +1 @@ +Factor out TDELockFile. diff --git a/tdeabc/address.cpp b/tdeabc/address.cpp new file mode 100644 index 000000000..112a70617 --- /dev/null +++ b/tdeabc/address.cpp @@ -0,0 +1,592 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "address.h" + +#include +#include +#include +#include +#include +#include + +#include + +using namespace KABC; + +TQMap *Address::mISOMap = 0; +static KStaticDeleter< TQMap > isoMapDeleter; + +Address::Address() : + mEmpty( true ), mType( 0 ) +{ + mId = TDEApplication::randomString( 10 ); +} + +Address::Address( int type ) : + mEmpty( true ), mType( type ) +{ + mId = TDEApplication::randomString( 10 ); +} + +bool Address::operator==( const Address &a ) const +{ + if ( mPostOfficeBox != a.mPostOfficeBox ) return false; + if ( mExtended != a.mExtended ) return false; + if ( mStreet != a.mStreet ) return false; + if ( mLocality != a.mLocality ) return false; + if ( mRegion != a.mRegion ) return false; + if ( mPostalCode != a.mPostalCode ) return false; + if ( mCountry != a.mCountry ) return false; + if ( mLabel != a.mLabel ) return false; + + return true; +} + +bool Address::operator!=( const Address &a ) const +{ + return !( a == *this ); +} + +bool Address::isEmpty() const +{ + if ( mPostOfficeBox.isEmpty() && + mExtended.isEmpty() && + mStreet.isEmpty() && + mLocality.isEmpty() && + mRegion.isEmpty() && + mPostalCode.isEmpty() && + mCountry.isEmpty() && + mLabel.isEmpty() ) { + return true; + } + return false; +} + +void Address::clear() +{ + *this = Address(); +} + +void Address::setId( const TQString &id ) +{ + mEmpty = false; + + mId = id; +} + +TQString Address::id() const +{ + return mId; +} + +void Address::setType( int type ) +{ + mEmpty = false; + + mType = type; +} + +int Address::type() const +{ + return mType; +} + +TQString Address::typeLabel() const +{ + TQString label; + bool first = true; + + const TypeList list = typeList(); + + TypeList::ConstIterator it; + for ( it = list.begin(); it != list.end(); ++it ) { + if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { + label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); + if ( first ) + first = false; + } + } + + return label; +} + +void Address::setPostOfficeBox( const TQString &s ) +{ + mEmpty = false; + + mPostOfficeBox = s; +} + +TQString Address::postOfficeBox() const +{ + return mPostOfficeBox; +} + +TQString Address::postOfficeBoxLabel() +{ + return i18n("Post Office Box"); +} + + +void Address::setExtended( const TQString &s ) +{ + mEmpty = false; + + mExtended = s; +} + +TQString Address::extended() const +{ + return mExtended; +} + +TQString Address::extendedLabel() +{ + return i18n("Extended Address Information"); +} + + +void Address::setStreet( const TQString &s ) +{ + mEmpty = false; + + mStreet = s; +} + +TQString Address::street() const +{ + return mStreet; +} + +TQString Address::streetLabel() +{ + return i18n("Street"); +} + + +void Address::setLocality( const TQString &s ) +{ + mEmpty = false; + + mLocality = s; +} + +TQString Address::locality() const +{ + return mLocality; +} + +TQString Address::localityLabel() +{ + return i18n("Locality"); +} + + +void Address::setRegion( const TQString &s ) +{ + mEmpty = false; + + mRegion = s; +} + +TQString Address::region() const +{ + return mRegion; +} + +TQString Address::regionLabel() +{ + return i18n("Region"); +} + + +void Address::setPostalCode( const TQString &s ) +{ + mEmpty = false; + + mPostalCode = s; +} + +TQString Address::postalCode() const +{ + return mPostalCode; +} + +TQString Address::postalCodeLabel() +{ + return i18n("Postal Code"); +} + + +void Address::setCountry( const TQString &s ) +{ + mEmpty = false; + + mCountry = s; +} + +TQString Address::country() const +{ + return mCountry; +} + +TQString Address::countryLabel() +{ + return i18n("Country"); +} + + +void Address::setLabel( const TQString &s ) +{ + mEmpty = false; + + mLabel = s; +} + +TQString Address::label() const +{ + return mLabel; +} + +TQString Address::labelLabel() +{ + return i18n("Delivery Label"); +} + +Address::TypeList Address::typeList() +{ + static TypeList list; + + if ( list.isEmpty() ) + list << Dom << Intl << Postal << Parcel << Home << Work << Pref; + + return list; +} + +TQString Address::typeLabel( int type ) +{ + if ( type & Pref ) + return i18n( "Preferred address", "Preferred" ); + + switch ( type ) { + case Dom: + return i18n("Domestic"); + break; + case Intl: + return i18n("International"); + break; + case Postal: + return i18n("Postal"); + break; + case Parcel: + return i18n("Parcel"); + break; + case Home: + return i18n("Home Address", "Home"); + break; + case Work: + return i18n("Work Address", "Work"); + break; + case Pref: + return i18n("Preferred Address"); + break; + default: + return i18n("Other"); + break; + } +} + +void Address::dump() const +{ + kdDebug(5700) << " Address {" << endl; + kdDebug(5700) << " Id: " << id() << endl; + kdDebug(5700) << " Extended: " << extended() << endl; + kdDebug(5700) << " Street: " << street() << endl; + kdDebug(5700) << " Postal Code: " << postalCode() << endl; + kdDebug(5700) << " Locality: " << locality() << endl; + kdDebug(5700) << " }" << endl; +} + + +TQString Address::formattedAddress( const TQString &realName, + const TQString &orgaName ) const +{ + TQString ciso; + TQString addrTemplate; + TQString ret; + + // FIXME: first check for iso-country-field and prefer that one + if ( !country().isEmpty() ) { + ciso = countryToISO( country() ); + } else { + // fall back to our own country + ciso = TDEGlobal::locale()->country(); + } + KSimpleConfig entry( locate( "locale", + TQString( "l10n/" ) + ciso + TQString( "/entry.desktop" ) ) ); + entry.setGroup( "KCM Locale" ); + + // decide whether this needs special business address formatting + if ( orgaName.isEmpty() ) { + addrTemplate = entry.readEntry( "AddressFormat" ); + } else { + addrTemplate = entry.readEntry( "BusinessAddressFormat" ); + if ( addrTemplate.isEmpty() ) + addrTemplate = entry.readEntry( "AddressFormat" ); + } + + // in the case there's no format found at all, default to what we've always + // used: + if ( addrTemplate.isEmpty() ) { + kdWarning(5700) << "address format database incomplete " + << "(no format for locale " << ciso + << " found). Using default address formatting." << endl; + addrTemplate = "%0(%n\\n)%0(%cm\\n)%0(%s\\n)%0(PO BOX %p\\n)%0(%l%w%r)%,%z"; + } + + // scan + parseAddressTemplateSection( addrTemplate, ret, realName, orgaName ); + + // now add the country line if needed (formatting this time according to + // the rules of our own system country ) + if ( !country().isEmpty() ) { + KSimpleConfig entry( locate( "locale", TQString( "l10n/" ) + + TDEGlobal::locale()->country() + TQString( "/entry.desktop" ) ) ); + entry.setGroup( "KCM Locale" ); + TQString cpos = entry.readEntry( "AddressCountryPosition" ); + if ( "BELOW" == cpos || cpos.isEmpty() ) { + ret = ret + "\n\n" + country().upper(); + } else if ( "below" == cpos ) { + ret = ret + "\n\n" + country(); + } else if ( "ABOVE" == cpos ) { + ret = country().upper() + "\n\n" + ret; + } else if ( "above" == cpos ) { + ret = country() + "\n\n" + ret; + } + } + + return ret; +} + +bool Address::parseAddressTemplateSection( const TQString &tsection, + TQString &result, const TQString &realName, const TQString &orgaName ) const +{ + // This method first parses and substitutes any bracketed sections and + // after that replaces any tags with their values. If a bracketed section + // or a tag evaluate to zero, they are not just removed but replaced + // with a placeholder. This is because in the last step conditionals are + // resolved which depend on information about zero-evaluations. + result = tsection; + int stpos = 0; + bool ret = false; + + // first check for brackets that have to be evaluated first + int fpos = result.find( KABC_FMTTAG_purgeempty, stpos ); + while ( -1 != fpos ) { + int bpos1 = fpos + KABC_FMTTAG_purgeempty.length(); + int bpos2; + // expect opening bracket and find next balanced closing bracket. If + // next char is no opening bracket, continue parsing (no valid tag) + if ( '(' == result[bpos1] ) { + bpos2 = findBalancedBracket( result, bpos1 ); + if ( -1 != bpos2 ) { + // we have balanced brackets, recursively parse: + TQString rplstr; + bool purge = !parseAddressTemplateSection( result.mid( bpos1+1, + bpos2-bpos1-1 ), rplstr, + realName, orgaName ); + if ( purge ) { + // purge -> remove all + // replace with !_P_!, so conditional tags work later + result.replace( fpos, bpos2 - fpos + 1, "!_P_!" ); + // leave stpos as it is + } else { + // no purge -> replace with recursively parsed string + result.replace( fpos, bpos2 - fpos + 1, rplstr ); + ret = true; + stpos = fpos + rplstr.length(); + } + } else { + // unbalanced brackets: keep on parsing (should not happen + // and will result in bad formatting) + stpos = bpos1; + } + } + fpos = result.find( KABC_FMTTAG_purgeempty, stpos ); + } + + // after sorting out all purge tags, we just search'n'replace the rest, + // keeping track of whether at least one tag evaluates to something. + // The following macro needs TQString for R_FIELD + // It substitutes !_P_! for empty fields so conditional tags work later +#define REPLTAG(R_TAG,R_FIELD) \ + if ( result.find(R_TAG, false) != -1 ) { \ + TQString rpl = R_FIELD.isEmpty() ? TQString("!_P_!") : R_FIELD; \ + result.replace( R_TAG, rpl ); \ + if ( !R_FIELD.isEmpty() ) { \ + ret = true; \ + } \ + } + REPLTAG( KABC_FMTTAG_realname, realName ); + REPLTAG( KABC_FMTTAG_REALNAME, realName.upper() ); + REPLTAG( KABC_FMTTAG_company, orgaName ); + REPLTAG( KABC_FMTTAG_COMPANY, orgaName.upper() ); + REPLTAG( KABC_FMTTAG_pobox, postOfficeBox() ); + REPLTAG( KABC_FMTTAG_street, street() ); + REPLTAG( KABC_FMTTAG_STREET, street().upper() ); + REPLTAG( KABC_FMTTAG_zipcode, postalCode() ); + REPLTAG( KABC_FMTTAG_location, locality() ); + REPLTAG( KABC_FMTTAG_LOCATION, locality().upper() ); + REPLTAG( KABC_FMTTAG_region, region() ); + REPLTAG( KABC_FMTTAG_REGION, region().upper() ); + result.replace( KABC_FMTTAG_newline, "\n" ); +#undef REPLTAG + + // conditional comma + fpos = result.find( KABC_FMTTAG_condcomma, 0 ); + while ( -1 != fpos ) { + TQString str1 = result.mid( fpos - 5, 5 ); + TQString str2 = result.mid( fpos + 2, 5 ); + if ( str1 != "!_P_!" && str2 != "!_P_!" ) { + result.replace( fpos, 2, ", " ); + } else { + result.remove( fpos, 2 ); + } + fpos = result.find( KABC_FMTTAG_condcomma, fpos ); + } + // conditional whitespace + fpos = result.find( KABC_FMTTAG_condwhite, 0 ); + while ( -1 != fpos ) { + TQString str1 = result.mid( fpos - 5, 5 ); + TQString str2 = result.mid( fpos + 2, 5 ); + if ( str1 != "!_P_!" && str2 != "!_P_!" ) { + result.replace( fpos, 2, " " ); + } else { + result.remove( fpos, 2 ); + } + fpos = result.find( KABC_FMTTAG_condwhite, fpos ); + } + + // remove purged: + result.remove( "!_P_!" ); + + return ret; +} + +int Address::findBalancedBracket( const TQString &tsection, int pos ) const +{ + int balancecounter = 0; + for( unsigned int i = pos + 1; i < tsection.length(); i++ ) { + if ( ')' == tsection[i] && 0 == balancecounter ) { + // found end of brackets + return i; + } else + if ( '(' == tsection[i] ) { + // nested brackets + balancecounter++; + } + } + return -1; +} + +TQString Address::countryToISO( const TQString &cname ) +{ + // we search a map file for translations from country names to + // iso codes, storing caching things in a TQMap for faster future + // access. + if ( !mISOMap ) + isoMapDeleter.setObject( mISOMap, new TQMap() ); + + TQMap::ConstIterator it; + it = mISOMap->find( cname ); + if ( it != mISOMap->end() ) + return it.data(); + + TQString mapfile = TDEGlobal::dirs()->findResource( "data", + TQString::fromLatin1( "tdeabc/countrytransl.map" ) ); + + TQFile file( mapfile ); + if ( file.open( IO_ReadOnly ) ) { + TQTextStream s( &file ); + TQString strbuf = s.readLine(); + while( !strbuf.isEmpty() ) { + TQStringList countryInfo = TQStringList::split( '\t', strbuf, true ); + if ( countryInfo[ 0 ] == cname ) { + file.close(); + mISOMap->insert( cname, countryInfo[ 1 ] ); + return countryInfo[ 1 ]; + } + strbuf = s.readLine(); + } + file.close(); + } + + // fall back to system country + mISOMap->insert( cname, TDEGlobal::locale()->country() ); + return TDEGlobal::locale()->country(); +} + +TQString Address::ISOtoCountry( const TQString &ISOname ) +{ + // get country name from ISO country code (e.g. "no" -> i18n("Norway")) + if ( ISOname.simplifyWhiteSpace().isEmpty() ) + return TQString::null; + + TQString mapfile = TDEGlobal::dirs()->findResource( "data", + TQString::fromLatin1( "tdeabc/countrytransl.map" ) ); + + TQFile file( mapfile ); + if ( file.open( IO_ReadOnly ) ) { + TQTextStream s( &file ); + TQString searchStr = "\t" + ISOname.simplifyWhiteSpace().lower(); + TQString strbuf = s.readLine(); + int pos; + while ( !strbuf.isEmpty() ) { + if ( (pos = strbuf.find( searchStr )) != -1 ) { + file.close(); + return i18n( strbuf.left( pos ).utf8() ); + } + strbuf = s.readLine(); + } + file.close(); + } + + return ISOname; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Address &addr ) +{ + return s << addr.mId << addr.mType << addr.mPostOfficeBox << + addr.mExtended << addr.mStreet << addr.mLocality << + addr.mRegion << addr.mPostalCode << addr.mCountry << + addr.mLabel; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Address &addr ) +{ + s >> addr.mId >> addr.mType >> addr.mPostOfficeBox >> addr.mExtended >> + addr.mStreet >> addr.mLocality >> addr.mRegion >> + addr.mPostalCode >> addr.mCountry >> addr.mLabel; + + addr.mEmpty = false; + + return s; +} diff --git a/tdeabc/address.h b/tdeabc/address.h new file mode 100644 index 000000000..b4165a098 --- /dev/null +++ b/tdeabc/address.h @@ -0,0 +1,341 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_ADDRESS_H +#define KABC_ADDRESS_H + +#include +#include +#include + +#include + +// template tags for address formatting localization +#define KABC_FMTTAG_realname TQString("%n") +#define KABC_FMTTAG_REALNAME TQString("%N") +#define KABC_FMTTAG_company TQString("%cm") +#define KABC_FMTTAG_COMPANY TQString("%CM") +#define KABC_FMTTAG_pobox TQString("%p") +#define KABC_FMTTAG_street TQString("%s") +#define KABC_FMTTAG_STREET TQString("%S") +#define KABC_FMTTAG_zipcode TQString("%z") +#define KABC_FMTTAG_location TQString("%l") +#define KABC_FMTTAG_LOCATION TQString("%L") +#define KABC_FMTTAG_region TQString("%r") +#define KABC_FMTTAG_REGION TQString("%R") +#define KABC_FMTTAG_newline TQString("\\n") +#define KABC_FMTTAG_condcomma TQString("%,") +#define KABC_FMTTAG_condwhite TQString("%w") +#define KABC_FMTTAG_purgeempty TQString("%0") + +namespace KABC { + +/** + @short Postal address information. + + This class represents information about a postal address. +*/ +class KABC_EXPORT Address +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Address & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Address & ); + + public: + /** + List of addresses. + */ + typedef TQValueList
List; + typedef TQValueList TypeList; + + /** + Address types: + + @li @p Dom - domestic + @li @p Intl - international + @li @p Postal - postal + @li @p Parcel - parcel + @li @p Home - home address + @li @p Work - address at work + @li @p Pref - preferred address + */ + enum Type { Dom = 1, Intl = 2, Postal = 4, Parcel = 8, Home = 16, Work = 32, + Pref = 64 }; + + /** + Constructor that creates an empty Address, which is initialized + with a unique id (see id()). + */ + Address(); + + /** + This is like Address() just above, with the difference + that you can specify the type. + */ + Address( int ); + + bool operator==( const Address & ) const; + bool operator!=( const Address & ) const; + + /** + Returns true, if the address is empty. + */ + bool isEmpty() const; + + /** + Clears all entries of the address. + */ + void clear(); + + /** + Sets the unique id. + */ + void setId( const TQString & ); + + /* + Returns the unique id. + */ + TQString id() const; + + /** + Sets the type of address. See enum for definiton of types. + + @param type type, can be a bitwise or of multiple types. + */ + void setType( int type ); + + /** + Returns the type of address. Can be a bitwise or of multiple types. + */ + int type() const; + + /** + Returns a translated string of all types the address has. + */ + TQString typeLabel() const; + + /** + Sets the post office box. + */ + void setPostOfficeBox( const TQString & ); + + /** + Returns the post office box. + */ + TQString postOfficeBox() const; + + /** + Returns the translated label for post office box field. + */ + static TQString postOfficeBoxLabel(); + + /** + Sets the extended address information. + */ + void setExtended( const TQString & ); + + /** + Returns the extended address information. + */ + TQString extended() const; + + /** + Returns the translated label for extended field. + */ + static TQString extendedLabel(); + + /** + Sets the street (including number). + */ + void setStreet( const TQString & ); + + /** + Returns the street. + */ + TQString street() const; + + /** + Returns the translated label for street field. + */ + static TQString streetLabel(); + + /** + Sets the locality, e.g. city. + */ + void setLocality( const TQString & ); + + /** + Returns the locality. + */ + TQString locality() const; + + /** + Returns the translated label for locality field. + */ + static TQString localityLabel(); + + /** + Sets the region, e.g. state. + */ + void setRegion( const TQString & ); + + /** + Returns the region. + */ + TQString region() const; + + /** + Returns the translated label for region field. + */ + static TQString regionLabel(); + + /** + Sets the postal code. + */ + void setPostalCode( const TQString & ); + + /** + Returns the postal code. + */ + TQString postalCode() const; + + /** + Returns the translated label for postal code field. + */ + static TQString postalCodeLabel(); + + /** + Sets the country. + */ + void setCountry( const TQString & ); + + /** + Returns the country. + */ + TQString country() const; + + /** + Returns the translated label for country field. + */ + static TQString countryLabel(); + + /** + Sets the delivery label. This is the literal text to be used as label. + */ + void setLabel( const TQString & ); + + /** + Returns the delivery label. + */ + TQString label() const; + + /** + Returns the translated label for delivery label field. + */ + static TQString labelLabel(); + + /** + Returns the list of available types. + */ + static TypeList typeList(); + + /** + Returns the translated label for a special type. + */ + static TQString typeLabel( int type ); + + /** + Used for debug output. + */ + void dump() const; + + /** + Returns this address formatted according to the country-specific + address formatting rules. The formatting rules applied depend on + either the addresses {@link #country country} field, or (if the + latter is empty) on the system country setting. If companyName is + provided, an available business address format will be preferred. + + @param realName the formatted name of the contact + @param orgaName the name of the organization or company + @return the formatted address (containing newline characters) + */ + TQString formattedAddress( const TQString &realName=TQString::null + , const TQString &orgaName=TQString::null ) const; + + /** + Returns ISO code for a localized country name. Only localized country + names will be understood. This might be replaced by a TDELocale method in + the future. + @param cname name of the country + @return two digit ISO code + */ + static TQString countryToISO( const TQString &cname ); + + /** + Returns a localized country name for a ISO code. + This might be replaced by a TDELocale method in the future. + @param ISOname two digit ISO code + @return localized name of the country + @since 3.2 + */ + static TQString ISOtoCountry( const TQString &ISOname ); + + private: + /** + Parses a snippet of an address template + @param tsection the template string to be parsed + @param result TQString reference in which the result will be stored + @return true if at least one tag evaluated positively, else false + */ + bool parseAddressTemplateSection( const TQString &tsection + , TQString &result + , const TQString &realName + , const TQString &orgaName ) const; + + /** + Finds the balanced closing bracket starting from the opening bracket at + pos in tsection. + @return position of closing bracket, -1 for unbalanced brackets + */ + int findBalancedBracket( const TQString &tsection, int pos ) const; + + bool mEmpty; + + TQString mId; + int mType; + + TQString mPostOfficeBox; + TQString mExtended; + TQString mStreet; + TQString mLocality; + TQString mRegion; + TQString mPostalCode; + TQString mCountry; + TQString mLabel; + + static TQMap *mISOMap; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Address & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Address & ); + +} + +#endif diff --git a/tdeabc/addressbook.cpp b/tdeabc/addressbook.cpp new file mode 100644 index 000000000..50cd9c8a6 --- /dev/null +++ b/tdeabc/addressbook.cpp @@ -0,0 +1,842 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "errorhandler.h" +#include "resource.h" + +#include "addressbook.h" +#include "addressbook.moc" + +using namespace KABC; + +struct AddressBook::AddressBookData +{ + Field::List mAllFields; + ErrorHandler *mErrorHandler; + TDEConfig *mConfig; + KRES::Manager *mManager; + TQPtrList mPendingLoadResources; + TQPtrList mPendingSaveResources; + Iterator end; +}; + +struct AddressBook::Iterator::IteratorData +{ + Resource::Iterator mIt; + TQValueList mResources; + int mCurrRes; +}; + +struct AddressBook::ConstIterator::ConstIteratorData +{ + Resource::ConstIterator mIt; + TQValueList mResources; + int mCurrRes; +}; + +AddressBook::Iterator::Iterator() + : d( new IteratorData ) +{ +} + +AddressBook::Iterator::Iterator( const AddressBook::Iterator &i ) + : d( new IteratorData ) +{ + d->mIt = i.d->mIt; + d->mResources = i.d->mResources; + d->mCurrRes = i.d->mCurrRes; +} + +AddressBook::Iterator &AddressBook::Iterator::operator=( const AddressBook::Iterator &i ) +{ + if ( this == &i ) + return *this; // guard against self assignment + + delete d; // delete the old data the Iterator was completely constructed before + d = new IteratorData; + d->mIt = i.d->mIt; + d->mResources = i.d->mResources; + d->mCurrRes = i.d->mCurrRes; + + return *this; +} + +AddressBook::Iterator::~Iterator() +{ + delete d; + d = 0; +} + +const Addressee &AddressBook::Iterator::operator*() const +{ + return *(d->mIt); +} + +Addressee &AddressBook::Iterator::operator*() +{ + return *(d->mIt); +} + +Addressee *AddressBook::Iterator::operator->() +{ + return &(*(d->mIt)); +} + +AddressBook::Iterator &AddressBook::Iterator::operator++() +{ + do { + bool jumped = false; + while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource + if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { + return *this; + } + + d->mCurrRes++; // jump to next resource + + jumped = true; + d->mIt = (d->mResources[ d->mCurrRes ])->begin(); + } + + if ( !jumped ) + (d->mIt)++; + + } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); + + return *this; +} + +AddressBook::Iterator &AddressBook::Iterator::operator++( int ) +{ + do { + bool jumped = false; + while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource + if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { + return *this; + } + + d->mCurrRes++; // jump to next resource + + jumped = true; + d->mIt = (d->mResources[ d->mCurrRes ])->begin(); + } + + if ( !jumped ) + (d->mIt)++; + + } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); + + return *this; +} + +AddressBook::Iterator &AddressBook::Iterator::operator--() +{ + (d->mIt)--; + + return *this; +} + +AddressBook::Iterator &AddressBook::Iterator::operator--( int ) +{ + (d->mIt)--; + + return *this; +} + +bool AddressBook::Iterator::operator==( const Iterator &it ) +{ + return ( d->mIt == it.d->mIt ); +} + +bool AddressBook::Iterator::operator!=( const Iterator &it ) +{ + return ( d->mIt != it.d->mIt ); +} + + +AddressBook::ConstIterator::ConstIterator() + : d( new ConstIteratorData ) +{ +} + +AddressBook::ConstIterator::ConstIterator( const AddressBook::ConstIterator &i ) + : d( new ConstIteratorData ) +{ + d->mIt = i.d->mIt; + d->mResources = i.d->mResources; + d->mCurrRes = i.d->mCurrRes; +} + +AddressBook::ConstIterator::ConstIterator( const AddressBook::Iterator &i ) +{ + d = new ConstIteratorData; + d->mIt = i.d->mIt; + d->mResources = i.d->mResources; + d->mCurrRes = i.d->mCurrRes; +} + +AddressBook::ConstIterator &AddressBook::ConstIterator::operator=( const AddressBook::ConstIterator &i ) +{ + if ( this == &i ) + return *this; // guard for self assignment + + delete d; // delete the old data because the Iterator was really constructed before + d = new ConstIteratorData; + d->mIt = i.d->mIt; + d->mResources = i.d->mResources; + d->mCurrRes = i.d->mCurrRes; + + return *this; +} + +AddressBook::ConstIterator::~ConstIterator() +{ + delete d; + d = 0; +} + +const Addressee &AddressBook::ConstIterator::operator*() const +{ + return *(d->mIt); +} + +const Addressee* AddressBook::ConstIterator::operator->() const +{ + return &(*(d->mIt)); +} + +AddressBook::ConstIterator &AddressBook::ConstIterator::operator++() +{ + do { + bool jumped = false; + while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource + if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { + return *this; + } + + d->mCurrRes++; // jump to next resource + + jumped = true; + d->mIt = (d->mResources[ d->mCurrRes ])->begin(); + } + + if ( !jumped ) + (d->mIt)++; + + } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); + + return *this; +} + +AddressBook::ConstIterator &AddressBook::ConstIterator::operator++(int) +{ + do { + bool jumped = false; + while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ) { // at end of addressee list of resource + if ( (uint)d->mCurrRes == d->mResources.count() - 1 ) { + return *this; + } + + d->mCurrRes++; // jump to next resource + + jumped = true; + d->mIt = (d->mResources[ d->mCurrRes ])->begin(); + } + + if ( !jumped ) + (d->mIt)++; + + } while ( d->mIt == (d->mResources[ d->mCurrRes ])->end() ); + + return *this; +} + +AddressBook::ConstIterator &AddressBook::ConstIterator::operator--() +{ + (d->mIt)--; + return *this; +} + +AddressBook::ConstIterator &AddressBook::ConstIterator::operator--(int) +{ + (d->mIt)--; + return *this; +} + +bool AddressBook::ConstIterator::operator==( const ConstIterator &it ) +{ + return ( d->mIt == it.d->mIt ); +} + +bool AddressBook::ConstIterator::operator!=( const ConstIterator &it ) +{ + return ( d->mIt != it.d->mIt ); +} + + +AddressBook::AddressBook() + : d( new AddressBookData ) +{ + d->mErrorHandler = 0; + d->mConfig = 0; + d->mManager = new KRES::Manager( "contact" ); + d->end.d->mResources = TQValueList(); + d->end.d->mCurrRes = -1; +} + +AddressBook::AddressBook( const TQString &config ) + : d( new AddressBookData ) +{ + d->mErrorHandler = 0; + if ( config.isEmpty() ) + d->mConfig = 0; + else + d->mConfig = new TDEConfig( config ); + d->mManager = new KRES::Manager( "contact" ); + d->mManager->readConfig( d->mConfig ); + d->end.d->mResources = TQValueList(); + d->end.d->mCurrRes = -1; +} + +AddressBook::~AddressBook() +{ + delete d->mManager; d->mManager = 0; + delete d->mConfig; d->mConfig = 0; + delete d->mErrorHandler; d->mErrorHandler = 0; + delete d; d = 0; +} + +bool AddressBook::load() +{ + kdDebug(5700) << "AddressBook::load()" << endl; + + clear(); + + KRES::Manager::ActiveIterator it; + bool ok = true; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + if ( !(*it)->load() ) { + error( i18n("Unable to load resource '%1'").arg( (*it)->resourceName() ) ); + ok = false; + } + } + + return ok; +} + +bool AddressBook::asyncLoad() +{ + kdDebug(5700) << "AddressBook::asyncLoad()" << endl; + + clear(); + + KRES::Manager::ActiveIterator it; + bool ok = true; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + d->mPendingLoadResources.append( *it ); + if ( !(*it)->asyncLoad() ) { + error( i18n("Unable to load resource '%1'").arg( (*it)->resourceName() ) ); + ok = false; + } + } + + return ok; +} + +bool AddressBook::save( Ticket *ticket ) +{ + kdDebug(5700) << "AddressBook::save()"<< endl; + + if ( ticket->resource() ) { + deleteRemovedAddressees(); + bool ok = ticket->resource()->save( ticket ); + if ( ok ) ticket->resource()->releaseSaveTicket( ticket ); + return ok; + } + + return false; +} + +bool AddressBook::asyncSave( Ticket *ticket ) +{ + kdDebug(5700) << "AddressBook::asyncSave()"<< endl; + + if ( ticket->resource() ) { + d->mPendingSaveResources.append( ticket->resource() ); + bool ok = ticket->resource()->asyncSave( ticket ); + if ( ok ) ticket->resource()->releaseSaveTicket( ticket ); + return ok; + } + + return false; +} + +AddressBook::Iterator AddressBook::begin() +{ + TQValueList list; + KRES::Manager::ActiveIterator resIt; + for ( resIt = d->mManager->activeBegin(); resIt != d->mManager->activeEnd(); ++resIt ) + list.append( *resIt ); + + if ( list.count() == 0 ) + return end(); + + Iterator it = Iterator(); + it.d->mResources = list; + it.d->mCurrRes = 0; + it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); + + while ( it.d->mIt == (it.d->mResources[ it.d->mCurrRes ])->end() ) { + if ( (uint)it.d->mCurrRes == it.d->mResources.count() - 1 ) + return end(); + + it.d->mCurrRes++; + + it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); + } + + return it; +} + +AddressBook::ConstIterator AddressBook::begin() const +{ + TQValueList list; + KRES::Manager::ActiveIterator resIt; + for ( resIt = d->mManager->activeBegin(); resIt != d->mManager->activeEnd(); ++resIt ) + list.append( *resIt ); + + if ( list.count() == 0 ) + return end(); + + Iterator it = Iterator(); + it.d->mResources = list; + it.d->mCurrRes = 0; + it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); + + while ( it.d->mIt == (it.d->mResources[ it.d->mCurrRes ])->end() ) { + if ( (uint)it.d->mCurrRes == it.d->mResources.count() - 1 ) + return end(); + + it.d->mCurrRes++; + + it.d->mIt = (it.d->mResources[ it.d->mCurrRes ])->begin(); + } + + return it; +} + +AddressBook::Iterator AddressBook::end() +{ + KRES::Manager::ActiveIterator resIt = d->mManager->activeEnd(); + + if ( resIt == d->mManager->activeBegin() || ! *(--resIt) ) { // no resource available + d->end.d->mIt = Resource::Iterator(); + } else { + d->end.d->mIt = (*resIt)->end(); + } + + return d->end; +} + +AddressBook::ConstIterator AddressBook::end() const +{ + KRES::Manager::ActiveIterator resIt = d->mManager->activeEnd(); + + if ( resIt == d->mManager->activeBegin() || ! *(--resIt) ) { // no resource available + d->end.d->mIt = Resource::Iterator(); + } else { + d->end.d->mIt = (*resIt)->end(); + } + + return d->end; +} + +void AddressBook::clear() +{ + KRES::Manager::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) + (*it)->clear(); +} + +Ticket *AddressBook::requestSaveTicket( Resource *resource ) +{ + kdDebug(5700) << "AddressBook::requestSaveTicket()" << endl; + + if ( !resource ) + resource = standardResource(); + + KRES::Manager::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + if ( (*it) == resource ) { + if ( (*it)->readOnly() || !(*it)->isOpen() ) + return 0; + else + return (*it)->requestSaveTicket(); + } + } + + return 0; +} + +void AddressBook::releaseSaveTicket( Ticket *ticket ) +{ + if ( !ticket ) + return; + + if ( ticket->resource() ) { + ticket->resource()->releaseSaveTicket( ticket ); + } +} + +void AddressBook::insertAddressee( const Addressee &a ) +{ + Resource *resource = a.resource(); + if ( resource == 0 ) + resource = standardResource(); + + Resource::Iterator it; + Addressee fAddr = resource->findByUid( a.uid() ); + + Addressee addr( a ); + if ( !fAddr.isEmpty() ) { + if ( fAddr != a ) + addr.setRevision( TQDateTime::currentDateTime() ); + else { + if ( fAddr.resource() == 0 ) { + fAddr.setResource( resource ); + //NOTE: Should we have setChanged( true ) here? + resource->insertAddressee( fAddr ); + } + return; + } + } + + addr.setResource( resource ); + addr.setChanged( true ); + resource->insertAddressee( addr ); +} + +void AddressBook::removeAddressee( const Addressee &a ) +{ + if ( a.resource() ) + a.resource()->removeAddressee( a ); +} + +void AddressBook::removeAddressee( const Iterator &it ) +{ + if ( (*it).resource() ) + (*it).resource()->removeAddressee( *it ); +} + +AddressBook::Iterator AddressBook::find( const Addressee &a ) +{ + Iterator it; + for ( it = begin(); it != end(); ++it ) { + if ( a.uid() == (*it).uid() ) + return it; + } + + return end(); +} + +Addressee AddressBook::findByUid( const TQString &uid ) +{ + KRES::Manager::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + Addressee addr = (*it)->findByUid( uid ); + if ( !addr.isEmpty() ) + return addr; + } + + return Addressee(); +} + +Addressee::List AddressBook::allAddressees() +{ + Addressee::List list; + + ConstIterator it; + for ( it = begin(); it != end(); ++it ) + list.append( *it ); + + return list; +} + +Addressee::List AddressBook::findByName( const TQString &name ) +{ + Addressee::List results; + + KRES::Manager::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) + results += (*it)->findByName( name ); + + return results; +} + +Addressee::List AddressBook::findByEmail( const TQString &email ) +{ + Addressee::List results; + + KRES::Manager::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) + results += (*it)->findByEmail( email ); + + return results; +} + +Addressee::List AddressBook::findByCategory( const TQString &category ) +{ + Addressee::List results; + + KRES::Manager::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) + results += (*it)->findByCategory( category ); + + return results; +} + +void AddressBook::dump() const +{ + kdDebug(5700) << "AddressBook::dump() --- begin ---" << endl; + + ConstIterator it; + for( it = begin(); it != end(); ++it ) { + (*it).dump(); + } + + kdDebug(5700) << "AddressBook::dump() --- end ---" << endl; +} + +TQString AddressBook::identifier() +{ + TQStringList identifier; + + + KRES::Manager::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + if ( !(*it)->identifier().isEmpty() ) + identifier.append( (*it)->identifier() ); + } + + return identifier.join( ":" ); +} + +Field::List AddressBook::fields( int category ) +{ + if ( d->mAllFields.isEmpty() ) { + d->mAllFields = Field::allFields(); + } + + if ( category == Field::All ) return d->mAllFields; + + Field::List result; + Field::List::ConstIterator it; + for ( it = d->mAllFields.constBegin(); it != d->mAllFields.constEnd(); ++it ) { + if ( (*it)->category() & category ) + result.append( *it ); + } + + return result; +} + +bool AddressBook::addCustomField( const TQString &label, int category, + const TQString &key, const TQString &app ) +{ + if ( d->mAllFields.isEmpty() ) { + d->mAllFields = Field::allFields(); + } + + TQString a = app.isNull() ? TDEGlobal::instance()->instanceName() : app; + TQString k = key.isNull() ? label : key; + + Field *field = Field::createCustomField( label, category, k, a ); + + if ( !field ) return false; + + d->mAllFields.append( field ); + + return true; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const AddressBook &ab ) +{ + if (!ab.d) return s; + + return s;// << ab.d->mAddressees; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, AddressBook &ab ) +{ + if (!ab.d) return s; + +// s >> ab.d->mAddressees; + + return s; +} + +bool AddressBook::addResource( Resource *resource ) +{ + if ( !resource->open() ) { + kdDebug(5700) << "AddressBook::addResource(): can't add resource" << endl; + return false; + } + + d->mManager->add( resource ); + resource->setAddressBook( this ); + + connect( resource, TQT_SIGNAL( loadingFinished( Resource* ) ), + this, TQT_SLOT( resourceLoadingFinished( Resource* ) ) ); + connect( resource, TQT_SIGNAL( savingFinished( Resource* ) ), + this, TQT_SLOT( resourceSavingFinished( Resource* ) ) ); + + connect( resource, TQT_SIGNAL( loadingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); + connect( resource, TQT_SIGNAL( savingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceSavingError( Resource*, const TQString& ) ) ); + + return true; +} + +bool AddressBook::removeResource( Resource *resource ) +{ + resource->close(); + + if ( resource == standardResource() ) + d->mManager->setStandardResource( 0 ); + + resource->setAddressBook( 0 ); + + disconnect( resource, TQT_SIGNAL( loadingFinished( Resource* ) ), + this, TQT_SLOT( resourceLoadingFinished( Resource* ) ) ); + disconnect( resource, TQT_SIGNAL( savingFinished( Resource* ) ), + this, TQT_SLOT( resourceSavingFinished( Resource* ) ) ); + + disconnect( resource, TQT_SIGNAL( loadingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); + disconnect( resource, TQT_SIGNAL( savingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); + + d->mManager->remove( resource ); + + return true; +} + +TQPtrList AddressBook::resources() +{ + TQPtrList list; + + KRES::Manager::ActiveIterator it; + for ( it = d->mManager->activeBegin(); it != d->mManager->activeEnd(); ++it ) { + if ( d->mManager->standardResource() == (*it) ) + list.prepend( *it ); + else + list.append( *it ); + } + + return list; +} + +void AddressBook::setErrorHandler( ErrorHandler *handler ) +{ + delete d->mErrorHandler; + d->mErrorHandler = handler; +} + +void AddressBook::error( const TQString& msg ) +{ + if ( !d->mErrorHandler ) // create default error handler + d->mErrorHandler = new ConsoleErrorHandler; + + if ( d->mErrorHandler ) + d->mErrorHandler->error( msg ); + else + kdError(5700) << "no error handler defined" << endl; +} + +void AddressBook::deleteRemovedAddressees() +{ + // no any longer needed +} + +void AddressBook::setStandardResource( Resource *resource ) +{ + d->mManager->setStandardResource( resource ); +} + +Resource *AddressBook::standardResource() +{ + return d->mManager->standardResource(); +} + +KRES::Manager *AddressBook::resourceManager() +{ + return d->mManager; +} + +void AddressBook::cleanUp() +{ +} + +bool AddressBook::loadingHasFinished() const +{ + return d->mPendingLoadResources.isEmpty(); +} + +void AddressBook::resourceLoadingFinished( Resource *res ) +{ + d->mPendingLoadResources.remove( res ); + emit loadingFinished( res ); + + if ( d->mPendingLoadResources.count() == 0 ) + emit addressBookChanged( this ); +} + +void AddressBook::resourceSavingFinished( Resource *res ) +{ + d->mPendingSaveResources.remove( res ); + + emit savingFinished( res ); +} + +void AddressBook::resourceLoadingError( Resource *res, const TQString &errMsg ) +{ + error( errMsg ); + + d->mPendingLoadResources.remove( res ); + if ( d->mPendingLoadResources.count() == 0 ) + emit addressBookChanged( this ); +} + +void AddressBook::resourceSavingError( Resource *res, const TQString &errMsg ) +{ + error( errMsg ); + + d->mPendingSaveResources.remove( res ); +} diff --git a/tdeabc/addressbook.h b/tdeabc/addressbook.h new file mode 100644 index 000000000..8b87b6898 --- /dev/null +++ b/tdeabc/addressbook.h @@ -0,0 +1,431 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_ADDRESSBOOK_H +#define KABC_ADDRESSBOOK_H + +#include +#include + +#include + +#include "addressee.h" +#include "field.h" + +namespace KABC { + +class ErrorHandler; +class Resource; +class Ticket; + +/** + @short Address Book + + This class provides access to a collection of address book entries. + */ +class KABC_EXPORT AddressBook : public TQObject +{ + Q_OBJECT + + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const AddressBook & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, AddressBook & ); + friend class StdAddressBook; + + public: + /** + @short Address Book Iterator + + This class provides an iterator for address book entries. + */ + class KABC_EXPORT Iterator + { + public: + Iterator(); + Iterator( const Iterator & ); + ~Iterator(); + + Iterator &operator=( const Iterator & ); + const Addressee &operator*() const; + Addressee &operator*(); + Addressee* operator->(); + Iterator &operator++(); + Iterator &operator++(int); + Iterator &operator--(); + Iterator &operator--(int); + bool operator==( const Iterator &it ); + bool operator!=( const Iterator &it ); + + struct IteratorData; + IteratorData *d; + }; + + /** + @short Address Book Const Iterator + + This class provides a const iterator for address book entries. + */ + class KABC_EXPORT ConstIterator + { + public: + ConstIterator(); + ConstIterator( const ConstIterator & ); + ConstIterator( const Iterator & ); + ~ConstIterator(); + + ConstIterator &operator=( const ConstIterator & ); + const Addressee &operator*() const; + const Addressee* operator->() const; + ConstIterator &operator++(); + ConstIterator &operator++(int); + ConstIterator &operator--(); + ConstIterator &operator--(int); + bool operator==( const ConstIterator &it ); + bool operator!=( const ConstIterator &it ); + + struct ConstIteratorData; + ConstIteratorData *d; + }; + + /** + Constructs an address book object. + You have to add the resources manually before calling load(). + */ + AddressBook(); + + /** + Constructs an address book object. + The resources are loaded automatically. + + @param config The config file which contains the resource settings. + */ + AddressBook( const TQString &config ); + + /** + Destructor. + */ + virtual ~AddressBook(); + + /** + Requests a ticket for saving the addressbook. Calling this function locks + the addressbook for all other processes. You need the returned ticket + object for calling the save() function. + + @param resource A pointer to the resource which shall be locked. If 0, + the default resource is locked. + @return 0 if the resource is already locked or a valid save ticket + otherwise. + @see save() + */ + Ticket *requestSaveTicket( Resource *resource = 0 ); + + /** + Releases the ticket requested previously with requestSaveTicket(). + Call this function, if you want to release a ticket without saving. + */ + void releaseSaveTicket( Ticket *ticket ); + + /** + Loads all addressees synchronously. + + @return Whether the loading was successfully. + */ + bool load(); + + /** + Loads all addressees asynchronously. This function returns immediately + and emits the addressBookChanged() signal as soon as the loading has + finished. + + @return Whether the synchronous part of loading was successfully. + */ + bool asyncLoad(); + + /** + Saves all addressees of one resource synchronously. If the save is + successfull the ticket is deleted. + + @param ticket The ticket returned by requestSaveTicket(). + @return Whether the saving was successfully. + */ + bool save( Ticket *ticket ); + + /** + Saves all addressees of one resource asynchronously. If the save is + successfull the ticket is deleted. + + @param ticket The ticket returned by requestSaveTicket(). + @return Whether the synchronous part of saving was successfully. + */ + bool asyncSave( Ticket *ticket ); + + /** + Returns an iterator pointing to the first addressee of address book. + This iterator equals end() if the address book is empty. + */ + ConstIterator begin() const; + + /** + This is an overloaded member function, provided for convenience. It + behaves essentially like the above function. + */ + Iterator begin(); + + /** + Returns an iterator pointing to the last addressee of address book. + This iterator equals begin() if the address book is empty. + */ + ConstIterator end() const; + + /** + This is an overloaded member function, provided for convenience. It + behaves essentially like the above function. + */ + Iterator end(); + + + /** + Removes all addressees from the address book. + */ + void clear(); + + /** + Insert an addressee into the address book. If an addressee with the same + unique id already exists, it is replaced by the new one, otherwise it is + appended. + + @param addr The addressee which shall be insert. + */ + void insertAddressee( const Addressee &addr ); + + /** + Removes an addressee from the address book. + + @param addr The addressee which shall be removed. + */ + void removeAddressee( const Addressee &addr ); + + /** + This is an overloaded member function, provided for convenience. It + behaves essentially like the above function. + + @param it An iterator pointing to the addressee which shall be removed. + */ + void removeAddressee( const Iterator &it ); + + /** + Returns an iterator pointing to the specified addressee. It will return + end() if no addressee matched. + + @param addr The addresee you are looking for. + */ + Iterator find( const Addressee &addr ); // KDE4: const + + /** + Searches an addressee with the specified unique identifier. + + @param uid The unique identifier you are looking for. + @return The addressee with the specified unique identifier or an + empty addressee. + */ + Addressee findByUid( const TQString &uid ); // KDE4: const + + /** + Returns a list of all addressees in the address book. + */ + Addressee::List allAddressees(); // KDE4: const + + /** + Searches all addressees which match the specified name. + + @param name The name you are looking for. + @return A list of all matching addressees. + */ + Addressee::List findByName( const TQString &name ); // KDE4: const + + /** + Searches all addressees which match the specified email address. + + @param email The email address you are looking for. + @return A list of all matching addressees. + */ + Addressee::List findByEmail( const TQString &email ); // KDE4: const + + /** + Searches all addressees which belongs to the specified category. + + @param category The category you are looking for. + @return A list of all matching addressees. + */ + Addressee::List findByCategory( const TQString &category ); // KDE4: const + + /** + Returns a string identifying this addressbook. The identifier is + created by concatenation of the resource identifiers. + */ + virtual TQString identifier(); // KDE4: const + + /** + Returns a list of all Fields known to the address book which are associated + with the given field category. + */ + Field::List fields( int category = Field::All ); // KDE4: const + + /** + Add custom field to address book. + + @param label User visible label of the field. + @param category Ored list of field categories. + @param key Identifier used as key for reading and writing the field. + @param app String used as application key for reading and writing + the field. + */ + bool addCustomField( const TQString &label, int category = Field::All, + const TQString &key = TQString::null, + const TQString &app = TQString::null ); + + /** + Adds a resource to the address book. + + @param resource The resource you want to add. + @return Whether opening the resource was successfully. + */ + bool addResource( Resource *resource ); + + /** + Removes a resource from the address book. + + @param resource The resource you want to remove. + @return Whether closing the resource was successfully. + */ + bool removeResource( Resource *resource ); + + /** + Returns a list of all resources. + */ + TQPtrList resources(); // KDE4: const + + /** + Sets the @p ErrorHandler, that is used by error() to + provide GUI independent error messages. + + @param errorHandler The error handler you want to use. + */ + void setErrorHandler( ErrorHandler *errorHandler ); + + /** + Shows GUI independent error messages. + + @param msg The error message that shall be displayed. + */ + void error( const TQString &msg ); + + /** + @deprecated There is no need to call this function anymore. + */ + void cleanUp() KDE_DEPRECATED; + + /** + Used for debug output. This function prints out the list + of all addressees to kdDebug(5700). + */ + void dump() const; + + /** + */ + void emitAddressBookLocked() { emit addressBookLocked( this ); } + void emitAddressBookUnlocked() { emit addressBookUnlocked( this ); } + void emitAddressBookChanged() { emit addressBookChanged( this ); } + + /** + Returns true when the loading of the addressbook has finished, + otherwise false. + + @since 3.5 + */ + bool loadingHasFinished() const; + + signals: + /** + Emitted when one of the resources discovered a change in its backend + or the asynchronous loading of all resources has finished. + You should connect to this signal to update the presentation of + the contact data in your application. + + @param addressBook The address book which emitted this signal. + */ + void addressBookChanged( AddressBook *addressBook ); + + /** + Emitted when one of the resources has been locked for writing. + + @param addressBook The address book which emitted this signal. + */ + void addressBookLocked( AddressBook *addressBook ); + + /** + Emitted when one of the resources has been unlocked. + You should connect to this signal if you want to save your changes + to a resource which is currently locked, and want to get notified when + saving is possible again. + + @param addressBook The address book which emitted this signal. + */ + void addressBookUnlocked( AddressBook *addressBook ); + + /** + Emitted when the asynchronous loading of one resource has finished + after calling asyncLoad(). + + @param resource The resource which emitted this signal. + */ + void loadingFinished( Resource *resource ); + + /** + Emitted when the asynchronous saving of one resource has finished + after calling asyncSave(). + + @param resource The resource which emitted this signal. + */ + void savingFinished( Resource *resource ); + + protected slots: + void resourceLoadingFinished( Resource* ); + void resourceSavingFinished( Resource* ); + void resourceLoadingError( Resource*, const TQString& ); + void resourceSavingError( Resource*, const TQString& ); + + protected: + void deleteRemovedAddressees(); + void setStandardResource( Resource* ); + Resource *standardResource(); + KRES::Manager *resourceManager(); + + private: + TQPtrList mDummy; // Remove in KDE 4 + struct AddressBookData; + AddressBookData *d; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const AddressBook & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, AddressBook & ); + +} + +#endif diff --git a/tdeabc/addresseedialog.cpp b/tdeabc/addresseedialog.cpp new file mode 100644 index 000000000..2b8bc91e6 --- /dev/null +++ b/tdeabc/addresseedialog.cpp @@ -0,0 +1,259 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include + +#include "stdaddressbook.h" + +#include "addresseedialog.h" +#include "addresseedialog.moc" + +using namespace KABC; + +AddresseeItem::AddresseeItem( TQListView *parent, const Addressee &addressee ) : + TQListViewItem( parent ), + mAddressee( addressee ) +{ + setText( Name, addressee.realName() ); + setText( Email, addressee.preferredEmail() ); +} + +TQString AddresseeItem::key( int column, bool ) const +{ + if (column == Email) { + TQString value = text(Email); + TQRegExp emailRe("<\\S*>"); + int match = emailRe.search(value); + if (match > -1) + value = value.mid(match + 1, emailRe.matchedLength() - 2); + + return value.lower(); + } + + return text(column).lower(); +} + +AddresseeDialog::AddresseeDialog( TQWidget *parent, bool multiple ) : + KDialogBase( KDialogBase::Plain, i18n("Select Addressee"), + Ok|Cancel, Ok, parent ), mMultiple( multiple ) +{ + TQWidget *topWidget = plainPage(); + + TQBoxLayout *topLayout = new TQHBoxLayout( topWidget ); + TQBoxLayout *listLayout = new TQVBoxLayout; + topLayout->addLayout( listLayout ); + + mAddresseeList = new TDEListView( topWidget ); + mAddresseeList->addColumn( i18n("Name") ); + mAddresseeList->addColumn( i18n("Email") ); + mAddresseeList->setAllColumnsShowFocus( true ); + mAddresseeList->setFullWidth( true ); + listLayout->addWidget( mAddresseeList ); + connect( mAddresseeList, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), + TQT_SLOT( slotOk() ) ); + connect( mAddresseeList, TQT_SIGNAL( selectionChanged( TQListViewItem * ) ), + TQT_SLOT( updateEdit( TQListViewItem * ) ) ); + + mAddresseeEdit = new KLineEdit( topWidget ); + mAddresseeEdit->setCompletionMode( TDEGlobalSettings::CompletionAuto ); + connect( mAddresseeEdit->completionObject(), TQT_SIGNAL( match( const TQString & ) ), + TQT_SLOT( selectItem( const TQString & ) ) ); + mAddresseeEdit->setFocus(); + mAddresseeEdit->completionObject()->setIgnoreCase( true ); + listLayout->addWidget( mAddresseeEdit ); + + setInitialSize( TQSize( 450, 300 ) ); + + if ( mMultiple ) { + TQBoxLayout *selectedLayout = new TQVBoxLayout; + topLayout->addLayout( selectedLayout ); + topLayout->setSpacing( spacingHint() ); + + TQGroupBox *selectedGroup = new TQGroupBox( 1, Qt::Horizontal, i18n("Selected"), + topWidget ); + selectedLayout->addWidget( selectedGroup ); + + mSelectedList = new TDEListView( selectedGroup ); + mSelectedList->addColumn( i18n("Name") ); + mSelectedList->addColumn( i18n("Email") ); + mSelectedList->setAllColumnsShowFocus( true ); + mSelectedList->setFullWidth( true ); + connect( mSelectedList, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), + TQT_SLOT( removeSelected() ) ); + + TQPushButton *unselectButton = new TQPushButton( i18n("Unselect"), selectedGroup ); + connect ( unselectButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeSelected() ) ); + + connect( mAddresseeList, TQT_SIGNAL( clicked( TQListViewItem * ) ), + TQT_SLOT( addSelected( TQListViewItem * ) ) ); + + setInitialSize( TQSize( 650, 350 ) ); + } + + mAddressBook = StdAddressBook::self( true ); + connect( mAddressBook, TQT_SIGNAL( addressBookChanged( AddressBook* ) ), + TQT_SLOT( addressBookChanged() ) ); + connect( mAddressBook, TQT_SIGNAL( loadingFinished( Resource* ) ), + TQT_SLOT( addressBookChanged() ) ); + + loadAddressBook(); +} + +AddresseeDialog::~AddresseeDialog() +{ +} + +void AddresseeDialog::loadAddressBook() +{ + mAddresseeList->clear(); + mItemDict.clear(); + mAddresseeEdit->completionObject()->clear(); + + AddressBook::Iterator it; + for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { + AddresseeItem *item = new AddresseeItem( mAddresseeList, (*it) ); + addCompletionItem( (*it).realName(), item ); + addCompletionItem( (*it).preferredEmail(), item ); + } +} + +void AddresseeDialog::addCompletionItem( const TQString &str, TQListViewItem *item ) +{ + if ( str.isEmpty() ) return; + + mItemDict.insert( str, item ); + mAddresseeEdit->completionObject()->addItem( str ); +} + +void AddresseeDialog::selectItem( const TQString &str ) +{ + if ( str.isEmpty() ) return; + + TQListViewItem *item = mItemDict.find( str ); + if ( item ) { + mAddresseeList->blockSignals( true ); + mAddresseeList->setSelected( item, true ); + mAddresseeList->ensureItemVisible( item ); + mAddresseeList->blockSignals( false ); + } +} + +void AddresseeDialog::updateEdit( TQListViewItem *item ) +{ + mAddresseeEdit->setText( item->text( 0 ) ); + mAddresseeEdit->setSelection( 0, item->text( 0 ).length() ); +} + +void AddresseeDialog::addSelected( TQListViewItem *item ) +{ + AddresseeItem *addrItem = dynamic_cast( item ); + if ( !addrItem ) return; + + Addressee a = addrItem->addressee(); + + TQListViewItem *selectedItem = mSelectedDict.find( a.uid() ); + if ( !selectedItem ) { + selectedItem = new AddresseeItem( mSelectedList, a ); + mSelectedDict.insert( a.uid(), selectedItem ); + } +} + +void AddresseeDialog::removeSelected() +{ + TQListViewItem *item = mSelectedList->selectedItem(); + AddresseeItem *addrItem = dynamic_cast( item ); + if ( !addrItem ) return; + + mSelectedDict.remove( addrItem->addressee().uid() ); + delete addrItem; +} + +Addressee AddresseeDialog::addressee() +{ + AddresseeItem *aItem = 0; + + if ( mMultiple ) + aItem = dynamic_cast( mSelectedList->firstChild() ); + else + aItem = dynamic_cast( mAddresseeList->selectedItem() ); + + if (aItem) return aItem->addressee(); + return Addressee(); +} + +Addressee::List AddresseeDialog::addressees() +{ + Addressee::List al; + AddresseeItem *aItem = 0; + + if ( mMultiple ) { + TQListViewItem *item = mSelectedList->firstChild(); + while( item ) { + aItem = dynamic_cast( item ); + if ( aItem ) al.append( aItem->addressee() ); + item = item->nextSibling(); + } + } + else + { + aItem = dynamic_cast( mAddresseeList->selectedItem() ); + if (aItem) al.append( aItem->addressee() ); + } + + return al; +} + +Addressee AddresseeDialog::getAddressee( TQWidget *parent ) +{ + AddresseeDialog *dlg = new AddresseeDialog( parent ); + Addressee addressee; + int result = dlg->exec(); + + if ( result == TQDialog::Accepted ) { + addressee = dlg->addressee(); + } + + delete dlg; + return addressee; +} + +Addressee::List AddresseeDialog::getAddressees( TQWidget *parent ) +{ + AddresseeDialog *dlg = new AddresseeDialog( parent, true ); + Addressee::List addressees; + int result = dlg->exec(); + if ( result == TQDialog::Accepted ) { + addressees = dlg->addressees(); + } + + delete dlg; + return addressees; +} + +void AddresseeDialog::addressBookChanged() +{ + loadAddressBook(); +} diff --git a/tdeabc/addresseedialog.h b/tdeabc/addresseedialog.h new file mode 100644 index 000000000..74470d1b4 --- /dev/null +++ b/tdeabc/addresseedialog.h @@ -0,0 +1,161 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_ADDRESSEEDIALOG_H +#define KABC_ADDRESSEEDIALOG_H + +#include + +#include +#include +#include + +#include "addressbook.h" + +namespace KABC { + +/** + @short Special ListViewItem, that is used by the AddresseeDialog. +*/ +class KABC_EXPORT AddresseeItem : public TQListViewItem +{ + public: + + /** + Type of column + @li @p Name - Name in Addressee + @li @p Email - Email in Addressee + */ + enum columns { Name = 0, Email = 1 }; + + /** + Constructor. + + @param parent The parent listview. + @param addressee The associated addressee. + */ + AddresseeItem( TQListView *parent, const Addressee &addressee ); + + /** + Returns the addressee. + */ + Addressee addressee() const { return mAddressee; } + + /** + Method used by TQListView to sort the items. + */ + virtual TQString key( int column, bool ascending ) const; + + private: + Addressee mAddressee; +}; + +/** + @short Dialog for selecting address book entries. + + This class provides a dialog for selecting entries from the standard KDE + address book. Use the getAddressee() function to open a modal dialog, + returning an address book entry. + + In the dialog you can select an entry from the list with the mouse or type in + the first letters of the name or email address you are searching for. The + entry matching best is automatically selected. Use double click, pressing + return or pressing the ok button to return the selected addressee to the + application. +*/ +class KABC_EXPORT AddresseeDialog : public KDialogBase +{ + Q_OBJECT + + public: + /** + Construct addressbook entry select dialog. + + @param parent parent widget + @param multiple if true, indicates a multiple selection. + */ + AddresseeDialog( TQWidget *parent=0, bool multiple=false ); + + /** + Destructor. + */ + virtual ~AddresseeDialog(); + + /** + Return the address chosen. + + If it is a multiple select, this will return only the first address chosen + */ + Addressee addressee(); + + /** + Return the list of addresses chosen + */ + Addressee::List addressees(); + + /** + Select a single address book entry. + + Open addressee select dialog and return the entry selected by the user. + If the user doesn't select an entry or presses cancel, the returned + addressee is empty. + */ + static Addressee getAddressee( TQWidget *parent ); + + /** + Select multiple address book entries. + + Open addressee select dialog and return the entries selected by the user. + If the user doesn't select an entry or presses cancel, the returned + addressee list is empty. + */ + static Addressee::List getAddressees( TQWidget *parent ); + + private slots: + void selectItem( const TQString & ); + void updateEdit( TQListViewItem *item ); + void addSelected( TQListViewItem *item ); + void removeSelected(); + + protected slots: + void addressBookChanged(); + + private: + void loadAddressBook(); + void addCompletionItem( const TQString &str, TQListViewItem *item ); + + bool mMultiple; + + TDEListView *mAddresseeList; + KLineEdit *mAddresseeEdit; + + TDEListView *mSelectedList; + + AddressBook *mAddressBook; + + TQDict mItemDict; + TQDict mSelectedDict; + + class AddresseeDialogPrivate; + AddresseeDialogPrivate *d; +}; + +} +#endif diff --git a/tdeabc/addresseehelper.cpp b/tdeabc/addresseehelper.cpp new file mode 100644 index 000000000..e8faeb897 --- /dev/null +++ b/tdeabc/addresseehelper.cpp @@ -0,0 +1,111 @@ +/* + This file is part of the KDE libraries + Copyright (C) 2003 Carsten Pfeiffer + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation, version 2. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include + +#include "addresseehelper.h" + +using namespace KABC; + +AddresseeHelper * AddresseeHelper::s_self; + +// static +AddresseeHelper *AddresseeHelper::self() +{ + if ( !s_self ) + s_self = new AddresseeHelper(); + + return s_self; +} + +AddresseeHelper::AddresseeHelper() + : TQObject( tqApp ), + DCOPObject( "KABC::AddresseeHelper" ) +{ + initSettings(); + + connectDCOPSignal( "kaddressbook", "KABC::AddressBookConfig", + "changed()", "initSettings()", false ); +} + +// static +void AddresseeHelper::addToSet( const TQStringList& list, + std::set& container ) +{ + TQStringList::ConstIterator it; + for ( it = list.begin(); it != list.end(); ++it ) { + if ( !(*it).isEmpty() ) + container.insert( *it ); + } +} + +void AddresseeHelper::initSettings() +{ + mTitles.clear(); + mSuffixes.clear(); + mPrefixes.clear(); + + mTitles.insert( i18n( "Dr." ) ); + mTitles.insert( i18n( "Miss" ) ); + mTitles.insert( i18n( "Mr." ) ); + mTitles.insert( i18n( "Mrs." ) ); + mTitles.insert( i18n( "Ms." ) ); + mTitles.insert( i18n( "Prof." ) ); + + mSuffixes.insert( i18n( "I" ) ); + mSuffixes.insert( i18n( "II" ) ); + mSuffixes.insert( i18n( "III" ) ); + mSuffixes.insert( i18n( "Jr." ) ); + mSuffixes.insert( i18n( "Sr." ) ); + + mPrefixes.insert( "van" ); + mPrefixes.insert( "von" ); + mPrefixes.insert( "de" ); + + TDEConfig config( "kabcrc", true, false ); // readonly, no kdeglobals + config.setGroup( "General" ); + + addToSet( config.readListEntry( "Prefixes" ), mTitles ); + addToSet( config.readListEntry( "Inclusions" ), mPrefixes ); + addToSet( config.readListEntry( "Suffixes" ), mSuffixes ); + mTradeAsFamilyName = config.readBoolEntry( "TradeAsFamilyName", true ); +} + +bool AddresseeHelper::containsTitle( const TQString& title ) const +{ + return mTitles.find( title ) != mTitles.end(); +} + +bool AddresseeHelper::containsPrefix( const TQString& prefix ) const +{ + return mPrefixes.find( prefix ) != mPrefixes.end(); +} + +bool AddresseeHelper::containsSuffix( const TQString& suffix ) const +{ + return mSuffixes.find( suffix ) != mSuffixes.end(); +} + +bool AddresseeHelper::tradeAsFamilyName() const +{ + return mTradeAsFamilyName; +} diff --git a/tdeabc/addresseehelper.h b/tdeabc/addresseehelper.h new file mode 100644 index 000000000..5280e6b2d --- /dev/null +++ b/tdeabc/addresseehelper.h @@ -0,0 +1,66 @@ +/* + This file is part of the KDE libraries + Copyright (C) 2003 Carsten Pfeiffer + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation, version 2. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_ADDRESSEEHELPER_H +#define KABC_ADDRESSEEHELPER_H + +#include +#include + +#include + +#include + +/** + static data, shared by ALL addressee objects +*/ + +namespace KABC { + +class KABC_EXPORT AddresseeHelper : public TQObject, public DCOPObject +{ + K_DCOP + + public: + static AddresseeHelper *self(); + + bool containsTitle( const TQString& title ) const; + bool containsPrefix( const TQString& prefix ) const; + bool containsSuffix( const TQString& suffix ) const; + bool tradeAsFamilyName() const; + + k_dcop: + ASYNC initSettings(); + + private: + AddresseeHelper(); + + static void addToSet( const TQStringList& list, + std::set& container ); + std::set mTitles; + std::set mPrefixes; + std::set mSuffixes; + bool mTradeAsFamilyName; + + static AddresseeHelper *s_self; +}; + +} + +#endif diff --git a/tdeabc/addresseelist.cpp b/tdeabc/addresseelist.cpp new file mode 100644 index 000000000..47324001c --- /dev/null +++ b/tdeabc/addresseelist.cpp @@ -0,0 +1,256 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Jost Schenck + 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include "addresseelist.h" + +#include "field.h" +#include "sortmode.h" + +using namespace KABC; + +// +// +// Traits +// +// + +bool SortingTraits::Uid::eq( const Addressee &a1, const Addressee &a2 ) +{ + // locale awareness doesn't make sense sorting ids + return ( TQString::compare( a1.uid(), a2.uid() ) == 0 ); +} + +bool SortingTraits::Uid::lt( const Addressee &a1, const Addressee &a2 ) +{ + // locale awareness doesn't make sense sorting ids + return ( TQString::compare( a1.uid(), a2.uid() ) < 0 ); +} + +bool SortingTraits::Name::eq( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.name(), a2.name() ) == 0 ); +} + +bool SortingTraits::Name::lt( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.name(), a2.name() ) < 0 ); +} + +bool SortingTraits::FormattedName::eq( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.formattedName(), a2.formattedName() ) == 0 ); +} + +bool SortingTraits::FormattedName::lt( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.formattedName(), a2.formattedName() ) < 0 ); +} + +bool SortingTraits::FamilyName::eq( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.familyName(), a2.familyName() ) == 0 + && TQString::localeAwareCompare( a1.givenName(), a2.givenName() ) == 0 ); +} + +bool SortingTraits::FamilyName::lt( const Addressee &a1, const Addressee &a2 ) +{ + int family = TQString::localeAwareCompare( a1.familyName(), a2.familyName() ); + if ( 0 == family ) { + return ( TQString::localeAwareCompare( a1.givenName(), a2.givenName() ) < 0 ); + } else { + return family < 0; + } +} + +bool SortingTraits::GivenName::eq( const Addressee &a1, const Addressee &a2 ) +{ + return ( TQString::localeAwareCompare( a1.givenName(), a2.givenName() ) == 0 + && TQString::localeAwareCompare( a1.familyName(), a2.familyName() ) == 0 ); +} + +bool SortingTraits::GivenName::lt( const Addressee &a1, const Addressee &a2 ) +{ + int given = TQString::localeAwareCompare( a1.givenName(), a2.givenName() ); + if ( 0 == given ) { + return ( TQString::localeAwareCompare( a1.familyName(), a2.familyName() ) < 0 ); + } else { + return given < 0; + } +} + +// +// +// AddresseeList +// +// + +static Field *sActiveField=0; + +AddresseeList::AddresseeList() + : TQValueList() +{ + mReverseSorting = false; + mActiveSortingCriterion = FormattedName; +} + +AddresseeList::~AddresseeList() +{ +} + +AddresseeList::AddresseeList( const AddresseeList &l ) + : TQValueList( l ) +{ + mReverseSorting = l.reverseSorting(); + mActiveSortingCriterion = l.sortingCriterion(); +} + +AddresseeList::AddresseeList( const TQValueList &l ) + : TQValueList( l ) +{ + mReverseSorting = false; +} + +void AddresseeList::dump() const +{ + kdDebug(5700) << "AddresseeList {" << endl; + kdDebug(5700) << "reverse order: " << ( mReverseSorting ? "true" : "false" ) << endl; + + TQString crit; + if ( Uid == mActiveSortingCriterion ) { + crit = "Uid"; + } else if ( Name == mActiveSortingCriterion ) { + crit = "Name"; + } else if ( FormattedName == mActiveSortingCriterion ) { + crit = "FormattedName"; + } else if ( FamilyName == mActiveSortingCriterion ) { + crit = "FamilyName"; + } else if ( GivenName == mActiveSortingCriterion ) { + crit = "GivenName"; + } else { + crit = "unknown -- update dump method"; + } + + kdDebug(5700) << "sorting criterion: " << crit << endl; + + for ( const_iterator it = begin(); it != end(); ++it ) { + (*it).dump(); + } + + kdDebug(5700) << "}" << endl; +} + +void AddresseeList::sortBy( SortingCriterion c ) +{ + mActiveSortingCriterion = c; + if ( Uid == c ) { + sortByTrait(); + } else if ( Name == c ) { + sortByTrait(); + } else if ( FormattedName == c ) { + sortByTrait(); + } else if ( FamilyName == c ) { + sortByTrait(); + } else if ( GivenName==c ) { + sortByTrait(); + } else { + kdError(5700) << "AddresseeList sorting criterion passed for which a trait is not known. No sorting done." << endl; + } +} + +void AddresseeList::sort() +{ + sortBy( mActiveSortingCriterion ); +} + +template +void AddresseeList::sortByTrait() +{ + // FIXME: better sorting algorithm, bubblesort is not acceptable for larger lists. + // + // for i := 1 to n - 1 + // do for j := 1 to n - i + // do if A[j] > A[j+1] + // then temp := A[j] + // A[j] := A[j + 1] + // A[j + 1 ] := temp + + iterator i1 = begin(); + iterator endIt = end(); + --endIt; + if ( i1 == endIt ) // don't need sorting + return; + + iterator i2 = endIt; + while( i1 != endIt ) { + iterator j1 = begin(); + iterator j2 = j1; + ++j2; + while( j1 != i2 ) { + if ( !mReverseSorting && Trait::lt( *j2, *j1 ) + || mReverseSorting && Trait::lt( *j1, *j2 ) ) { + tqSwap( *j1, *j2 ); + } + ++j1; + ++j2; + } + ++i1; + --i2; + } +} + +void AddresseeList::sortByField( Field *field ) +{ + if ( !field ) { + kdWarning(5700) << "sortByField called with no active sort field" << endl; + return; + } + + sActiveField = field; + + if ( count() == 0 ) + return; + + KABC::FieldSortMode *mode = new KABC::FieldSortMode( sActiveField, !mReverseSorting ); + + KABC::Addressee::setSortMode( mode ); + qHeapSort( *this ); + KABC::Addressee::setSortMode( 0 ); + + delete mode; +} + +void AddresseeList::sortByMode( SortMode *mode ) +{ + if ( count() == 0 ) + return; + + KABC::Addressee::setSortMode( mode ); + qHeapSort( *this ); + KABC::Addressee::setSortMode( 0 ); +} + +Field* +AddresseeList::sortingField() const +{ + return sActiveField; +} diff --git a/tdeabc/addresseelist.h b/tdeabc/addresseelist.h new file mode 100644 index 000000000..7c9df0275 --- /dev/null +++ b/tdeabc/addresseelist.h @@ -0,0 +1,221 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Jost Schenck + 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_ADDRESSEELIST_H +#define KABC_ADDRESSEELIST_H + +#include + +#include "addressee.h" + +namespace KABC { + +class Field; +class SortField; +class SortMode; + +/** + * Each trait must implement one static function for equality, one for "less + * than". Class name should be the field name. A trait does not necessarily + * have to stick to just one field: a trait sorting by family name can e.g. + * sort addressees with equal family name by given name. + * + * If you want to implement reverse sorting, you do not have to write another + * trait, as AddresseeList takes care of that. + */ +namespace SortingTraits +{ + +class KABC_EXPORT Uid +{ + public: + static bool eq( const Addressee &, const Addressee & ); + static bool lt( const Addressee &, const Addressee & ); +}; + +class KABC_EXPORT Name +{ + public: + static bool eq( const Addressee &, const Addressee & ); + static bool lt( const Addressee &, const Addressee & ); +}; + +class KABC_EXPORT FormattedName +{ + public: + static bool eq( const Addressee &, const Addressee & ); + static bool lt( const Addressee &, const Addressee & ); +}; + +class KABC_EXPORT FamilyName // fallback to given name +{ + public: + static bool eq( const Addressee &, const Addressee & ); + static bool lt( const Addressee &, const Addressee & ); +}; + +class KABC_EXPORT GivenName // fallback to family name +{ + public: + static bool eq( const Addressee &, const Addressee & ); + static bool lt( const Addressee &, const Addressee & ); +}; + +} + +/** + * Addressee attribute used for sorting. + */ +typedef enum { Uid, Name, FormattedName, FamilyName, GivenName } SortingCriterion; + +/** + * @short a TQValueList of Addressee, with sorting functionality + * + * This class extends the functionality of TQValueList with + * sorting methods specific to the Addressee class. It can be used + * just like any other TQValueList but is no template class. + * + * An AddresseeList does not automatically keep sorted when addressees + * are added or removed or the sorting order is changed, as this would + * slow down larger operations by sorting after every step. So after + * such operations you have to call {@link #sort} or {@link #sortBy} to + * create a defined order again. + * + * Iterator usage is inherited by TQValueList and extensively documented + * there. Please remember that the state of an iterator is undefined + * after any sorting operation. + * + * For the enumeration Type SortingCriterion, which specifies the + * field by the collection will be sorted, the following values exist: + * Uid, Name, FormattedName, FamilyName, GivenName. + * + * @author Jost Schenck jost@schenck.de + */ +class KABC_EXPORT AddresseeList : public TQValueList +{ + public: + AddresseeList(); + ~AddresseeList(); + AddresseeList( const AddresseeList & ); + AddresseeList( const TQValueList & ); + + /** + * Debug output. + */ + void dump() const; + + /** + * Determines the direction of sorting. On change, the list + * will not automatically be resorted. + * @param r true if sorting should be done reverse, false otherwise + */ + void setReverseSorting( bool r = true ) { mReverseSorting = r; } + + /** + * Returns the direction of sorting. + * @return true if sorting is done reverse, false otherwise + */ + bool reverseSorting() const { return mReverseSorting; } + + /** + * Sorts this list by a specific criterion. + * @param c the criterion by which should be sorted + */ + void sortBy( SortingCriterion c ); + + /** + * Sorts this list by a specific field. If no parameter is given, the + * last used Field object will be used. + * @param field pointer to the Field object to be sorted by + */ + void sortByField( Field *field = 0 ); + + /** + * Sorts this list by a specific sorting mode. + * @param mode pointer to the sorting mode object to be sorted by + * @since 3.4 + */ + void sortByMode( SortMode *mode = 0 ); + + /** + * Sorts this list by its active sorting criterion. This normally is the + * criterion of the last sortBy operation or FormattedName if up + * to now there has been no sortBy operation. + * + * Please note that the sorting trait of the last {@link #sortByTrait} + * method call is not remembered and thus the action can not be repeated + * by this method. + */ + void sort(); + + /** + * Templated sort function. You normally will not want to use this but + * {@link #sortBy} and {@link #sort} instead as the existing sorting + * criteria completely suffice for most cases. + * + * However, if you do want to use some special sorting criterion, you can + * write a trait class that will be provided to this templated method. + * This trait class has to have a class declaration like the following: + * \code + * class MySortingTrait { + * public: + * // eq returns true if a1 and a2 are equal + * static bool eq(KABC::Addressee a1, KABC::Addressee a2); + * // lt returns true is a1 is "less than" a2 + * static bool lt(KABC::Addressee a1, KABC::Addressee a2); + * }; + * \endcode + * You can then pass this class to the sortByTrait method like this: + * \code + * myAddresseelist.sortByTrait<MySortingTrait>(); + * \endcode + * Please note that the {@link #sort} method can not be used to repeat the + * sorting of the last sortByTrait action. + * + * Right now this method uses the bubble sort algorithm. This should be + * replaced for a better one when I have time. + */ + template void sortByTrait(); + + /** + * Returns the active sorting criterion, ie the sorting criterion that + * will be used by a {@link #sort} call. + */ + SortingCriterion sortingCriterion() const { return mActiveSortingCriterion; } + + /** + * Returns the active sorting field, ie a pointer to the Field object + * which was used for the last {@link #sortByField} operation. + * This function returns the last GLOBAL sorting field, not + * the class specific one. + * You're a lot better off by keeping track of this locally. + */ + Field* sortingField() const; + + private: + bool mReverseSorting; + SortingCriterion mActiveSortingCriterion; + //KDE 4.0 - add a d-pointer here! +}; + +} + +#endif diff --git a/tdeabc/addresslineedit.cpp b/tdeabc/addresslineedit.cpp new file mode 100644 index 000000000..dc7a889a1 --- /dev/null +++ b/tdeabc/addresslineedit.cpp @@ -0,0 +1,610 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Helge Deller + 2002 Lubos Lunak + 2001,2003 Carsten Pfeiffer + 2001 Waldo Bastian + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +// $Id$ + +#include "addresslineedit.h" + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include "ldapclient.h" + +#include + +//============================================================================= +// +// Class AddressLineEdit +// +//============================================================================= + + +using namespace KABC; + +TDECompletion * AddressLineEdit::s_completion = 0L; +bool AddressLineEdit::s_addressesDirty = false; +TQTimer* AddressLineEdit::s_LDAPTimer = 0L; +LdapSearch* AddressLineEdit::s_LDAPSearch = 0L; +TQString* AddressLineEdit::s_LDAPText = 0L; +AddressLineEdit* AddressLineEdit::s_LDAPLineEdit = 0L; +TDEConfig *AddressLineEdit::s_config = 0L; + +static KStaticDeleter completionDeleter; +static KStaticDeleter ldapTimerDeleter; +static KStaticDeleter ldapSearchDeleter; +static KStaticDeleter ldapTextDeleter; +static KStaticDeleter configDeleter; + +AddressLineEdit::AddressLineEdit(TQWidget* parent, + bool useCompletion, + const char *name) + : KLineEdit(parent,name) +{ + m_useCompletion = useCompletion; + m_completionInitialized = false; + m_smartPaste = false; + + init(); + + // Whenever a new AddressLineEdit is created (== a new composer is created), + // we set a dirty flag to reload the addresses upon the first completion. + // The address completions are shared between all AddressLineEdits. + // Is there a signal that tells us about addressbook updates? + if (m_useCompletion) + s_addressesDirty = true; +} + + +//----------------------------------------------------------------------------- +void AddressLineEdit::init() +{ + if ( !s_completion ) { + completionDeleter.setObject( s_completion, new TDECompletion() ); + s_completion->setOrder( TDECompletion::Sorted ); + s_completion->setIgnoreCase( true ); + } + + if( m_useCompletion ) { + if( !s_LDAPTimer ) { + ldapTimerDeleter.setObject( s_LDAPTimer, new TQTimer ); + ldapSearchDeleter.setObject( s_LDAPSearch, new LdapSearch ); + ldapTextDeleter.setObject( s_LDAPText, new TQString ); + } + connect( s_LDAPTimer, TQT_SIGNAL( timeout()), TQT_SLOT( slotStartLDAPLookup())); + connect( s_LDAPSearch, TQT_SIGNAL( searchData( const TQStringList& )), + TQT_SLOT( slotLDAPSearchData( const TQStringList& ))); + } + + if ( m_useCompletion && !m_completionInitialized ) + { + setCompletionObject( s_completion, false ); // we handle it ourself + connect( this, TQT_SIGNAL( completion(const TQString&)), + this, TQT_SLOT(slotCompletion() )); + + TDECompletionBox *box = completionBox(); + connect( box, TQT_SIGNAL( highlighted( const TQString& )), + this, TQT_SLOT( slotPopupCompletion( const TQString& ) )); + connect( box, TQT_SIGNAL( userCancelled( const TQString& )), + TQT_SLOT( userCancelled( const TQString& ))); + + m_completionInitialized = true; // don't connect muliple times. That's + // ugly, tho, better have completionBox() + // virtual in KDE 4 + // Why? This is only called once. Why should this be called more + // than once? And why was this protected? + } +} + +//----------------------------------------------------------------------------- +AddressLineEdit::~AddressLineEdit() +{ +} + +//----------------------------------------------------------------------------- + +TDEConfig* AddressLineEdit::config() +{ + if ( !s_config ) + configDeleter.setObject( s_config, new TDEConfig( "kabldaprc", false, false ) ); // Open read-write, no kdeglobals + + return s_config; +} + +void AddressLineEdit::setFont( const TQFont& font ) +{ + KLineEdit::setFont( font ); + if ( m_useCompletion ) + completionBox()->setFont( font ); +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::keyPressEvent(TQKeyEvent *e) +{ + bool accept = false; + + if (TDEStdAccel::shortcut(TDEStdAccel::SubstringCompletion).contains(KKey(e))) + { + doCompletion(true); + accept = true; + } + else if (TDEStdAccel::shortcut(TDEStdAccel::TextCompletion).contains(KKey(e))) + { + int len = text().length(); + + if (len == cursorPosition()) // at End? + { + doCompletion(true); + accept = true; + } + } + + if( !accept ) + KLineEdit::keyPressEvent( e ); + + if( e->isAccepted()) + { + if( m_useCompletion && s_LDAPTimer != NULL ) + { + if( *s_LDAPText != text()) + stopLDAPLookup(); + *s_LDAPText = text(); + s_LDAPLineEdit = this; + s_LDAPTimer->start( 500, true ); + } + } +} + +void AddressLineEdit::mouseReleaseEvent( TQMouseEvent * e ) +{ + if (m_useCompletion && (e->button() == Qt::MidButton)) + { + m_smartPaste = true; + KLineEdit::mouseReleaseEvent(e); + m_smartPaste = false; + return; + } + KLineEdit::mouseReleaseEvent(e); +} + +void AddressLineEdit::insert(const TQString &t) +{ + if (!m_smartPaste) + { + KLineEdit::insert(t); + return; + } + TQString newText = t.stripWhiteSpace(); + if (newText.isEmpty()) + return; + + // remove newlines in the to-be-pasted string as well as an eventual + // mailto: protocol + newText.replace( TQRegExp("\r?\n"), ", " ); + if ( newText.startsWith( "mailto:" ) ) + { + KURL u(newText); + newText = u.path(); + } + else if (newText.find(" at ") != -1) + { + // Anti-spam stuff + newText.replace( " at ", "@" ); + newText.replace( " dot ", "." ); + } + else if (newText.find("(at)") != -1) + { + newText.replace( TQRegExp("\\s*\\(at\\)\\s*"), "@" ); + } + + TQString contents = text(); + int start_sel = 0; + int end_sel = 0; + int pos = cursorPosition(); + if (getSelection(&start_sel, &end_sel)) + { + // Cut away the selection. + if (pos > end_sel) + pos -= (end_sel - start_sel); + else if (pos > start_sel) + pos = start_sel; + contents = contents.left(start_sel) + contents.right(end_sel+1); + } + + int eot = contents.length(); + while ((eot > 0) && contents[eot-1].isSpace()) eot--; + if (eot == 0) + { + contents = TQString::null; + } + else if (pos >= eot) + { + if (contents[eot-1] == ',') + eot--; + contents.truncate(eot); + contents += ", "; + pos = eot+2; + } + + contents = contents.left(pos)+newText+contents.mid(pos); + setText(contents); + setCursorPosition(pos+newText.length()); +} + +void AddressLineEdit::paste() +{ + if (m_useCompletion) + m_smartPaste = true; + KLineEdit::paste(); + m_smartPaste = false; +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::cursorAtEnd() +{ + setCursorPosition( text().length() ); +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::enableCompletion(bool enable) +{ + m_useCompletion = enable; +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::doCompletion(bool ctrlT) +{ + if ( !m_useCompletion ) + return; + + TQString prevAddr; + + TQString s(text()); + int n = s.findRev(','); + + if (n >= 0) + { + n++; // Go past the "," + + int len = s.length(); + + // Increment past any whitespace... + while( n < len && s[n].isSpace() ) + n++; + + prevAddr = s.left(n); + s = s.mid(n,255).stripWhiteSpace(); + } + + if ( s_addressesDirty ) + loadAddresses(); + + if ( ctrlT ) + { + TQStringList completions = s_completion->substringCompletion( s ); + if (completions.count() > 1) { + m_previousAddresses = prevAddr; + setCompletedItems( completions ); + } + else if (completions.count() == 1) + setText(prevAddr + completions.first()); + + cursorAtEnd(); + return; + } + + TDEGlobalSettings::Completion mode = completionMode(); + + switch ( mode ) + { + case TDEGlobalSettings::CompletionPopupAuto: + { + if (s.isEmpty()) + break; + } + case TDEGlobalSettings::CompletionPopup: + { + m_previousAddresses = prevAddr; + TQStringList items = s_completion->allMatches( s ); + items += s_completion->allMatches( "\"" + s ); + items += s_completion->substringCompletion( '<' + s ); + uint beforeDollarCompletionCount = items.count(); + + if( s.find( ' ' ) == -1 ) // one word, possibly given name + items += s_completion->allMatches( "$$" + s ); + + if ( !items.isEmpty() ) + { + if ( items.count() > beforeDollarCompletionCount ) + { + // remove the '$$whatever$' part + for( TQStringList::Iterator it = items.begin(); + it != items.end(); + ++it ) + { + int pos = (*it).find( '$', 2 ); + if( pos < 0 ) // ??? + continue; + (*it)=(*it).mid( pos + 1 ); + } + } + + items = removeMailDupes( items ); + + // We do not want KLineEdit::setCompletedItems to perform text + // completion (suggestion) since it does not know how to deal + // with providing proper completions for different items on the + // same line, e.g. comma-separated list of email addresses. + bool autoSuggest = (mode != TDEGlobalSettings::CompletionPopupAuto); + setCompletedItems( items, autoSuggest ); + + if (!autoSuggest) + { + int index = items.first().find( s ); + TQString newText = prevAddr + items.first().mid( index ); + //kdDebug() << "OLD TEXT: " << text() << endl; + //kdDebug() << "NEW TEXT: " << newText << endl; + setUserSelection(false); + setCompletedText(newText,true); + } + } + + break; + } + + case TDEGlobalSettings::CompletionShell: + { + TQString match = s_completion->makeCompletion( s ); + if ( !match.isNull() && match != s ) + { + setText( prevAddr + match ); + cursorAtEnd(); + } + break; + } + + case TDEGlobalSettings::CompletionMan: // Short-Auto in fact + case TDEGlobalSettings::CompletionAuto: + { + if (!s.isEmpty()) + { + TQString match = s_completion->makeCompletion( s ); + if ( !match.isNull() && match != s ) + { + TQString adds = prevAddr + match; + setCompletedText( adds ); + } + break; + } + } + case TDEGlobalSettings::CompletionNone: + default: // fall through + break; + } +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::slotPopupCompletion( const TQString& completion ) +{ + setText( m_previousAddresses + completion ); + cursorAtEnd(); +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::loadAddresses() +{ + s_completion->clear(); + s_addressesDirty = false; + + TQStringList adrs = addresses(); + for( TQStringList::ConstIterator it = adrs.begin(); it != adrs.end(); ++it) + addAddress( *it ); +} + +void AddressLineEdit::addAddress( const TQString& adr ) +{ + s_completion->addItem( adr ); + int pos = adr.find( '<' ); + if( pos >= 0 ) + { + ++pos; + int pos2 = adr.find( pos, '>' ); + if( pos2 >= 0 ) + s_completion->addItem( adr.mid( pos, pos2 - pos )); + } +} + +void AddressLineEdit::slotStartLDAPLookup() +{ + if( !s_LDAPSearch->isAvailable() || s_LDAPLineEdit != this ) + return; + startLoadingLDAPEntries(); +} + +void AddressLineEdit::stopLDAPLookup() +{ + s_LDAPSearch->cancelSearch(); + s_LDAPLineEdit = NULL; +} + +void AddressLineEdit::startLoadingLDAPEntries() +{ + TQString s( *s_LDAPText ); + // TODO cache last? + TQString prevAddr; + int n = s.findRev(','); + if (n>= 0) + { + prevAddr = s.left(n+1) + ' '; + s = s.mid(n+1,255).stripWhiteSpace(); + } + if( s.length() == 0 ) + return; + + loadAddresses(); // TODO reuse these? + s_LDAPSearch->startSearch( s ); +} + +void AddressLineEdit::slotLDAPSearchData( const TQStringList& adrs ) +{ + if( s_LDAPLineEdit != this ) + return; + for( TQStringList::ConstIterator it = adrs.begin(); it != adrs.end(); ++it ) { + TQString name(*it); + int pos = name.find( " <" ); + int pos_comma = name.find( ',' ); + // put name in quotes, if we have a comma in the name + if (pos>0 && pos_comma>0 && pos_commahasFocus()) + { + if( completionMode() != TDEGlobalSettings::CompletionNone ) + { + doCompletion( false ); + } + } +} + +TQStringList AddressLineEdit::removeMailDupes( const TQStringList& adrs ) +{ + TQStringList src = adrs; + qHeapSort( src ); + TQString last; + for( TQStringList::Iterator it = src.begin(); it != src.end(); ) { + if( *it == last ) + { + it = src.remove( it ); + continue; // dupe + } + last = *it; + ++it; + } + return src; +} + +//----------------------------------------------------------------------------- +void AddressLineEdit::dropEvent(TQDropEvent *e) +{ + KURL::List uriList; + if(KURLDrag::canDecode(e) && KURLDrag::decode( e, uriList )) + { + TQString ct = text(); + KURL::List::Iterator it = uriList.begin(); + for (; it != uriList.end(); ++it) + { + if (!ct.isEmpty()) ct.append(", "); + KURL u(*it); + if ((*it).protocol() == "mailto") + ct.append( (*it).path() ); + else + ct.append( (*it).url() ); + } + setText(ct); + setEdited( true ); + } + else { + if (m_useCompletion) + m_smartPaste = true; + TQLineEdit::dropEvent(e); + m_smartPaste = false; + } +} + + +TQStringList AddressLineEdit::addresses() +{ + TQApplication::setOverrideCursor( KCursor::waitCursor() ); // loading might take a while + + TQStringList result; + TQString space(" "); + TQRegExp needQuotes("[^ 0-9A-Za-z\\x0080-\\xFFFF]"); + TQString endQuote("\" "); + TQString addr, email; + + KABC::AddressBook *addressBook = KABC::StdAddressBook::self(); + KABC::AddressBook::Iterator it; + for( it = addressBook->begin(); it != addressBook->end(); ++it ) { + TQStringList emails = (*it).emails(); + + TQString n = (*it).prefix() + space + + (*it).givenName() + space + + (*it).additionalName() + space + + (*it).familyName() + space + + (*it).suffix(); + + n = n.simplifyWhiteSpace(); + + TQStringList::ConstIterator mit; + + for ( mit = emails.begin(); mit != emails.end(); ++mit ) { + email = *mit; + if (!email.isEmpty()) { + if (n.isEmpty() || (email.find( '<' ) != -1)) + addr = TQString::null; + else { /* do we really need quotes around this name ? */ + if (n.find(needQuotes) != -1) + addr = '"' + n + endQuote; + else + addr = n + space; + } + + if (!addr.isEmpty() && (email.find( '<' ) == -1) + && (email.find( '>' ) == -1) + && (email.find( ',' ) == -1)) + addr += '<' + email + '>'; + else + addr += email; + addr = addr.stripWhiteSpace(); + result.append( addr ); + } + } + } + + KABC::DistributionListManager manager( addressBook ); + manager.load(); + result += manager.listNames(); + + TQApplication::restoreOverrideCursor(); + + return result; +} + +#include "addresslineedit.moc" diff --git a/tdeabc/addresslineedit.h b/tdeabc/addresslineedit.h new file mode 100644 index 000000000..f81ffbfe4 --- /dev/null +++ b/tdeabc/addresslineedit.h @@ -0,0 +1,123 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Helge Deller + 2002 Lubos Lunak + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_ADDRESSLINEEDIT_H +#define KABC_ADDRESSLINEEDIT_H +// $Id$ + +#include +#include +#include + +#include "klineedit.h" +#include "kcompletion.h" + +class TDEConfig; + +namespace KABC { + +class LdapSearch; + +/** + * A lineedit with LDAP and kabc completion + * + * This lineedit is supposed to be used wherever the user types email addresses + * and might want a completion. You can simply use it as a replacement for + * KLineEdit or TQLineEdit. + * + * You can enable or disable the lineedit at any time. + * + * @see AddressLineEdit::enableCompletion() + */ +class KABC_EXPORT AddressLineEdit : public KLineEdit +{ + Q_OBJECT +public: + AddressLineEdit(TQWidget* parent, bool useCompletion = true, + const char *name = 0L); + virtual ~AddressLineEdit(); + + /** + * Reimplented for internal reasons. + * @ see KLineEdit::setFont() + */ + virtual void setFont( const TQFont& ); + + static TDEConfig *config(); + +public slots: + /** + * Set cursor to end of line. + */ + void cursorAtEnd(); + /** + * Toggle completion. + */ + void enableCompletion( bool enable ); + +protected: + /** + * Always call AddressLineEdit::loadAddresses() as the first thing. + * Use addAddress() to add addresses. + */ + virtual void loadAddresses(); + void addAddress( const TQString& ); + virtual void keyPressEvent(TQKeyEvent*); + virtual void dropEvent(TQDropEvent *e); + virtual void paste(); + virtual void insert(const TQString &t); + virtual void mouseReleaseEvent( TQMouseEvent * e ); + void doCompletion(bool ctrlT); + +private slots: + void slotCompletion() { doCompletion(false); } + void slotPopupCompletion( const TQString& ); + void slotStartLDAPLookup(); + void slotLDAPSearchData( const TQStringList& ); + +private: + void init(); + void startLoadingLDAPEntries(); + void stopLDAPLookup(); + TQStringList addresses(); + TQStringList removeMailDupes( const TQStringList& adrs ); + + TQString m_previousAddresses; + bool m_useCompletion; + bool m_completionInitialized; + bool m_smartPaste; + TQString m_typedText; // unused + + static bool s_addressesDirty; + static TDECompletion *s_completion; + static TQTimer *s_LDAPTimer; + static LdapSearch *s_LDAPSearch; + static TQString *s_LDAPText; + static AddressLineEdit *s_LDAPLineEdit; + static TDEConfig *s_config; + +private: + class AddressLineEditPrivate* d; +}; + +} + +#endif /* KABC_ADDRESSLINEEDIT_H */ diff --git a/tdeabc/agent.cpp b/tdeabc/agent.cpp new file mode 100644 index 000000000..571b7803e --- /dev/null +++ b/tdeabc/agent.cpp @@ -0,0 +1,148 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "addressee.h" + +#include "agent.h" + +using namespace KABC; + +Agent::Agent() + : mAddressee( 0 ), mIntern( false ) +{ +} + +Agent::Agent( const TQString &url ) + : mAddressee( 0 ),mUrl( url ), mIntern( false ) +{ +} + +Agent::Agent( Addressee *addressee ) + : mAddressee( addressee ), mIntern( true ) +{ +} + +Agent::~Agent() +{ + delete mAddressee; + mAddressee = 0; +} + +bool Agent::operator==( const Agent &a ) const +{ + if ( mIntern != a.mIntern ) + return false; + + if ( !mIntern ) { + if ( mUrl != a.mUrl ) + return false; + } else { + if ( mAddressee && !a.mAddressee ) return false; + if ( !mAddressee && a.mAddressee ) return false; + if ( !mAddressee && !a.mAddressee ) return false; + if ( (*mAddressee) != (*a.mAddressee) ) return false; + } + + return true; +} + +bool Agent::operator!=( const Agent &a ) const +{ + return !( a == *this ); +} + +Agent &Agent::operator=( const Agent &addr ) +{ + if ( this == &addr ) + return *this; + + if ( addr.mIntern && addr.mAddressee ) { + if ( mAddressee ) + delete mAddressee; + + mAddressee = new Addressee; + *mAddressee = *(addr.mAddressee); + } + + mUrl = addr.mUrl; + mIntern = addr.mIntern; + + return *this; +} + +void Agent::setUrl( const TQString &url ) +{ + mUrl = url; + mIntern = false; +} + +void Agent::setAddressee( Addressee *addressee ) +{ + mAddressee = addressee; + mIntern = true; +} + +bool Agent::isIntern() const +{ + return mIntern; +} + +TQString Agent::url() const +{ + return mUrl; +} + +Addressee *Agent::addressee() const +{ + return mAddressee; +} + +TQString Agent::asString() const +{ + if ( mIntern ) + return "intern agent"; + else + return mUrl; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Agent &agent ) +{ + TQ_UINT32 hasAddressee = ( agent.mAddressee != 0 ); + + s << agent.mIntern << agent.mUrl << hasAddressee; + if ( hasAddressee ) + s << (*agent.mAddressee); + + return s; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Agent &agent ) +{ + TQ_UINT32 hasAddressee; + + s >> agent.mIntern >> agent.mUrl >> hasAddressee; + + if ( hasAddressee ) { + agent.mAddressee = new Addressee; + s >> (*agent.mAddressee); + } + + return s; +} diff --git a/tdeabc/agent.h b/tdeabc/agent.h new file mode 100644 index 000000000..dbe048f08 --- /dev/null +++ b/tdeabc/agent.h @@ -0,0 +1,128 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_AGENT_H +#define KABC_AGENT_H + +class TQDataStream; + +#include + +#include + +namespace KABC { + +class Addressee; + +/** + * Important!!! + * + * At the moment the vcard format does not support saving and loading + * this entity. + */ +class KABC_EXPORT Agent +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Agent & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Agent & ); + +public: + + /** + * Consturctor. Creates an empty object. + */ + Agent(); + + /** + * Consturctor. + * + * @param url A URL that describes the position of the agent file. + */ + Agent( const TQString &url ); + + /** + * Consturctor. + * + * @param addressee The addressee object of the agent. + */ + Agent( Addressee *addressee ); + + /** + * Destructor. + */ + ~Agent(); + + + bool operator==( const Agent & ) const; + bool operator!=( const Agent & ) const; + Agent &operator=( const Agent & ); + + /** + * Sets a URL for the location of the agent file. When using this + * function, isIntern() will return 'false' until you use + * setAddressee(). + * + * @param url The location URL of the agent file. + */ + void setUrl( const TQString &url ); + + /** + * Sets the addressee of the agent. When using this function, + * isIntern() will return 'true' until you use setUrl(). + * + * @param addressee The addressee object of the agent. + */ + void setAddressee( Addressee *addressee ); + + /** + * Returns whether the agent is described by a URL (extern) or + * by a addressee (intern). + * When this method returns 'true' you can use addressee() to + * get a Addressee object. Otherwise you can request the URL + * of this agent by url() and load the data from that location. + */ + bool isIntern() const; + + /** + * Returns the location URL of this agent. + */ + TQString url() const; + + /** + * Returns the addressee object of this agent. + */ + Addressee* addressee() const; + + /** + * Returns string representation of the agent. + */ + TQString asString() const; + +private: + Addressee *mAddressee; + TQString mUrl; + + int mIntern; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Agent & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Agent & ); + +} +#endif diff --git a/tdeabc/countrytransl.map b/tdeabc/countrytransl.map new file mode 100644 index 000000000..1459f0942 --- /dev/null +++ b/tdeabc/countrytransl.map @@ -0,0 +1,12381 @@ +Andorra ad +Andorra ad +أندورا ad +Андора ad +Андора ad +অ্যানডোরা ad +Andora ad +Andora ad +Ανδόρα ad +Andoro ad +آندورا ad +Andorre ad +Andóra ad +אנדורה ad +अंडोरा ad +アンドラ ad +អង់ដូរ៉ា ad +안도라 ad +ອີນເດີຍ ad +Andora ad +Андора ad +Андорра ad +ਐਂਡੋਰਾ ad +Andora ad +Андорра ad +Andora ad +Андора ad +Andora ad +அன்டோரா ad +Андора ad +แอนโดรา ad +Андорра ad +Андорра ad +Andore ad +安道尔 ad +安道爾 ad +United Arab Emirates ae +Vereenigde Arabiese Emirate ae +الإمارات العربية المتحدة ae +Злучаныя Арабскія Эміраты ae +ОАЕ ae +সংযুক্ত আরব আমিরশাহি ae +Stadoù-Unanet Arabeg ae +Ujedinjeni arapski emirati ae +Emirats Àrabs Units ae +Spojené arabské emiráty ae +Emiraethau Arabaidd Unedig ae +Forenende Arabiske Emirater ae +Vereinigte Arabische Emirate ae +Ενωμένα Αραβικά Εμιράτα ae +Uniĝintaj Arabaj Emirlandoj ae +Emiratos árabes unidos ae +Araabia Ühendemiraadid ae +Arabiar Emirato Batuak ae +امارات متحده عربی ae +Yhdistyneet Arabiemiraatit ae +Émirats Arabes Unis ae +Ferienigde Arabyske Emiraten ae +Aontas na nÉimíríochtaí Arabacha ae +Emiratos Árabes Unidos ae +איחוד האמירויות הערביות ae +संयुक्त अरब अमीरात ae +Ujedinjeni arapski emirati ae +Egyesült Arab Emirátusok ae +Sameinuðu arabísku furstadæmin ae +Emirati Arabi Uniti ae +アラブ首長国連邦 ae +អារ៉ាប់​រួម ae +아랍 에미레이트 연합 ae +ສະຫະລັດ ae +Jungtiniai Arabų Emiratai ae +Apvienotie Arābu Emerāti ae +Обединети Арапски Емирати ae +Нэгдсэн арабын имрат ae +Emirati Għarab Magħquda ae +De forente arabiske emirater ae +Vereenigte Araabsche Emiraten ae +Verenigde Arabische Emiraten ae +Dei sameinte arabiske emirata ae +Di-Emirate tseo di Kopanego tsa Arab ae +ਸੰਯੁਕਤ ਅਰਬ ਅਮੀਰਾਤ ae +Zjednoczone Emiraty Arabskie ae +Emiratos Árabes Unidos ae +Emirados Árabes Unidos ae +Emiratele Arabe Unite ae +Объединенные Арабские Эмираты ae +Leta Zunze Ubumwe z'Abarabu ae +Ovttastuvvon arábalaš emiráhtat ae +Spojené arabské emiráty ae +Združeni arabski Emirati ae +Уједињени арапски емирати ae +Ujedinjeni arapski emirati ae +Förenade arabemiraten ae +யுனைடெட் அரபி எமிரேட்ஸ் ae +Аморати муттаҳидаи Араб ae +สหรัฐอาหรับอีมิเรตส์ ae +Birleşik Arap Emirlikleri ae +Berläşkän Ğäräp Ämirlekläre ae +Об'єднані Арабські Емірати ae +Бирлашган Араб Амирликлари ae +Mashango o tangananaho a Emirates ae +Emirat Arabes Unis ae +阿联酋 ae +阿拉伯聯合大公國 ae +Izindawo zezinduna zase-United Arab ae +Afghanistan af +أفغانستان af +Афганістан af +Афганистан af +আফগানিস্তান af +Afganistan af +Afganistan af +Afganistan af +Afghanistán af +Affganistan af +Αφγανιστάν af +Afganio af +Afghanistán af +Afganistan af +افغانستان af +Afganistan af +An Afganastáin af +Afganistan af +אפגניסטן af +अफगानिस्तान af +Afganistan af +Afganisztán af +Afganistan af +Afganistan af +アフガニスタン af +អាហ្វកានីស្ថាន af +아프가니스탄 af +ລີທົ່ວເນີຍ af +Afganistāna af +Авганистан af +Афганстан af +Afganistan af +ਅਫਗਾਨਿਸਤਾਨ af +Afganistan af +Afeganistão af +Afeganistão af +Afganistan af +Афганистан af +Afuganisitani af +Afganistan af +Afganistan af +Авганистан af +Avganistan af +Afganistan af +ஆப்கானிஸ்தான் af +Афғонистон af +อาฟกานิสถาน af +Afganistan af +Äfğänstan af +Афганістан af +Афғонистон af +Afganistan af +阿富汗 af +阿富汗 af +Antigua and Barbuda ag +Antigue en Barbuda ag +أنتيغوا و باربودا ag +Antigua və Barbuda ag +Антыгуа і Барбуда ag +Антигуа и Барбуда ag +অ্যান্টিগুয়া এবং বার্বুডা ag +Antigua ha Barbuda ag +Antigua i Barbuda ag +Antigua i Barbuda ag +Antigua a Barbuda ag +Antigwa a Barbwda ag +Antigua og Barbuda ag +Antigua und Barbuda ag +Αντίγκουα και Μπαρμπούντα ag +Antigvo-Barbudo ag +Antigua y Barbuda ag +Antigua ja Barbuda ag +Antigua eta Barbuda ag +آنتیگوا و باربودا ag +Antigua ja Barbados ag +Antigua og Barbuda ag +Antigua et Barbuda ag +Antigua en Barbuda ag +Antigua agus Barbúda ag +Antiga e Barbuda ag +אנטיגואה ובריבודה ag +एन्टिगुआ और बारबूडा ag +Antigua i Barbuda ag +Antigua és Barbuda ag +Antigua dan Barbuda ag +Antígva og Barbúda ag +Antigua e Barbuda ag +アンティグアバーブーダ ag +Antigua និង Barbuda ag +앤티가 바부다 ag +Antikva ir Barbuda ag +Antigva un Barbuda ag +Антигва и Барбуда ag +Антигуа ба Барбуда ag +Antigwa u Barbuda ag +Antigua og Barbuda ag +Antigua un Barbuda ag +Antigua en Barbuda ag +Antigua og Barbuda ag +Antigua le Barbuda ag +Antigua e Barbuda ag +ਐਂਟੀਗੁਆ ਤੇ ਬਾਰਬੁਡਾ ag +Antigua i Barbuda ag +Antígua e Barbuda ag +Antigua e Barbuda ag +Antigua şi Barbuda ag +Антигуа и Барбуда ag +Antigwa na Barubida ag +Antigua ja Barbuda ag +Antigua a Barbuda ag +Antigva in Barbuda ag +Антигва и Барбуда ag +Antigva i Barbuda ag +I-Antigua kanye ne Barbuda ag +Antigua och Barbuda ag +ஆன்டிகா மற்றும் பெர்முடா ag +Антигуо ва Барбудо ag +อันทิกัว และ บาร์บูดา ag +Antigua ve Barbuda ag +Antigua wä Barbuda ag +Трінідад і Тобаго ag +Антигуа ва Барбуда ag +Antigua và Barbuda ag +Antigua eyet Barbuda ag +Antigua ne Barbuda ag +安提瓜和巴布达 ag +安地瓜島和巴布達島 ag +Antigua kanye ne-Barbuda ag +Anguilla ai +أنغويلا ai +Ангілья ai +Ангила ai +অ্যাঙ্গুইলা ai +Angilla ai +Angwila ai +Ανγκουίλα ai +Angvilo ai +آنگوییلا ai +אנגווילה ai +एंगुएला ai +Angvilla ai +イギリス属領アンギラ ai +អង់ហ្ស៊ីឡា ai +앙길라 ai +ແພນວິນ ai +Ангилја ai +Ангуаилла ai +Angwilla ai +ਐਂਨਗੁਈਲਾ ai +Anghila ai +Ангилла ai +Angwiya ai +Angvila ai +Ангвила ai +Angvila ai +ஆன்கில்லா ai +Ангуилло ai +แองกีลา ai +Ангілья ai +Ангвилла ai +Anguila ai +安圭拉 ai +阿爾及利亞 ai +Albania al +Albanië al +ألبانيا al +Альбанія al +Албания al +অলবেনিয়া al +Albani al +Albanija al +Albània al +Albánie al +Albanien al +Albanien al +Αλβανία al +Albanio al +Albaania al +آلبانی al +Albanie al +Albanië al +An Albáin al +Albánia al +אלבניה al +अल्बानिया al +Albánia al +Albanía al +アルバニア al +អាល់បានី al +알바니아 al +ແອດແລນຕິກ al +Albanija al +Albānija al +Албанија al +Албани al +Albanija al +Albanien al +Albanië al +ਅਲਬਾਨੀਆ al +Albânia al +Albânia al +Албания al +Alubaniya al +Albánia al +Albánsko al +Albanija al +Албанија al +Albanija al +Albanien al +ஆல்பனியா al +Олбанӣ al +อัลเบเนีย al +Arnavutluk al +Албанія al +Албания al +Albaneye al +阿尔巴尼亚 al +阿亞巴尼亞 al +Armenia am +Armenië am +أرمينيا am +Армэнія am +Армения am +আর্মেনিয়া am +Armeni am +Armenija am +Armènia am +Arménie am +Armenien am +Armenien am +Αρμενία am +Armenio am +Armeenia am +ارمنستان am +Arménie am +Armenië am +An Airméin am +Arménia am +ארמניה am +आर्मेनिया am +Örményország am +Armenía am +アルメニア am +អារមេនី am +아르메니아 am +ອາເຈນຕິນາ am +Armėnija am +Armēnija am +Ерменија am +Армен am +Armenien am +Armenië am +ਅਰਮੀਨੀਆ am +Arménia am +Armênia am +Армения am +Arumeniya am +Arménsko am +Armenija am +Јерменија am +Jermenija am +Armenien am +ஆர்மேனியா am +Арманистон am +อาร์เมเนีย am +Ermenistan am +Ärmänstan am +Вірменія am +Арманистон am +Årmeneye am +亚美尼亚 am +亞美尼亞 am +Netherlands Antilles an +Nederlandse Antilles an +أنتيل هولندا an +Нідэрляндскія Антылы an +Холандски Антили an +নেদারল্যাণ্ডস অ্যান্টিলেস an +Antilh an Izelvroioù an +Nizozemski Antili an +Antilles del Països Baixos an +Nizozemské Antily an +Ynysoedd Iseldiraidd Y Carib? an +Nederlandske antiller an +Niederländische Antillen an +Ολλανδικές Αντίλλες an +Nederlandaj Antiloj an +Antillas holandesas an +Hollandi Antillid an +Antilla Holandarrak an +آنتیلس هلند an +Alankomaiden Antillit an +Antilles néerlandaises an +Nederlânske Antillen an +Aintillí na hÍsiltíre an +Antillas Holandesas an +नीदरलैंड एन्टीलीस an +Nizozemski Antili an +Holland-Antillák an +Hollensku Antillur an +Antille Olandesi an +オランダ領アンチル an +អង់ទីយ៍​ហូល្លង់ an +네덜란드령 안틸레스 an +ເນເທີແລນ an +Nyderlandų Antilai an +Nīderlandes Antiļas an +Холандски Антили an +Недерландын Антиллэс an +De nederlandske Antillene an +Nedderlandsche Antillen an +Nederlandse Antillen an +Dei nederlandske Antillane an +ਨੀਂਦਰਲੈਂਡ ਐਂਟੀਲੀਸ an +Antyle Holenderskie an +Antilhas Holandês an +Antilhas Holandesas an +Antilele Olandeze an +Нидерландские Антильские острова an +Antiye z'Ubuholande an +Hollándalaš Antillat an +Holandské Antily an +Nizozemski Antili an +Холандски антили an +Holandski antili an +Nederländska Antillerna an +நெதர்லாந்து அன்டில்ஸ் an +Антилиси Ҳолланд an +เนเธอร์แลนด์ แอนทิลีส an +Hollanda Antilleri an +Niderland Antilläre an +Антільські острови (Нідерланди) an +Нидерландлар Антил Ороллари an +Hà Lan Antilles an +Antiyes Neyerlandesses an +荷属安的列斯群岛 an +荷屬安地列斯群島 an +Angola ao +أنغولا ao +Ангола ao +Ангола ao +অ্যাঙ্গোলা ao +Ανγκόλα ao +Angolo ao +آنگولا ao +Angóla ao +אנגולה ao +अंगोला ao +Angóla ao +アンゴラ ao +អង់ហ្គោឡា ao +앙골라 ao +ບັນແກເລີຍ ao +Ангола ao +Ангол ao +ਅੰਗੋਲਾ ao +Ангола ao +Ангола ao +ஆங்கோலா ao +Ангуло ao +แองโกลา ao +Ангола ao +Ангола ao +安哥拉 ao +安哥拉 ao +Argentina ar +Argentinië ar +الأرجنتين ar +Аргентына ar +Аржентина ar +আর্জেন্টিনা ar +Arc'hantina ar +Ariannin ar +Argentinien ar +Αργεντινή ar +Argentino ar +آرژانتین ar +Agentiina ar +Argentine ar +Argentinië ar +An Airgintín ar +Arxentina ar +ארגנטינה ar +अर्जेंटीना ar +Argentína ar +Argentína ar +アルゼンチン ar +អាហ្សង់ទីន ar +아르헨티나 ar +ອາເຈນຕິນາ ar +Argentīna ar +Аргентина ar +Аргентин ar +Arġentina ar +Argentinien ar +Argentinië ar +ਅਰਜ਼ਨਟੀਨਾ ar +Argentyna ar +Аргентина ar +Arijantina ar +Argentína ar +Аргентина ar +I-Argentina ar +ஆர்சென்டினா ar +Оржонтина ar +อาร์เจนตินา ar +Arjantin ar +Аргентина ar +Аргентина ar +Agenthina ar +Årdjintene ar +阿根廷 ar +阿根廷 ar +American Samoa as +Amerikanse Samoa as +ساموا الأمريكية as +Амэрыканскае Самоа as +Американски Самоа as +মার্কিন সামোয়া as +Samoa amerikanek as +Američka Samoa as +Samoa Americana as +Americká Samoa as +Samoa Americanaidd as +Samoa (USA) as +Amerikanisches Samoa as +Αμερικανική Σαμόα as +Amerika Samoo as +Samoa americana as +Ameerika Samoa as +Amerikar Samoa as +ساموای آمریکا as +Amerikan Samoa as +Samoa américaines as +Amerikaansk Samoa as +Samó Meiriceánach as +Samoa Americana as +סמואה האמריקנית as +अमेरिकी सामोआ as +Američka Samoa as +Amerikai Szamoa as +Bandaríska Samóa as +Samoa Americane as +アメリカンサモア as +សាមូអា អាមេរិក as +미국령 사모아 as +ອາເມລິກາເຫນືອ as +Amerikos Samoa as +Amerikas Samoa as +Американска Самоа as +Америк, Самоа as +Samoa Amerikana as +Amerikansk Samoa as +Amerikaansch Samoa as +Amerikaans Samoa as +Amerikansk Samoa as +ਅਮਰੀਕੀ ਸਾਮੋਆ as +Samoa Amerykańskie as +Samoa Americana as +Samoa Americana as +Samoa americană as +Американское Самоа as +Samowa Nyamerika as +Amerihkálaš Samoa as +Americká Samoa as +Ameriška Samoa as +Америчка Самоа as +Američka Samoa as +Amerikanska Samoa as +அமெரிக்கா சமோயா as +Самоаи Амрикоӣ as +อเมริกัน ซามัว as +Amerika Samoası as +Amerikalı Samoa as +Американське Самоа as +Америка Самоаси as +Samowa Amerikinne as +美属萨摩亚 as +美屬薩摩亞 as +Austria at +Oostenryk at +النمسا at +Avstriya at +Аўстрыя at +Австрия at +অস্ট্রিয়া at +Aostria at +Austrija at +Àustria at +Rakousko at +Awstria at +Østrig at +Österreich at +Αυστρία at +Aŭstrio at +اتریش at +Itävalta at +Eysturríki at +Autriche at +Eastenryk at +An Ostair at +אוסטריה at +आस्ट्रिया at +Austrija at +Ausztria at +Austurríki at +オーストリア at +អូទ្រីស at +오스트리아 at +ອອດສະເຕເລີຍ at +Austrija at +Austrija at +Австрија at +Австри at +Awtrija at +Østerrike at +Österriek at +Oostenrijk at +Austerrike at +ਆਸਟਰੀਆ at +Áustria at +Áustria at +Австрия at +Ositiriya at +Nuortariika at +Rakúsko at +Avstrija at +Аустрија at +Austrija at +I-Austria at +Österrike at +ஆஸ்த்திரியா at +Австрия at +ออสเตรีย at +Avusturya at +Австрія at +Австрия at +Ositiria at +Áo at +Otriche at +奥地利 at +奧地利 at +Australia au +Australië au +أستراليا au +Avustralya au +Аўстралія au +Австралия au +অস্ট্রেলিয়া au +Aostralia au +Australija au +Austràlia au +Austrálie au +Awstralia au +Australien au +Australien au +Αυστραλία au +Aŭstralio au +Austraalia au +استرالیا au +Australie au +Australië au +An Astráil au +Austrália au +אוסטרליה au +आस्ट्रेलिया au +Australija au +Ausztrália au +Ástralía au +オーストラリア au +អូស្ត្រាលី au +오스트레일리아 au +ອອດສະເຕເລີຍ au +Australija au +Austrālija au +Австралија au +Австрали au +Awstralja au +Australien au +Australië au +ਅਸਟਰੇਲੀਆ au +Austrália au +Austrália au +Австралия au +Ositaraliya au +Austrália au +Austrália au +Avstralija au +Аустралија au +Australija au +I-Australia au +Australien au +ஆஸ்த்திரேலியா au +Остролиё au +ออสเตรเลีย au +Avusturalya au +Австралія au +Австралия au +Ositiralia au +Úc au +Ostraleye au +澳大利亚 au +澳大利亞 au +Aruba aw +أروبا aw +Аруба aw +আরুবা aw +Arwba aw +Αρούμπα aw +Arubo aw +آروبا aw +ארובה aw +अरूबा aw +Arúba aw +オランダ自治領アルバ aw +អារូបា aw +아루바 aw +ເກມໄັພ່ aw +Аруба aw +Арува aw +ਅਰੂਬੀ aw +Аруба aw +Áruba aw +Аруба aw +அருபா aw +Арубо aw +อรูบา aw +Аруба aw +Аруба aw +Arouba aw +阿鲁巴 aw +阿魯巴 aw +Åland Islands ax +Åland Eilande ax +Острови Аланд ax +Illes Åland ax +Ålandské ostrovy ax +Åland-øerne ax +Aland ax +Νησιά Åland ax +Islas Aland ax +Ahvenamaa ax +Åland irlak ax +Ahvenanmaan saaret ax +Îles Åland ax +Åland-eilannen ax +Na hOileáin Åland ax +Illas Åland ax +Åland-szigetek ax +Álandseyjar ax +Isole Åland ax +オーランド諸島 ax +កោះ Åland ax +Åland salos ax +Острови Оланд ax +Åland-øyene ax +Åland-Inseln ax +Åland-eilanden ax +Åland-øyane ax +ਅਮਾਨ ਟਾਪੂ ax +Wyspy Åland ax +Ilhas Åland ax +Ilhas Åland ax +Аландские острова ax +Ibirwa by'Åland ax +Åland sullot ax +Ålandski otoki ax +Аландска острва ax +Alandska ostrva ax +Åland ax +หมู่เกาะอาลันด์ ax +Cayman Adaları ax +Aland Utrawları ax +Аландські острови ax +Аланд Ороллари ax +阿兰群岛 ax +奧蘭群島 ax +Azerbaijan az +أذربيجان az +Azərbaycan az +Азэрбайджан az +Азербайджан az +আজেরবাইজান az +Azerbeidjan az +Azerbejdžan az +Azerbaitjan az +Ázerbajdžánský az +Aserbaijan az +Azerbajdjan az +Aserbaidschan az +Αζερμπαϊτζάν az +Azerbajĝano az +Azerbaiján az +Aserbaidžaan az +آذربایجان az +Azerbaidäani az +Aserbadsjan az +Azerbeidjan az +An Asarbaiseáin az +אזרביג'ן az +अजरबैजान az +Azerbejdžan az +Azerbajdzsán az +Aserbaídsjan az +Azerbaigian az +アゼルバイジャン az +អាហ្ស៊ែរបែហ្សង់ az +아제르바이잔 az +ອາເຊີໄບຈັນ az +Azerbaidžanas az +Azerbaidžāna az +Азербејџан az +Азарбайжан az +Ażerbajġan az +Aserbajdsjan az +Aserbaidschan az +Azerbeidjan az +Aserbajdsjan az +ਅਜ਼ਰਬਾਈਜਾਨ az +Azerbejdżan az +Azerbaijão az +Azerbaijão az +Азербайджан az +Azeribayijani az +Aserbaižan az +Ázerbajdžánsky az +Azerbajdžan az +Азербејџан az +Azerbejdžan az +I-Azerbaijan az +அசர்பைசான் az +Озарбойҷон az +อาร์เซอร์ไบจัน az +Azerice az +Äzärbaycan az +Азербайджан az +Озарбайжон az +Azerbaydjan az +阿塞拜疆 az +亞塞拜然 az +Bosnia and Herzegovina ba +Bosnië en Herzegovina ba +البوسنا و الهرسك ba +Босьнія і Герцагавіна ba +Босна и Херцеговина ba +বসনিয়া এবং হারজিগোভিনা ba +Bosni hag Herzigovi ba +Bosna i Hercegovina ba +Bòsnia i Hercegovina ba +Bosna a Herzegovina ba +Bosnia a Hertsegofina ba +Bosnien-Herzegovina ba +Bosnien und Herzegowina ba +Βοσνία και Ερζεγοβίνη ba +Bosnio kaj Hercegovino ba +Bosnia y Herzegovina ba +Bosnia ja Hertsegovina ba +Bosnia eta Herzegovina ba +بوسنی و هرزگوین ba +Bosnia ja Herzegovina ba +Bosnia-Herzegovina ba +Bosnie herzégovine ba +Bosnië en Herzegovina ba +An Bhoisnia agus Heirseagóivéin ba +Bosnia e Herzegovina ba +בוסניה הרצגובינה ba +बोस्निया और हर्जेगोविना ba +Bosna i Hercegovina ba +Bosznia-Hercegovina ba +Bosnía og Hersegóvína ba +Bosnia e Erzegovina ba +ボスニアヘルツェゴビナ ba +បូស្ន៊ី និង​ហឺហ្ស៊េហ្គោវីណា ba +보스니아어와 헤르체고비나 ba +ບອສເນີຍ ແລະ ເຫີເຊີໂກວິນາ ba +Bosnija ir Hercegovina ba +Bosnija un Hercogovina ba +Босна и Херцеговина ba +Босни ба Херцеговина ba +Bożnia u Ħerżegovina ba +Bosnia-Hercegovina ba +Bosnien-Herzegowina ba +Bosnië en Herzegovina ba +Bosnia-Hercegovina ba +Bosnia le Herzegovina ba +ਬੋਸਨੀਆ ਤੇ ਹਰਜ਼ੀਗੋਵਿਨਾ ba +Bośnia i Hercegowina ba +Bósnia e Herzegovina ba +Bósnia Herzegovina ba +Bosnia şi Herţegovina ba +Босния и Герцеговина ba +Bosiniya na Herizegovina ba +Bosnia ja Hercegovina ba +Bosna a Hercegovina ba +Bosna in Hercegovina ba +Босна и Херцеговина ba +Bosna i Hercegovina ba +I-Bosnia kanye ne Herzegovina ba +Bosnien och Herzegovina ba +பொசுனியா மற்றும் ஹர்ஜிகோவினா ba +Босния ва Герсогавина ba +บอสเนียและเฮอร์เซโกวินา ba +Bosna Hersek ba +Bosnia wä Herzegovina ba +Боснія і Герцеговина ba +Босния ва Герцоговина ba +Mubosinia na Muhezegovina ba +Bosnia và Herzegovina ba +Bosneye ba +Bosnia ne Herzegovina ba +波斯尼亚和黑塞哥维那 ba +波士尼亞與赫塞哥維納 ba +Bosnia kanye ne-Herzegovina ba +Barbados bb +بربادوس bb +Барбадос bb +Барбейдос bb +বারবাডোস bb +Μπαρμπάντος bb +Barbado bb +باربادوس bb +Barbade bb +Barbadós bb +ברבדוס bb +बारबाडोस bb +バルバドス bb +បារបាដូស bb +바르바도스 bb +ບາລບາດອດສ bb +Barbadosas bb +Barbadosa bb +Барбадос bb +Барбодас bb +ਬਾਰਬਾਡੋਸ bb +Барбадос bb +Barubadosi bb +Барбадос bb +I-Barbados bb +பார்பேடாசு bb +Барбадос bb +บาร์บาดอส bb +Барбадос bb +Барбадос bb +Bårbades bb +巴巴多斯 bb +巴貝多 bb +Bangladesh bd +بنغلاديش bd +Banqladeş bd +Банглядэш bd +Бангладеш bd +বাংলাদেশ bd +Bangladaech bd +Bangladeš bd +Bangladéš bd +Bangladesch bd +Μπαγκλαντές bd +Bangladeŝo bd +بنگلادش bd +An Bhanglaidéis bd +בנגלדש bd +बांग्लादेश bd +Bangladeš bd +Banglades bd +Bangladess bd +バングラデシュ bd +បង់ក្លាដេស្ហ bd +방글라데시 bd +ບັງຄະລາເທດ bd +Bangladešas bd +Bangladeša bd +Бангладеш bd +Бангладеш bd +Bangladexx bd +Bangladesch bd +ਬੰਗਲਾਦੇਸ਼ bd +Bangladesz bd +Bangladeş bd +Бангладеш bd +Bangaladeshi bd +Bangladéš bd +Bangladeš bd +Бангладеш bd +Bangladeš bd +I-Bangladesh bd +பங்களாதேசு bd +Банглодеш bd +บังคลาเทศ bd +Bangladeş bd +Bangladeş bd +Бангладеш bd +Бангладеш bd +孟加拉国 bd +孟加拉 bd +Belgium be +België be +بلجيكا be +Belçika be +Бэльгія be +Белгия be +বেলজিয়াম be +Belgia be +Belgija be +Bèlgica be +Belgie be +Gwlad Belg be +Belgien be +Belgien be +Βέλγιο be +Belgio be +Bélgica be +Belgia be +Belgika be +بلژیک be +Belgia be +Belgia be +Belgique be +België be +An Bheilg be +Bélxica be +בלגיה be +बेल्जियम be +Belgija be +Belgia be +Belgía be +Belgio be +ベルギー be +បែលហ្ស៊ិក be +벨기에 be +ເບລຢ່ງມ be +Belgija be +Beļģija be +Белгија be +Белги be +Belġju be +Belgia be +Belgien be +België be +Belgia be +Bèlgica be +ਬੈਲਜੀਅਮ be +Belgia be +Bélgica be +Bélgica be +Belgia be +Бельгия be +Ububiligi be +Belgia be +Belgicko be +Belgija be +Белгија be +Belgija be +I-Belgium be +Belgien be +பெல்சியம் be +Белгия be +เบลเยียม be +Belçika be +Belgia be +Бельгія be +Белгия be +Bỉ be +Beldjike be +比利时 be +比利時 be +Burkina Faso bf +بوركينا فاسو bf +Буркіна Фасо bf +Буркина Фасо bf +বারকিনা ফাসো bf +Bwrcina Ffaso bf +Μπουρκίνα Φάσο bf +Burkino bf +بورکینافاسو bf +Buircíne Fasó bf +בורניקה פאסו bf +बुर्किना फासो bf +Burkina faso bf +Búrkína Fasó bf +ブルキナファソ bf +ប៊ូរគីណាហ្វាសូ bf +부르키나 파소 bf +ຕຸລະກີ bf +Буркина Фасо bf +Буркина Фасо bf +ਬੁਰਕਿਨਾ ਫਾਸੋ bf +Буркина-Фасо bf +Burukina Faso bf +Буркина Фасо bf +பர்கினா ஃபசோ bf +Буркина Фасу bf +เบอร์กินาฟาโซ bf +Буркіна-Фасо bf +Буркина-Фассо bf +Bourkina Fasso bf +布基纳法索 bf +布吉納法索 bf +Bulgaria bg +Bulgarye bg +بلغاريا bg +Bolgarıstan bg +Баўгарыя bg +България bg +বুলগেরিয়া bg +Bulgari bg +Bugarska bg +Bulgària bg +Bulharsko bg +Bwlgaria bg +Bulgarien bg +Bulgarien bg +Βουλγαρία bg +Bulgario bg +Bulgaaria bg +بلغارستان bg +Bulgarie bg +Bulgarije bg +An Bhulgáir bg +Bulgária bg +בולגריה bg +बुल्गारिया bg +Bugarska bg +Bulgária bg +Búlgaría bg +ブルガリア bg +ប៊ុលហ្ការី bg +불가리아 bg +ບັນແກເລີຍ bg +Bulgarija bg +Bulgārija bg +Бугарија bg +Болгари bg +Bulgarija bg +Bulgarien bg +Bulgarije bg +ਬੁਲਗਾਰੀਆ bg +Bułgaria bg +Bulgária bg +Bulgária bg +Болгария bg +Buligariya bg +Bulgária bg +Bulharsko bg +Bolgarija bg +Бугарска bg +Bugarska bg +I-Bulgaria bg +Bulgarien bg +பல்கேரியா bg +Булғористон bg +บัลแกเรีย bg +Bulgaristan bg +Болгарія bg +Болгария bg +Baligaria bg +Bulgåreye bg +保加利亚 bg +保加利亞 bg +Bahrain bh +البحرين bh +Бахрэйн bh +Бахрейн bh +বাহরেন bh +Barein bh +Bahrein bh +Bahrajn bh +Μπαχρέιν bh +Barejno bh +Bahrein bh +Bahrein bh +بحرین bh +Baghrein bh +Bairéin bh +Barein bh +בחריין bh +बहारीन bh +Barein bh +バーレーン bh +បារ៉ែន bh +바레인 bh +ຖັກກ່ງວ bh +Bahreinas bh +Bahreina bh +Бахреин bh +Бахрайн bh +Baħrain bh +Baghrein bh +ਬਹਿਰੀਨ bh +Bahrajn bh +Bahrein bh +Бахрейн bh +Bahirayini bh +Bahrajn bh +Bahrajn bh +Бахреин bh +Bahrein bh +I-Bahrain bh +Bahrein bh +பஹ்ரைன் bh +Баҳрайн bh +บาห์เรียน bh +Bahreyn bh +Bahreyn bh +Бахрейн bh +Баҳрайн bh +Bareyn bh +巴林 bh +巴林 bh +Burundi bi +بوروندي bi +Бурундзі bi +Бурунди bi +বুরুন্ডি bi +Bwrwndi bi +Μπουρουντί bi +Burundo bi +بروندی bi +An Bhurúin bi +בורונדי bi +बुरूंडी bi +Búrúndí bi +ブルンジ bi +ប៊ូរុនឌី bi +부룬디 bi +ເຄອຣດ bi +Burundija bi +Бурунди bi +Бурунди bi +ਬੁਰੁਨਡੀ bi +Бурунди bi +Бурунди bi +புருன்டி bi +Бурундӣ bi +บูรันดิ bi +Бурунді bi +Бурунди bi +Bouroundi bi +布隆迪 bi +浦隆地 bi +Benin bj +Denin bj +بينين bj +Бэнін bj +Бенин bj +বেনিন bj +Μπενίν bj +Benino bj +بنین bj +Bénin bj +Beinin bj +בנין bj +बेनिन bj +Benín bj +ベナン bj +បេណាំង bj +베냉 bj +ບອສເນີຍ bj +Benina bj +Бенин bj +Бенин bj +ਬੀਨਿਨ bj +Benim bj +Бенин bj +Bene bj +Бенин bj +பெனின் bj +Бенини bj +เบนิน bj +Бенін bj +Бенин bj +贝宁 bj +貝南 bj +Bermuda bm +برمودا bm +Бэрмуды bm +Бермуда bm +বার্মুডা bm +Bermud bm +Bermudy bm +Bermwda bm +Bermudas bm +Βερμούδες bm +Bermudoj bm +برمودا bm +Bermudes bm +Beirmiúda bm +ברמודה bm +बरमूडा bm +Bermúdaeyjar bm +英領バーミューダ bm +ប៊េរមូដា bm +버뮤다 bm +ເຍລລະມັນ bm +Bermudų bm +Bermudas bm +Бермуди bm +Бермуда bm +ਬੀਰਮੁਡਾ bm +Bermudy bm +Bermude bm +Бермудские Острова bm +Berimuda bm +Bermudy bm +Bermudi bm +Бермуда bm +பெருமுடா bm +Бермудо bm +เบอร์มิวดา bm +Бермуди bm +Бермуда Ороллари bm +Bermudes bm +百慕大 bm +百慕達 bm +Brunei Darussalam bn +بروناي دار السلام bn +Брунэй bn +Бруней bn +ব্রুনেই দারএসসলাম bn +Darussalam Brunei bn +Brunej bn +Brwnei Darwsalam bn +Brunei bn +Μπρουνέι Νταρουσαλάμ bn +Brunejo bn +Brunei bn +برونویی بیت‌المقدس bn +Brunei bn +Brúiné bn +בורניי דרוסלם bn +ब्रूनेई दारेस्सलाम bn +Brunei Szultánság bn +Brúnei Darussalam bn +Brunei bn +ブルネイ bn +ប្រ៊ុយណេ bn +브루나이 bn +ເບລາລັສເຊີຍ bn +Bruneja Darusalama bn +Брунеи Дар ес Салам bn +Бруней Даруссалам bn +Brunei bn +Brunei bn +Brunei bn +ਬਰੂਨੀ ਡਾਰੂਸਲਾਮ bn +Brunei Dar-es-Salam bn +Brunei bn +Бруней bn +Buruneyi Darusalamu bn +Brunei bn +Brunei Darusalam bn +Брунеј Дарусалам bn +Brunej Darusalam bn +ப்ரூனை டருசலாம் bn +Брунеи Байтулмуқаддас bn +บรูไนดูรัสซาลาม bn +Brunei bn +Бруней Даруссалам bn +Бруней Доруссалом bn +Bruney Darussalam bn +文莱达鲁萨兰 bn +文萊達魯薩蘭 bn +Bolivia bo +Bolivië bo +بوليفيا bo +Boliviya bo +Балівія bo +Боливия bo +বলিভিয়া bo +Bolivija bo +Bolívia bo +Bolívie bo +Bolifia bo +Bolivien bo +Βολιβία bo +Bolivio bo +Boliivia bo +بولیوی bo +Bolivie bo +An Bholaiv bo +Bolívia bo +בוליביה bo +बोलिविया bo +Bolivija bo +Bolívia bo +Bólivía bo +ボリビア bo +បូលីវី bo +볼리비아 bo +ໂບລີເວີຍ bo +Bolivija bo +Bolīvija bo +Боливија bo +Боливи bo +Bolivja bo +Bolivien bo +ਬੋਲਵੀਆ bo +Boliwia bo +Bolívia bo +Bolívia bo +Боливия bo +Boliviya bo +Bolívia bo +Bolivija bo +Боливија bo +Bolivija bo +I-Bolivia bo +பொலிவியா bo +Боливия bo +โบลิเวีย bo +Bolivya bo +Болівія bo +Боливия bo +Boliveye bo +玻利维亚 bo +玻利維亞 bo +Brazil br +Brazilië br +البرازيل br +Braziliya br +Бразылія br +Бразилия br +ব্রাজিল br +Brasil br +Brazílie br +Brasil br +Brasilien br +Brasilien br +Βραζιλία br +Brazilo br +Brasil br +Brasiilia br +Brasil br +برزیل br +Brasilia br +Brésil br +Brazilië br +An Bhrasaíl br +Brasil br +ברזיל br +ब्राजील br +Brazília br +Brasilía br +Brasile br +ブラジル br +ប្រេហ្ស៊ីល br +브라질 br +ບາຊີລ br +Brazilija br +Brazīlija br +Бразил br +Бразил br +Brażil br +Brasil br +Brasilien br +Brazilië br +Brasil br +Brasil br +ਬਰਾਜ਼ੀਲ br +Brazylia br +Brasil br +Brasil br +Brazilia br +Бразилия br +Burezile br +Brasil br +Brazília br +Brazilija br +Бразил br +I-Brazil br +Brasilien br +பிரேசில் br +Бразил br +บราซิล br +Brezilya br +Бразилія br +Бразилия br +Burazili br +Braezi br +巴西 br +巴西 br +Bahamas bs +جزر الباهاما bs +Багамы bs +Бахамски острови bs +বাহামাস bs +Bahami bs +Bahames bs +Bahamy bs +Ynysoedd Bahama bs +Μπαχάμες bs +Bahamoj bs +Bahama bs +باهاماس bs +Bahaman saaret bs +Na Bahámaí bs +Baamas bs +בהמס bs +बहामा bs +Bahamák bs +Bahamaeyjar bs +バハマ bs +បាហាម៉ា bs +바하마 bs +ປານາມາ bs +Bahamų bs +Бахами bs +Бахамас bs +Baħamas bs +ਬਾਹਾਮਾਸ bs +Bahamy bs +Багамские острова bs +Bahamasi bs +Bahamy bs +Bahami bs +Бахами bs +Bahami bs +பனாமா bs +Боҳомос bs +บาฮามา bs +Bahamalar bs +Багами bs +Багама Ороллари bs +巴哈马 bs +巴拿馬 bs +Bhutan bt +بوتان bt +Бутан bt +Бутан bt +ভূটান bt +Butañ bt +Butan bt +Bhútán bt +Bhwtan bt +Μπουτάν bt +Butano bt +Bhután bt +بوتان bt +Bhoutan bt +An Bhútáin bt +Bután bt +בהוטן bt +भूटान bt +Bhután bt +Bútan bt +ブータン bt +ប៊ូតាន bt +부탄 bt +ຖັກກ່ງວ bt +Bhutano bt +Butāna bt +Бутан bt +Бутан bt +Butan bt +ਭੁਟਾਨ bt +Butão bt +Butão bt +Butan bt +Бутан bt +Butani bt +Butan bt +Бутан bt +Butan bt +பூடான் bt +Бутон bt +ภูฏาน bt +Butan bt +Бутан bt +Бутан bt +Boutan bt +不丹 bt +不丹 bt +Botswana bw +بوتسوانا bw +Батсвана bw +Ботсуана bw +বটসওয়ানা bw +Bocvana bw +Μποτσουάνα bw +Bocvano bw +بوتسووانا bw +An Bhotsuáin bw +Botsuana bw +בוצאונה bw +बोत्सवाना bw +Botsvana bw +Botsvana bw +ボツワナ bw +បុតស្វាណា bw +보츠와나 bw +ບອດສເນີຍ bw +Botsvanos bw +Botsvāna bw +Боцвана bw +Ботсвана bw +ਬੋਟਸਵਾਨਾ bw +Botsuana bw +Ботсвана bw +Botsvana bw +Боцвана bw +Bocvana bw +பாட்ஸ்வனா bw +Ботсвана bw +บอทสวานา bw +Botsvana bw +Ботсвана bw +Боцвана bw +Boswana bw +博茨瓦纳 bw +波札那 bw +Belarus by +روسيا البيضاء by +Беларусь by +Беларус by +বেলারুস by +Belarusi by +Bjelorusija by +Bielorússia by +Bělorusko by +Belarws by +Hviderusland by +Weißrussland by +Λευκορωσία by +Belorusio by +Valgevene by +بلاروس by +Valkovenäjä by +Hvítarusland by +Bélarus by +Wyt-Rusland by +An Bhealarúis by +Bielorúsia by +בלרוס by +बेलारूस by +Bjelorusija by +Fehéroroszország by +Hvíta-Rússland by +Bielorussia by +ベラルーシ by +បេឡារុស្ស by +벨라루스 by +ເບລາລັສ by +Baltarusija by +Baltkrievija by +Белорусија by +Цагаан орос by +Hviterussland by +Wittrussland by +Wit-Rusland by +Kviterussland by +ਬੇਲਾਰੂਸ by +Białoruś by +Bielorrússia by +Беларусь by +Belarusi by +Vilges-Ruošša by +Bielorusko by +Belorusija by +Белорусија by +Belorusija by +I-Belarus by +Vitryssland by +பெலாரூசு by +Белорусиё by +เบลารุส by +Білорусія by +Белорус by +Belaruss by +白俄罗斯 by +白俄羅斯 by +Belize bz +بيليز bz +Бэлізе bz +Белийз bz +বেলিজ bz +Beliz bz +Bel?s bz +Μπελίζε bz +Belizo bz +بلیز bz +An Bheilís bz +בליז bz +बेलिज bz +Belís bz +ベリーズ bz +បេលីហ្ស bz +벨리즈 bz +ເບລຍ່ງມ bz +Belizo bz +Beliza bz +Белизе bz +Белизэ bz +Beliż bz +ਬੀਲੀਜ਼ਿ bz +Белиз bz +Белиз bz +Beliz bz +பெல்சியம் bz +Белиз bz +เบลไลซ์ bz +Beliz bz +Беліз bz +Белиз bz +伯利兹 bz +比利時 bz +Default C +Standaard C +افتراضي C +Ön Qurğulu C +Па ўмаўчаньні C +По подразбиране C +ডিফল্ট C +Dre ziouer C +Omissió C +Výchozí C +Rhagosodedig C +Standard C +Standard C +Προκαθορισμένο C +Apriora C +Predeterminado C +Vaikimisi C +Lehenetsia C +پیش‌فرض C +Oletus C +Forsettur C +Par défaut C +Standert C +Réamhshocrú C +Por Omisión C +ברירת מחדל C +डिफ़ॉल्ट C +Uobičajeno C +Standard C +Alapértelmezett C +Standar C +Sjálfgefið C +Predefinito C +標準 C +លំនាំដើម C +기본 C +ຄ່າປະລິຍາຍ C +Numatyta C +Noklusētais C +Почетно C +Стандарт C +Normali C +Standard C +Standard C +Standaard C +Standard C +Thuso ya Tshoganetso C +Omission C +ਮੂਲ C +Domyślnie C +Por Omissão C +Padrão C +Implicit C +По умолчанию C +Mburabuzi C +Standárda C +Štandardný C +Privzeto C +Подразумевано C +Podrazumevano C +Förval C +முன்னிருப்பு C +Пешфарзӣ C +ค่าปริยาย C +Öntanımlı C +Ğädäti C +Типовий C +Андоза C +Mặc định C +Prémetou C +Okwendalo C +默认 C +預設 C +Okwendalo C +Canada ca +Kanada ca +كندا ca +Kanada ca +Канада ca +Канада ca +কানাডা ca +Kanada ca +Kanada ca +Canadà ca +Kanada ca +Kanada ca +Καναδάς ca +Kanado ca +Canadá ca +Kanada ca +Kanada ca +کانادا ca +Kanada ca +Kanada ca +Kanada ca +Ceanada ca +Canadá ca +קנדה ca +कनाडा ca +Kanada ca +Kanada ca +Kanada ca +Kanada ca +カナダ ca +កាណាដា ca +캐나다 ca +ແຄນາດາ ca +Kanada ca +Kanāda ca +Канада ca +Канад ca +Kanada ca +Kanada ca +ਕੈਨੇਡਾ ca +Kanada ca +Canadá ca +Canadá ca +Канада ca +Kanada ca +Kanada ca +Kanada ca +Канада ca +Kanada ca +I-Canada ca +Kanada ca +கனடா ca +Канада ca +แคนาดา ca +Kanada ca +Kanada ca +Канада ca +Канада ca +加拿大 ca +加拿大 ca +Cocos (Keeling) Islands cc +Kokos Eilande cc +جزر كوكوس (كيلينغ) cc +Кокосови острови cc +কোকোস (কীলিং) দ্বীপপুঞ্জ cc +Inizi Koko (Keeling) cc +Kokosovo (Keeling) ostrvo cc +Illes Cocos (Keeling) cc +Kokosové ostrovy (Keeling) cc +Ynysoedd y Cocos (Keeling) cc +Cocos/Keeling-Inseln cc +Νήσοι Κόκος (Κήλινγκ) cc +Kokosinsuloj cc +Islas Cocos (Keeling) cc +Kookossaared cc +Cocos Irlak cc +جزایر کوکوس کیلینگ cc +Cookinsaaret cc +Îles Cocos cc +Oileán na gCócónna (Keeling) cc +Illas Cocos (Keeling) cc +איי קוקוס cc +कोकोस (कीलिंग) आइलैंड्स cc +Cocos (Keeling) Otoci cc +Kókusz-szigetek (Keeling) cc +Kókoseyjar cc +Isole Cocos (Keeling) cc +オーストラリア領ココス島 cc +កោះ Cocos (Keeling) cc +코코스 제도 cc +Kokosu salas cc +Острови Кокос (Килинг) cc +Cocos (Keeling) арлууд cc +Gżejjer Cocos (Keeling) cc +Kokosøyene cc +Cocos- (Keeling-) Inseln cc +Kokosøyane cc +ਕੋਕੋਸ(ਕਿਨਿੰਗ) ਟਾਪੂ cc +Wyspy Kokosowe (Keelinga) cc +Ilhas Cocos (Keeling) cc +Ilhas Cocos cc +Insulele Cocos (Keeling) cc +Кокосовые (Килинг) острова cc +Ibirwa Kokosi cc +Kokosullut cc +Kokosove Ostrovy cc +Kokosovi (Keelingovi) otoki cc +Кокосова (Килингова) острва cc +Kokosova (Kilingova) ostrva cc +Kokosöarna cc +கோகோஸ் (கீலிங்) தீவுகள் cc +Ҷазираи Кокос (Килинг) cc +หมู่เกาะโคคอส (Keeling) cc +Keeling Adaları cc +Kokos (Keeling) Utrawları cc +Кокосові острови cc +Кокос (Килинг) Ороллари cc +Iyes Cocos cc +科科斯群岛 cc +可可斯群島 cc +Congo, The Democratic Republic of the cd +Kongo, Demokratiese republiek van die cd +Дэмакратычная Рэспубліка Конга cd +ДР Конго cd +কঙ্গোর গণতান্ত্রিক প্রজাতন্ত্র cd +Kongo, Demokratska republika cd +Congo, República Democràtica del cd +Kongo cd +Congo, Gweriniaeth Democrataidd y cd +Congo, den demokratiske republik cd +Kongo, Republik cd +Κονγκό, Δημοκρατία του cd +Kongo, la Demokratia Respubliko de la cd +Congo, República democrática del cd +Kongo (DV) cd +Kongoko Errepublika Demokratikoa cd +Kongon demokraattinen tasavalta cd +République Démocratique du Congo cd +Kongo, de democratische republyk van de cd +Poblacht Dhaonlathach an Chongó cd +Congo, República Democrática do cd +קונגו, הרפובליקה הדמוקרטית של cd +डेमोक्रेटिक रिपब्लिक ऑफ कॉगो cd +Kongói Demokratikus Köztársaság cd +Kongó, Austur cd +Congo, Repubblica Democratica del cd +コンゴ,民主共和国 cd +សាធារណរដ្ឋ​ប្រជាធិបតេយ្យ​កុងហ្គោ cd +Kongo demokratinė respublika cd +Kongo demokrātiskā republika cd +Конго, Демократска Република на cd +Kongo (RD) cd +Kongo cd +Kongo (De demokraatsche Republiek) cd +Congo, Democratische republiek cd +Kongo cd +ਕਾਂਗੋ, ਲੋਕਤੰਤਰੀ ਗਣਰਾਜ cd +Republika Demokratyczna Kongo cd +Congo, República Democrática do cd +República Democrática do Congo cd +Congo, Republica Democrată cd +Демократическая Республика Конго cd +Kongo, Repubulika Iharanira Demokarasi ya cd +Kongo cd +Demokratická Republika Kongo cd +Kongo, demokratična republika cd +Конго, Демократска Република cd +Kongo, Demokratska Republika cd +Demokratiska republiken Kongo cd +கான்கோ, குடியரசு cd +Ҷумҳурии демократии Ҳонконг cd +สาธารณรัฐประชาธิปไตยคองโก cd +Demokratik Kongo Cumhuriyeti cd +Kongo, Demokrat Cömhüriäte cd +Конго, демократична республіка cd +Конго Демократик Республикаси cd +Congo, republike democratike cd +刚果民主共和国 cd +剛果民主共和國 cd +Central African Republic cf +Sentrale Afrika Republiek cf +جمهورية أفريقيا الوسطى cf +Цэнтральнаафрыканская Рэспубліка cf +ЦАР cf +মধ্য আফ্রিকান রিপাবলিক cf +Republik centrafricaine cf +Centralnoafrička Republika cf +República Centro Africana cf +Středoafrická republika cf +Gweriniaeth Canolig Affrica cf +Central-afrikanske Republik cf +Zentralafrikanische Republik cf +Δημοκρατία Κεντρικής Αφρικής cf +Mezafrika Respubliko cf +República Centroafricana cf +Kesk-Aafrika Vabariik cf +Afrika Erdiko Errepublika cf +جمهوری افریقای مرکزی cf +Keski-Afrikan tasavalta cf +République centrafricaine cf +Sintraal Afrikaanse Republyk cf +Poblacht na hAfraice Láir cf +República Centro Africana cf +הרפובליקה האפריקנית התיכונה cf +सेंट्रल अफ्रीकन रिपब्लिक cf +Centralna Afrička Republika cf +Közép-Afrikai Köztársaság cf +Mið-Afríkulýðveldið cf +Repubblica Centrafricana cf +中央アフリカ共和国 cf +សាធារណរដ្ឋ​អាហ្វ្រិក​កណ្ដាល cf +중앙 아프리카 공화국 cf +ໂດມິນິກັນ cf +Centrinės Afrikos Respublika cf +Centrālāfrikas republika cf +Централноафриканска Република cf +Төв африкын ард улс cf +Repubblika Ċentrali Afrikana cf +Den sentralafrikanske republikk cf +Zentraalafrikaansche Republiek cf +Centraal Afrikaanse Republiek cf +Den sentralafrikanske republikken cf +ਕੇਂਦਰੀ ਅਫਰੀਕੀ ਗਣਰਾਜ cf +Republika Środkowej Afryki cf +República Central Africana cf +República da África Central cf +Republica Centrafricană cf +Центрально-Африканская Республика cf +Repubulika ya Santara Afurika cf +Guovddášafrihkálaš republihkka cf +Stredoafrická Republika cf +Centralnoafriška republika cf +Централноафричка Република cf +Centralnoafrička Republika cf +Centralafrikanska Republiken cf +மைய ஆப்பிரிக்க குடியரசு cf +Ҷумҳурии Африқои Марказӣ cf +สาธารณรัฐอัฟริกากลาง cf +Orta Afrika Cumhuriyeti cf +Üzäk Afrika Cömhüriäte cf +Центральна африканська республіка cf +Марказий Африка Республикаси cf +Cộng hoà Trung Phi cf +Cintrafrike cf +中非共和国 cf +多明尼加共和國 cf +Congo cg +Konsole cg +الكونغو cg +Конга cg +Конго cg +কঙ্গো cg +Kongo cg +Kongo cg +Kongo cg +Kongo cg +Κονγκό cg +Kongo (Brazavila) cg +Kongo cg +Kongo cg +کنگو cg +Kongo cg +Kongo cg +Congó cg +קונגו cg +कोंगो cg +Kongo cg +Kongó cg +Kongó, Vestur cg +コンゴ cg +កុងហ្គោ cg +콩고 cg +ຄອນໂໍຊລ cg +Kongo cg +Kongo cg +Конго cg +Конго cg +Kongo cg +Kongo-Brazaville cg +Kongo cg +Kongo-Brazaville cg +ਕਾਂਗੋ cg +Kongo cg +Конго cg +Kongo cg +Kongo cg +Kongo cg +Kongo cg +Конго cg +Kongo cg +Kongo cg +கான்கோ cg +Конго cg +คองโก cg +Kongo cg +Kongo cg +Конго cg +Конго cg +刚果 cg +剛果 cg +Switzerland ch +Switserland ch +سويسرا ch +İsveçrə ch +Швэйцарыя ch +Швейцария ch +সুইজারল্যাণ্ড ch +Suis ch +Švicarska ch +Suïssa ch +Švýcarsko ch +Y Swistir ch +Schweiz ch +Schweiz ch +Ελβετία ch +Svislando ch +Suiza ch +Šveits ch +Suitza ch +سوییس ch +Sveitsi ch +Suisse ch +Switserlân ch +An Eilvéis ch +Suíza ch +שוייץ ch +स्विट्जरलैंड ch +Švicarska ch +Svájc ch +Swiss ch +Sviss ch +Svizzera ch +スイス ch +ស្វ៊ីស ch +스위스 ch +ສະວິສເຊີແລນ ch +Šveicarija ch +Šveice ch +Швајцарија ch +Швецарь ch +Svizzera ch +Sveits ch +Swiez ch +Zwitserland ch +Sveits ch +Suissa ch +ਸਵਿਟਜ਼ਰਲੈਂਡ ch +Szwajcaria ch +Suíça ch +Suíça ch +Elveţia ch +Швейцария ch +Swazilande ch +Šveica ch +Švajčiarsko ch +Švica ch +Швајцарска ch +Švajcarska ch +I-Switzerland ch +Schweiz ch +சுவிட்சர்லாந்து ch +Свитзерланд ch +สวิสเซอร์แลนด์ ch +İsviçre ch +İswiçrä ch +Швейцарія ch +Швейцария ch +Thuỵ Sĩ ch +Swisse ch +瑞士 ch +瑞士 ch +Cote d'ivoire ci +ساحل العاج ci +Бераг Слановай Косьці ci +Кот Дивоар ci +Aod an Olifant ci +Obala Slonovače ci +Costa d'ivori ci +Pobřeží slonoviny ci +Y Traeth Ifori ci +Elfenbenskysten ci +Ακτή Ελεφαντοστού ci +Eburio ci +Costa de Marfil ci +Cote d'Ivoire ci +Boli kosta ci +کُتِ دیوُیر ci +Côte d'Ivoire ci +Ivoorkust ci +An Cósta Eabhair ci +कोट डि'वॉरे ci +Baci kocke ci +Elefántcsontpart ci +Fílabeinsströndin ci +Costa d'Avorio ci +コートジボアール ci +កូដឌីវ័រ ci +코트디부아르 ci +ປ່ອຍຫມາກກະລອກ ci +Kotdivuāra ci +Брегот на Слоновата Коска ci +Kosta tal-Avorju ci +Elfenbenskysten ci +Elfenbeenküst ci +Ivoorkust ci +Elfenbeinskysten ci +ਕਾਂਟੋ ਡੀਵੋਇਰੀ ci +Wybrzeże Kości Słoniowej ci +Costa do Marfim ci +Coasta de Azur ci +Кот Д'Ивуар ci +Kote divuware ci +Elfenčalánriddu ci +Slonokoščena obala ci +Обала слоноваче ci +Obala slonovače ci +Elfenbenskusten ci +Соҳили Оҷ ci +อ่าวไอวอรี ci +Кот Д'Івуар ci +Кот д'Ивуар ci +Bờ biển ngà ci +Coisse d' Ivwere ci +科特迪瓦 ci +象牙海岸 ci +Cook islands ck +Cook Eilande ck +جزر كوك ck +Астравы Кука ck +Острови Кук ck +কুক দ্বীপপুঞ্জ ck +Inizi Kook ck +Kukova ostrva ck +Illes Cook ck +Cookovy ostrovy ck +Ynysoedd Cook ck +Cook-øerne ck +Cook-Inseln ck +Νησιά Κουκ ck +Kukinsuloj ck +Islas Cook ck +Cooki saared ck +Cook Irlak ck +جزایر کوک ck +Cooksaaret ck +Îles Cook ck +Oileáin Chook ck +Illas Cook ck +איי קוק ck +कुक आइलैंड ck +Cook otoci ck +Cook-szigetek ck +Cooks-eyjar ck +Isole Cook ck +ニュージーランド自治領クック諸島 ck +កោះ Cook ck +쿡 제도 ck +ຄຸກກີ້ ck +Kuko salų ck +Kuka salas ck +Кукови острови ck +Cook арлууд ck +Gżejjer Cook ck +Cookøyene ck +Cookinseln ck +Cook Eilanden ck +Cookøyane ck +ਕੁੱਕ ਟਾਪੂ ck +Wyspy Cooka ck +Ilhas Cook ck +Ilhas Cook ck +Insulele Cook ck +Острова Кука ck +Ibirwa bya Kuke ck +Cooksullut ck +Cookove ostrovy ck +Cookovi otoki ck +Кукова острва ck +Kukova ostrva ck +Cooköarna ck +குக் தீவு ck +Ҷазираи Кук ck +หมู่เกาะคุก ck +Cook Adaları ck +Kok Utrawları ck +Острови Кука ck +Кук Ороллари ck +Iyes Cook ck +库克群岛 ck +庫克群島 ck +Chile cl +Chilië cl +تشيلي cl +Şili cl +Чылі cl +Чили cl +চিলি cl +Čile cl +Xile cl +Tsile cl +Χιλή cl +Ĉilio cl +Tšiili cl +Txile cl +شیلی cl +Chili cl +Chili cl +An tSile cl +צ'ילה cl +चिली cl +Čile cl +Chili cl +Cile cl +チリ cl +ឈីលី cl +칠레 cl +ຊີລີ cl +Čilė cl +Čīle cl +Чиле cl +Чили cl +Ċile cl +Chili cl +ਚਿੱਲੀ cl +Cile cl +Чили cl +Shili cl +Čile cl +Čile cl +Чиле cl +Čile cl +I-Chile cl +சிலி cl +Чилли cl +ชิลี cl +Şili cl +Çili cl +Чилі cl +Чили cl +Chi lê cl +Tchili cl +智利 cl +智利 cl +Cameroon cm +Kameroon cm +الكاميرون cm +Камэрун cm +Камерун cm +ক্যামেরুন cm +Kameroun cm +Kamerun cm +Camerun cm +Kamerun cm +Y Camer?n cm +Cameroun cm +Kamerun cm +Καμερούν cm +Kameruno cm +Camerún cm +Kamerun cm +Kamerun cm +کامرون cm +Kamerun cm +Cameroun cm +Kameroen cm +Camarún cm +Camerún cm +קמרון cm +कैमरून cm +Kamerun cm +Kamerun cm +Kamerún cm +Camerun cm +カメルーン cm +កាមេរូន cm +카메룬 cm +ຕາລາງງານ - K cm +Kamerūno cm +Kamerūna cm +Камерун cm +Камерун cm +Kamerun cm +Kamerun cm +Kamerun cm +Cameroen cm +Kamerun cm +ਕੈਮਰੂਨ cm +Kamerun cm +Camarões cm +Camarões cm +Camerun cm +Камерун cm +Kameruni cm +Kamerun cm +Komerun cm +Kamerun cm +Камерун cm +Kamerun cm +Kamerun cm +கமீரூன் cm +Камерун cm +คาเมรูน cm +Kamerun cm +Kameroon cm +Камерун cm +Камерун cm +Camrone cm +喀麦隆 cm +喀麥隆 cm +China cn +الصين cn +Çin cn +Кітай cn +Китай cn +চীন cn +Sina cn +Kina cn +Xina cn +Čína cn +Tseina cn +Kina cn +Κίνα cn +Ĉinujo cn +Hiina cn +Txina cn +چین cn +Kiina cn +Kina cn +Chine cn +An tSín cn +סין cn +चीन cn +Kina cn +Kína cn +Cina cn +Kína cn +Cina cn +中国 cn +ចិន cn +중국 cn +ຈີນ cn +Kinija cn +Ķīna cn +Кина cn +Хятад cn +Ċina cn +Kina cn +Kina cn +Xina cn +ਚੀਨ cn +Chiny cn +Китай cn +Ubushinwa cn +Kiinná cn +Čína cn +Kitajska cn +Кина cn +Kina cn +I-China cn +Kina cn +சீனா cn +Хитой cn +จีน cn +Çin cn +Çin cn +Китай cn +Хитой cn +Trung Quốc cn +Chine cn +中国 cn +中國 cn +Colombia co +Colombië co +كولمبيا co +Калюмбія co +Колумбия co +কলোম্বিয়া co +Kolumbi co +Kolumbija co +Colòmbia co +Kolumbie co +Kolumbien co +Κολομβία co +Kolumbio co +Kolumbia co +Kolonbia co +کلمبیا co +Kolumbia co +Colombie co +Columbia co +An Cholóim co +Colómbia co +קולומביה co +कोलम्बिया co +Kolumbija co +Kolumbia co +Kólumbía co +コロンビア co +កូឡុំប៊ី co +콜롬비아 co +ໂຄລຳເບີຍ co +Kolumbija co +Kolumbija co +Колумбија co +Колумб co +Kolumbja co +Kolumbien co +Columbia co +ਕੋਲੰਬੀਆ co +Kolumbia co +Colômbia co +Colômbia co +Columbia co +Колумбия co +Kolombiya co +Kolombia co +Kolumbia co +Kolumbija co +Колумбија co +Kolumbija co +I-Colombia co +கொலம்பியா co +Колумбия co +โคลัมเบีย co +Kolombiya co +Kolombia co +Колумбія co +Колумбия co +Colombeye co +Columbia co +哥伦比亚 co +哥倫比亞 co +Costa Rica cr +كوستاريكا cr +Коста Рыка cr +Коста Рика cr +কোস্টা রিকা cr +Kosta Rika cr +Kostarika cr +Kostarika cr +Κόστα Ρίκα cr +Kostariko cr +کاستاریکا cr +Kosta Rika cr +Cósta Ríce cr +קוסטה ריקה cr +कोस्टा रिका cr +Kosta rika cr +Kostaríka cr +コスタリカ cr +កូស្តារីកា cr +코스타 리카 cr +ໂຄເອເທີຍ cr +Kosta Rika cr +Kostarika cr +Коста Рика cr +Коста Рика cr +ਕੋਸਟਾ ਰੀਕਾ cr +Kostaryka cr +Коста-Рика cr +Kosita Rika cr +Kostarika cr +Kostarika cr +Костарика cr +Kostarika cr +I-Costa Rica cr +கோஸ்டா ரிகா cr +Коста Рика cr +คอสตาริกา cr +Kosta Rika cr +Kosta Rika cr +Коста-Ріка cr +Коста Рика cr +哥斯达黎加 cr +哥斯大黎加 cr +Cuba cu +Kuba cu +كوبا cu +Куба cu +Куба cu +কিউবা cu +Kuba cu +Kuba cu +Kuba cu +Ciwba cu +Kuba cu +Κούβα cu +Kubo cu +Kuuba cu +Kuba cu +کوبا cu +Kuuba cu +Kuba cu +Cúba cu +קובה cu +क्यूबा cu +Kuba cu +Kuba cu +Kúba cu +キューバ cu +គុយបា cu +쿠바 cu +ເກມໄພ່ cu +Kuba cu +Kuba cu +Куба cu +Куба cu +Kuba cu +Kuba cu +ਕਿਊਬਾ cu +Kuba cu +Куба cu +Kuba cu +Kuba cu +Kuba cu +Куба cu +Kuba cu +I-Cuba cu +Kuba cu +கியுபா cu +Куба cu +คิวบา cu +Küba cu +Kuba cu +Куба cu +Куба cu +古巴 cu +古巴 cu +Cape Verde cv +Kaap Verde cv +كاب فيردي cv +Кабо Верде cv +কেপ ভারডি cv +Penn Verde cv +Zelenortska ostrva cv +Cap Verd cv +Kapverdy cv +Cape Ferde cv +Kapverdiske øer cv +Cap Verdische Inseln cv +Πράσινο Ακρωτήριο cv +Kapo-Verdo cv +Cabo Verde cv +Roheneeme saared cv +Cabo Verde cv +کیپ‌ورده cv +Kap Verde cv +Cap vert cv +Kaap Verdië cv +Rinn Verde cv +Cabo Verde cv +כף וורדה cv +कैप वर्डे cv +Zöldfoki-szigetek cv +Grænhöfðaeyjar cv +Capo Verde cv +カーポベルデ cv +កាបវែរ cv +카보베르데 cv +ເກມໄພ່ cv +Kabaverde cv +Кејп Верде cv +Капе Вэрдэ cv +Kapp Verde cv +Kap Verde cv +Kaap Verdië cv +Kapp Verde cv +ਕੇਪ ਵੀਰਡੀ cv +Cabo Verde cv +Cabo Verde cv +Capul Verde cv +Кабо-Верде cv +Kapu Veri cv +Кејп Верд cv +Kejp Verd cv +Kap Verde cv +கேப் வெர்ட் cv +Димоғи Верде cv +แหลมเวอร์ดี cv +Kape Verde cv +Кабо-Верде cv +Кейп Верде cv +Cap Vert cv +佛得角 cv +維德角 cv +Christmas Island cx +Kersfees Eiland cx +جزر الكريسماس cx +Остров Рождество cx +ক্রিস্টমাস দ্বীপ cx +Inizi Nedeleg cx +Božično ostrvo cx +Illa de Pascua cx +Vánoční ostrovy cx +Ynys y Nadolig cx +Juleøen cx +Weihnachtsinsel cx +Νήσος των Χριστουγέννων cx +Kristnaskinsulo cx +Islas Christmas cx +Jõulusaar cx +Eguberri Irla cx +جزایر کریسمس cx +Joulusaari cx +Île de Noël cx +Christmas Eilân cx +Oileán na Nollag cx +Illas Christmas cx +איי כריסטמס cx +क्रिसमस आइलैंड cx +Uskršnji otoci cx +Karácsony-szigetek cx +Jólaey cx +Isola Christmas cx +クリスマス諸島 cx +កោះ Christmas cx +크리스마스 섬 cx +ຄິດສະຕອລ cx +Kalėdų salos cx +Ziemassvētku salas cx +Велигденски Острови cx +Кристмас арлууд cx +Christmasøya cx +Wiehnachtsinsel cx +Christmasøya cx +ਕ੍ਰਿਸਮਿਸ ਟਾਪੂ cx +Wyspy Bożego Narodzenia cx +Ilhas Natal cx +Ilhas do Natal cx +Insulele Christmas cx +Остров Рождества cx +Ikirwa cya Noheli cx +Christmassuollu cx +Vianočné Ostrovy cx +Božični otok cx +Божићно острво cx +Božićno ostrvo cx +Julön cx +கிருஸ்துமஸ் தீவு cx +Ҷазираи Кристмас cx +เกาะคริสต์มาส cx +Yılbaşı Adaları cx +Christmas Utrawları cx +Острів Різдва cx +Крисмас Ороли cx +Đảo giáng sinh cx +圣诞岛 cx +聖誕島 cx +Cyprus cy +Siprus cy +قبرص cy +Кіпр cy +Кипър cy +সাইপ্রাস cy +Chipr cy +Kipar cy +Xipre cy +Kypr cy +Cypern cy +Zypern cy +Κύπρος cy +Cipro cy +Chipre cy +Küpros cy +Txipre cy +قبرس cy +Kypros cy +Chypre cy +An Chipir cy +Chipre cy +קפריסין cy +साइप्रस cy +Cipar cy +Ciprus cy +Kýpur cy +Cipro cy +キプロス cy +ស៊ីពរ៍ cy +키프로스 cy +ບີບອັດ cy +Kipro cy +Kipra cy +Кипар cy +Сипрус cy +Ċipru cy +Kypros cy +Zypern cy +Kypros cy +ਕਿਉਪਰਸ cy +Cypr cy +Chipre cy +Chipre cy +Cipru cy +Кипр cy +Shipure cy +Kypros cy +Ciper cy +Кипар cy +Kipar cy +Cypern cy +சிப்ரஸ் cy +Кипр cy +ไซปรัส cy +Kıbrıs cy +Kiper cy +Кіпр cy +Кипр cy +Síp cy +Chîpe cy +塞浦路斯 cy +賽普勒斯 cy +Czechia cz +Czechië cz +التشيك cz +Çex Respublikası cz +Чэхія cz +Чешка република cz +চেকিয়া cz +Tchekia cz +Češka cz +Txèquia cz +Česko cz +Y Weriniaeth Siec cz +Tjekkiet cz +Tschechien cz +Τσεχία cz +Ĉeĥio cz +República Checa cz +Tšehhi cz +Txekia cz +چک cz +Tsekki cz +République tchèque cz +Tsjechië cz +Poblacht na Seice cz +Chéquia cz +צ'כיה cz +चेक cz +Češka cz +Csehország cz +Tékkland cz +Repubblica Ceca cz +チェコ cz +ឆេក cz +체코 cz +Čekija cz +Čehija cz +Чешка cz +Чехиа cz +Cżekia cz +Tsjekkia cz +Tschechien cz +Tsjechië cz +Tsjekkia cz +Chèquia cz +ਚੈੱਚੀਆ cz +Czechy cz +República Checa cz +República Tcheca cz +Cehia cz +Чехия cz +Ceke cz +Čeahkka cz +Česko cz +Češka cz +Чешка cz +Češka cz +I-Czechia cz +Tjeckien cz +செக்யா cz +Чехия cz +เชค cz +Çek Cumhuriyeti cz +Çexiä cz +Чехія cz +Чехия cz +Séc cz +Tchekeye cz +捷克 cz +捷克 cz +Germany de +Duitsland de +ألمانيا de +Almaniya de +Нямеччына de +Германия de +জার্মানি de +Alamagn de +Njemačka de +Alemanya de +Německo de +Yr Almaen de +Tyskland de +Deutschland de +Γερμανία de +Germanio de +Alemania de +Saksamaa de +Alemania de +آلمان de +Saksa de +Týskland de +Allemagne de +Dûtslân de +An Ghearmáin de +Alemaña de +גרמניה de +जर्मनी de +Njemačka de +Németország de +Jerman de +Þýskaland de +Germania de +ドイツ de +អាល្លឺម៉ង់ de +독일 de +ເຍລລະມັນນີ de +Vokietija de +Vācija de +Германија de +Герман de +Jerman de +Ġermanja de +Tyskland de +Düütschland de +Duitsland de +Tyskland de +Alemanya de +ਜਰਮਨੀ de +Niemcy de +Alemanha de +Alemanha de +Germania de +Германия de +Ubudage de +Duiska de +Nemecko de +Nemčija de +Немачка de +Nemačka de +I-Germany de +Tyskland de +ஜெர்மனி de +Олмон de +เยอรมันนี de +Almanya de +Almania de +Німеччина de +Олмония de +Đức de +Almagne de +德国 de +德國 de +IJalimani de +Djibouti dj +جيبوتي dj +Джыбуці dj +Джибути dj +জিবৌতি dj +Đibuti dj +Džibuti dj +Jib?ti dj +Dschibuti dj +Τζιμπουτί dj +Ĝibutio dj +جیبوتی dj +Xibuti dj +ג'יבוטי dj +डिबौती dj +Džibuti dj +Dzsibuti dj +Djíbútí dj +Gibuti dj +ジブチ dj +ហ្ស៊ីបូទី dj +지부티 dj +ພັດພາ dj +Džibutis dj +Džibutija dj +Џибути dj +Жибут dj +Dġibuti dj +Dschibouti dj +ਡਜੀਬੁਉਟੀ dj +Dżibuti dj +Djibuti dj +Djibuti dj +Джибути dj +Jibuti dj +Djibuhti dj +Džibuty dj +Džibuti dj +Џибути dj +Džibuti dj +I-Djibouti dj +டிஜிபொடி dj +Ҷибойти dj +จิบูติ dj +Cibuti dj +Djibuti dj +Джібуті dj +Жибути dj +吉布提 dj +吉布地 dj +Denmark dk +Denemarke dk +الدنمارك dk +Danimarka dk +Данія dk +Дания dk +ডেনমার্ক dk +Danmark dk +Danska dk +Dinamarca dk +Dánsko dk +Denmarc dk +Danmark dk +Dänemark dk +Δανία dk +Danlando dk +Dinamarca dk +Taani dk +Danimarka dk +دانمارک dk +Tanska dk +Danmark dk +Danemark dk +Denemarken dk +An Danmhairg dk +Dinamarca dk +דנמרק dk +डेनमार्क dk +Danska dk +Dánia dk +Danmörk dk +Danimarca dk +デンマーク dk +ដាណឺម៉ាក dk +덴마크 dk +ເດນມາກ dk +Danija dk +Dānija dk +Данска dk +Дани dk +Danimarka dk +Danmark dk +Dänmark dk +Denemarken dk +Danmark dk +Dinamarca dk +ਡੈੱਨਮਾਰਕ dk +Dania dk +Dinamarca dk +Dinamarca dk +Danemarca dk +Дания dk +Danimarike dk +Dánmárku dk +Dánsko dk +Danska dk +Данска dk +Danska dk +I-Denmark dk +Danmark dk +டென்மார்க் dk +Денмарк dk +เดนมาร์ก dk +Danimarka dk +Dania dk +Данія dk +Дания dk +Đan Mạch dk +Daenmåtche dk +丹麦 dk +丹麥 dk +Dominica dm +Dominisië dm +دومينيكا dm +Дамініка dm +Доминика dm +ডমিনিকা dm +Dominik dm +Dominika dm +Dominika dm +Dominikanische Republik dm +Ντομίνικα dm +Dominiko dm +دومینیکا dm +Dominique dm +Doiminice dm +דומינקה dm +डोमिनिका dm +Dominika dm +Dóminíka dm +ドミニカ dm +ដូមីនីកា dm +도미니카 dm +ໂລມາເນີຍ dm +Dominika dm +Dominika dm +Доминика dm +Доминика dm +Dominika dm +ਡੋਮਾਨੀਕਾ dm +Dominika dm +Dominicana dm +Доминика dm +Dominikani dm +Dominikánsko dm +Dominikanska republika dm +Доминика dm +Dominika dm +டொமினிகா dm +Доминика dm +โดมินากัน dm +Dominik dm +Dominika dm +Домініка dm +Доминика dm +Dominike dm +多米尼加 dm +多明尼加 dm +Dominican Republic do +Dominikaanse Republiek do +جمهورية الدومينيكان do +Dominik Respublikası do +Дамініканская Рэспубліка do +Доминиканска република do +ডমিনিকান রিপাবলিক do +Republik Dominikan do +Dominikanska Republika do +República Dominicana do +Dominikánská republika do +Gweriniaeth Dominica do +Dominikanske Republik do +Dominikanische Republik do +Δομινικανή Δημοκρατία do +Dominika Respubliko do +República Dominicana do +Dominikaani Vabariik do +Dominikar Errepublika do +جمهوری دامینیکن do +Dominikaaninen tasavalta do +République dominicaine do +Dominicaanse Republyk do +An Phoblacht Dhoiminiceach do +República Dominicana do +הרפובליקה הדומיניקנית do +डोमिनिकन रिपब्लिक do +Dominikanska Republika do +Dominikai Köztársaság do +Republik Dominika do +Dóminíska lýðveldið do +Repubblica Dominicana do +ドミニカ共和国 do +សាធារណរដ្ឋ​ដូមីនីកែន do +도미니카 공화국 do +ໂດມິນີກັນ do +Dominikos Respublika do +Dominikas Republika do +Доминиканска Република do +Домникан ард улс do +Repubblika Dominikana do +Den dominikanske republikk do +Dominikaansche Republiek do +Dominicaanse Republiek do +Den dominikanske republikken do +Republica Dominicana do +ਡੋਮਾਨੀਕਾ ਗਣਰਾਜ do +Dominikana do +República Dominicana do +República Dominicana do +Republica Dominicană do +Доминиканская республика do +Repubulika Dominikani do +Dominihkalaš republihkka do +Dominikánska republika do +Dominikanska republika do +Доминиканска Република do +Dominikanska Republika do +I-Dominican Republic do +Dominikanska republiken do +டொமினிக்கன் குடியரசு do +Ҷумҳурии Доминика do +สาธารณรัฐโดมินิกัน do +Dominik Cumhuriyeti do +Dominika Cömhüriäte do +Домініканська республіка do +Доминикана Республикаси do +Muvhuso wa Dominican do +Cộng hoà Dominican do +Republike Dominikinne do +IRepublic yeDominican do +多米尼加共和国 do +多明尼加共和國 do +Algeria dz +Algerië dz +الجزائر dz +Альжыр dz +Алжир dz +অ্যালজেরিয়া dz +Aljeri dz +Alžir dz +Algèria dz +Alžírsko dz +Algeriet dz +Algerien dz +Αλγερία dz +Algerio dz +Argelia dz +Alžeeria dz +الجزیره dz +Algérie dz +Algerije dz +An Ailgéir dz +Alxéria dz +אלג'יריה dz +अल्जीरिया dz +Alžir dz +Algéria dz +Alsír dz +アルジェリア dz +អាល់ហ្សេរី dz +알제리 dz +ບັນກາເລີຍ dz +Alžyras dz +Alžīrija dz +Алжир dz +Алжер dz +Alġerija dz +Algerie dz +Algerien dz +Algerije dz +Algerie dz +ਅਲਜੀਰੀਆ dz +Algieria dz +Argélia dz +Argélia dz +Алжир dz +Aligeriya dz +Alžírsko dz +Alžirija dz +Алжир dz +Alžir dz +I-Algeria dz +Algeriet dz +அல்ஜிரியா dz +Алҷазоир dz +อัลจีเรีย dz +Aljır dz +Алжир dz +Жазоир dz +Aldjereye dz +阿尔及利亚 dz +阿爾及利亞 dz +Equador ec +Ewenaar ec +الإكوادور ec +Ekvator ec +Эквадор ec +Еквадор ec +ইকুয়েডর ec +Ecuador ec +Ekvador ec +Ekvádor ec +Ecwador ec +Ecuador ec +Ισημερινός ec +Ekvadoro ec +Ecuador ec +Ekuador ec +اکوادور ec +Équateur ec +Eacuadór ec +Ecuador ec +אקוודור ec +इक्वेडॉर ec +Ekvador ec +Ecuador ec +Ekvador ec +Ecuador ec +エクアドル ec +អេក្វាឌ័រ ec +에콰도르 ec +ເອກໍດໍ ec +Ekvadoras ec +Ekvadora ec +Еквадор ec +Эквадор ec +Ekwador ec +Ecuador ec +Ecuador ec +Ecuador ec +ਏਕਾਵੇਡਰ ec +Ekwador ec +Ecuador ec +Эквадор ec +Ekwateri ec +Ekvador ec +Ekvádor ec +Ekvador ec +Еквадор ec +Ekvador ec +I-Equador ec +ஈக்வெடார் ec +Эквадор ec +เอกวาดอร์ ec +Ekvator ec +Еквадор ec +Эквадор ec +Ecwåteur ec +厄瓜多尔 ec +厄瓜多 ec +Estonia ee +Estlandies ee +استونيا ee +Estoniya ee +Эстонія ee +Естония ee +এস্টোনিয়া ee +Estonija ee +Estònia ee +Estonsko ee +Estland ee +Estland ee +Εσθονία ee +Estlando ee +Eesti ee +استونی ee +Eesti ee +Estonie ee +Estland ee +An Eastóin ee +אסטוניה ee +एस्तोनिया ee +Estonija ee +Észtország ee +Eistland ee +エストニア ee +អេស្តូនី ee +에스토니아 ee +ເອໂທເນີຍ ee +Estija ee +Igaunija ee +Естонија ee +Эстони ee +Estonja ee +Estland ee +Estland ee +Estland ee +Estland ee +Estònia ee +ਈਸਟੋਨੀਆ ee +Estónia ee +Estônia ee +Эстония ee +Esitoniya ee +Estteeana ee +Estónsko ee +Estonija ee +Естонија ee +Estonija ee +I-Estonia ee +Estland ee +எசுடோனியா ee +Эстония ee +เอสโทเนีย ee +Estonya ee +Естонія ee +Эстония ee +Estoneye ee +爱沙尼亚 ee +愛沙尼亞 ee +Egypt eg +Egipte eg +مصر eg +Misir eg +Эгіпэт eg +Египет eg +মিশর eg +Ejipt eg +Egipat eg +Egipte eg +Yr Aifft eg +Egypten eg +Ägypten eg +Αίγυπτος eg +Egiptujo eg +Egipto eg +Egiptus eg +Egipto eg +مصر eg +Egypti eg +Egyptaland eg +Égypte eg +Egypte eg +An Éigipt eg +Exipto eg +מצרים eg +इजिप्त eg +Egipat eg +Egyiptom eg +Egyptaland eg +Egitto eg +エジプト eg +អេហ្ស៊ីប eg +이집트 eg +ອີຢີບ eg +Egiptas eg +Ēģipte eg +Египет eg +Египт eg +Mesir eg +Eġittu eg +Ägypten eg +Egypte eg +Egepeta eg +ਮਿਸਰ eg +Egipt eg +Egipto eg +Egito eg +Egipt eg +Египет eg +Misiri eg +Egypta eg +Egipt eg +Египат eg +Egipat eg +I-Egypt eg +Egypten eg +எகிப்து eg +Миср eg +อียิปต์ eg +Mısır eg +Mısır eg +Єгипет eg +Миср eg +Ai Cập eg +Edjipe eg +埃及 eg +埃及 eg +Igibhithe eg +Western Sahara eh +Westelike Sahara eh +الصحراء الغربية eh +Заходняя Сахара eh +Западна Сахара eh +পশ্চিম সাহারা eh +Sahara occidental eh +Zapadna Sahara eh +Sàhara Occidental eh +Západní Sahara eh +Gorllewin Sahara eh +Vestsahara eh +Westsahara eh +Δυτική Σαχάρα eh +Okcidenta Saharo eh +Sahara occidental eh +Lääne-Sahara eh +Mendebaldeko Sahara eh +صحرای غربی eh +Länsi-Sahara eh +Sahara occidental eh +West Sahara eh +An Sahára Thiar eh +Saara Ocidental eh +מערב סהרה eh +पश्चिमी सहारा eh +Westerm Sahara eh +Nyugat-Szahara eh +Vestur-Sahara eh +Sahara Occidentale eh +西サハラ eh +សាហារ៉ា​ខាង​លិច eh +서사하라 eh +ພື້ນທີ່ທຳງານ eh +Vakarų Sahara eh +Rietumsahāra eh +Западна Сахара eh +Барууг сахар eh +Saħara tal-Punent eh +Vest-Sahara eh +Westsahara eh +West Sahara eh +Vest-Sahara eh +ਦੱਖਣੀ ਸਹਾਰਾ eh +Zachodnia Sahara eh +Sara Ocidental eh +Sahara Ocidental eh +Sahara de Vest eh +Западная Сахара eh +Sahara y'Iburengerazuba eh +Oarje-Sahara eh +Západna Sahara eh +Zahodna Sahara eh +Западна Сахара eh +Zapadna Sahara eh +Västsahara eh +மேற்கத்திய சஹாரா eh +Саҳрои Ғарбӣ eh +ซาฮาร่าตะวันตก eh +Batı Sahara eh +Batış Sahara eh +Західна Сахара eh +Ғарбий Сахара eh +Tây Sahara eh +Sara Coûtchantrece eh +西撒哈拉 eh +西盛哈拉 eh +Eritrea er +اريتريا er +Эрытрэя er +Еритрея er +এরিট্রিয়া er +Eritre er +Eritreja er +Ερυθραία er +Eritreo er +اریتره er +Érythrée er +Eiritré er +אריתריאה er +एरिट्रीया er +Eritreja er +Erítrea er +エリトリア er +អេរីទ្រា er +에리트레아 er +ແກ້ໄຂແຟ້ມທຳງານ er +Eritrėja er +Eritreja er +Еритреја er +Эритреа er +ਈਰੀਟਰੀਆ er +Erytrea er +Eritreia er +Eritréia er +Эритрея er +Eritereya er +Eritreja er +Еритреја er +Eritreja er +ரிட்ரியா er +Эритрия er +เอริเทรีย er +Eritre er +Ерітрея er +Эритрия er +Eritrêye er +厄立特里亚 er +厄利垂亞 er +Spain es +Spanje es +أسبانيا es +İspaniya es +Гішпанія es +Испания es +স্পেন es +Spagn es +Španija es +Espanya es +Španělsko es +Sbaen es +Spanien es +Spanien es +Ισπανία es +Hispanio es +España es +Hispaania es +Espainia es +اسپانیا es +Espanja es +Spania es +Espagne es +Spanje es +An Spáinn es +España es +ספרד es +स्पेन es +Španjolska es +Spanyolország es +Spanyol es +Spánn es +Spagna es +スペイン es +អេស្ប៉ាញ es +스페인 es +ສະເປັນ es +Ispanija es +Spānija es +Шпанија es +Испани es +Sepanyol es +Spanja es +Spania es +Spanien es +Spanje es +Spania es +Espanha es +ਸਪੇਨ es +Hiszpania es +Espanha es +Espanha es +Spania es +Испания es +Esipanye es +Spánia es +Španielsko es +Španija es +Шпанија es +Španija es +I-Spain es +Spanien es +சுபெயின் es +Испаниё es +สเปน es +İspanya es +İspania es +Іспанія es +Испания es +Tây Ban Nha es +Sipagne es +西班牙 es +西班牙 es +Ethiopia et +Ethiopië et +اثيوبيا et +Этыёпія et +Етиопия et +ইথিওপিয়া et +Etiopi et +Etiopija et +Etiòpia et +Etiopie et +Ethiopien et +Äthiopien et +Αιθιοπία et +Etiopio et +Etiopía et +Etioopia et +Etiopia et +اتیوپی et +Etiopia et +Éthiopie et +Ethiopië et +An Aetóip et +Etiopia et +אתיופיה et +इथियोपिया et +Etiopija et +Etiópia et +Eþíópía et +Etiopia et +エチオピア et +អេត្យូពី et +에티오피아 et +ເອໂທເນີຍ et +Etiopija et +Etiopija et +Етиопија et +Этопи et +Etjopia et +Etiopia et +Äthiopien et +Ethiopië et +Etiopia et +ਈਥੋਪੀਆ et +Etiopia et +Etiópia et +Etiópia et +Etiopia et +Эфиопия et +Etiyopiya et +Etiopia et +Etiópia et +Etiopija et +Етиопија et +Etiopija et +Etiopien et +எதியோபியா et +Ҳабашистон et +เอธิโอเปีย et +Etiyopya et +Efiopia et +Ефіопія et +Эфиопия et +Etiopeye et +埃塞俄比亚 et +衣索比亞 et +Finland fi +فنلندا fi +Finlandiya fi +Фінляндыя fi +Финландия fi +ফিনল্যাণ্ড fi +Finska fi +Finlàndia fi +Finsko fi +Y Ffindir fi +Finnland fi +Φινλανδία fi +Finnlando fi +Finlandia fi +Soome fi +Finlandia fi +فنلاند fi +Suomi fi +Finnland fi +Finlande fi +Finlân fi +An Fhionlainn fi +Finlándia fi +פינלנד fi +फिनलैंड fi +Finska fi +Finnország fi +Finlandia fi +Finnland fi +Finlandia fi +フィンランド fi +ហ្វាំងឡង់ fi +핀란드 fi +ຟີນແລນ fi +Suomija fi +Somija fi +Финска fi +Финнланд fi +Finlandja fi +Finnland fi +Finlandia fi +ਫਿਨਲੈਂਡ fi +Finlandia fi +Finlândia fi +Finlândia fi +Finlanda fi +Финляндия fi +Finilande fi +Suopma fi +Fínsko fi +Finska fi +Финска fi +Finska fi +I-Finland fi +பின்லாந்து fi +Финлонд fi +ฟินแลนด์ fi +Finlandiya fi +Finland (Suomi) fi +Фінляндія fi +Финляндия fi +Phần Lan fi +Finlande fi +芬兰 fi +芬蘭 fi +Fiji fj +فيجي fj +Фіджы fj +Острови Фиджи fj +ফিজি fj +Fidji fj +Fidži fj +Fidži fj +Ffiji fj +Fidschi fj +Φίτζι fj +Fiĝioj fj +Fidži fj +فیجی fj +Fidji fj +Fidsí fj +פיג'י fj +फिजी fj +Fidzsi fj +Fídjieyjar fj +Figi fj +フィジー fj +ហ្វ៊ីហ្ស៊ី fj +피지 fj +ມີດີ fj +Fidži fj +Фиџи fj +Фижи fj +Fiġi fj +Fidschi fj +ਫਿੱਜੀ fj +Fidżi fj +Ilhas Fiji fj +Фиджи fj +Fidži fj +Fidži fj +Фиџи fj +Fidži fj +பிஜி fj +Фиҷи fj +ฟิจิ fj +Фіджі fj +Фижи fj +Fidji fj +斐济 fj +菲濟 fj +Falkland Islands (Malvinas) fk +Falkland Eilande (Malvinas) fk +جزر الفوكلاند (المالفيناس) fk +Фалклендскія астравы (Мальвіны) fk +Фолклендски острови fk +ফকল্যাণ্ড দ্বীপপুঞ্জ (মলভিনাস) fk +Inizi Falklandi (Malvinas) fk +Foklandska ostrva (Malvini) fk +Illes Falkland (Malvines) fk +Falklandy (Malvíny) fk +Ynysoedd Y Ffalcland (Malfinas) fk +Falkland-øerne fk +Falkland-Inseln (Malvinen) fk +Νησιά Φώκλαντ (Malvinas) fk +Falklandoj fk +Islas Falkland (Malvinas) fk +Falklandi saared (Malviinid) fk +Falkland Irlak (Malvinak) fk +جزایر فالکلند مالویناس fk +Falklandin saaret (Malvinassaaret) fk +Îles Falkland (Malvinas) fk +Falkland Eilannen (Malvinas) fk +Na hOileáin Fháclainne (Malvinas) fk +Illas Falkland (Malvinas) fk +איי פולקלנד fk +फाकलैंड आइलैंड (मालविनास) fk +Folklandska otočja (Malvini) fk +Falkland-szigetek fk +Falklandseyjar fk +Isole Falkland (Malvine) fk +フォークランド諸島 fk +កោះ Falkland (Malvinas) fk +포클랜드 군도 (말비나스) fk +Folklendu salas fk +Фокландски Острови (Малвини) fk +Фалкланд арлууд (Малвинас) fk +Gżejjer Falkland (Malvinas) fk +Falklandsøyene fk +Falklandinseln (Malvinas) fk +Falkland Eilanden (Malvinas) fk +Falklandsøyane fk +ਫਾਕਲੈਂਡ ਟਾਪੂ fk +Wyspy Falklandzkie (Malwiny) fk +Ilhas Falkland (Malvinas) fk +Ilhas Malvinas fk +Insulele Falkland (Malvine) fk +Фолклендские (Мальвинские) острова fk +Ibirwa bya Falikilande (Maluvinasi) fk +Falklánddasullot fk +Falklandské Ostrovy (Malviny) fk +Falklandski otoki (Malvini) fk +Фолкландска острва (Малвини) fk +Folklandska ostrva (Malvini) fk +Falklandsöarna fk +ஃபால்க் தீவு(மால்வினாஸ்) fk +Ҷазираи фолкланд (Малвина) fk +หมู่เกาะฟอล์คแลนด์ (Malvinas) fk +Falkland Adaları fk +Falkland Utrawları (Malvinnar) fk +Фолклендські острови (Британія) fk +Фолкленд (Малвин) Ороллари fk +Iyes Malouwines fk +福克兰群岛(马尔维纳斯) fk +福克蘭群島 (馬爾維納斯) fk +Micronesia, Federated States of fm +Micronesië, Vereenigde State van fm +Федэрацыя Мiкранэзіі fm +Микронезия fm +মাইক্রোনেশিয়া, ফেডারেটেড স্টেটস অব fm +Mikronezija, Federalne države fm +Micronesia, Estats Federats de fm +Mikronésie fm +Micronesia, Taleithau Cyfunol fm +Mikronesien, de forenede stater af fm +Mikronesien, Föderation von fm +Μικρονησίας, Ομόσπονδες πολιτείες της fm +Mikronezio, Respubliko de fm +Micronesia, Estados federados de fm +Mikroneesia fm +Mikronesiako Estatu Federatuak fm +Mikronesian liittovaltio fm +Etats Fédérés de Micronésie fm +Micronesië, Federale staten Fan fm +Stáit Cónascacha na Micrinéise fm +Micronésia, Estados Federados de fm +מיקרונזיה, מדינות הפדרציה של fm +फेडरेटेड स्टेट ऑफ माइक्रोनेसिया fm +Mikronézia fm +Míkrónesía, Sambandsríki fm +Micronesia, stati federati di fm +ミクロネシア,米自由連邦 fm +រដ្ឋ​សហព័ន្ធ​មិក្រូនេស៊ី fm +Mikronezija fm +Mikronēzija fm +Микронезија, Федеративни Држави на fm +Mikronesja (Stati Federati ta') fm +Mikronesiaføderasjonen fm +Mikronesien, Vereenigte Staten vun fm +Micronesië, Federale staten van fm +Mikronesiaføderasjonen fm +ਮਾਇਕਰੋਨੀਸੀਆ, ਸੰਘੀ ਪ੍ਰਾਂਤ fm +Federacja Stanów Mikronezji fm +Micronésia, Estados Federados da fm +Estados Federados da Micronésia fm +Micronezia, Statele Federative fm +Микронезия fm +Mikoronesiya, Leta Zishyizwehamwe fm +Mikronesiafederašuvdna fm +Spojené štáty Mikronézie fm +Mikronezija, Združene države fm +Микронезија, Федерација држава fm +Mikronezija, Federacija država fm +Mikronesiska federationen fm +மைக்ரோனிசா, ஒருங்கிணைந்த மாநிலம் fm +สหพันธรัฐมิโครนีเซีย fm +Mikronezya Federasyonu fm +Mikronesia, Berläşkän İlläre fm +Мікронезія, федеративні штати fm +Микронезия fm +Micronezeye fm +密克罗尼西亚联邦 fm +密克羅尼西亞聯邦 fm +Faroe Islands fo +Faroe Eilande fo +جزر الفيرو fo +Острови Фаро fo +ফারো দ্বীপপুঞ্জ fo +Enez Faroe fo +Farska ostrva fo +Illes Faroe fo +Faerské ostrovy fo +Ynysoedd Ffar?e fo +Færøerne fo +Färöer-Inseln fo +Νήσοι Φερόε fo +Ferooj fo +islas Faroe fo +Fääri saared fo +Faroe Irlak fo +جزایر فارو fo +Färsaaret fo +Îles Féroé fo +Faroe Eilannen fo +Na Scigirí (Oileáin Fharó) fo +Illas Feroe fo +איי פארו fo +फारोए आइलैंड fo +Faroe Otoci fo +Faroe-szigetek fo +Færeyjar fo +Isole Fær Øer fo +フェロー諸島 fo +កោះ​ហ្វ៉ារ៉ូ fo +페로 제도 fo +ໄອແລນ fo +Faroe salos fo +Fēru salas fo +Фарски Острови fo +Фарое арлууд fo +Gżejjer Faroe fo +Færøyene fo +Färöerinseln fo +Faroe Eilanden fo +Færøyane fo +ਫਾਰੋਈ ਟਾਪੂ fo +Wyspy Faroe fo +Ilhas Faroe fo +Ilhas Faroe fo +Insulele Feroe fo +Фарерские острова fo +Ibirwa bya Farowe fo +Fearsuolu fo +Ostrovy Faroe fo +Otoki Faroe fo +Фарска острва fo +Farska ostrva fo +Färöarna fo +ஃபரோ தீவுகள் fo +Ҷазираи Фару fo +หมู่เกาะฟาโร fo +Faroe Adaları fo +Faroe Utrawları fo +Фарерські острови fo +Фарер Ороллари fo +Đảo Faroe fo +Iye Faeroyé fo +法罗群岛 fo +法羅群島 fo +France fr +Frankryk fr +فرنسا fr +Fransa fr +Францыя fr +Франция fr +ফ্রান্স fr +Frañs fr +Francuska fr +França fr +Francie fr +Ffrainc fr +Frankrig fr +Frankreich fr +Γαλλία fr +Francio fr +Francia fr +Prantsusmaa fr +Frantzia fr +فرانسه fr +Ranska fr +Frakland fr +Frankryk fr +An Fhrainc fr +Franza fr +צרפת fr +फ्रांस fr +Francuska fr +Franciaország fr +Prancis fr +Frakkland fr +Francia fr +フランス fr +បារាំង fr +프랑스 fr +ຝຣັ່ງ fr +Prancūzija fr +Francija fr +Франција fr +Франц fr +Perancis fr +Franza fr +Frankrike fr +Frankriek fr +Frankrijk fr +Frankrike fr +Fora fr +França fr +ਫਰਾਂਸ fr +Francja fr +França fr +França fr +Franţa fr +Франция fr +Ubufaransa fr +Fránkriika fr +Francúzsko fr +Francija fr +Француска fr +Francuska fr +I-France fr +Frankrike fr +பிரான்சு fr +Фаронса fr +ฝรั่งเศส fr +Fransa fr +Fransia fr +Франція fr +Франция fr +Fura fr +Pháp fr +Fransi fr +法国 fr +法國 fr +Gabon ga +الغابون ga +Габон ga +Габон ga +গ্যাবন ga +Gabun ga +Γκαμπόν ga +Gabono ga +Gabón ga +گابون ga +An Ghabúin ga +Gabón ga +גבון ga +गेबॉन ga +ガボン ga +ហ្គាបុង ga +가봉 ga +ແກລ່ງນ ga +Gabonas ga +Gabona ga +Габон ga +Габон ga +Gabun ga +ਗਾਬੋਨ ga +Gabão ga +Gabão ga +Габон ga +Gabo ga +Габон ga +காபான் ga +Габон ga +กาบอน ga +Габон ga +Габон ga +加蓬 ga +加彭 ga +United Kingdom gb +Vereenigde Koninkryk gb +المملكة المتحدة gb +Birləşmiş Krallıq gb +Злучанае Каралеўства gb +Великобритания gb +ইউনাইটেড কিংডম gb +Rouantelezh Unanet gb +Velika Britanija gb +Regne Unit gb +Spojené království gb +Y Deyrnas Unedig gb +Storbritannien gb +Großbritannien gb +Ηνωμένο Βασίλειο gb +Britio gb +Reino Unido gb +Suurbritannia gb +Erresuma Batua gb +بریتانیا gb +Iso-Britannia gb +Stórabretland gb +Royaume Uni gb +Ferienigd Keninkryk gb +An Ríocht Aontaithe gb +Reino Unido gb +בריטניה gb +यूनाइटेड किंगडम gb +Ujedinjeno Kraljevstvo gb +Egyesült Királyság gb +Inggris gb +Bretland gb +Regno Unito gb +イギリス gb +ចក្រភព​អង់គ្លេស gb +영국 gb +ສະຫະລາດສະອານາຈັກ gb +Jungtinė Karalystė gb +Apvienotā Karaliste gb +Обединето Кралство gb +Их британ gb +Renju Unit gb +Storbritannia gb +Grootbritannien gb +Verenigd Koninkrijk gb +Storbritannia gb +Regne Unit gb +ਬਰਤਾਨੀਆ gb +Wielka Brytania gb +Reino Unido gb +Reino Unido gb +Anglia gb +Великобритания gb +Ubwongereza gb +Stuorrabrittania gb +Anglicko gb +Združeno kraljestvo gb +Уједињено Краљевство gb +Ujedinjeno Kraljevstvo gb +I-United Kingdom gb +Storbritannien gb +ஐக்கிய ராஜ்ஜியம் gb +Подшоҳии Муттаҳида gb +สหราชอาณาจักร gb +Birleşik Krallık gb +Berläşkän Padşahlıq gb +Великобританія gb +Буюк Британия gb +Anh gb +Rweyåme Uni gb +United Kingdom gb +英国 gb +聯合王國 gb +United Kingdom gb +Grenada gd +غرينادا gd +Qrenada gd +Грэнада gd +Гренада gd +গ্রেনাডা gd +Granada gd +Γρενάδα gd +Grenado gd +Granada gd +گرانادا gd +Grenade gd +Granada gd +גרנדה gd +ग्रेनाडा gd +Granada gd +グレナダ gd +ហ្គ្រីណាដា gd +그러네이다 gd +ເກນາດາ gd +Grenāda gd +Гренада gd +Гренада gd +Granada gd +ਗਰੀਨਾਡਾ gd +Granada gd +Granada gd +Гренада gd +Gerenada gd +I-Grenada gd +கிரெனடா gd +Гронодо gd +เกรนาดา gd +Гренада gd +Гренада gd +Grenåde gd +格林纳达 gd +格瑞那達 gd +Georgia ge +Georgië ge +جورجيا ge +Грузія ge +Грузия ge +জর্জিয়া ge +Jeorji ge +Gruzija ge +Geòrgia ge +Gruzie ge +Georgien ge +Georgien ge +Γεωργία ge +Georgino ge +Gruusia ge +گرجستان ge +Géorgie ge +Georgië ge +An tSeoirsia ge +Xeórxia ge +ג'ורג'יה ge +ज्यार्जिया ge +Grúzia ge +Georgía ge +ジョージア島 ge +ហ្សកហ្ស៊ី ge +그루지아 ge +ເຊີເບີຍ ge +Gruzija ge +Gruzija ge +Грузија ge +Георги ge +Ġorġia ge +Georgien ge +Georgië ge +ਜਾਰਜੀਆ ge +Gruzja ge +Geórgia ge +Geórgia ge +Грузия ge +Jeworugiya ge +Gruzija ge +Грузија ge +Gruzija ge +Georgien ge +ஜியோர்ஜியா ge +Гурҷистон ge +จอร์เจีย ge +Gürcistan ge +Görcestan ge +Грузія ge +Гуржистон ge +Djeyordjeye ge +格鲁吉亚 ge +喬治亞 ge +Ghana gh +غانا gh +Гана gh +Гана gh +ঘানা gh +Gwana gh +Gana gh +Γκάνα gh +Ganao gh +غنا gh +Gána gh +Gana gh +גאנה gh +घाना gh +Gana gh +ガーナ gh +ហ្កាណា gh +가나 gh +ຈີນ gh +Gana gh +Gana gh +Гана gh +Гана gh +Gana gh +ਘਾਨਾ gh +Gana gh +Gana gh +Gana gh +Гана gh +Gana gh +Gana gh +Гана gh +Gana gh +I-Ghana gh +கானா gh +Ғано gh +กานา gh +Гана gh +Гана gh +Gana gh +加纳 gh +迦納 gh +Gibraltar gi +جبل طارق gi +Гібралтар gi +Гибралтар gi +জিব্রল্টার gi +Jibraltar gi +Γιβραλτάρ gi +Gibraltaro gi +گیبرالتار gi +Giobráltar gi +Xibraltar gi +גיברלטר gi +जिब्राल्टर gi +Gibraltár gi +Gíbraltar gi +Gibilterra gi +ジブラルタル gi +지브롤터 gi +ມອລຕາ gi +Gibraltaras gi +Gibraltārs gi +Гибралтар gi +Гибралтар gi +Ġibiltar gi +ਗੀਬਰਾਲਟਾਰ gi +Гибралтар gi +Jiburalitari gi +Гибралтар gi +ஜிப்ரல்டார் gi +Ҷабалуттариқ gi +ยิบรอลตา gi +Cebelitarık gi +Гібралтар gi +Гибралтар gi +Djibraltar gi +直布罗陀 gi +直布羅陀 gi +Greenland gl +Groenland gl +Гренландия gl +গ্রীনল্যাণ্ড gl +Griñland gl +Groenlàndia gl +Grónsko gl +Y Lasynys gl +Grønland gl +Grönland gl +Ισλανδία gl +Groenlandia gl +Gröönimaa gl +Gröönlanti gl +Groenland gl +Grienlân gl +An Ghraonlainn gl +Groenlándia gl +Grönland gl +Grænland gl +Groenlandia gl +グリーンランド gl +Grenlandija gl +Гренланд gl +Grønland gl +Gröönland gl +Groenland gl +Grønland gl +ਗਰੀਨਲੈਂਡ gl +Grenlandia gl +Gronelândia gl +Гренландия gl +Goronilande gl +Ruonáeatnan gl +Grenlandija gl +Гренланд gl +Grenland gl +Grönland gl +Гринландия gl +กรีนแลนด์ gl +Grönland gl +Гренландія gl +Гренландия gl +格陵兰 gl +格陵蘭 gl +Gambia gm +Gambië gm +غامبيا gm +Гамбія gm +Гамбия gm +গামবিয়া gm +Gambi gm +Gambija gm +Gàmbia gm +Gambie gm +Γκάμπια gm +Gambio gm +گامبیا gm +Gambie gm +An Ghaimbia gm +Gámbia gm +גמביה gm +जाम्बिया gm +Gambija gm +Gambía gm +ガンビア gm +ហ្កាំប៊ី gm +감비아 gm +ແກມມາ gm +Gambija gm +Gambija gm +Гамбија gm +Гамби gm +Gambja gm +ਗੈਂਬੀਆ gm +Gâmbia gm +Gâmbia gm +Гамбия gm +Gambiya gm +Gambija gm +Гамбија gm +Gambija gm +காம்பியா gm +Гомбиё gm +แกมเบีย gm +Гамбія gm +Гамбия gm +Gambeye gm +冈比亚 gm +甘比亞 gm +Guinea gn +غينيا gn +Гвінэя gn +Гвинея gn +গিনি gn +Gine gn +Gvineja gn +Gini gn +Γουινέα gn +Gvineo gn +Ginea gn +گینه gn +Guinée gn +An Ghuine gn +Guiné gn +גינאה gn +गुईना gn +Gvineja gn +Gínea gn +ギニア gn +ហ្គីណេ gn +기니 gn +ເຖາວັນ gn +Gvinėja gn +Gvineja gn +Гвинеја gn +Гуйнеа gn +Ginea gn +ਗੁਇਨੀਆ gn +Gwinea gn +Guiné gn +Guiné gn +Гвинея gn +Gineya gn +Gvineja gn +Гвинеја gn +Gvineja gn +க்யுனியா gn +Гине gn +กินี gn +Gine gn +Гвінея gn +Гвинея gn +Guinêye gn +几内亚 gn +幾內亞 gn +Guadeloupe gp +غواديلوب gp +Гвадэлупа gp +Гваделупа gp +গাডেলুপ gp +Gwadeloup gp +Gvadalupe gp +Guadalupe gp +Gwadel?p gp +Γουαδελούπη gp +Gvadelupo gp +Guadalupe gp +Guadalupe gp +گوادلوپ gp +Guadalúip gp +Guadalupe gp +גאודלופה gp +ग्वाडेलोप gp +Gvadelúpeyjar gp +Guadalupa gp +仏領グアドループ gp +ហ្គាដឺលុប gp +과들루프 gp +ເດີລຸກ gp +Gvandelupa gp +Гваделупе gp +Gwadelup gp +ਗੁਆਡੀਓਪੀ gp +Gwadelupa gp +Guadalupe gp +Guadalupe gp +Guadelupa gp +Гваделупа gp +Gwaderupe gp +Гвадалупе gp +Gvadalupe gp +க்வாடெல்போப் gp +Гвадалуппо gp +เกาะกัวเดอลูป gp +Guadelupa gp +Гваделупа gp +Гваделупа gp +瓜德罗普 gp +瓜德魯普 gp +Equatorial Guinea gq +Ekwatoriaal Guinea gq +غينيا الاستوائية gq +Экватарыяльная Гвінэя gq +Екваториална Гвинея gq +ইকুয়েটোরিয়াল গিনি gq +Guine équatoriale gq +Ekvatorijalna Gvineja gq +Guinea Equatorial gq +Rovníková Guinea gq +Gini Gyhydeddol gq +Ækvatorial Guinea gq +Äquatorial-Guinea gq +Ισημερινή Γουινέα gq +Ekvatora Gvineo gq +Guinea equatorial gq +Ekvatoriaal-Guinea gq +Ginea Ekuatoriala gq +گینه اکوادور gq +Päiväntasaajan Guinea gq +Guinée équatoriale gq +Guine Mheánchiorclach gq +Guinea Ecuatorial gq +גינאה המשוונית gq +इक्वेटोरियल गुएना gq +Ekvatorijalna Gvineja gq +Egyenlítői Guinea gq +Miðbaugs-Gínea gq +Guinea Equatoriale gq +赤道ギニア gq +ហ្គីណេ​អេក្វាទ័រ gq +적도 기니 gq +ການສອນ gq +Ekvatoriaus Gvinėja gq +Ekvatoriālā Gvineja gq +Екваторијална Гвинеја gq +Equatorial Гуйнеа gq +Ginea Ekwatorjali gq +Ekvatorial-Guinea gq +Äquatoriaal-Guinea gq +Equatoriaal Guinea gq +Ekvatorial-Guinea gq +ਏਕੂਲੇਟਰਲ ਗੁਈਨਿਆ gq +Gwinea Równikowa gq +Guiné Equatorial gq +Guiné Equatorial gq +Guinea Ecuatorială gq +Экваториальная Гвинея gq +Gineya Ekwatoriyale gq +Ekvatorialalaš-Guinea gq +Rovníkova Guinea gq +Ekvatorialna Gvineja gq +Екваторијална Гвинеја gq +Ekvatorijalna Gvineja gq +Ekvatorialguinea gq +ஈகோடோரியல் க்யுனியா gq +Гинеи Экваторӣ gq +กินี ตรงเส้นศูนย์สูตร gq +Ekvatoral Gine gq +Equatorlı Guinea gq +Екваторіальна Гвінея gq +Экваториал Гвинея gq +Guinêye Ecwåtoriåle gq +赤道几内亚 gq +赤道幾內亞 gq +Greece gr +Griekeland gr +اليونان gr +Yunanıstan gr +Грэцыя gr +Гърция gr +গ্রীস gr +Gres gr +Grčka gr +Grècia gr +Řecko gr +Gwlad Groeg gr +Grækenland gr +Griechenland gr +Ελλάδα gr +Grekujo gr +Grecia gr +Kreeka gr +Grezia gr +یونان gr +Kreikka gr +Grikkaland gr +Grèce gr +Grikelân gr +An Ghréig gr +Grécia gr +יוון gr +ग्रीस gr +Grčka gr +Görögország gr +Grikkland gr +Grecia gr +ギリシャ gr +ក្រិក gr +그리스 gr +ກີຊ gr +Graikija gr +Grieķija gr +Грција gr +Грек gr +Greċja gr +Hellas gr +Grekenland gr +Griekenland gr +Hellas gr +Grèça gr +ਗਰੀਸ gr +Grecja gr +Grécia gr +Grécia gr +Grecia gr +Греция gr +Ubugereki gr +Greika gr +Grécko gr +Grčija gr +Грчка gr +Grčka gr +I-Greece gr +Grekland gr +கிரீசு gr +Юнон gr +กรีซ gr +Yunanistan gr +Yunanstan gr +Греція gr +Юнонистон gr +Hy Lạp gr +Grece gr +希腊 gr +希臘 gr +Guatemala gt +Gautemala gt +غواتيمالا gt +Quatemala gt +Гватэмала gt +Гватемала gt +গুয়াতেমালা gt +Gvatemala gt +Gwatemala gt +Γουατεμάλα gt +Gvatemalo gt +گواتمالا gt +Guatamala gt +גואטמלה gt +ग्वाटेमाला gt +Gvatemala gt +Gvatemala gt +グァテマラ gt +ហ្គាតេម៉ាឡា gt +과테말라 gt +ກັວເຕມາລາ gt +Gvatemala gt +Gvatemala gt +Гватемала gt +Гуятемала gt +Gwatemala gt +ਗੁਆਟੇਮਾਲਾ gt +Gwatemala gt +Гватемала gt +Gwatemala gt +Gvatemala gt +Гватемала gt +Gvatemala gt +I-Guatemala gt +குவாத்தமாலா gt +Гватемоло gt +กัวเตมาลา gt +Гватемала gt +Гватемала gt +Gwatemala gt +危地马拉 gt +瓜地馬拉 gt +Guam gu +غوام gu +Гуам gu +Гуам gu +গুয়াম gu +Gwam gu +Gw?m gu +Γκουάμ gu +Gvamo gu +گوام gu +גואם gu +गुवाम gu +Gvam gu +グァム gu +ហ្គាំម gu +괌 gu +ແກມມາ gu +Guama gu +Гвам gu +Гуам gu +Gwam gu +ਗੁਆਮ gu +Гуам gu +Gwamu gu +Гуам gu +காம் gu +Гуамма gu +กวม gu +Гуам gu +Гуам gu +Gwam gu +关岛 gu +關島 gu +Guinea-Bissau gw +غينيا-بيساو gw +Гвінэя-Бісаў gw +Гвинея Бисау gw +গিনি-বিসো gw +Gine-Biso gw +Gvineja-Bisau gw +Gini-Bisaw gw +Γουινέα-Μπισσάου gw +Gvineo Bisaŭa gw +Ginea-Bissau gw +گینه بیسائو gw +Guinée-Bissau gw +Guine-Bhissau gw +גינאה ביסאו gw +गुएना-बिसाऊ gw +Bissau-Guinea gw +Gínea-Bissá gw +ギニアビサオ gw +ហ្គីណេប៊ីសៅ gw +기니비사 gw +ລັດເຊີຍ gw +Gvineja-Bisava gw +Гвинеја Бисао gw +Гуйнеа-Биссау gw +Ginea-Bissaw gw +ਗੁਇਨਿਆ-ਬਿਸ਼ਾਉ gw +Gwinea-Bissau gw +Guiné Bissau gw +Guiné-Bissau gw +Гвинея-Бисау gw +Gineya-Bisawu gw +Гвинеја Бисао gw +Gvineja Bisao gw +க்யுனியா-பிஸ்ஸா gw +Гвинеи Биссои gw +กินี - บิสซอ gw +Gine-Bissau gw +Гвінея-Бісау gw +Гвинея-Биссау gw +Guinêye-Bissaw gw +几内亚比绍 gw +幾內亞比紹 gw +Guyana gy +غيانا gy +Гвіяна gy +Гуайана gy +গায়ানা gy +Gwiana gy +Gvajana gy +Giana gy +Γουιάνα gy +Gujano gy +گویان gy +Guyane gy +An Ghuáin gy +Guiana gy +גויאנה gy +गुयाना gy +Gvæjana gy +ガイアナ gy +ហ្គីយ៉ាណា gy +가이아나 gy +ຈີນ gy +Gviana gy +Gajana gy +Гвајана gy +Гуяна gy +Gujana gy +ਗੁਆਨਾ gy +Gujana gy +Guiana gy +Guiana gy +Guiana gy +Гайана gy +Giyana gy +Gvajana gy +Гвајана gy +Gvajana gy +கானா gy +Гуана gy +กูยาน่า gy +Guana gy +Гайяна gy +Гвиана gy +圭亚那 gy +蓋亞納 gy +Hong Kong SAR(China) hk +Hong Kong SAR (China) hk +Хонг Конг (Китай) hk +হং কং SAR(চীন) hk +Hong Kong SAR(Sina) hk +Hong Kong SAR(Xina) hk +Hong Kong SAR (Čína) hk +Hongkong SAR(Kina) hk +Χονγκ Κονγκ SAR (Κίνα) hk +Hongkong hk +Hong Kong SAR(Txina) hk +Hong Kong SAR (Kiina) hk +Hong Kong SAR (Chine) hk +Hong Cong SAR(An tSín) hk +Hong Kong hk +הונג קונג SAR (סין) hk +Hongkong (Kína) hk +Hong Kong (sjálfstjórnarhérað í Kína) hk +Hong Kong SAR(Cina) hk +香港(中国) hk +ហុងចិន (ចិន) hk +Hong Kongas SAR(Kinija) hk +Хонг Конг САР(Кина) hk +Hongkong SAR(Kina) hk +Hong Kong hk +Hongkong SAR(Kina) hk +ਹਾਂਗ-ਕਾਂਗ SAR(ਚੀਨ) hk +Hong Kong SAR (Chiny) hk +Hong Kong SAR (China) hk +Гонконг hk +Hong Kong SAR (Ubushinwa) hk +Hongkong SAR(Kiinná) hk +Hong Kong SAR (Kitajska) hk +SAR Hong Kong (Кина) hk +SAR Hong Kong (Kina) hk +Hong Kong (Kina) hk +ஹாங்காங் SAR(சீனா) hk +ฮ่องกง hk +Hong Kong (Çin) hk +Гонконг SAR (Китай) hk +Гонконг (Хитой) hk +中国香港特别行政区 hk +香港 SAR(中國) hk +Honduras hn +هندوراس hn +Гандурас hn +Хондурас hn +হণ্ডুরাস hn +Hondures hn +Hondwras hn +Ονδούρα hn +Honduro hn +هندوراس hn +Hondúras hn +הונדורס hn +होंडुरास hn +Hondúras hn +ホンジュラス hn +ហុងឌូរ៉ាស់ hn +온두라스 hn +ຫອນດູລັດ hn +Hondūras hn +Hondurasa hn +Хондурас hn +Хондурас hn +Ħonduras hn +Hondures hn +ਹੰਨਡੂਰਸ hn +Гондурас hn +Hondirasi hn +Хондурас hn +I-Honduras hn +ஆண்டுராஸ் hn +Ҳиндурос hn +ฮอนดูรัส hn +Гондурас hn +Гондурас hn +洪都拉斯 hn +宏都拉斯 hn +Croatia hr +Kroasië hr +كرواتيا hr +Xırvatıstan hr +Харватыя hr +Хърватска hr +ক্রোয়াশিয়া hr +Kroatia hr +Hrvatska hr +Croàcia hr +Chorvatsko hr +Kroatien hr +Kroatien hr +Κροατία hr +Kroatio hr +Croacia hr +Horvaatia hr +Kroazia hr +کرواسی hr +Kroatia hr +Kroatia hr +Croatie hr +Kroatië hr +An Chróit hr +Croácia hr +קרואטיה hr +क्रोएशिया hr +Hrvatska hr +Horvátország hr +Kroasia hr +Króatía hr +Croazia hr +クロアチア hr +ក្រូអាត hr +크로아티아 hr +ໂຄເອເທີຍ hr +Kroatija hr +Horvātija hr +Хрватска hr +Кроати hr +Kroazja hr +Kroatia hr +Kroatien hr +Kroatië hr +Kroatia hr +Croacia hr +ਕਰੋਆਟਿਆ hr +Chorwacja hr +Croácia hr +Croácia hr +Croaţia hr +Хорватия hr +Korowasiya hr +Kroátia hr +Chorvátsko hr +Hrvaška hr +Хрватска hr +Hrvatska hr +I-Croatia hr +Kroatien hr +க்ரோடியா hr +Хорватӣ hr +โครเอเธีย hr +Hırvatistan hr +Kroatia hr +Хорватія hr +Хорватия hr +Crowåceye hr +克罗地亚 hr +克羅埃西亞 hr +Haiti ht +Haïti ht +هايتي ht +Гаіці ht +Хаити ht +হাইতি ht +Haití ht +Αϊτή ht +Haitio ht +Haití ht +هاییتی ht +Haïti ht +Háítí ht +האיטי ht +हैती ht +Haítí ht +ハイチ ht +ហែទី ht +아이티 ht +ວາດຮູບ - K ht +Haitis ht +Хаити ht +Хайти ht +Ħaiti ht +ਹਾਇਟੀ ht +Гаити ht +Hayiti ht +Хаити ht +ஹைதி ht +Ҳаити ht +ไฮติ ht +Гаїті ht +Гаити ht +Hayiti ht +海地 ht +海地 ht +Hungary hu +Hongarye hu +هنغاريا hu +Macarıstan hu +Вугоршчына hu +Унгария hu +হাঙ্গেরী hu +Hungaria hu +Mađarska hu +Hongria hu +Maďarsko hu +Hwngari hu +Ungarn hu +Ungarn hu +Ουγγαρία hu +Hungario hu +Hungría hu +Ungari hu +Hungaria hu +مجارستان hu +Unkari hu +Ungarn hu +Hongrie hu +Hongarije hu +An Ungáir hu +Hungria hu +הונגריה hu +हंगरी hu +Mađjarska hu +Magyarország hu +Hungaria hu +Ungverjaland hu +Ungheria hu +ハンガリー hu +ហុងគ្រី hu +헝가리 hu +ຫັງກາລີ hu +Vengrija hu +Ungārija hu +Унгарија hu +Унгар hu +Ungerija hu +Ungarn hu +Ungarn hu +Hongarije hu +Ungarn hu +Hongria hu +ਹੰਗਰੀ hu +Węgry hu +Hungria hu +Hungria hu +Ungaria hu +Венгрия hu +Hongiriya hu +Ungár hu +Maďarsko hu +Madžarska hu +Мађарска hu +Mađarska hu +I-Hungary hu +Ungern hu +ஹங்கேரி hu +Маҷористон hu +ฮังการี hu +Macaristan hu +Macarstan hu +Угорщина hu +Венгрия hu +Hongreye hu +匈牙利 hu +匈牙利 hu +Indonesia id +Indonesië id +إندونيسيا id +İndoneziya id +Інданэзія id +Индонезия id +ইন্দোনেশিয়া id +Indonezi id +Indonezija id +Indonèsia id +Indonésie id +Indonesien id +Indonesien id +Ινδονησία id +Indonezio id +Indoneesia id +اندونزی id +Indonésie id +Indonesië id +An Indinéis id +Indonésia id +אינדונזיה id +इंडोनेशिया id +Indonezija id +Indonézia id +Indónesía id +インドネシア id +ឥណ្ឌូនេស៊ី id +인도네시아 id +ອີຍໂດນີເຊີຍ id +Indonezija id +Indonēzija id +Индонезија id +Индонез id +Indoneżja id +Indonesien id +Indonesië id +ਇੰਡੋਨੇਸ਼ੀਆ id +Indonezja id +Indonésia id +Indonésia id +Indonezia id +Индонезия id +Indonesiya id +Indonézia id +Indonezija id +Индонезија id +Indonezija id +I-Indonesia id +Indonesien id +இந்தோனீசியா id +Индонезӣ id +อินโดนีเซีย id +İndonezya id +İndonesia id +Індонезія id +Индонезия id +Indonezeye id +印度尼西亚 id +印尼 id +Ireland ie +Ierland ie +أيرلندا ie +İrlandiya ie +Ірляндыя ie +Ирландия ie +আয়ারল্যাণ্ড ie +Iwerzhon ie +Irska ie +Irlanda ie +Irsko ie +Iwerddon ie +Irland ie +Irland ie +Ιρλανδία ie +Islando ie +Irlanda ie +Iirimaa ie +Irlanda ie +ایرلند ie +Irlanti ie +Írland ie +Irlande ie +Ierlân ie +Éire ie +Irlanda ie +אירלנד ie +आयरलैंड ie +Irska ie +Írország ie +Irlandia ie +Írland ie +Irlanda ie +アイルランド ie +អៀរឡង់ ie +아일랜드 ie +ໄອແລນ ie +Airija ie +Īrija ie +Ирска ie +Ирланд ie +Irlanda ie +Irland ie +Irland ie +Ierland ie +Irland ie +Irlanda ie +ਆਇਰਲੈਂਡ ie +Irlandia ie +Irlanda ie +Irlanda ie +Irlanda ie +Ирландия ie +Irilande ie +Irlánda ie +Írsko ie +Irska ie +Ирска ie +Irska ie +I-Ireland ie +Irland ie +அயர்லாந்து ie +Ирлонд ie +ไอร์แลนด์ ie +İrlanda ie +İreland, İrlandia ie +Ірландія ie +Ирландия ie +Irlande ie +伊朗 ie +愛爾蘭 ie +Israel il +اسرائيل il +İzrail il +Ізраіль il +Израел il +ইসরাইল il +Izrael il +Izrael il +Ισραήλ il +Israelo il +Iisrael il +اسراییل il +Ísrael il +Israël il +Iosrael il +ישראל il +इज़राइल il +Izrael il +Izrael il +Ísrael il +Israele il +イスラエル il +អ៊ីស្រាអែល il +이스라엘 il +ອິດສະລະເອລ il +Izraelis il +Izraēla il +Израел il +Изриал il +Iżrael il +ਇਜ਼ਰਾਈਲ il +Izrael il +Израиль il +Isirayeli il +Izrael il +Izrael il +Израел il +Izrael il +I-Israel il +இசுரேல் il +Исроил il +อิสราเอล il +İsrail il +İsrael il +Ізраїль il +Исроил il +Israyel il +USirayeli il +以色列 il +以色列 il +India in +Indië in +الهند in +Hindistan in +Індыя in +Индия in +ভারত in +Indez in +Indija in +Índia in +Indie in +Indien in +Indien in +Ινδία in +Hindujo in +هندوستان in +Intia in +Inde in +An India in +Índia in +הודו in +भारत in +Indija in +Indland in +インド in +ឥណ្ឌា in +인도 in +ອິນເດີຍ in +Indija in +Indija in +Индија in +Энэтхэг in +Indja in +Indien in +ਭਾਰਤ in +Indie in +Índia in +Índia in +Индия in +Ubuhinde in +Indija in +Индија in +Indija in +I-India in +Indien in +இந்தியா in +Ҳиндустон in +อินเดีย in +Hindistan in +Hindstan in +Індія in +Ҳиндистон in +Ấn Độ in +Inde in +印度 in +印度 in +Endiya in +Iraq iq +Irak iq +العراق iq +İraq iq +Ірак iq +Ирак iq +ইরাক iq +Irak iq +Irak iq +Irák iq +Irac iq +Irak iq +Irak iq +Ιράκ iq +Irako iq +Irak iq +Iraak iq +Irak iq +عراق iq +Irak iq +Irak iq +Irak iq +Irak iq +An Iaráic iq +עיראק iq +इराक iq +Irak iq +Irak iq +Írak iq +イラク iq +អ៊ីរ៉ាក់ iq +이라크 iq +ອີລັກ iq +Irakas iq +Irāka iq +Ирак iq +Ирак iq +Irak iq +Irak iq +Irak iq +Irak iq +ਇਰਾਕ iq +Irak iq +Iraque iq +Iraque iq +Irak iq +Ирак iq +Iraki iq +Iráka iq +Irák iq +Irak iq +Ирак iq +Irak iq +I-Iraq iq +Irak iq +ஈராக் iq +Ироқ iq +อิรัก iq +Irak iq +Ğíraq iq +Ірак iq +Ироқ iq +Irak iq +伊拉克 iq +伊拉克 iq +Iran ir +أيران ir +Іран ir +Иран ir +ইরান ir +Írán ir +Ιράν ir +Irano ir +Iraan ir +ایران ir +An Iaráin ir +Irán ir +איראן ir +इरान ir +Irán ir +Íran ir +イラン ir +អ៊ីរ៉ង់ ir +이란 ir +ອີລັກ ir +Iranas ir +Irāna ir +Иран ir +Иран ir +ਈਰਾਨ ir +Irão ir +Irã ir +Иран ir +Irani ir +Irána ir +Irán ir +Иран ir +I-Iran ir +ஈரான் ir +Эрон ir +อิหร่าน ir +İran ir +İran ir +Іран ir +Эрон ir +伊朗 ir +伊朗 ir +Iceland is +Ysland is +أيسلندا is +İslandiya is +Ісьляндыя is +Исландия is +আইসল্যাণ্ড is +Island is +Island is +Islàndia is +Island is +Ynys yr I? is +Island is +Island is +Ισλανδία is +Islando is +Islandia is +Island is +Islandia is +ایسلند is +Islanti is +Ísland is +Islande is +Yslân is +An Íoslainn is +Islándia is +איסלנד is +आयरलैंड is +Island is +Izland is +Islandia is +Ísland is +Islanda is +アイスランド is +អ៊ីស្លង់ is +아이슬란드 is +ໄອຊແລນ is +Islandija is +Islande is +Исланд is +Исланд is +Islandja is +Island is +Island is +IJsland is +Island is +Islandia is +ਆਈਸਲੈਂਡ is +Islandia is +Islândia is +Islândia is +Islanda is +Исландия is +Isilande is +Islánda is +Island is +Islandija is +Исланд is +Island is +I-Iceland is +Island is +தீவு is +Ислонд is +ไอซ์แลนด์ is +İzlanda is +İsland is +Ісландія is +Исландия is +Izlande is +冰岛 is +冰島 is +Icelandi is +Italy it +Italië it +ايطاليا it +İtalyia it +Італія it +Италия it +ইতালী it +Italia it +Italija it +Itàlia it +Itálie it +Yr Eidal it +Italien it +Italien it +Ιταλία it +Italio it +Italia it +Itaalia it +Italia it +ایتالیا it +Italia it +Italia it +Italie it +Italië it +An Iodáil it +Itália it +איטליה it +इटली it +Italija it +Olaszország it +Italia it +Ítalía it +Italia it +イタリア it +អ៊ីតាលី it +이탈리아 it +ອີຕາລີ it +Italija it +Itālija it +Италија it +Итали it +Itali it +Italja it +Italia it +Italien it +Italië it +Italia it +Italia it +ਇਟਲੀ it +Włochy it +Itália it +Itália it +Italia it +Италия it +Ubutaliyani it +Itália it +Taliansko it +Italija it +Италија it +Italija it +I-Italy it +Italien it +இத்தாலி it +Итолиё it +อิตาลี it +İtalya it +İtalia it +Італія it +Италия it +Ý it +Itåleye it +Ithali it +意大利 it +義大利 it +Jamaica jm +Jamaika jm +جامايكا jm +Yamayka jm +Ямайка jm +Ямайка jm +জামাইকা jm +Jamaika jm +Jamajka jm +Jamajka jm +Jamaika jm +Τζαμάικα jm +Jamajko jm +Jamaika jm +جاماییکا jm +Jamaika jm +Jamaïque jm +An Iamáice jm +Xamaica jm +ג'מייקה jm +जमैका jm +Jamajka jm +Jamaika jm +Jamaika jm +Jamaíka jm +Giamaica jm +ジャマイカ jm +ហ្សាម៉ាអ៊ិគ jm +자메이카 jm +ຈາໄມກາ jm +Jamaika jm +Jamaika jm +Јамајка jm +Ямайк jm +Ġamajka jm +Jamaika jm +ਜੈਮੇਕਾ jm +Jamajka jm +Ямайка jm +Jamayika jm +Jamajka jm +Jamajka jm +Јамајка jm +Jamajka jm +I-Jamaica jm +சமெய்க்கா jm +Ҷомойко jm +จาไมก้า jm +Jamaika jm +Jamayka jm +Ямайка jm +Ямайка jm +Djamayike jm +牙买加 jm +牙買加 jm +Jordan jo +Jordaan jo +الأردن jo +İordaniya jo +Ярданія jo +Йордания jo +জর্ডান jo +Jordani jo +Jordània jo +Jordán jo +Gwlad Iorddonen jo +Jordanien jo +Ιορδανία jo +Jordanio jo +Jordania jo +Jordaania jo +Jordania jo +اردن jo +Jordania jo +Jordanie jo +Jordanië jo +An Iordáin jo +Xordánia jo +ירדן jo +जॉर्डन jo +Jordánia jo +Jórdanía jo +Giordania jo +ヨルダン jo +ហ្ស៊កដានី jo +요르단 jo +ຈໍແດນ jo +Jordanija jo +Jordānija jo +Јордан jo +Ёрдан jo +Ġordan jo +Jordanien jo +Jordanië jo +ਜਾਰਡਨ jo +Jordania jo +Jordânia jo +Jordânia jo +Iordania jo +Иордания jo +Yorudani jo +Jordánia jo +Jordánsko jo +Jordanija jo +Јордан jo +I-Jordan jo +Jordanien jo +ஜோர்டான் jo +Урдон jo +จอร์แดน jo +Ürdün jo +Йорданія jo +Иордан jo +Djordaneye jo +约旦 jo +約旦 jo +Ijolidani jo +Japan jp +اليابان jp +Yaponiya jp +Японія jp +Япония jp +জাপান jp +Japon jp +Japó jp +Japonsko jp +Siapan jp +Ιαπωνία jp +Japanio jp +Japón jp +Jaapan jp +Japonia jp +ژاپن jp +Japani jp +Japon jp +An tSeapáin jp +Xapón jp +יפן jp +जापान jp +Japán jp +Jepang jp +Giappone jp +日本 jp +ជប៉ុន jp +일본 jp +ຍີ່ປຸ່ນ jp +Japonija jp +Japāna jp +Јапонија jp +Япон jp +Jepun jp +Ġappun jp +Japon jp +ਜਾਪਾਨ jp +Japonia jp +Japão jp +Japão jp +Japonia jp +Япония jp +Ubuyapani jp +Japána jp +Japonsko jp +Japonska jp +Јапан jp +I-Japan jp +சப்பான் jp +Ҷопон jp +ญี่ปุ่น jp +Japonya jp +Japan, Yaponia jp +Японія jp +Япония jp +Nhật bản jp +Djapon jp +日本 jp +日本 jp +Kenya ke +Kenië ke +كينيا ke +Кенія ke +Кения ke +কেনিয়া ke +Kenija ke +Keňa ke +Cenia ke +Kenia ke +Κένυα ke +Kenjo ke +Kenia ke +کنیا ke +Kenia ke +An Chéinia ke +Kenia ke +קניה ke +केन्या ke +Kenija ke +Kenía ke +ケニア ke +កេនយ៉ា ke +케냐 ke +ເວນດາ ke +Kenija ke +Kenija ke +Кенија ke +Кения ke +Kenja ke +Kenia ke +ਕੀਨੀਆ ke +Kenia ke +Quénia ke +Quênia ke +Kenia ke +Кения ke +Keňa ke +Kenija ke +Кенија ke +Kenija ke +கென்யா ke +Куниё ke +เคนยา ke +Kenia ke +Кенія ke +Кения ke +Kenia ke +肯尼亚 ke +肯亞 ke +Kyrgyzstan kg +قيرغيزستان kg +Кыргызстан kg +Киргизстан kg +কির্গিজস্তান kg +Kirgistan kg +Kirgistan kg +Kyrgigstan kg +Kyrgyzstán kg +Cyrgystan kg +Kirgizistan kg +Kirgisien kg +Κιργιζιστάν kg +Kirgizujo kg +Kyrgyzstán kg +Kõrgõzstan kg +قرقیزستان kg +Kirghizstan kg +An Chirgeastáin kg +Kirguizistán kg +קירגיסטן kg +किर्गिजिस्तान kg +Kirgizisztán kg +Kirgisistan kg +Kirghizistan kg +キルギスタン kg +គៀរហ្គីស្តង់ kg +키르기스스탄 kg +ຄສິຕັລ kg +Kirgistanas kg +Kirgizstāna kg +Киргистан kg +Киргизстан kg +Kirgiżstan kg +Kirgisistan kg +Kirgisien kg +Kirgizië kg +Kirgisistan kg +ਕਿਰਗਸਤਾਨ kg +Kigistan kg +Quirguistão kg +Quirguistão kg +Kirgiztan kg +Киргизстан kg +Kirigizisitani kg +Kirgisistan kg +Kirgizstan kg +Киргистан kg +Kirgistan kg +Kirgizistan kg +கிர்கிஸ்தான் kg +Қирғизистон kg +คีจิสถาน kg +Kırgızistan kg +Qırğızstan kg +Киргизстан kg +Қирғизистон kg +Kirguiztan kg +吉尔吉斯斯坦 kg +吉爾吉斯 kg +Cambodia kh +Kambodië kh +كمبوديا kh +Камбоджа kh +Камбоджа kh +কামবোডিয়া kh +Kambodj kh +Kambođa kh +Cambodja kh +Kambodža kh +Kambodscha kh +Καμπότζη kh +Kamboĝo kh +Kambodža kh +Canbodia kh +کامبوج kh +Kambodza kh +Cambodge kh +Cambodja kh +An Chambóid kh +Camboia kh +קמבודיה kh +कम्बोडिया kh +Kambođa kh +Kambodzsa kh +Kambódía kh +Cambogia kh +カンボジア kh +កម្ពុជា kh +캄보디아 kh +ໂຄລຳເບີຍ kh +Kambodža kh +Kambodža kh +Камбоџа kh +Камбодиа kh +Kemboja kh +Kambodja kh +Kambodsja kh +Kambodscha kh +Cambodja kh +Kambodsja kh +ਕੰਬੋਡੀਆ kh +Kambodża kh +Cambodja kh +Cambodja kh +Cambogia kh +Камбоджа kh +Kamboji kh +Kamboža kh +Kambodža kh +Kambodža kh +Камбоџа kh +Kambodža kh +Kambodja kh +கம்போடியா kh +Камбуҷа kh +กัมพูชา kh +Kamboçya kh +Kambodia kh +Камбоджа kh +Камбоджа kh +Cam pu chia kh +Cambodje kh +柬埔寨 kh +柬埔寨 kh +Kiribati ki +كيريباتي ki +Кiрыбацi ki +Кирибати ki +কিরিবাটি ki +Ciribati ki +Κιριμπάτι ki +Kiribato ki +کیریباتی ki +Ciribeas ki +קיריבאטי ki +किरीबाती ki +Kíribatí ki +キリバス ki +គិរិបាទី ki +키리바시 ki +ແຟຄທັລ - K ki +Кирибати ki +Крибати ki +ਕਿਰਿਬਟੀ ki +Кирибати ki +Кирибати ki +கிரிபடி ki +Карибот ki +คิริบาติ ki +Кірібаті ki +Кирибати ki +基里巴斯 ki +吉里巴斯 ki +Comoros km +جزر القمر km +Каморы km +Коморски острови km +কমোরস km +Komoros km +Komori km +Komory km +Ynysoedd Y Comoros km +Comorerne km +Komoren km +Κομόρες km +Komoroj km +Komoorid km +کوموروس km +Komorit km +Comores km +Na Comóir km +קומורוס km +कोमोरो km +Kómoreyjar km +Comore km +コモロ km +កុំម៉ូរ៉ូស km +코모로 km +ສີ km +Komoru salas km +Коморски острови km +Соморос km +Komoros km +Komorene km +Komoren km +Komorane km +ਕੋਮੋਰੋਸ km +Komory km +Коморские острова km +Komore km +Komorot km +Komori km +Комора km +Komora km +Komorerna km +காமாரோஸ் km +Коморос km +โคโมรอส km +Komoros km +Komorlar km +Коморські острови km +Коморос km +Comores km +科摩罗 km +葛摩 km +St. Kitts and Nevis kn +St. Kitts en Nevis kn +سانت كيتس و نيفيس kn +St. Kitts və Nevis kn +Сэнт-Крыстофер і Нэвіс kn +Св. Китс и Невис kn +সেন্ট কিটস এবং নেভিস kn +S. Kitts ha Nevis kn +St. Kitts i Nevis kn +Sv. Kitts a Nevis kn +Ynysoedd St. Kitts a Nevis kn +St. Kitts-Nevis kn +St. Kitts und Nevis kn +Άγιος Χριστόφορος (Σαιντ Κιτς) και Νέβις kn +Sent-Kristofo kaj Neviso kn +St. Kitts y Nevis kn +St. Kitts ja Nevis kn +St. Kitts eta Nevis kn +سن کیتس و نویس kn +St. Kitts ja Nevis kn +St Kitts et Nevis kn +St. Kitts en Nevis kn +San Críostóir Nimheas kn +Saint Kitts e Nevis kn +סנט קיטס ונביס kn +सेंट किट्स तथा नेविस kn +St. Kitts és Nevis kn +St. Kitts dan Nevis kn +Sankti Kristófer og Nevis kn +Saint Kitts e Nevis kn +セントクリストファーネイビス kn +សង់ឃីត និង នេវីស kn +세인트 키츠 네비스 kn +Šv. Kitts ir Nevis kn +Senkitsa un Nevisa kn +Св. Китс и Невис kn +St. Киттс ба Невис kn +St. Kitts u Nevis kn +St. Kitts og Nevis kn +St. Kitts un Nevis kn +St. Kitts en Nevis kn +St. Kitts og Nevis kn +St. Kitts le Nevis kn +St. Kitts e Nevis kn +ਸੇਂਟ ਕਿਟਸ ਤੇ ਨਿਵੀਸ kn +St. Kitts e Nevis kn +St Kitts e Nevis kn +Sf. Kitts şi Nevis kn +Сент-Китс и Невис kn +Mutagatifu Kitsi na Nevisi kn +St. Kitts ja Nevis kn +St. Kitts a Nevis kn +St. Kitts in Nevis kn +Св. Китс и Невис kn +Sv. Kits i Nevis kn +I-St. Kitts and Nevis kn +St. Kitts och Nevis kn +செயின்ட் கிட்சு & நெவிசு kn +Синт Киттс ва Невис kn +เซนต์กิตส์และเนวิส kn +St. Kitts ve Nevis kn +Santa Kitts wä Nevis kn +Федерація Сент-Кітс і Невіс kn +Сент-Кристофер ва Невис kn +St. Kitts na Nevis kn +St. Kitts và Nevis kn +St. Kitts neNevis kn +圣基茨和尼维斯 kn +聖克理斯多福及尼維斯 kn +St. Kitts kanye no-Nevis kn +North Korea kp +Noord Korea kp +كوريا الشمالية kp +Şimali Koreya kp +Паўночная Карэя kp +Северна Корея kp +উত্তর কোরিয়া kp +Norzh-Korea kp +Sjeverna Koreja kp +Corea del Nord kp +Severní Korea kp +Gogledd Corea kp +Nordkorea kp +Nord-Korea kp +Βόρεια Κορέα kp +Nordkoreo kp +Corea del Norte kp +Põhja-Korea kp +Ipar Korea kp +کره شمالی kp +Pohjois-Korea kp +Norðurkorea kp +Corée du nord kp +Noard-Korea kp +An Chóiré Thuaidh kp +Corea do Norte kp +צפון קוריאה kp +उत्तरी कोरिया kp +Sjeverna Koreja kp +Észak-Korea kp +Korea Utara kp +Norður-Kórea kp +Corea del Nord kp +朝鮮民主主義人民共和国 kp +កូរ៉េ​ខាង​ជើង kp +조선민주주의 인민공화국 kp +ເກົາລີເຫນືອ kp +Šiaurės Korėja kp +ZiemeļKoreja kp +Северна Кореја kp +Хойд солонгос kp +Korea ta' Fuq kp +Nord-Korea kp +Noordkorea kp +Noord-Korea kp +Nord-Korea kp +Lebowa la Korea kp +Corea dèu Nord kp +ਉੱਤਰੀ ਕੋਰੀਆ kp +Korea Północna kp +Coreia do Norte kp +Coréia do Norte kp +Coreea de Nord kp +Северная Корея kp +Koreya y'Amajyaruguru kp +Davvi-Korea kp +severná Kórea kp +Severna Koreja kp +Северна Кореја kp +Severna Koreja kp +I-North Korea kp +Nordkorea kp +வட கொரியா kp +Кореяи Шимолӣ kp +เกาหลีเหนือ kp +Kuzey Kore kp +Tönyaq Korea kp +Північна Корея kp +Шимолий Корея kp +Devhula ha Korea kp +Bắc Triều Tiên kp +Bijhe Corêye kp +Umntla Korea kp +朝鲜 kp +北韓 kp +Enyakatho ne-Korea kp +South Korea kr +Suid Korea kr +كوريا الجنوبية kr +Cənubi Koreya kr +Паўднёвая Карэя kr +Южна Корея kr +দক্ষিণ কোরিয়া kr +Su-Korea kr +Južna Koreja kr +Corea del Sud kr +Jižní Korea kr +De Corea kr +Sydkorea kr +Süd-Korea kr +Νότια Κορέα kr +Sudkoreo kr +Corea del Sur kr +Lõuna-Korea kr +Hego Korea kr +کره جنوبی kr +Etelä-Korea kr +Suðurkorea kr +Corée du sud kr +Sûd-Korea kr +An Chóiré Theas kr +Corea do Sur kr +דרום קוריאה kr +दक्षिणी कोरिया kr +Južna Koreja kr +Dél-Korea kr +Korea Selatan kr +Suður-Kórea kr +Corea del Sud kr +大韓民国 kr +កូរ៉េ​ខាង​ត្បូង kr +대한민국 kr +ເກົາລີໃຕ້ kr +Pietų Korėja kr +DievidKoreja kr +Јужна Кореја kr +Өмнөд солонгос kr +Korea t'Isfel kr +Sør-Korea kr +Söödkorea kr +Zuid-Korea kr +Sør-Korea kr +Borwa bja Korea kr +Corea dèu Sud kr +ਦੱਖਣੀ ਕੋਰੀਆ kr +Korea Południowa kr +Coreia do Sul kr +Coréia do Sul kr +Coreea de Sud kr +Южная Корея kr +Koreya y'Amajyepfo kr +Lulli-Korea kr +Južná Kórea kr +Južna Koreja kr +Јужна Кореја kr +Južna Koreja kr +I-South Korea kr +Sydkorea kr +தென் கொரியா kr +Кореяи Ҷанубӣ kr +เกาหลีใต้ kr +Güney Kore kr +Könyaq Korea kr +Південна Корея kr +Жанубий Корея kr +Korea tshipembe kr +Hàn Quốc kr +Nonne Corêye kr +Umzantsi Korea kr +韩国 kr +南韓 kr +Emzansi Korea kr +Kuwait kw +Kuwaït kw +الكويت kw +Кувэйт kw +Кувейт kw +কুয়েত kw +Kowaet kw +Kuvajt kw +Kuvajt kw +Coweit kw +Κουβέιτ kw +Kuvajto kw +Kuveit kw +کویت kw +Kuvait kw +Kowait kw +Koeweit kw +Cuáit kw +כווית kw +कुवैत kw +Kuvajt kw +Kuvait kw +Kúveit kw +クェート kw +គុយវ៉ែត kw +쿠웨이트 kw +ແຕ້ມຮູບ- K kw +Kuveitas kw +Kuveita kw +Кувајт kw +Кувейт kw +Koeweit kw +ਕੁਵੈਤ kw +Koweit kw +Kuveit kw +Кувейт kw +Koweti kw +Kuvajt kw +Kuvajt kw +Кувајт kw +Kuvajt kw +I-Kuwait kw +குவைத் kw +Қувейт kw +คูเวต kw +Küwäyt kw +KКувейт kw +Кувайт kw +Kuweyt kw +科威特 kw +科威特 kw +Cayman Islands ky +Cayman Eilande ky +جزر الكايمان ky +Кайманови острови ky +কেম্যান দ্বীপপুঞ্জ ky +Inizi Kaeman ky +Kajmanska ostrva ky +Illes Caimà ky +Kajmanské ostrovy ky +Ynysoedd Caiman ky +Cayman-øerne ky +Kaiman-Inseln ky +Νησιά Κάυμαν ky +Kejmanoj ky +Islas Caimán ky +Kaimanisaared ky +Kaiman Irlak ky +جزایر کِیمن ky +Cayman-saaret ky +Îles Caïman ky +Kaaiman Eilannen ky +Oileáin na gCadhman ky +Illas Caimán ky +איי קיימן ky +केमन आइलैंड ky +Kajmanski Otoci ky +Kajmán-szigetek ky +Cayman-eyjar ky +Isole Cayman ky +英領ケイマン諸島 ky +កោះ​កៃម៉ាន ky +케이맨 제도 ky +ຄາຕາລັນ ky +Kaimanų salos ky +Kaimanu salas ky +Кајмански Острови ky +Cayman арлууд ky +Gżejjer Cayman ky +Caymanøyene ky +Kayman-Inseln ky +Kaaiman Eilanden ky +Caymanøyane ky +ਕਾਅਮਾਨ ਟਾਪੂ ky +Kajmany ky +Ilhas Caimão ky +Ilhas Cayman ky +Insulele Cayman ky +Каймановы острова ky +Ibirwa bya Kayimani ky +Caymansullot ky +Kajmanske Ostrovy ky +Kajmanski otoki ky +Кајманска острва ky +Kajmanska ostrva ky +Caymanöarna ky +கேமான் தீவுகள் ky +Ҷазираи Кайман ky +หมู่เกาะเคย์แมน ky +Cayman Adaları ky +Kayman Utrawları ky +Кайман острів ky +Кайман Ороллари ky +Iyes Cayman ky +开曼群岛 ky +開曼群島 ky +Kazakhstan kz +كازاخستان kz +Казахстан kz +Казахстан kz +কাজাকস্তান kz +Kazakstan kz +Kazahstan kz +Kazachstán kz +Casacstan kz +Kasachstan kz +Καζακστάν kz +Kazaĥujo kz +Kazakhstán kz +Kasahstan kz +قزاقستان kz +Kazakstan kz +Kazachstan kz +An Chasacstáin kz +Kazaxistán kz +קזחסטאן kz +कज़ाखिस्तान kz +Kazahstan kz +Kazahsztán kz +Kasakstan kz +Kazakistan kz +カザフスタン kz +កាហ្សាក់ស្តង់ kz +카자흐스탄 kz +ແກແລກຕິກ - K kz +Kazachstanas kz +Kazahstāna kz +Казакстан kz +Казак kz +Każakstan kz +Kasakhstan kz +Kasachstan kz +Kazachstan kz +Kasakhstan kz +ਕਾਜ਼ਾਕਸਤਾਨ kz +Kazachstan kz +Cazaquistão kz +Cazaquistão kz +Cazahstan kz +Казахстан kz +Kazakisitani kz +Kasakhstan kz +Kazachstan kz +Kazahstan kz +Казахстан kz +Kazahstan kz +Kazakstan kz +கஜஸ்தான்` kz +Қазоқистон kz +คาซัคสถาน kz +Kazakistan kz +Qazaqstan kz +Казахстан kz +Қозоғистон kz +Kazaxhtan kz +哈萨克斯坦 kz +哈薩克 kz +Laos la +لاوس la +Лаос la +Лаос la +লাওস la +Λάος la +Laoso la +لائوس la +Láós la +לאוס la +लाओस la +Laosz la +ラオス la +ឡាវ la +라오스 la +ລາວ la +Laosas la +Laosa la +Лаос la +Лаос la +ਲਿਉਸ la +Лаос la +Lawosi la +Лаос la +லாஸ் la +Лаос la +ลาว la +Лаос la +Лаос la +Lào la +Lawosse la +老挝 la +寮國 la +Lebanon lb +Libanon lb +لبنان lb +Ліван lb +Ливан lb +লেবানন lb +Liban lb +Liban lb +Líban lb +Libanon lb +Libanus lb +Libanon lb +Libanon lb +Λίβανος lb +Libano lb +Líbano lb +Liibanon lb +Libano lb +لبنان lb +Libanon lb +Libanon lb +Liban lb +Libanon lb +An Liobáin lb +Líbano lb +לבנון lb +लेबनान lb +Libanon lb +Libanon lb +Líbanon lb +Libano lb +レバノン lb +លីបង់ lb +레바논 lb +ເດນ່ງນ lb +Libanas lb +Libāna lb +Либан lb +Либанон lb +Lubnan lb +Libanu lb +Libanon lb +Libanon lb +Libanon lb +Libanon lb +ਲਿਬਨਾਨ lb +Liban lb +Líbano lb +Líbano lb +Liban lb +Ливан lb +Libani lb +Libanon lb +Libanon lb +Libanon lb +Либан lb +Liban lb +I-Lebanon lb +Libanon lb +லெபனான் lb +Лубнон lb +เลบานอน lb +Ліван lb +Лебанон lb +Li Băng lb +Liban lb +黎巴嫩 lb +黎巴嫩 lb +St. Lucia lc +سانت لوسيا lc +Сэнт-Люсія lc +Св. Лучия lc +সেন্ট লুসিয়া lc +S. Lucia lc +Svatá Lucie lc +St. Lwsia lc +Σάντα Λουτσία lc +Sent-Lucio lc +Santa Lucía lc +سن لوسیا lc +Sankta Lusia lc +Sainte Lucie lc +San Lúisia lc +Santa Lucia lc +סנטה לוסיה lc +सेंट लूसिया lc +Sankti Lúsía lc +Santa Lucia lc +セントルシア lc +សង់លូស៊ីយ៉ា lc +세인트 루시아 lc +ເຊັນລູເຊີຍ lc +Šv Liucija lc +Sv. Lūcija lc +Св. Луција lc +St. Лусиа lc +St. Luċija lc +ਸੇਂਟ ਲੂਉਸ lc +Santa Lúcia lc +Santa Lúcia lc +Sf. Lucia lc +Сент-Люсия lc +Mutagatifu Lusiya lc +Sv. Júlia lc +Sv. Lucija lc +Св. Луција lc +Sv. Lucija lc +I-St. Lucia lc +சென்ட் லூசியா lc +Синт Лусиё lc +เซนต์ลูเซีย lc +Santa Lüçiä lc +Сент-Люсія lc +Сент-Люсия lc +Ste Luceye lc +圣卢西亚 lc +聖露西亞 lc +Liechtenstein li +ليشتنشتاين li +Ліхтэнштэйн li +Лихтенщайн li +লিখটেনস্টাইন li +Lihtenštajn li +Lichtenštejnsko li +Λίχτενσταϊν li +Liĥtenŝtejno li +Liechtestein li +لیختن اشتاین li +An Lichtinstéin li +ליכטנשטין li +लिचटेनस्टीन li +Lihtenštajn li +リヒテンシュタイン li +លិចទេនស្តែន li +리히텐슈타인 li +ຟ້າແມບ li +Lichtenšteinas li +Lihtenšteina li +Лихтенштајн li +Лихтэнштайн li +Liechtensteen li +ਲੀਚਟੀਨਸਟੀਨ li +Lichtensztajn li +Лихтенштейн li +Liyeshitensiteyini li +Лихтенштајн li +Lihtenštajn li +லச்சென்ஸ்டென் li +Лихтанштоин li +ลิชเทนสไตน์ li +Lihtenştayn li +Lihtenstein li +Ліхтенштейн li +Лихтенштейн li +Lîchtensteyn li +列支敦士登 li +列支敦斯登 li +Sri Lanka lk +سريلانكا lk +Шры-Ланка lk +Шри Ланка lk +শ্রীলঙ্কা lk +Šri Lanka lk +Srí Lanka lk +Sri Lanca lk +Σρι Λάνκα lk +Sri-Lanko lk +سریلانکا lk +Srí Lanca lk +סרי לנקה lk +श्री लंका lk +Šri Lanka lk +Srí Lanka lk +スリランカ lk +ស្រីលង្កា lk +스리랑카 lk +ເຊີເບີຍ lk +Šri Lanka lk +Šrilanka lk +Шри Ланка lk +Шириланк lk +ਸ੍ਰੀਲੰਕਾ lk +Шри-Ланка lk +Siri Lanka lk +Šri Lanka lk +Шри Ланка lk +Šri Lanka lk +இலங்கை lk +Сри Лонко lk +ศรีลังกา lk +Şri Lanka lk +Шрі-Ланка lk +Шри Ланка lk +斯里兰卡 lk +斯里蘭卡 lk +Liberia lr +Liberië lr +ليبيريا lr +Лібэрыя lr +Либерия lr +লাইবেরিয়া lr +Liberija lr +Libèria lr +Libérie lr +Λιβερία lr +Liberio lr +Libeeria lr +لیبریا lr +Libéria lr +An Libéir lr +Libéria lr +לוב lr +लाइबेरिया lr +Liberija lr +Libéria lr +Líbería lr +リベリア lr +លីបេរីយ៉ា lr +라이베리아 lr +ລິຊາ lr +Libērija lr +Либерија lr +Либери lr +Liberja lr +ਲੀਬਿਰੀਆ lr +Libéria lr +Libéria lr +Либерия lr +Liberiya lr +Lýbia lr +Liberija lr +Либерија lr +Liberija lr +லிபிரியா lr +Либериё lr +ไลบีเรีย lr +Liberya lr +Ліберія lr +Либерия lr +利比里亚 lr +賴比瑞亞 lr +Lesotho ls +ليسوتو ls +Лесота ls +Лесото ls +লেসোথো ls +Lesoto ls +Lesoto ls +Λεσόθο ls +Lesoto ls +Lesoto ls +لسوتو ls +Leosóta ls +Lesoto ls +לסוטו ls +लेसोथो ls +Lesótó ls +レソト ls +ឡេសូតូ ls +레소토 ls +ທົດສອບ ls +Lesoto ls +Лесото ls +Лисото ls +Leżoto ls +ਲਿਉਥੂ ls +Lesoto ls +Lesoto ls +Lesoto ls +Лесото ls +Lesoto ls +Lesoto ls +Лесото ls +Lesoto ls +லஸொதோ ls +Лисуту ls +เลโซโต ls +Lesoto ls +Lesoto ls +Лесото ls +Лесото ls +Lessoto ls +莱索托 ls +賴索扥 ls +Lithuania lt +Lithuanië lt +ليتوانيا lt +Litvaniya lt +Літва lt +Литва lt +লিথুয়েনিয়া lt +Lituani lt +Litvanija lt +Lituània lt +Litva lt +Lithwania lt +Litauen lt +Litauen lt +Λιθουανία lt +Litovio lt +Lituania lt +Leedu lt +Lituania lt +لیتوانی lt +Liettua lt +Lituanie lt +Litouwen lt +An Liotuáin lt +Lituánia lt +ליטא lt +लिथुआनिया lt +Litva lt +Litvánia lt +Litháen lt +Lituania lt +リトアニア lt +លីទុយអានី lt +리투아니아 lt +ລິທົ່ວເນີຍ lt +Lietuva lt +Lietuva lt +Литванија lt +Литва lt +Litwanja lt +Litauen lt +Litauen lt +Litouwen lt +Litauen lt +ਲੀਥੂਨੀਆ lt +Litwa lt +Lituânia lt +Lituânia lt +Lituania lt +Литва lt +Litwaniya lt +Lietuva lt +Litva lt +Litva lt +Литванија lt +Litvanija lt +I-Lithuania lt +Litauen lt +லித்துவேனியா lt +Литвониё lt +ลิธัวเนีย lt +Litvanya lt +Lituania lt +Литва lt +Литва lt +Litwaneye lt +立陶宛 lt +立陶宛 lt +Luxembourg lu +Luxenburg lu +لوكسمبورغ lu +Lüksemburq lu +Люксэмбург lu +Люксембург lu +লাক্সেমবুর্গ lu +Luksembourg lu +Luksemburg lu +Luxemburg lu +Lucembursko lu +Lwcsembwrg lu +Luxemburg lu +Λουξεμβούργο lu +Luksemburgo lu +Luxemburgo lu +Luksemburg lu +Luxenburgo lu +لوگزامبورگ lu +Luxemburg lu +Luksemborg lu +Luxemburg lu +Lucsamburg lu +Luxemburgo lu +לוקסמבורג lu +लक्समबर्ग lu +Luksemburg lu +Luxemburg lu +Lúxemborg lu +Lussemburgo lu +ルクセンブルグ lu +លុចហ្សំបួរ lu +룩셈부르크 lu +ລັກແຊມເບີກ lu +Liuksemburgas lu +Luksemburga lu +Луксембург lu +Люксембүрг lu +Lussemburgu lu +Luxemborg lu +Luxemburg lu +ਲਕਸ਼ਮਬਰਗ lu +Luksemburg lu +Luxemburgo lu +Luxemburgo lu +Luxemburg lu +Люксембург lu +Lugizamburu lu +Luxemburg lu +Luxemburg lu +Luksemburg lu +Луксембург lu +Luksemburg lu +I-Luxembourg lu +Luxemburg lu +லக்சம்போர்க் lu +Лукзамбург lu +ลักเซมเบอร์ก lu +Lüksemburg lu +Lüksemburg lu +Люксембург lu +Люксембург lu +Lussimbork lu +卢森堡 lu +盧森堡 lu +Latvia lv +لاتفيا lv +Latviya lv +Латвія lv +Латвия lv +লাতভিয়া lv +Latvija lv +Letònia lv +Lotyšsko lv +Latfia lv +Letland lv +Lettland lv +Λεττονία lv +Latvio lv +Letonia lv +Läti lv +لاتویا lv +Lettonie lv +Letland lv +An Laitvia lv +Letónia lv +לטביה lv +लाटविया lv +Latvija lv +Lettország lv +Lettland lv +Lettonia lv +ラトビア lv +ឡាតវីយ៉ា lv +라트비아 lv +ລັດເວີຍ lv +Latvija lv +Latvija lv +Латвија lv +Латви lv +Latvja lv +Lettland lv +Letland lv +ਲਾਟਵੀਆ lv +Łotwa lv +Letónia lv +Латвия lv +Lativiya lv +Látvia lv +Lotyšsko lv +Latvija lv +Латвија lv +Latvija lv +I-Latvia lv +Lettland lv +லட்வியா lv +Латвонӣ lv +ลัธเวีย lv +Litvanya lv +Латвія lv +Латвия lv +Lativia lv +Letoneye lv +拉脱维亚 lv +拉脫維亞 lv +Libya ly +Libië ly +ليبيا ly +Лівія ly +Либия ly +লিবিয়া ly +Julia ly +Libija ly +Líbia ly +Lýbie ly +Libia ly +Libyen ly +Libyen ly +Λιβύη ly +Libio ly +Libia ly +Liibüa ly +Libia ly +لیبی ly +Lybie ly +Libië ly +An Libia ly +Líbia ly +לוב ly +लीबिया ly +Libija ly +Líbia ly +Líbía ly +Libia ly +リビア ly +លីប៊ី ly +리비아 ly +ລິຊາ ly +Libija ly +Lībija ly +Либија ly +Либя ly +Libja ly +Libyen ly +Libië ly +ਲੀਬੀਆ ly +Libia ly +Líbia ly +Líbia ly +Libia ly +Ливия ly +Libiya ly +Lýbia ly +Libija ly +Либија ly +Libija ly +I-Libya ly +Libyen ly +லிபியா ly +Либия ly +ลิเบีย ly +Libia ly +Лівія ly +Либия ly +Libeye ly +利比亚 ly +利比亞 ly +Morocco ma +Morokko ma +المغرب ma +Марока ma +Мароко ma +মরক্কো ma +Marok ma +Maroko ma +Marroc ma +Maroko ma +Moroco ma +Marokko ma +Marokko ma +Μαρόκο ma +Maroko ma +Marruecos ma +Maroko ma +Maroko ma +مراکش ma +Marokko ma +Marokko ma +Maroc ma +Marokko ma +Maracó ma +Marrocos ma +מרוקו ma +मोरक्को ma +Maroko ma +Marokkó ma +Marokkó ma +Marocco ma +モロッコ ma +ម៉ារ៉ុក ma +모로코 ma +ເມົາລິ ma +Marokas ma +Maroka ma +Мароко ma +Морокко ma +Marokk ma +Marokko ma +Marokko ma +Marokko ma +Marokko ma +ਮੋਰਕੋ ma +Maroko ma +Marrocos ma +Marrocos ma +Maroc ma +Марокко ma +Maroke ma +Marokko ma +Maroko ma +Maroko ma +Мароко ma +Maroko ma +I-Morocco ma +Marocko ma +மோராகோ ma +Марокко ma +โมร็อคโค ma +Morokko ma +Марокко ma +Марокаш ma +Ma rốc ma +Marok ma +摩洛哥 ma +摩洛哥 ma +Monaco mc +Monako mc +موناكو mc +Манака mc +Монако mc +মোনাকো mc +Monako mc +Monako mc +Mònaco mc +Monako mc +Μονακό mc +Monako mc +Mónaco mc +موناکو mc +Monacó mc +Mónaco mc +מונקו mc +मोनेको mc +Monako mc +Mónakó mc +モナコ mc +ម៉ូណាកូ mc +모나코 mc +ເມົາລິ mc +Monakas mc +Monako mc +Монако mc +Монако mc +Monako mc +ਮੋਨਕੋ mc +Monako mc +Mónaco mc +Mônaco mc +Монако mc +Monako mc +Monako mc +Monako mc +Монако mc +Monako mc +மனாகோ mc +Монако mc +โมนาโค mc +Monako mc +Manako mc +Монако mc +Монако mc +摩纳哥 mc +摩納哥 mc +Moldova md +مولدوفا md +Малдова md +Молдавия md +মলডোভা md +Moldavi md +Moldàvia md +Moldávie md +Moldofa md +Moldawien md +Μολδαβία md +Moldavujo md +Moldavia md +Moldavia md +مولداوی md +Moldavie md +An Mholdóiv md +Moldávia md +מולדובה md +मॉल्दोवा md +Moldóva md +Moldavia md +モルドバ md +ម៉ុលដូវ៉ា md +몰도바 md +ສະໂລວັກ md +Moldāvija md +Молдавија md +Молдав md +Moldavja md +Moldawien md +Moldavië md +ਮੋਡੋਵਾ md +Mołdawia md +Moldávia md +Молдова md +Molidova md +Moldávsko md +Молдавија md +Moldavija md +Moldavien md +மால்டோவா md +Молдавӣ md +มอลโดวา md +Молдова md +Молдова md +摩尔多瓦 md +摩爾多瓦 md +Madagascar mg +Madagaskar mg +مدغشقر mg +Мадагаскар mg +Мадагаскар mg +মাদাগাস্কার mg +Madagaskar mg +Madagaskar mg +Madagaskar mg +Madagaskar mg +Μαδαγασκάρη mg +Madagaskaro mg +Madagaskar mg +ماداگاسکار mg +Madagaskar mg +מדגסקר mg +मेडागास्कर mg +Madagaskar mg +Madagaszkár mg +Madagaskar mg +マダガスカル mg +ម៉ាដាហ្កាស្ការ mg +마다카스카르 mg +ຄາສະບາລ - K mg +Madagaskaras mg +Madagaskara mg +Мадаскар mg +Мадагаскар mg +Madagaskar mg +Madagaskar mg +Madagaskar mg +Madagaskar mg +ਮੈਡਾਗਾਸਕਰ mg +Madagaskar mg +Madagáscar mg +Мадагаскар mg +Madagasikari mg +Madagaskar mg +Madagaskar mg +Madagaskar mg +Мадагаскар mg +Madagaskar mg +Madagaskar mg +மடகஸ்கார் mg +Мадогоскор mg +มาดากัสกา mg +Madagaskar mg +Madagaskar mg +Мадагаскар mg +Мадагаскар mg +马达加斯加 mg +馬達加斯加 mg +Marshall Islands mh +Marshall EIlande mh +جزر مارشال mh +Маршалавы астравы mh +Маршалски острови mh +মারশাল দ্বীপপুঞ্জ mh +Inizi Marshall mh +Maršalova ostrva mh +Illes Marshall mh +Marshallovy ostrovy mh +Ynysoedd Marshall mh +Marshall-øerne mh +Marshall-Inseln mh +Νησιά Μάρσαλ mh +Marŝaloj mh +Islas Marshall mh +Marshalli saared mh +Marshall Irlak mh +جزایر مارشال mh +Marshallinsaaret mh +Îles Marshall mh +Marshall Eilânen mh +Oileáin Mharshall mh +Illas Marshall mh +איי מרשל mh +मार्शल आइलैंड mh +Marshall Otoci mh +Marshall-szigetek mh +Marshall-eyjar mh +Isole Marshall mh +米自由連合マーシャル諸島 mh +កោះ Marshall mh +마샬 제도 mh +ລາດສະອານາຈັກໄທຍ mh +Marshalo salos mh +Māršalu salas mh +Маршалови Острови mh +Маршаллын арлууд mh +Gżejjer Marshall mh +Marshalløyene mh +Marshallinseln mh +Marshall Eilanden mh +Marshalløyane mh +ਮਾਰਸ਼ਲ ਟਾਪੂ mh +Wyspy Marshalla mh +Ilhas Marshall mh +Ilhas Marshall mh +Insulele Marshall mh +Маршалловы острова mh +Ibirwa bya Marishali mh +Marshallsullot mh +Maršálove ostrovy mh +Marshallovi otoki mh +Маршалова острва mh +Maršalova ostrva mh +Marshallöarna mh +மார்ஷல் தீவுகள் mh +Ҷазираи Маршал mh +หมู่เกาะมาแชล mh +Marşal Adaları mh +Marşal Utrawları mh +Маршальські острови mh +Маршалл Ороллари mh +Iyes Marshall mh +马绍群岛 mh +馬紹爾群島 mh +Macedonia mk +Makedoniese mk +مقدونيا mk +Makedonya mk +Македонія mk +Македония mk +ম্যাসিডোনিয়া mk +Makedonia mk +Makedonija mk +Macedònia mk +Makedonie mk +Makedonien mk +Makedonien mk +Σλαβομακεδονία mk +Makedonujo mk +Makedoonia mk +Mazedonia mk +مقدونیه mk +Makedonia mk +Macédoine mk +Macedonië mk +An Mhacadóin (IPIM) mk +Macedónia mk +מקדוניה mk +मकदूनिया mk +Makedonija mk +Macedónia mk +Masedonia mk +Makedónía mk +マケドニア mk +ម៉ាសេដន mk +마케도니아 mk +ມາເຊໂດເນີຍ mk +Makedonija mk +Maķedonija mk +Македонија mk +Макидон mk +Maċedonja mk +Makedonia mk +Makedonien mk +Macedonië mk +Makedonia mk +Macedònian mk +ਮੈਕਡੋਨੀਆ mk +Macedónia mk +Macedônia mk +Македония mk +Masedoniya mk +Makedonia mk +Macedónsky mk +Makedonija mk +Македонија mk +Makedonija mk +I-Macedonia mk +Makedonien mk +மாசிடோ னியா mk +Мақдуниё mk +มาเซโดเนีย mk +Makedonya mk +Makedonia mk +Македонія mk +Македония mk +Masedonia mk +Macedoneye mk +马其顿 mk +馬其頓 mk +Mali ml +مالي ml +Малі ml +Мали ml +মালি ml +Μαλί ml +Malio ml +مالی ml +Mailí ml +מאלי ml +माली ml +Malí ml +マリ ml +ម៉ាលី ml +말리 ml +ຈົດຫມາຍ ml +Мали ml +Мали ml +ਮਾਲੀ ml +Мали ml +Мали ml +மாலி ml +Молӣ ml +มาลี ml +Малі ml +Мали ml +马里 ml +馬利 ml +Myanmar mm +ميانمار mm +М'янма mm +Мианмар mm +মিয়ানমার mm +Mjanmar mm +Mianmar mm +Burma mm +Burma (Myanmar) mm +Μιανμάρ mm +Mjanmao mm +Birmania mm +میانمار mm +Maenmar mm +מינמר mm +म्यनमार mm +Mianmar mm +Mjanmar mm +ミャンマー mm +មីយ៉ាន់ម៉ា mm +미얀마 mm +ຕົວຮງກພີື້ນທີ່ທຳງານ - K mm +Mjanma mm +Мијанмар mm +Мянмар mm +Mjanmar mm +Myanmar (Birma) mm +ਮਿਆਂਮਾਰ mm +Mianmar mm +Мьянма (Бирма) mm +Mjanmar mm +Мијанмар mm +Mijanmar mm +மயன்மார் mm +Миёнмор mm +เมียนมาร์ mm +Mianmar mm +М'янма mm +Мянмар mm +Miến Điện mm +Birmaneye mm +缅甸 mm +緬甸 mm +Mongolia mn +Mongolië mn +منغوليا mn +Манголія mn +Монголия mn +মোঙ্গোলিয়া mn +Mongoli mn +Mongolija mn +Mongòlia mn +Mongolsko mn +Mongoliet mn +Mongolei mn +Μογγολία mn +Mongolio mn +Mongoolia mn +مغولستان mn +Mongolie mn +Mongolië mn +An Mhongóil mn +Mongólia mn +מונגוליה mn +मंगोलिया mn +Mongolija mn +Mongólia mn +Mongólía mn +モンゴル mn +ម៉ុងហ្គោលី mn +몽골 mn +ລອກອິນ mn +Mongolija mn +Mongolija mn +Монголија mn +МОНГОЛ mn +Mongolja mn +Mongolei mn +Mongolië mn +ਮੰਗੋਲੀਆ mn +Mongólia mn +Mongólia mn +Монголия mn +Mongoliya mn +Mongolsko mn +Mongolija mn +Монголија mn +Mongolija mn +Mongoliet mn +மாங்கோலியா mn +Муғулистон mn +มองโกเลีย mn +Moğolistan mn +Moğolstan mn +Монголія mn +Муғилистон mn +Mông cổ mn +Mongoleye mn +蒙古 mn +蒙古 mn +Macau SAR(China) mo +Macau SAR (China) mo +Макао (Китай) mo +মাকাউ SAR(চীন) mo +Makav SAR(Sina) mo +Macau SAR(Xina) mo +Macau SAR (Čína) mo +Macau SAR(Kina) mo +Macao SAR (China) mo +Μακάο SAR (Κίνα) mo +Macau mo +Macau SAR(Txina) mo +Makao SAR(Kiina) mo +Macao SAR (Chine) mo +Macao SAR(An tSín) mo +מקאו SAR (סין) mo +Makaó (Kína) mo +Makaó (sjálfstjórnarhérað í Kína) mo +Macau SAR(Cina) mo +マカオ(中国) mo +ម៉ាកាវ (ចិន) mo +Macau SAR(Kinija) mo +Макао САР(Кина) mo +Macao SAR (Kina) mo +Macao mo +Macao SAR (Kina) mo +ਮੈਕਿਉ SAR(ਚੀਨ) mo +Makao SAR (Chiny) mo +Macau (China) mo +Macao SAR(China) mo +Макао mo +Makawu SAR (Ubushinwa) mo +Macau SAR (Kiinná) mo +Macau SAR (Kitajska) mo +SAR Macau (Кина) mo +SAR Macau (Kina) mo +Macao (Kina) mo +Macau SAR(சீனா) mo +มาเก๊า mo +Makau (Çin) mo +Macau SAR(Китай) mo +Макау (Хитой) mo +中国澳门特别行政区 mo +澳門 SAR(中國) mo +Martinique mq +مارتينيك mq +Мартыніка mq +Мартиника mq +মার্টিনিক্ mq +Martinik mq +Martinik mq +Martinica mq +Martinik mq +Martin?c mq +Μαρτινίκα mq +Martiniko mq +Martinica mq +Martinika mq +مارتینیک mq +Martainíc mq +Martinica mq +מרטיניק mq +मार्टीनीक mq +Martiník mq +Martinica mq +フランス海外県マルチニーク mq +ម៉ារទីនីគ mq +마르티니크 mq +ເມົາລິ mq +Martinika mq +Martinika mq +Мартиник mq +Мартиники mq +Martinik mq +ਮਾਰਟੀਨਿਕਿਉ mq +Martynika mq +Martinica mq +Martinica mq +Martinica mq +Мартиника mq +Maritinike mq +Martinik mq +Мартиник mq +Martinik mq +மார்தினிக்யு mq +Мартиник mq +มาทินิค mq +Martinik mq +Martinik mq +Мартініка mq +Мартиника mq +Martinike mq +马提尼克 mq +馬提尼克 mq +Mauritania mr +Mauritanië mr +موريتانيا mr +Маўрытанія mr +Мавритания mr +মরিটানিয়া mr +Maouritani mr +Mauritanija mr +Mauritània mr +Mauretánie mr +Mawritania mr +Mauretanien mr +Mauretanien mr +Μαυριτανία mr +Maŭritanujo mr +Mauritaania mr +موراتانی mr +Mauritanie mr +Mauritanië mr +An Mháratáin mr +Mauritánia mr +מאוריטניה mr +मारीतानिया mr +Mauritanija mr +Mauritánia mr +Máritanía mr +モーリタニア mr +ម៉ូរីតានី mr +모리타니 mr +ລິທົວເນີຍ mr +Mauritanija mr +Mauritānija mr +Мавританија mr +Мауритани mr +Mawritanja mr +Mauretanien mr +Mauritanië mr +ਮਾਉਰੀਟਨਿਆ mr +Mauretania mr +Mauritânia mr +Mauritânia mr +Мавритания mr +Moritaniya mr +Mavretanija mr +Мауританија mr +Mauritanija mr +Mauretanien mr +மௌரிடானியா mr +Мавритонӣ mr +มอริทาเนีย mr +Mauritanya mr +Мавританія mr +Мавритания mr +Moritanreye mr +毛里塔尼亚 mr +茅利塔尼亞 mr +Montserrat ms +مونتسيرات ms +Монсерат ms +মন্টসেরাট ms +Monsera ms +Μοντσεράτ ms +Moncerato ms +مون‌سرات ms +Montsarat ms +מונטסרט ms +मॉटसेरट ms +Monserrat ms +英領モントセラト ms +ម៉ុងសេរ៉ា ms +몬트세라트 ms +ຈໍພາບ ms +Monserata ms +Монсерат ms +Монтсеррат ms +ਮੋਨਟਸੀਰਾਟ ms +Монтсеррат ms +Monserati ms +Монсерат ms +Monserat ms +மான்ட்செர்ரட் ms +Мунтесирот ms +มอนต์เซอร์รัท ms +Монтсеррат ms +Монцеррат ms +蒙特塞拉特 ms +蒙的塞拉特 ms +Malta mt +مالطة mt +Мальта mt +Малта mt +মলটা mt +Malt mt +Μάλτα mt +Malto mt +مالت mt +Malte mt +Málta mt +מלטה mt +माल्टा mt +Málta mt +マルタ mt +ម៉ាល់តា mt +몰타 mt +ມອລຕາ mt +Малта mt +Малта mt +ਮਾਲਟਾ mt +Мальта mt +Malita mt +Малта mt +I-Malta mt +மால்டா mt +Молет mt +มอลตา mt +Мальта mt +Малта mt +Male mt +马耳他 mt +馬爾他 mt +Mauritius mu +موريشيوس mu +Маўрыцы mu +Остров Мавриций mu +মরিশাস mu +Mauris mu +Mauricijus mu +Maurici mu +Mauricius mu +Mawrisiws mu +Μαυρίκιος mu +Maŭricio mu +Mauricio mu +Maurizio mu +موریتیس mu +Île Maurice mu +Oileán Mhuirís mu +Maurício mu +מאוריציוס mu +मॉरीशस mu +Mauricijus mu +Máritíus mu +モーリシャス mu +ម៉ូរីទុស mu +모리셔스 mu +ພາທິຊັ້ນ mu +Maurīcija mu +Маврициус mu +Мавритус mu +Mawriju mu +ਮਾਉਰੀਟਿਸ mu +Mauritânia mu +Ilhas Maurício mu +Mauriţius mu +Маврикий mu +Ibirwa bya Morise mu +Maurícius mu +Mavricij mu +Маурицијус mu +Mauricijus mu +மௌரிடியஸ் mu +Мавритӣ mu +มอริเชียส mu +Mauritus mu +Маврікій mu +Маврикий mu +Iye Môrice mu +毛里求斯 mu +毛里求斯 mu +Maldives mv +جزر المالديف mv +Мальдывы mv +Малдивски острови mv +মালদ্বীপ mv +Inizi Maldiv mv +Maldivi mv +Maledivy mv +Ynysoedd y Mald?f mv +Maldiverne mv +Malediven mv +Μαλδίβες mv +Maldivoj mv +Maldivas mv +Maldiivid mv +Maldibak mv +مالدیو mv +Malediivit mv +Malediven mv +Na Maildiví mv +Maldivas mv +מולדבה mv +मालदीव mv +Maldivi mv +Maldív-szigetek mv +Maldíveyjar mv +Maldive mv +モルジブ mv +ម៉ាល់ឌីវ mv +몰디브 mv +ມັລດິສ mv +Maldyvai mv +Maldivu salas mv +Малдиви mv +Малдив mv +Maldivene mv +Malediven mv +Malediven mv +Maldivane mv +ਮਾਲਦੀਵ mv +Malediwy mv +Maldivas mv +Maldivas mv +Maldive mv +Мальдивские острова mv +Malidive mv +Maldiivat mv +Maldiv mv +Малдиви mv +Maldivi mv +Maldiverna mv +மால்தீவுகள் mv +Молдивӣ mv +มัลดิฟ mv +Maldivler mv +Maldivlar mv +Мальдіви mv +Малдив Ороллари mv +马尔代夫 mv +馬爾地夫 mv +Malawi mw +مالاوي mw +Малаві mw +Малави mw +মালাওয়ি mw +Malavi mw +Μαλάουι mw +Malavio mw +مالاوی mw +An Mhaláiv mw +Malavi mw +מלאווי mw +मलावी mw +Malavi mw +Malaví mw +マラウイ mw +ម៉ាឡាវី mw +말라위 mw +ມອລຕາ mw +Malavi mw +Малави mw +Малави mw +ਮਾਲਾਵੀ mw +Малави mw +Малави mw +Malavi mw +மலவி mw +Моловӣ mw +มาลาวี mw +Malavi mw +Малаві mw +Малави mw +马拉维 mw +馬拉威 mw +Mexico mx +Meksiko mx +المكسيك mx +Meksika mx +Мэксыка mx +Мексико mx +মেক্সিকো mx +Mec'hiko mx +Meksiko mx +Mèxic mx +Mexiko mx +Mecsico mx +Mexiko mx +Μεξικό mx +Meksiko mx +México mx +Mehhiko mx +Mexiko mx +مکزیک mx +Meksiko mx +Meksiko mx +Mexique mx +Meicsiceo mx +México mx +מקסיקו mx +मेक्सिको mx +Meksiko mx +Mexikó mx +Meksiko mx +Mexíkó mx +Messico mx +メキシコ mx +ម៉ិចស៊ិក mx +멕시코 mx +ເມັກຊີໂກ mx +Meksika mx +Meksika mx +Мексико mx +Мексико mx +Messiku mx +Mexiko mx +Mèxic mx +ਮੈਕਸਿਕੋ mx +Meksyk mx +México mx +México mx +Mexic mx +Мексика mx +Megizike mx +Mexiko mx +Mehika mx +Мексико mx +Meksiko mx +I-Mexico mx +மெக்சிகோ mx +Мексико mx +เม็กซิโก mx +Meksika mx +Meksiko mx +Мексика mx +Мексика mx +Mê hi cô mx +Mecsike mx +墨西哥 mx +墨西哥 mx +Malaysia my +Malysië my +ماليزيا my +Малайзыя my +Малайзия my +মালয়েশিয়া my +Malezia my +Malezija my +Malàsia my +Malajsie my +Maleisia my +Μαλαισία my +Malajzio my +Malasia my +Malaisia my +Malasia my +مالزی my +Malesia my +Malaisie my +Maleisië my +An Mhalaeisia my +Malásia my +מלזיה my +मलेशिया my +Malezija my +Malajzia my +Malasía my +マレーシア my +ម៉ាឡេស៊ី my +말레이시아 my +ມອລຕາ my +Malaizija my +Malaizija my +Малезија my +Малайз my +Malażja my +Maleisië my +ਮਲੇਸ਼ੀਆ my +Malezja my +Malásia my +Malásia my +Malaezia my +Малайзия my +Maleziya my +Malajzia my +Malezija my +Малезија my +Malezija my +மலேசியா my +Малайзӣ my +มาเลเซีย my +Malezya my +Малайзія my +Малайзия my +Malaizeye my +马来西亚 my +馬來西亞 my +Mozambique mz +Mosambiek mz +موزمبيق mz +Мазамбік mz +Мозамбик mz +মোজামবিক mz +Mozambik mz +Mozambik mz +Moçambic mz +Mozambik mz +Mosamb?c mz +Μοζαμβίκη mz +Mozambiko mz +Mosambiik mz +Mozanbike mz +موزامبیک mz +Mosambik mz +Mósaimbíc mz +מוזמביק mz +मोज़ाम्बीक mz +Mozambik mz +Mozambik mz +Mósambík mz +Mozambico mz +モザンビーク mz +ម៉ូហ្សាំប៊ិក mz +모잠비크 mz +ຫນ່ວຍຄວາມຈຳ mz +Mozambikas mz +Mozambika mz +Мозамбик mz +Мозамбайк mz +Możambik mz +Mosambik mz +Mosambik mz +Mosambik mz +ਮੋਜ਼ਾਨਬਿਕਿਉ mz +Mozambik mz +Moçambique mz +Moçambique mz +Mozambic mz +Мозамбик mz +Mosambik mz +Mozambik mz +Mozambik mz +Мозамбик mz +Mozambik mz +Moçambique mz +மோசாம்பிக் mz +Мозамбик mz +โมแซมบิก mz +Mozambik mz +Mozambik mz +Мозамбік mz +Мозамбик mz +Mozambike mz +莫桑比克 mz +莫三比克 mz +Namibia na +Namibië na +ناميبيا na +Намібія na +Намибия na +নামিবিয়া na +Namibi na +Namibija na +Namíbia na +Namíbie na +Ναμίμπια na +Namibio na +Namiibia na +نامیبیا na +Namibie na +Namibië na +An Namaib na +Namíbia na +נמיביה na +नामीबिया na +Namibija na +Namíbia na +Namibía na +ナミビア na +ណាមីប៊ី na +나미비아 na +ຈາໄມກາ na +Namibija na +Namībija na +Намибија na +Намиби na +Namibja na +Namibië na +ਨਾਮੀਬੀਆ na +Namíbia na +Namíbia na +Намибия na +Namibiya na +Namíbia na +Namibija na +Намибија na +Namibija na +நாமிபியா na +Намибиё na +นามิเบีย na +Namibya na +Намібія na +Намибия na +Namibeye na +纳米比亚 na +那米比亞 na +New Caledonia nc +Nuwe Caledonië nc +كاليدونيا الجديدة nc +Новая Каледонія nc +Нова Каледония nc +নিউ ক্যালিডোনিয়া nc +Kaledoni-nevez nc +Nova Kaledonija nc +Nova Caledònia nc +Nová Kaledonie nc +Caledonia Newydd nc +Ny Caledonien nc +Neukaledonien nc +Νέα Καληδονία nc +Nov-Kaledonio nc +Nueva Caledonia nc +Uus-Kaledoonia nc +Kaledonia Berria nc +کالدونیا نو nc +Uusi-Kaledonia nc +Nouvelle Calédonie nc +Nij Caledonië nc +An Nua-Chaladóin nc +Nova Caledónia nc +קלדוניה החדשה nc +न्यू केलेदूनिया nc +Nova Kaledonija nc +Új-Kaledónia nc +Nýja-Kaledónía nc +Nuova Caledonia nc +ニューカレドニア nc +នូវែលកាលេដូនី nc +뉴 칼레도니아 nc +ມາເຊໂດເນີຍ nc +Naujoji Kaledonija nc +Jaunkaledonija nc +Нова Каледонија nc +Шинэ каледони nc +Kaledonja Ġdida nc +Ny-Caledonia nc +Nieg Kaledonien nc +Nieuw Caledonië nc +Ny-Caledonia nc +ਨਵਾਂ ਕਾਲੀਡੋਨਾ nc +Nowa Kaledonia nc +Nova Caledónia nc +Nova Caledônia nc +Noua Caledonie nc +Новая Каледония nc +Kaledoniya nc +Ođđa Kaledonia nc +Nová Kaledónia nc +Nova Kaledonija nc +Нова Каледонија nc +Nova Kaledonija nc +Nya Caledonien nc +நியூ கலடோனியா nc +Каледонияи Нав nc +นิวคาเลโดเนีย nc +Yeni Kaledonya nc +Yaña Kaledonia nc +Нова Каледонія nc +Янги Каледония nc +Nouve Caledonreye nc +新喀里多尼亚 nc +新喀里多尼亞 nc +Niger ne +النيجر ne +Нігер ne +Нигер ne +নাইজের ne +Nijer ne +Níger ne +Νίγηρας ne +Niĝero ne +نیجر ne +Nigeria ne +An Nígir ne +Níxer ne +ניג'ר ne +निगर ne +Níger ne +ニジェール ne +នីហ្សេរ ne +니제르 ne +ຕົວຮງກພື້ນທີ່ທຳງານ ne +Nigēra ne +Нигер ne +Нигер ne +Niġer ne +ਨਿਜੀਰ ne +Nigéria ne +Nigéria ne +Нигер ne +Nijeri ne +Nigéria ne +Нигер ne +நிஜர் ne +Нигерӣ ne +ไนเจอร์ ne +Nijerya ne +Нігер ne +Нигер ne +Nidjer ne +尼日尔 ne +尼日 ne +Norfolk Island nf +Norfolk Eiland nf +جزيرة نورفولك nf +Норфалк nf +Остров Норфолк nf +নরফোক দ্বীপপুঞ্জ nf +Enez Norfolk nf +Norfolk ostrvo nf +Illa Norfolk nf +Ynys Norffolc nf +Norfolk-øerne (Australien) nf +Norfolk-Insel nf +Νήσος Νόρφοκ nf +Norfolkinsulo nf +Isla Norfolk nf +Norfolki saar nf +Norfok Irla nf +جزایر نورفولک nf +Norfolkinsaari nf +Île Norfolk nf +Norfolk Eilân nf +Oileán Norfolc nf +Illa Norfolk nf +איי נורפולק nf +नॉरफाक आइलैंड nf +Otok Norfolk nf +Norfolk-szigetek nf +Norfolkeyja nf +Isola Norfolk nf +オーストラリア領ノーフォーク諸島 nf +កោះ Norfolk nf +노포크 제도 nf +ໂປແລນ nf +Norfolko sala nf +Norfolka nf +Норфолшки Остров nf +Norfolk арлууд nf +Gżira ta' Norfolk nf +Norfolkøya nf +Norfolkinsel nf +Norfolk Eiland nf +Norfolkøya nf +ਨੋਰਫੋਲਕ ਟਾਪੂ nf +Wyspy Norfolk nf +Ilha Norfolk nf +Ilhas Norfolk nf +Insulele Norfolk nf +Остров Норфолк nf +Ikirwa cya Norufolika nf +Norfolksuolu nf +Ostrov Norfolk nf +Otok Norfolk nf +Норфолкшко острво nf +Norfolkško ostrvo nf +Norfolkön nf +நார்போக் தீவு nf +Ҷазираи Нурфолк nf +เกาะนอร์ฟอล์ค nf +Norfolk Adaları nf +Norfolk Utrawları nf +Острів Норфолк nf +Норфолк Ороли nf +Iye di Norfolk nf +诺福克岛 nf +諾福克島 nf +Nigeria ng +Nigerië ng +نيجيريا ng +Нігерыя ng +Нигерия ng +নাইজেরিয়া ng +Nijeria ng +Nigerija ng +Nigèria ng +Nigérie ng +Νιγηρία ng +Niĝerio ng +Nigeeria ng +نیجریه ng +Nigéria ng +An Nigéir ng +Nixéria ng +ניגריה ng +नाइजीरिया ng +Nigerija ng +Nigéria ng +Nígería ng +ナイジェリア ng +នីហ្សេរីយ៉ា ng +나이지리아 ng +ບັນແກເລີຍ ng +Nigerija ng +Nigērija ng +Нигерија ng +Нигери ng +Niġerja ng +ਨੀਜੀਰਿਆ ng +Nigéria ng +Nigéria ng +Нигерия ng +Nigeriya ng +Nigéria ng +Nigerija ng +Нигерија ng +Nigerija ng +நிஜேரியா ng +Нигерӣ ng +ไนจีเรีย ng +Nijerya ng +Нігерія ng +Нигерия ng +Nidjeria ng +尼日利亚 ng +奈及利亞 ng +Nicaragua ni +Nikaragua ni +نيكاراغوا ni +Нікарагуа ni +Никарагуа ni +নিকারাগুয়া ni +Nikwaraga ni +Nikaragva ni +Nikaragua ni +Nicaragwa ni +Νικαράγουα ni +Nikaragvo ni +Nikaraagua ni +Nikaragua ni +نیکاراگویه ni +Nikaragua ni +Nikaragua ni +Nicearagua ni +ניקרגווה ni +निकारागुआ ni +Nikaragva ni +Níkaragva ni +ニカラグア ni +នីការ៉ាហ្គ័រ ni +니카라과 ni +ປາລາກກວຍ ni +Nikaragva ni +Nikaragva ni +Никарагва ni +Никрагуа ni +Nikaragwa ni +ਨਿਕਾਰਗੁਆ ni +Nikaragua ni +Nicarágua ni +Nicarágua ni +Никарагуа ni +Nikaragwa ni +Nikaragua ni +Nikaragva ni +Никарагва ni +Nikaragva ni +I-Nicaragua ni +நிகராகுவே ni +Никарагуа ni +นิคารากัว ni +Nikaragua ni +Nikaragua ni +Нікарагуа ni +Никарагуа ni +Nicaragwa ni +尼加拉瓜 ni +尼加拉瓜 ni +Netherlands nl +Nederland nl +هولندا nl +Hollandiya nl +Галяндыя nl +Холандия nl +হল্যাণ্ড nl +Izelvroioù nl +Nizozemska nl +Holanda nl +Nizozemí nl +Yr Iseldiroedd nl +Holland nl +Niederlande nl +Κάτω Χώρες nl +Nederlando nl +Países Bajos nl +Holland nl +Holanda nl +هلند nl +Alankomaat nl +Háland nl +Pays bas nl +Nederlân nl +An Ísiltír nl +Países Baixos nl +הולנד nl +नीदरलैंड्स nl +Nizozemska nl +Hollandia nl +Belanda nl +Holland nl +Paesi Bassi nl +オランダ nl +ហុល្លង់ nl +네덜란드 nl +ເນເທີແລນ์ nl +Olandija nl +Nīderlande nl +Холандија nl +Недерланд nl +Nederland nl +Nedderlanne nl +Nederland nl +Nederland nl +Holanda nl +ਨੀਂਦਰਲੈਂਡ nl +Holandia nl +Holanda nl +Holanda nl +Olanda nl +Нидерланды nl +Ubuholandi nl +Hollánda nl +Holandsko nl +Nizozemska nl +Холандија nl +Holandija nl +I-Netherlands nl +Nederländerna nl +நெதர்லாந்து nl +Ҳуланд nl +เนเธอร์แลนด์ nl +Hollanda nl +Niderlandlar nl +Голландія nl +Нидерландлар nl +Hà Lan nl +Bas Payis nl +荷兰 nl +荷蘭 nl +Norway no +Noorweë no +النرويج no +Norveç no +Нарвэгія no +Норвегия no +নরওয়ে no +Norvegia no +Norveška no +Noruega no +Norsko no +Norwy no +Norge no +Norwegen no +Νορβηγία no +Norvegio no +Noruega no +Norra no +Norvegia no +نروژ no +Norja no +Norra no +Norvège no +Noorwegen no +An Iorua no +Noruega no +נורבגיה no +नार्वे no +Norveška no +Norvégia no +Norwegia no +Noregur no +Norvegia no +ノルウェー no +ន័រវែស no +노르웨이 no +ນໍເວ no +Norvegija no +Norvēģija no +Норвешка no +Норвеги no +Norveġja no +Norge no +Norwegen no +Noorwegen no +Noreg no +Noruega no +ਨਾਰਵੇ no +Norwegia no +Noruega no +Noruega no +Norvegia no +Норвегия no +Noruveje no +Norga no +Nórsko no +Norveška no +Норвешка no +Norveška no +I-Norway no +Norge no +நார்வே no +Норвегӣ no +นอร์เวย์ no +Norveç no +Норвегія no +Норвегия no +Na uy no +Norvedje no +挪威 no +挪威 no +Nepal np +نيبال np +Нэпал np +Непал np +নেপাল np +Nepál np +Νεπάλ np +Nepalo np +نپال np +Népal np +Neipeal np +נפאל np +नेपाल np +Nepál np +ネパール np +នេប៉ាល់ np +네팔 np +ເວນດາ np +Nepalas np +Nepāla np +Непал np +Непал np +ਨੇਪਾਲ np +Непал np +Nepali np +Непал np +நேபாளம் np +Нипол np +เนปาล np +Непал np +Непал np +尼泊尔 np +尼泊爾 np +Nauru nr +ناورو nr +Науру nr +Науру nr +নাউরু nr +Naurueg nr +Nawrw nr +Ναουρού nr +Naŭro nr +Naurú nr +نائورو nr +Naurusaaret nr +Nárúis nr +נאורו nr +नौरू nr +Naurski nr +Nárú nr +ナウル nr +ណូរូ nr +나우루 nr +ປາລາກກວຍ nr +Науру nr +Науру nr +Nawru nr +ਨਾਉਰੂ nr +Науру nr +Ikinawuru nr +Науру nr +நௌரு nr +Науру nr +นาวรู nr +Науру nr +Науру nr +Nawouro nr +瑙鲁 nr +諾魯 nr +Niue nu +Nieu nu +نيوي nu +Ніўэ nu +Ниуе nu +নিউই nu +Niwe nu +Νιούε nu +Niuo nu +نیئو nu +ניווה nu +नियू nu +ニュージーランド自治領ニウエ nu +នីវ nu +니우에 nu +ເນ໊ຕ nu +Није nu +Ниуе nu +Niwe nu +ਨੀਉਈ nu +Ниуе nu +Ниуе nu +நீயு nu +Ниу nu +นิอุเอ nu +Nive nu +Niu nu +Ніуе nu +Ниуе nu +Niuwé nu +纽埃 nu +紐鄂島 nu +New Zealand nz +Nuwe Seeland nz +نيوزيلاندا nz +Yeni Zellandiya nz +Новая Зэляндыя nz +Нова Зеландия nz +নিউজিল্যাণ্ড nz +Zeland nevez nz +Novi Zeland nz +Nova Zelanda nz +Nový Zéland nz +Seland Newydd nz +Neuseeland nz +Νέα Ζηλανδία nz +Nov-Zelando nz +Nueva Zelanda nz +Uus-Meremaa nz +Zelanda Berria nz +زلاندنو nz +Uusi-Seelanti nz +Nýsæland nz +Nouvelle Zélande nz +Nij Seelân nz +An Nua-Shéalainn nz +Nova Celándia nz +ניו זילנד nz +न्यूजीलैंड nz +Novi Zeland nz +Új-Zéland nz +Selandia Baru nz +Nýja-Sjáland nz +Nuova Zelanda nz +ニュージーランド nz +នូវែលហ្សេឡង់ nz +뉴질랜드 nz +ນີວຊີແລນ nz +Naujoji Zelandija nz +JaunZēlande nz +Нов Зеланд nz +Шинэ зеаланд nz +Nieg Seeland nz +Nieuw Zeeland nz +Navera Zelanda nz +ਨਿਊਜ਼ੀਲੈਂਡ nz +Nowa Zelandia nz +Nova Zelândia nz +Nova Zelândia nz +Noua Zeelandă nz +Новая Зеландия nz +Nuveli Zelande nz +Ođđa Zealánda nz +Nový Zéland nz +Nova Zelandija nz +Нови Зеланд nz +Novi Zeland nz +I-New Zealand nz +Nya Zeeland nz +நியூசிலாந்து nz +Зилонди Нав nz +นิวซีแลนด์ nz +Yeni Zelanda nz +Yaña Zealand nz +Нова Зеландія nz +Янги Зеландия nz +Nouve Zelande nz +新西兰 nz +紐西蘭 nz +Oman om +عُمان om +Аман om +Оман om +ওমান om +Omán om +Ομάν om +Omano om +Omán om +Omaan om +عمان om +Omán om +עומן om +ओमन om +Omán om +Óman om +オマーン om +អូម៉ង់ om +오만 om +ເຍີຍລະມັນ om +Omanas om +Omāna om +Оман om +Оман om +ਓਮਾਨ om +Omã om +Omã om +Оман om +Omani om +Omán om +Оман om +I-Oman om +ஓமன் om +Оман om +โอมาน om +Umman om +Оман om +Уммон om + Oman om +阿曼 om +阿曼 om +Panama pa +بنما pa +Панама pa +Панама pa +পানামা pa +Panamà pa +Παναμάς pa +Panamo pa +Panamá pa +پاناما pa +Panamá pa +פנמה pa +पनामा pa +パナマ pa +ប៉ាណាម៉ា pa +파나마 pa +ປານາມາ pa +Панама pa +Панама pa +ਪੈਨਾਮਾ pa +Panamá pa +Panamá pa +Панама pa +Панама pa +I-Panama pa +பனாமா pa +Панама pa +ปานามา pa +Панама pa +Панама pa +巴拿马 pa +巴拿馬 pa +Peru pe +البيرو pe +Пэру pe +Перу pe +পেরু pe +Perou pe +Perú pe +Periw pe +Περού pe +Peruo pe +Perú pe +Peruu pe +پرو pe +Pérou pe +Peiriú pe +Perú pe +פרו pe +पेरू pe +Perú pe +Perù pe +ペルー pe +ប៉េរូ pe +페루 pe +ເປລູ pe +Перу pe +Перу pe +Pero pe +ਪੇਰੂ pe +Перу pe +Перу pe +I-Peru pe +பெரு pe +Перу pe +เปรู pe +Перу pe +Перу pe +Perou pe +秘鲁 pe +秘魯 pe +French Polynesia pf +Fraans Polynesië pf +بولينيزيا الفرنسية pf +Француская Палінэзія pf +Полинезия pf +ফরাসী পলিনেশিয়া pf +Polinezi galleg pf +Francuska Polinezija pf +Polinèsia francessa pf +Francouzská Polynésie pf +Polynesia Ffrengig pf +Fransk Polynesien pf +Französisch Polynesien pf +Γαλλική Πολυνησία pf +Franca Polinezio pf +Polinesia francesa pf +Prantsuse Polüneesia pf +Polinesia Frantziarra pf +پولونزی فرانسه pf +Ranskan Polynesia pf +Polynésie française pf +Frânsk Polinesië pf +Polainéis na Fraince pf +Polinésia Francesa pf +פולינזיה הצרפתית pf +फ्रेंच पॉलीनेसिया pf +Francuska Polinezija pf +Francia-Polinézia pf +Franska Pólýnesía pf +Polinesia Francese pf +フランス領ポリネシア pf +ប៉ូលីនេស៊ី​បារាំង pf +프랑스령 폴리네시아 pf +ຝຣັ່ງເສດ pf +Prancūzų Polinezija pf +Franču Polinēzija pf +Француска Полинезија pf +Франц полинеси pf +Polineżja Franċiża pf +Fransk Polynesia pf +Franzöösch Polynesien pf +Frans Polinesië pf +Fransk Polynesia pf +ਫਰੈਂਚ ਪੋਲੀਂਸੀਆ pf +Polinezja Francuska pf +Polinésia Francesa pf +Polinésia Francesa pf +Polinezia Franceză pf +Французская Полинезия pf +Polinesiya Mfaransa pf +Fránskkalaš Polynesia pf +Francúzska Polynézia pf +Francoska Polinezija pf +Француска Полинезија pf +Francuska Polinezija pf +Franska Polynesien pf +பிரன்சு போலினேசியா pf +Пулинезияи Фаронса pf +ฝรั่งเศสโพลีนีเซีย pf +Fransız Polinezyası pf +Frans Polinesia pf +Французька Полінезія pf +Француз Полинезия pf +Polynesia thuộc Pháp pf +Polinezeye francesse pf +法属波利尼西亚 pf +法屬波利尼西亞 pf +Papua New Guinea pg +بابوا غينيا الجديدة pg +Papua Yeni Gvineya pg +Папуа–Новая Гвінэя pg +Папуа Нова Гвинея pg +পাপুয়া নিউ গিনি pg +Papouazi Gine Nevez pg +Papua Nova Gvineja pg +Papua Nova Guinea pg +Papua - Nová Guinea pg +Papwa Gini Newydd pg +Papua Neu-Guinea pg +Παπούα Νέα Γουινέα pg +Papuo-Nov-Gvineo pg +Papua Nueva Guinea pg +Paapua Uus-Guinea pg +Papua Ginea Berria pg +پاپوا گینه نو pg +Papua-Uusi-Guinea pg +Papouasie-Nouvelle-Guinée pg +Papua Nij Guinea pg +Nua-Ghuine Phapua pg +Papúa Nova Guiné pg +פפואה ניו גיני pg +पापुआ न्यू गियाना pg +Papua Nova Gvineja pg +Pápua Új-Guinea pg +Papúa Nýja-Gínea pg +Papua Nuova Guinea pg +パプアニューギニア pg +ប៉ាពូញូវហ្គីណេ pg +파푸아뉴기니 pg +ເທົາອ່ອນ pg +Papua Naujoji Gvinėja pg +Papua Jaungvineja pg +Папуа Нова Гвинеја pg +Папуа шинэ Гуйнеа pg +Papwa Ginea pg +Papua Ny-Guinea pg +Papua-Niegguinea pg +Papua Ny-Guinea pg +ਪਾਪੂਆ ਨਵਾਂ ਗੂਈਆ pg +Papua Nowa Gwinea pg +Papua Nova Guiné pg +Papua Nova Guiné pg +Papua Noua Guinee pg +Папуа-Новая Гвинея pg +Papuwa Gineya Nshya pg +Papua Ođđa-Guinea pg +Papua Nová Guinea pg +Papua Nova Gvineja pg +Папуа Нова Гвинеја pg +Papua Nova Gvineja pg +Papua Nya Guinea pg +பாப்பா நியூ ஜினியா pg +Папуа Гвинеияи Нав pg +ปาปัวนิวกินี pg +Papua Yeni Gine pg +Papua Yaña Guinea pg +Папуа Нова Гвінея pg +Папуа Янги Гвинея pg +Papouwazeye Nouve Guinêye pg +巴布亚新几内亚 pg +巴布紐幾內亞 pg +Philippines ph +Fillipyne ph +الفلبين ph +Fillipinlər ph +Філіпіны ph +Филипини ph +ফিলিপিনস ph +Filipin ph +Filipini ph +Filipines ph +Filipíny ph +Ynysoedd Y Philipinau ph +Filippinerne ph +Philippinen ph +Φιλιππίνες ph +Filipinoj ph +Filipinas ph +Filipiinid ph +Filipinak ph +فیلیپین ph +Filippiinit ph +Filippijnen ph +Na hOileáin Fhilipíneacha ph +Filipinas ph +פיליפינים ph +फिलिप्पीन्स ph +Filipini ph +Fülöp-szigetek ph +Filippseyjar ph +Filippine ph +フィリピン ph +ហ្វ៊ីលីពីន ph +필리핀 ph +ອາລະປະໂຫຍດ ph +Filipinai ph +Filipīnas ph +Филипини ph +Плиппин ph +Filippini ph +Filippinene ph +Philippinen ph +Filippijnen ph +Filippinane ph +ਫਿਲੀਪੀਨਜ਼ ph +Filipiny ph +Filipinas ph +Filipinas ph +Filipine ph +Филиппины ph +Filipine ph +Filippiinat ph +Filipíny ph +Filipini ph +Филипини ph +Filipini ph +Filippinerna ph +பிலிப்பைன்ஸ் ph +Филипин ph +ฟิลิปปินส์ ph +Filipinler ph +Filippinnär ph +Філіппіни ph +Филиппин ph +Filipenes ph +菲律宾 ph +菲律賓 ph +Pakistan pk +باكستان pk +Пакістан pk +Пакистан pk +পাকিস্তান pk +Paquistà pk +Pákistán pk +Pacistan pk +Πακιστάν pk +Pakistano pk +پاکستان pk +An Phacastáin pk +Paquistán pk +פאקיסטן pk +पाकिस्तान pk +Pakisztán pk +パキスタン pk +ប៉ាគីស្ថាន pk +파키스탄 pk +ລງບ pk +Pakistanas pk +Pakistāna pk +Пакистан pk +Пакистан pk +ਪਾਕਿਸਤਾਨ pk +Paquistão pk +Paquistão pk +Пакистан pk +Pakisitani pk +Пакистан pk +பாகிஸ்தான் pk +Покистон pk +ปากีสถาน pk +Päqstan pk +Пакистан pk +Покистон pk +巴基斯坦 pk +巴基斯坦 pk +Poland pl +بولندا pl +Polşa pl +Польшча pl +Полша pl +পোল্যাণ্ড pl +Polonia pl +Poljska pl +Polònia pl +Polsko pl +Gwlad Pwyl pl +Polen pl +Polen pl +Πολωνία pl +Pollando pl +Polonia pl +Poola pl +Polonia pl +لهستان pl +Puola pl +Pólland pl +Pologne pl +Polen pl +An Pholainn pl +Polónia pl +פולין pl +पोलैंड pl +Poljska pl +Lengyelország pl +Polandia pl +Pólland pl +Polonia pl +ポーランド pl +ប៉ូឡូញ pl +폴란드 pl +ໂປແລນ pl +Lenkija pl +Polija pl +Полска pl +Польш pl +Polonja pl +Polen pl +Polen pl +Polen pl +Polen pl +Polònia pl +ਪੋਲੈਂਡ pl +Polska pl +Polónia pl +Polônia pl +Polonia pl +Польша pl +Polonye pl +Polska pl +Poľsko pl +Poljska pl +Пољска pl +Poljska pl +I-Poland pl +Polen pl +போலாந்து pl +Поландия pl +โปแลนด์ pl +Polonya pl +Polonia, Polşa pl +Польща pl +Полша pl +Pholandi pl +Ba Lan pl +Pologne pl +波兰 pl +波蘭 pl +Saint Pierre and Miquelon pm +St Pierre en Miquelon pm +سانت بيير و ميكيلون pm +Saint Pierre və Miquelon pm +Сэн-П'ер і Мікелон pm +Св. Пиер и Магелан pm +সেন্ট পিয়ের এবং মিকেলন pm +Sant Per ha Mikelon pm +Sveti Pjer i Migelon pm +Saint Pierre i Miquelon pm +Saint Pierre a Miquelon pm +Ynysoedd Sant Pierre a Micwelon pm +Saint Pierre og Miquelon pm +Saint Pierre und Miquelon pm +Σαιν Πιέρ (Άγιος Πέτρος) και Μικελόν pm +Sent-Piero kaj Mikelono pm +Saint Pierre y Miquelon pm +Saint Pierre ja Miquelon pm +Saint Pierre eta Miquelon pm +سنت پیِر و میکولئون pm +Saint-Pierre ja Miquelon pm +Saint-Pierre-et-Miquelon pm +Saint Pierre en Miquelon pm +Peadar Naofa agus Micilín pm +Saint Pierre e Miquelon pm +סאן פייר ומיקלון pm +सेंट पियरे तथा मिक्वेलन pm +Saint Pierre i Miquelon pm +Saint Pierre és Miquelon pm +Sankti Pierre og Miquelon pm +Saint Pierre e Miquelon pm +フランス海外領土サンピエールミクロン諸島 pm +세인트 피에르 미쿠엘론 pm +Senpjēra un Mikelona pm +Свети Пјер и Микелон pm +Сайнт пиерре ба микуелон pm +Saint Pierre u Miquelon pm +Saint-Pierre-et-Miquelon pm +Sankt Pierre un Miquelon pm +Saint Pierre en Miquelon pm +Saint-Pierre-et-Miquelon pm +ਸੇਂਟ ਪੀਈਰੀ ਤੇ ਮਾਕਿਉਲੋਨ pm +Saint Pierre i Miquelon pm +S. Pedro e Miquelão pm +Saint Pierre e Miquelon pm +Saint Pierre şi Miquelon pm +Сен-Пьер и Микелон pm +Mutagatifu Petero na Mikelo pm +Saint-Pierre-et-Miquelon pm +Saint Pierre a Miquelon pm +Sveti Pierre in Miquelon pm +Св. Пјер и Микелон pm +Sv. Pjer i Mikelon pm +Saint Pierre och Miquelon pm +செயின்ட் பியரி மற்றும் மிக்யுலன் pm +Синт Пир Миколеюн pm +เซนต์ปิแอร์ และมิเคอลอน pm +Saint Pierre ve Miquelon pm +Saint Pierre wä Miquelon pm +Сент-П'єр і Мікелон pm +Сент-Пер ва Микелон pm +Sint Pire et Miquelon pm +圣皮埃尔和密克隆 pm +聖皮埃爾島及密克隆島 pm +Pitcairn pn +بيتكايرن pn +Піткэрн pn +Острови Питкерн pn +পিটকেম pn +Pitkern pn +Ynys Pitcairn pn +Πίτκαιρν pn +Pitkarna Insulo pn +پیت کِرن pn +פיטקרן pn +पिटकैर्न pn +英領ピトケアン諸島 pn +핏케언 pn +ລງບ pn +Pitkērna pn +Питкерн pn +Питкайрн pn +ਪੀਟਕਾਰਨ pn +Питкаирн pn +பிட்காய்ன் pn +Питкорин pn +เกาะพิตแคร์น pn +Pitkairn pn +Питкерн pn +皮特开恩 pn +匹特開恩島 pn +Puerto Rico pr +بورتوريكو pr +Puerto Riko pr +Пуэрта Рыка pr +Порто Рико pr +পুয়ের্তো রিকো pr +Porto Rico pr +Portoriko pr +Portoriko pr +Pwerto Rico pr +Πουέρτο Ρίκο pr +Puerto-Riko pr +پورتوریکو pr +Porto Rico pr +Portó Ríce pr +Porto Rico pr +פורטו ריקו pr +प्यूर्टो रिको pr +Portoriko pr +Púertó Ríkó pr +Portorico pr +プエルトリコ pr +ព័រតូរីកូ pr +푸에르토리코 pr +ໂປຣໂຕຄອນ pr +Puerto Rikas pr +Puertoriko pr +Порто Рико pr +Пуерто Рико pr +ਰੂਇਰਟੂ ਰੀਕੋ pr +Porto Rico pr +Porto Rico pr +Пуэрто-Рико pr +Porito Riko pr +Portoriko pr +Порторико pr +Portoriko pr +ப்யுர்டோ ரிகோ pr +Пурто Рико pr +เปอร์โตริโก pr +Porta Riko pr +Puerto Riko pr +Пуерто-Ріко pr +Пуэрто-Рико pr +Porto Rico pr +波多黎各 pr +波多黎各 pr +Palestinian Territory ps +Palesteinse Gebied ps +السلطة الفلسطينية ps +Fələstin Sahəsi ps +Палестынская тэрыторыя ps +Палестина ps +প্যালেস্টিনিয়ান টেরিটরি ps +Palestinska teritorija ps +Territori Palestí ps +Palestinské území ps +Tiriogaeth Palesteina ps +Palæstinensiske selvstyreområder ps +Palästinensisches Gebiet ps +Παλαιστίνη ps +Palestina Teritorio ps +Territorio palestino ps +Palestiina ps +Palestina ps +فلسطین ps +Palestiinalaisalue ps +Palestinensiska økið ps +Territoire palestinien ps +Palestijnsk territorium ps +Críoch na bPalaistíneach ps +Território Palestino ps +השטחים הפלסטיניים ps +फिलीस्तीनी टेरिटरी ps +Palestinski teritorij ps +Palesztin területek ps +Palestína ps +Palestina ps +パレスチナ自治区 ps +ប៉ាលេស្ទីន ps +팔레스타인 자치구 ps +ການພິມຜິດພາດ ps +Palestinos teritorija ps +Palestīniešu treitorija ps +Палестински територии ps +Палестины газар нутаг ps +Palestina ps +Palestinske territorier ps +De palästinensche sülvenregeerte Regioon ps +Palestijns territorium ps +Palestinske territorium ps +Bohwa bja Palestina ps +ਫਲਾਸਤੀਨ ਖੇਤਰ ps +Palestyna ps +Território Palestiniano ps +Território Palestino ps +Teritoriul Palestinian ps +Палестинские территории ps +Igihugu cya Palesitina ps +Palestiinnalaš territoria ps +Palestínske územia ps +Palestinski teritorij ps +Палестина ps +Palestina ps +I-Palestinian Territory ps +Palestina ps +பாலஸ்தீன ஆணையம் ps +Фаластин ps +เขตปกครองปาเลสไตน์ ps +Filistin Bölgesi ps +Fälestin ps +Палестинська територія ps +Фаластин Ерлари ps +Mukano wa maphalesitina ps +Lãnh thổ của Palestine ps +Palestene ps +Umhlaba wePalestina ps +巴勒斯坦地区 ps +巴勒斯坦領地 ps +Indawo yama-Phalesitina ps +Portugal pt +البرتغال pt +Portuqaliya pt +Партугалія pt +Португалия pt +পোর্তুগাল pt +Portugalsko pt +Portiwgal pt +Πορτογαλία pt +Portugalo pt +پرتغال pt +Portugali pt +An Phortaingéil pt +פורטוגל pt +पुर्तगाल pt +Portugália pt +Portúgal pt +Portogallo pt +ポルトガル pt +ព័រទុយហ្គាល់ pt +포르투갈 pt +ໂປຣຕຸເກສ pt +Portugalija pt +Portugāle pt +Португалија pt +Португал pt +Portugall pt +ਪੁਰਤਗਾਲ pt +Portugalia pt +Portugalia pt +Португалия pt +Poritigali pt +Portugalsko pt +Portugalska pt +Португал pt +I-Portugal pt +போர்த்துகல் pt +Пуртуқол pt +โปรตุเกส pt +Portekiz pt +Portugalia pt +Португалія pt +Португалия pt +Bồ Đào Nha pt +葡萄牙 pt +葡萄牙 pt +Palau pw +بالاو pw +Палау pw +Палау pw +পালাউ pw +Palaw pw +Παλάου pw +Palao pw +پالائو pw +פלאו pw +पलाऊ pw +Palá pw +パラオ pw +ប៉ាឡូ pw +팔라우 pw +ມອລຕາ pw +Палау pw +Палау pw +ਪਾਲਾਉ pw +Палау pw +Palawu pw +Палау pw +பலாவ் pw +Палау pw +เกาะพาเลา pw +Палау pw +Палау pw +Palawou pw +帕劳 pw +帛琉 pw +Paraguay py +Paraguaai py +باراغواي py +Paraqvay py +Парагвай py +Парагвай py +প্যারাগুয়ে py +Paragwae py +Paragvaj py +Paraguai py +Paragw?i py +Παραγουάη py +Paragvajo py +Paraguai py +پاراگویه py +Paragua py +Paraguai py +פרגואי py +पैरागुए py +Paragvaj py +Paragvæ py +パラグアイ py +ប៉ារ៉ាហ្គាយ py +파라과이 py +ປາລາກກວຍ py +Paragvajus py +Paragvaja py +Парагвај py +Парагвай py +Paragwaj py +Paraguai py +ਪਾਰਾਗੁਆ py +Paragwaj py +Paraguai py +Paraguai py +Paraguai py +Парагвай py +Paragwe py +Portugalsko py +Paragvaj py +Парагвај py +Paragvaj py +I-Paraguay py +பராகுவே py +Порогвие py +ปารากวัย py +Парагвай py +Парагвай py +Paragway py +巴拉圭 py +巴拉圭 py +Qatar qa +قطر qa +Катар qa +Катар qa +কাতার qa +Kwatar qa +Katar qa +Katar qa +Catar qa +Katar qa +Κατάρ qa +Kataro qa +Katar qa +قطر qa +Katar qa +Catar qa +קטר qa +क़तर qa +Katar qa +Katar qa +Katar qa +カタール qa +កាតារ qa +카타르 qa +ມອລຕາ qa +Kataras qa +Katara qa +Катар qa +Катар qa +Katar qa +ਕਤਰ qa +Katar qa +Катар qa +Katari qa +Katar qa +Katar qa +Катар qa +Katar qa +I-Qatar qa +கதார் qa +Қатар qa +ควาตาร์ qa +Katar qa +Катар qa +Қатар qa +Katar qa +卡塔尔 qa +卡達 qa +Romania ro +Romenië ro +رومانيا ro +Rumıniya ro +Румынія ro +Румъния ro +রুমেনিয়া ro +Roumani ro +Rumunija ro +Rumunsko ro +Rumænien ro +Rumänien ro +Ρουμανία ro +Rumanio ro +Rumanía ro +Rumeenia ro +Errumania ro +رومانی ro +Rumenia ro +Roumanie ro +Roemenië ro +An Rómáin ro +Románia ro +רומניה ro +रोमानिया ro +Rumunjska ro +Románia ro +Rumania ro +Rúmenía ro +ルーマニア ro +រូម៉ានី ro +루마니아 ro +ໂລມາເນີຍ ro +Rumunija ro +Rumānija ro +Романија ro +Румын ro +Rumanija ro +Rumänien ro +Roemenië ro +ਰੋਮਾਨੀਆ ro +Rumunia ro +Roménia ro +Romênia ro +România ro +Румыния ro +Romaniya ro +Románia ro +Rumunsko ro +Romunija ro +Румунија ro +Rumunija ro +I-Romania ro +Rumänien ro +ருமேனியா ro +Руминия ro +โรมาเนีย ro +Romanya ro +Румунія ro +Руминия ro +Roumaneye ro +罗马尼亚 ro +羅馬尼亞 ro +Russia ru +Rusland ru +روسيا ru +Rusiya ru +Расея ru +Русия ru +রাশিয়া ru +Rusia ru +Rusija ru +Rússia ru +Rusko ru +Rwsia ru +Rusland ru +Russland ru +Ρωσία ru +Ruslando ru +Rusia ru +Venemaa ru +Errusia ru +روسیه ru +Venäjä ru +Russland ru +Russie ru +Rusland ru +An Rúis ru +Rúsia ru +רוסיה ru +रुस ru +Rusija ru +Oroszország ru +Rusia ru +Rússland ru +ロシア ru +រូស្ស៊ី ru +러시아 ru +ລັດເຊີຍ ru +Rusija ru +Krievija ru +Русија ru +Орос ru +Russja ru +Russland ru +Russland ru +Rusland ru +Russland ru +ਰੂਸ ru +Rosja ru +Rússia ru +Rússia ru +Rusia ru +Россия ru +Uburusiya ru +Ruošša ru +Rusko ru +Rusija ru +Русија ru +Rusija ru +I-Russia ru +Ryssland ru +ரசியா ru +Руссия ru +รัสเซีย ru +Rusya ru +Urısia, Räsäy ru +Росія ru +Россия ru +Rashia ru +Nga ru +Rûsseye ru +Rashiya ru +俄罗斯 ru +俄羅斯 ru +Rwanda rw +رواندا rw +Ruanda rw +Руанда rw +Руанда rw +রোয়ান্ডা rw +Ruanda rw +Ruanda rw +Ruanda rw +Ρουάντα rw +Ruando rw +Ruanda rw +رواندا rw +Ruanda rw +Ruanda rw +Ruanda rw +רואנדה rw +रवांडा rw +Ruanda rw +Ruanda rw +Rúanda rw +Ruanda rw +ルワンダ rw +រវ៉ាន់ដា rw +르완다 rw +ແພນດ້າ rw +Ruanda rw +Ruanda rw +Руанда rw +Рванда rw +Ruanda rw +ਰਵਾਂਡਾ rw +Ruanda rw +Ruanda rw +Ruanda rw +Ruanda rw +Руанда rw +Ruanda rw +Руанда rw +Ruanda rw +வான்டா rw +Руондо rw +รวันด้า rw +Ruanda rw +Руанда rw +Рванда rw +卢旺达 rw +盧安達 rw +Saudi Arabia sa +Saudi Arabië sa +السعودية sa +Səudi Ərəbistan sa +Саудаўская Арабія sa +Саудитска Арабия sa +সৌদি আরব sa +Arabi Saudiet sa +Saudijska Arabija sa +Aràbia Saurí sa +Saúdská Arábie sa +Sawdi Arabia sa +Saudi Arabien sa +Saudi-Arabien sa +Σαουδική Αραβία sa +Saŭda Arabio sa +Arabia Saudí sa +Saudi Araabia sa +عربستان سعودی sa +Saudi-Arabia sa +Arabie Saoudite sa +Saudi-Arabië sa +An Araib Shádach sa +Arabia Saudita sa +ערב הסעודית sa +सऊदी अरब sa +Saudijska Arabija sa +Szaúd-Arábia sa +Sádi-Arabía sa +Arabia Saudita sa +サウジアラビア sa +អារ៉ាប៊ីសាអ៊ូឌីត sa +사우디 아라비아 sa +ອາລະບິກ sa +Saudo Arabija sa +Saūda Arābija sa +Саудиска Арабија sa +Саудын араб sa +Għarabja Sawdita sa +Saudi-Arabia sa +Saudi Arabien sa +Saudi-Arabië sa +Saudi-Arabia sa +ਸਾਊਦੀ ਅਰਬ sa +Arabia Saudyjska sa +Arábia Saudita sa +Arábia Saudita sa +Arabia Saudită sa +Саудовская Аравия sa +Arabiya Sawudite sa +Saudi Arábia sa +Saudská arábia sa +Saudova Arabija sa +Саудијска Арабија sa +Saudijska Arabija sa +I-Saudi Arabia sa +Saudiarabien sa +சவுதி அரேபியா sa +Арабистони Саудӣ sa +ซาอุดิอาระเบีย sa +Suudi Arabistan sa +Söğüd Ğäräbstan sa +Саудівська Аравія sa +Саудия Арабистони sa +Ẩrập Saudi sa +Arabeye Sawoudite sa +沙特阿拉伯 sa +沙烏地阿拉伯 sa +Solomon Islands sb +Solomon Eilande sb +جزر سليمان sb +Solomon Adaları sb +Саламонавы астравы sb +Соломонови острови sb +সলোমন দ্বীপপুঞ্জ sb +Inizi Salaun sb +Solomonska ostrva sb +Illes Solomon sb +Šalamounovy ostrovy sb +Ynysoedd Solomon sb +Salomon-øerne sb +Salomon-Inseln sb +Νήσοι Σολομώντος sb +Salomonoj sb +Islas Salomón sb +Saalomoni saared sb +Solomon Irlak sb +جزایر سلیمان sb +Solomon-saaret sb +Îles Salomon sb +Solomon Eilannen sb +Oileáin Sholamón sb +Illas Salomón sb +איי שלמה sb +सोलोमन आइलैंड sb +Solomonova otočja sb +Salamon-szigetek sb +Salómonseyjar sb +Isole Salomone sb +ソロモン諸島 sb +កោះ​សូឡូម៉ូន sb +솔로몬 제도 sb +ສະໂລວະເນີຍ sb +Saliamono salos sb +Solomonu salas sb +Соломонски Острови sb +Соломоны арлууд sb +Gżejjer Solomon sb +Salomonøyene sb +Salomonen sb +Solomon Eilanden sb +Salomonøyane sb +ਸੋਲੋਮੋਨ ਆਈਸਲੈਂਡ sb +Wyspy Salomona sb +Ilhas Salomão sb +Ilhas Salomão sb +Insulele Solomon sb +Соломоновы острова sb +Ibirwa bya Salomo sb +Salomonsullot sb +Šalamúnove ostrovy sb +Solomonovi otoki sb +Соломонова острва sb +Solomonova ostrva sb +Salomonöarna sb +சாலமன் தீவுகள் sb +Ҷазираи Сулаймон sb +หมู่เกาะโซโลมอน sb +Solomon Adaları sb +Solomon Utrawları sb +Соломонові острови sb +Соломон Ороллари sb +Quần đảo Solomon sb +Iyes Salomon sb +所罗门群岛 sb +索羅門群島 sb +Seychelles sc +سيشل sc +Сэйшэлы sc +Сейшелски острови sc +সীচিলিস sc +Sechell sc +Sejšeli sc +Ynysoedd y Seisi?l sc +Seychellerne sc +Seychellen sc +Σεϋχέλλες sc +Sejŝeloj sc +Seišellid sc +سیشل sc +Seychellit sc +Seychellen sc +Na Séiséil sc +Seicheles sc +איי סיישל sc +शेसेल्स sc +Sejšeli sc +Seychelles-eyjar sc +セイシェル sc +សីស្ហែល sc +세이셸 sc +ເຊລ sc +Seišeļu salas sc +Сејшели sc +Сейчеллис sc +Seychellene sc +Seychellen sc +Seychellen sc +Seychellane sc +ਸੀਲਚੀਲੀਸ sc +Seszele sc +Ilhas Seychelles sc +Сейшельские острова sc +Seyishele sc +Seyšellat sc +Sejšeli sc +Сејшели sc +Sejšeli sc +Seychellerna sc +சேசெல்லஸ் sc +Сейшелӣ sc +ซีเชลล์ sc +Seyşeller sc +Seyşellär sc +Сейшельські острови sc +Сейшел Ороллари sc +Seycheles sc +塞舌尔 sc +塞席爾 sc +Sudan sd +السودان sd +Судан sd +Судан sd +সুদান sd +Sondan sd +Sudán sd +Swdan sd +Σουδάν sd +Sudano sd +Sudán sd +Sudaan sd +سودان sd +Sudania sd +Soudan sd +An tSúdáin sd +Sudán sd +סודן sd +सूडान sd +Szudán sd +Súdan sd +スーダン sd +ស៊ូដង់ sd +수단 sd +ຊູດານ sd +Sudanas sd +Sudāna sd +Судан sd +Судан sd +ਸੂਡਾਨ sd +Sudão sd +Sudão sd +Судан sd +Sudani sd +Sudán sd +Судан sd +I-Sudan sd +சூடான் sd +Судон sd +ซูดาน sd +Судан sd +Судан sd +Sudani sd +Soudan sd +苏丹 sd +蘇丹 sd +Sweden se +Swede se +السويد se +İsveç se +Швэцыя se +Швеция se +সুইডেন se +Švedska se +Suècia se +Švédsko se +Sverige se +Schweden se +Σουηδία se +Svedio se +Suecia se +Rootsi se +Suedia se +سوئد se +Ruotsi se +Svøriki se +Suède se +Zweden se +An tSualainn se +Suécia se +שבדיה se +स्वीडन se +Švedska se +Svédország se +Swedia se +Svíþjóð se +Svezia se +スウェーデン se +ស៊ុយអែដ se +스웨덴 se +ສະວີເດນ se +Švedija se +Zviedrija se +Шведска se +Швед se +Svezja se +Sverige se +Zweden se +Sverige se +Suècia se +ਸਵੀਡਨ se +Szwecja se +Suécia se +Suécia se +Suedia se +Швеция se +Suwede se +Ruoŧŧa se +Švédsko se +Švedska se +Шведска se +Švedska se +I-Sweden se +Sverige se +சுவீடன் se +Шведӣ se +สวีเดน se +İsveç se +İswäc, Şwedsia se +Швеція se +Швеция se +Swidene se +Thuỵ Điển se +Suwede se +瑞典 se +瑞典 se +Singapore sg +سنغافورة sg +Sinqapur sg +Сынгапур sg +Сингапур sg +সিঙ্গাপুর sg +Singapour sg +Singapur sg +Singapur sg +Singapur sg +Singap?r sg +Singapur sg +Σινγκαπούρη sg +Singapuro sg +Singapur sg +Singapur sg +سنگاپور sg +Singapour sg +Singeapór sg +Singapur sg +סינגפור sg +सिंगापोर sg +Singapur sg +Szingapúr sg +Singapúr sg +シンガポール sg +សិង្ហបុរី sg +싱가포르 sg +ໂຊນາ sg +Singapūras sg +Singapūra sg +Сингапур sg +Сингафур sg +Singapura sg +Singapor sg +Singapur sg +ਸਿੰਘਾਪੁਰ sg +Singapur sg +Singapura sg +Singapura sg +Сингапур sg +Singapur sg +Singapur sg +Сингапур sg +Singapur sg +சிங்கப்பூர் sg +Сингопур sg +สิงคโปร์ sg +Singapur sg +Singapur sg +Сінгапур sg +Сингапур sg +Singapour sg +新加坡 sg +新加坡 sg +Saint Helena sh +St Helena sh +سانت هيلانة sh +Востраў Сьвятой Алены sh +Св. Елена sh +সেন্ট হেলেনা sh +Sant Lena sh +Sveta Helena sh +Santa Helena sh +Svatá Helena sh +Ynys Santes Helena sh +St. Helena sh +St. Helena sh +Αγία Ελένη sh +Sent-Heleno sh +Santa Helena sh +سنت هلن sh +Sainte-Hélène sh +Sint Helena sh +San Héilin sh +Santa Helena sh +סט. הלנה sh +सेंट हेलेना sh +Sveta Helena sh +Szent Heléna sh +Sankti Helena sh +Sant'Elena sh +英領セントヘレナ島 sh +សង់ហេឡេណា sh +세인트헬레나 sh +ຫົວເລື່ອງ sh +Šv. Elenos sala sh +Sv. Helēnas sala sh +Света Елена sh +Сайнт Хелена sh +St. Helena sh +Sankt Helena sh +St. Helena sh +ਸੇਂਟ ਹੀਲੀਨਆ sh +Święta Helena sh +Santa Helena sh +Santa Helena sh +Sfînta Elena sh +остров Святой Елены sh +Mutagatifu Helena sh +St. Helena sh +Svätá Helena sh +Sveta Helena sh +Света Јелена sh +Sveta Jelena sh +செயின்ட் ஹேலேனா sh +Синт Ҳилин sh +เซนต์เฮเลน่า sh +Острів Святої Єлени sh +Авлиё Елена Ороли sh +Sint Elene sh +圣赫勒拿 sh +聖赫勒拿島 sh +Slovenia si +Slovenië si +سلوفينيا si +Sloveniya si +Славенія si +Словения si +স্লোভেনিয়া si +Sloveni si +Slovenija si +Eslovènia si +Slovinsko si +Slofenia si +Slovenien si +Slowenien si +Σλοβενία si +Slovenio si +Eslovenia si +Sloveenia si +Eslovenia si +اسلوانی si +Slovénie si +Slowenië si +An tSlóivéin si +Eslovénia si +סלובניה si +स्लोवेनिया si +Slovenija si +Szlovénia si +Slóvenía si +スロベニア si +ស្លូវ៉ានី si +슬로베니아 si +ສະໂລວະເນີຍ si +Slovėnija si +Slovēnija si +Словенија si +Слован si +Slovenja si +Slowenien si +Slowenië si +Eslovenia si +ਸਲੋਵੀਨੀਆ si +Słowenia si +Eslovénia si +Eslovênia si +Словения si +Siloveniya si +Slovinsko si +Slovenija si +Словенија si +Slovenija si +I-Slovenia si +Slovenien si +சுலோவினியா si +Услувонӣ si +สโลเวเนีย si +Slovenya si +Словенія si +Словения si +Esloveneye si +斯洛文尼亚 si +斯洛維尼亞 si +Slovakia sk +Slovakië sk +سلوفاكيا sk +Slovakiya sk +Славакія sk +Словакия sk +স্লোভাকিয়া sk +Slovaki sk +Slovačka sk +Eslovàquia sk +Slovensko sk +Slofacia sk +Slovakiet sk +Slowakien sk +Σλοβακία sk +Slovakujo sk +Eslovaquia sk +Slovakkia sk +Eslovakia sk +اسلواکی sk +Slovaquie sk +Slowakije sk +An tSlóvaic sk +Eslováquia sk +סלובקיה sk +स्लोवाकिया sk +Slovačka sk +Szlovákia sk +Slóvakía sk +Slovacchia sk +スロバキア sk +ស្លូវ៉ាគី sk +슬로바키아 sk +ສະໂລວັກ sk +Slovakija sk +Slovākija sk +Словачка sk +Словак sk +Slovakja sk +Slowakei sk +Slowakije sk +ਸਲੋਵਾਕਿਆ sk +Słowacja sk +Eslováquia sk +Eslováquia sk +Slovacia sk +Словакия sk +Silovakiya sk +Slovákia sk +Slovensko sk +Slovaška sk +Словачка sk +Slovačka sk +I-Slovakia sk +Slovakien sk +சுலோவாக்கிய sk +Услувок sk +สโลวาเกีย sk +Slovakya sk +Словакія sk +Словакия sk +Eslovakeye sk +斯洛伐克 sk +斯洛伐克 sk +San Marino sm +سان مارينو sm +Сан-Марына sm +Сан Марино sm +সান মারিনো sm +Σαν Μαρίνο sm +San-Marino sm +سن‌مارینو sm +Saint-Marin sm +San Mairíne sm +סן מרינו sm +सेन मेरिनो sm +San Marínó sm +サンマリノ sm +សាន់ម៉ារីណូ sm +산마리노 sm +ໂຊນາ sm +San Marinas sm +Sanmarīno sm +Сан Марино sm +Сан Марино sm +ਸਨ ਮਰੀਨੋ sm +São Marino sm +Сан-Марино sm +Mutagatifu Marini sm +Сан Марино sm +சான் மரினோ sm +Сан Морину sm +ซานมาริโน sm +Сан-Маріно sm +Сан-Марино sm +Sint Marin sm +圣马力诺 sm +聖馬力諾 sm +Senegal sn +السنغال sn +Seneqal sn +Сэнэгал sn +Сенегал sn +সেনেগল sn +Σενεγάλη sn +Senegalo sn +سنگال sn +Senegali sn +Sénégal sn +An tSeineagáil sn +סנגל sn +सेनेगल sn +Szenegál sn +セネガル sn +សេនេហ្គាល់ sn +세네갈 sn +ທົ່ວໄປ sn +Senegalas sn +Senegāla sn +Сенегал sn +Сенегал sn +Senegall sn +ਸੈਨੇਗਾਲ sn +Сенегал sn +Senegali sn +Сенегал sn +சீனேகல் sn +Синегол sn +เซนีกัล sn +Сенегал sn +Сенегал sn +Senegål sn +塞内加尔 sn +塞內加爾 sn +Somalia so +Somalië so +صومال so +Somali so +Самалі so +Сомалия so +সোমালিয়া so +Somali so +Somalija so +Somàlia so +Somálsko so +Σομαλία so +Somalio so +Somaalia so +سومالی so +Somalie so +Somalie so +An tSomáil so +Somália so +סומליה so +सोमालिया so +Somalija so +Szomália so +Sómalía so +ソマリア so +សូម៉ាលី so +소말리아 so +ໂລມາເນີຍ so +Somalis so +Somālija so +Сомалија so +Сомали so +Somalija so +Somalien so +Somalie so +ਸੋਮਾਲੀਆ so +Somália so +Somália so +Сомали so +Somaliya so +Somália so +Somálsko so +Somalija so +Сомалија so +Somalija so +I-Somalia so +சோமாலியா so +Сумалӣ so +โซมาเลีย so +Somali so +Сомалі so +Сомали so +Somaleye so +索马里 so +索馬利亞 so +Suriname sr +سورينام sr +Surinam sr +Сурынам sr +Суринам sr +সুরিনাম sr +Surinam sr +Surinam sr +Surinam sr +Swrinam sr +Surinam sr +Σουρινάμ sr +Surinamo sr +Surinam sr +Surinam sr +سورینام sr +Surinam sr +Suranam sr +סורינאם sr +सूरीनाम sr +Surinam sr +Súrínam sr +スリナム sr +ស៊ូរីណាមី sr +수리남 sr +ເຊີເບີຍ sr +Surinamas sr +Surinama sr +Суринам sr +Суринам sr +Surinam sr +Surinam sr +Surinam sr +Surinam sr +ਸੂਰੀਨਾਮੀ sr +Surinam sr +Surinam sr +Суринам sr +Surinamu sr +Surinam sr +Surinam sr +Surinam sr +Суринам sr +Surinam sr +Surinam sr +சுரிநேம் sr +Суринам sr +ซูรีนามิ sr +Surinam sr +Surinam sr +Сурінам sr +Суринам sr +苏里南 sr +蘇利南 sr +Sao Tome and Principe st +Sao Tome en Principe st +ساو تومي و البرنسيب st +Sao Tome və Principe st +Сан-Тамэ і Прынсіпі st +Сао Томе и Принсипи st +সাও টোম এবং প্রিন্সিপ st +Sao Tome ha Principe st +Sao Tome i Principe st +Sao Tome i Principe st +Sao Tome a Principe st +Ynysoedd Sao Tome a Principe st +Sao Tomé og Principe st +Sao Tome und Principe st +Σάο Τομέ και Πρίνσιπε st +Sao-Tomeo kaj Principeo st +Sao Tome y Príncipe st +Sao Tome ja Principe st +Sao Tome eta Principe st +سائوتومه و پرینسیپه st +São Tomé ja Príncipe st +Sao Tomé et Principe st +Sao Tome en Principe st +São Tomé agus Príncipe st +Santo Tomé e Príncipe st +साओ टोम तथा प्रिंसिपी st +Sv. Toma i Princip st +Sao Tome és Principe st +Saó Tóme og Prinsípe st +São Tomé e Príncipe st +サントメプリンシペ st +상투메 프린시페 st +ບໍລິການ st +Santome un Prinsipi st +Сао Томе и Принсипе st +Сао Томэ ба Принцип st +Sao Tome u Principe st +São Tomé og Príncipe st +São Tomé un Príncipe st +Sao Tome en Principe st +São Tomé og Príncipe st +ਸਾਓ ਟੋਮੀ ਤੇ ਪਰੀਸਿਪੀ st +Sao Tome i Principe st +São Tomé and Príncipe st +São Tome e Príncipe st +Sao Tome şi Principe st +Сан-Томе и Принсипи st +Sawo Tome na Purencipe st +São Tomé ja Príncipe st +Sao Tome a Principe st +Sao Tome in Principe st +Св. Тома и Принцип st +Sv. Toma i Princip st +São Tomé och Príncipe st +சயோ டோம் மற்றும் பிரின்ஸிபி st +Синт Том ва Принсип st +ซาวโทม และ พรินซิป st +Sao Tome ve Principe st +Sao Tome wä Principe st +Сан-Томе і Прінсіпі st +Сан-Томе ва Принсипи st +São Tomé et Prince st +圣多美和普林西比 st +聖多美及普林西比 st +El Salvador sv +السلفادور sv +Сальвадор sv +Салвадор sv +এল সালভাডোর sv +Ar Salvador sv +Salvador sv +El Salfador sv +Ελ Σαλβαντόρ sv +Salvadoro sv +Salvador sv +السالوادور sv +Salvador sv +An tSalvadóir sv +O Salvador sv +אל סלבדור sv +अल सल्वाडोर sv +Salvador sv +エルサルバドル sv +អែលសាល់វ៉ាឌ័រ sv +엘살바도르 sv +ເອລຊັນວາດດໍ sv +Salvadoras sv +Salvadora sv +Ел Салвадор sv +Эл Салвадор sv +ਈਲ ਸਾਲਵੇਡੋਰ sv +Salwador sv +Salvador sv +Сальвадор sv +Eli Salivadoro sv +Salvádor sv +Salvador sv +Ел Салвадор sv +I-El Salvador sv +எல் சால்வடோ ர் sv +Ал Салвадур sv +เอลซัลวาดอร์ sv +Ель-Сальвадор sv +Салвадор sv +萨尔瓦多 sv +薩爾瓦多 sv +Syria sy +Sirië sy +سوريا sy +Suriyə sy +Сырыя sy +Сирия sy +সিরিয়া sy +Siri sy +Sirija sy +Síria sy +Sýrie sy +Syrien sy +Syrien sy +Συρία sy +Sirio sy +Siria sy +Süüria sy +Siria sy +سوریه sy +Syyria sy +Syrie sy +Syrië sy +An tSiria sy +Síria sy +סוריה sy +सीरिया sy +Sirija sy +Szíria sy +Sýrland sy +Siria sy +シリア sy +ស៊ីរី sy +시리아 sy +ເຊີເບີຍ sy +Sirija sy +Sīrija sy +Сирија sy +Сири sy +Siria sy +Syrien sy +Syrië sy +ਸੀਰੀਆ sy +Síria sy +Síria sy +Siria sy +Сирия sy +Siriya sy +Sýria sy +Sirija sy +Сирија sy +Sirija sy +I-Syria sy +Syrien sy +சிரியா sy +Сурия sy +ซีเรีย sy +Suriye sy +Süriä sy +Сирія sy +Сурия sy +Sireye sy +叙利亚 sy +敘利亞 sy +Swaziland sz +Swasiland sz +سوازيلاند sz +Svaziland sz +Свазылэнд sz +Свазиленд sz +সোয়াজিল্যাণ্ড sz +Svazilend sz +Neozelàndia sz +Gwlad y Swasi sz +Swasiland sz +Σουαζιλάνδη sz +Svazilando sz +Swazilandia sz +Svaasimaa sz +Swazilandia sz +سووازیلند sz +Swazimaa sz +An tSuasalainn sz +Suacilándia sz +סוואזילנד sz +स्वाजीलैंड sz +Svazilend sz +Szváziföld sz +Svasíland sz +スワジランド sz +ស្វាហ្ស៊ីឡង់ sz +스와질란드 sz +ລາດສະນາຈັກໄທຍ sz +Svazilenda sz +Свазиленд sz +Свациланд sz +Sważilandja sz +Swasiland sz +ਸਵਾਜ਼ੀਲੈਂਡ sz +Suazi sz +Suazilândia sz +Suazilândia sz +Suaziland sz +Свазиленд sz +Swazilande sz +Swazijsko sz +Svazi sz +Свазиленд sz +Svazilend sz +ஸ்வாசிலான்ட் sz +Свозиланд sz +สวาซิแลนด์ sz +Свазіленд sz +Свазиленд sz +Suwazilande sz +斯威士兰 sz +史瓦濟蘭 sz +Turks and Caicos Islands tc +Turks en Caicos Eilande tc +جزر الترك و الكايكوس tc +Türk və Caicos Adaları tc +Астравы Тэркс і Кайкас tc +Острови Търкс и Кайкос tc +টার্কস এবং কাইকোস দ্বীপপুঞ্জ tc +Inizi Turks ha Kaikos tc +Turks i Kaikos ostrva tc +Illes Turks i Caicos tc +Turks a Caicos ostrovy tc +Ynysoedd Twrc a Chaicos tc +Turks- og Caicosøerne tc +Turks- und Caicos-Inseln tc +Νήσοι Τερκς και Κάικος tc +Turkoj kaj Kajkoj tc +Islas Turcos y Caicos tc +Turks ja Caicos tc +Turks eta Caicos Irlak tc +جزایر تورکس و کایکوس tc +Turks- ja Caicos-saaret tc +Îles Turks et Caicos tc +Turks en Caicos Eilânen tc +Na hOileáin Turks agus Caicos tc +Illas Caicos e Turks tc +איי קאיקוס וטורקס tc +तुर्क तथा कैकोस आइलैंड tc +Turks i Caicos otočje tc +Turks- és Caicos-szigetek tc +Turks- og Caicos-eyjar tc +Isole Turks e Caicos tc +英領タークス諸島 カイコス諸島 tc +កោះ​ទួក និង​ កៃកូស tc +터크스 케이커스 제도 tc +Tērksa un Kaikosa tc +Острови Турк и Каикос tc +Турк ба Кайкогийн арлууд tc +Gżejjer Turks u Caicos tc +Turks- og Caicosøyene tc +Turks- un Caicosinseln tc +Turks en Caicos Eilanden tc +Turks- og Caicosøyane tc +ਤੁਰਕਸ ਤੇ ਕਾਇਕੋਸ ਟਾਪੂ tc +Wyspy Turks i Caicos tc +Ilhas Turks e Caicos tc +Ilhas Caicos e Turca tc +Insulele Turks şi Caicos tc +Острова Теркс и Кайкос tc +Ibirwa bya Turike na Kayikosi tc +Turks- ja Kaikossullot tc +Turks a Caicos ostrovy tc +Otoka Turks in Caicos tc +Турка и Кајкошка острва tc +Turka i Kajkoška ostrva tc +Turks- och Caicosöarna tc +துருக்கிகள் மற்றும் காய்கோஸ் தீவுகள் tc +Ҷазираи Турк ва Койкус tc +เกาะดติร์กและเคคอส tc +Turks ve Caicos Adaları tc +Türks wä Caicos Utrawları tc +Острови Теркс і Кайкос tc +Туркс ва Каикос Ороллари tc +Quần đảo Turks và Caicos tc +Iyes Turks et Caicos tc +特克斯和凯科斯群岛 tc +土克斯和開卡斯群島 tc +Chad td +تشاد td +Çad td +Чад td +Чад td +চ্যাড td +Tchad td +Čad td +Txad td +Čad td +Tsiad td +Tchad td +Tschad td +Τσαντ td +Ĉado td +Tšaad td +Txad td +چاد td +Tchad td +Tsjaad td +Sead td +Chade td +צ'אד td +चाड td +čad td +Csád td +Tsjad td +Ciad td +チャド td +ឆាដ td +차드 td +ເກມໄພ່ td +Čada td +Чад td +Чад td +Ċad td +Tsjad td +Tschad td +Tsjaad td +Tsjad td +ਚਾਂਦ td +Czad td +Chade td +Chade td +Ciad td +Чад td +Cade td +Čad td +Čad td +Čad td +Чад td +Čad td +Tchad td +சாட் td +Чод td +ชาด td +Çad td +Çad td +Чад td +Чад td +Tchad td +乍得 td +查德 td +Togo tg +توغو tg +Тога tg +Того tg +টোগো tg +Τόγκο tg +توگو tg +Tógó tg +טוגו tg +टोगो tg +Tógó tg +トーゴ tg +តូហ្គោ tg +토고 tg +ຂອງເລ່ນສະນຸກ tg +Того tg +Того tg +ਤੋਗੋ tg +Того tg +Того tg +டோகோ tg +Того tg +โตโก tg +Того tg +Того tg +多哥 tg +多哥 tg +Thailand th +تايلاند th +Tayland th +Тайлянд th +Тайланд th +থাইল্যাণ্ড th +Tajland th +Tailàndia th +Thajsko th +Gwlad y Tai th +Ταϊλάνδη th +Tajlando th +Tailandia th +Tai th +Thailandia th +تایلند th +Thaimaa th +Tailand th +Thaïlande th +Thailân th +An Téalainn th +Tailándia th +תאילנד th +थाइलैंड th +Tajland th +Thaiföld th +Taíland th +Tailandia th +タイ th +ថៃ th +태국 th +ລາດສະນາຈັກໄທຍ th +Tailandas th +Taizeme th +Тајланд th +Тайланд th +Tajlandja th +Tailandia th +ਥਾਈਲੈਂਡ th +Tajlandia th +Tailândia th +Tailândia th +Tailanda th +Таиланд th +Tayilande th +Thajsko th +Tajska th +Тајланд th +Tajland th +I-Thailand th +தாய்லாந்து th +Тойлонд th +ราชอาณาจักรไทย th +Tayland th +Tayland th +Таїланд th +Таиланд th +Thái Lan th +Taylande th +泰国 th +泰國 th +Tajikistan tj +طاجيكستان tj +Tacikistan tj +Таджыкістан tj +Таджикистан tj +তাজিকিস্তান tj +Tadjikistan tj +Tadžikistan tj +Tadjikistan tj +Tádžikistán tj +Tajicistan tj +Tadschikistan tj +Τατζικιστάν tj +Taĝikujo tj +Tajikistán tj +Tadžikistan tj +تاجیکستان tj +Tadjikistan tj +An Táidsíceastáin tj +Taxiquistán tj +טג'קיסטן tj +ताजिकिस्तान tj +Tadžikistan tj +Tadzsikisztán tj +Tadsjikistan tj +Tagikistan tj +タジキスタン tj +តាហ្ស៊ីគីស្តង់ tj +타지키스탄 tj +ໃຕ້ຫວັນ tj +Tadžikistanas tj +Tadžikistāna tj +Таџикистан tj +Тажикстан tj +Taġikistan tj +Tadsjikistan tj +Tadschikistan tj +Tadjikistan tj +Tadsjikistan tj +ਤਜ਼ਾਕਸਤਾਨ tj +Tadżykistan tj +Tajiquistão tj +Tajiquistão tj +Таджикистан tj +Tajikisitani tj +Tažikistan tj +Tadžikistan tj +Tadžikistan tj +Таџикистан tj +Tadžikistan tj +Tadzjikistan tj +தஜிகிஸ்தான் tj +Тоҷикистон tj +ธาจีกิสถาน tj +Tacikistan tj +Tajıqstan tj +Таджикистан tj +Тожикистон tj +Tadjikistan tj +塔吉克斯坦 tj +塔吉克 tj +Tokelau tk +توكيلاو tk +Такелау tk +Токело tk +টোকেলো tk +Tokelo tk +Tocelaw tk +Τοκελάου tk +Tokelao tk +توکلائو tk +Na hOileáin Tócala tk +טוקלאו tk +तोकेलाऊ tk +Tókelá tk +ニュージーランド自治領トケラウ tk +តូកេឡូ tk +토켈로 tk +ເບລາລັສ tk +Токелау tk +Токелау tk +Tokelaw tk +ਤੋਕੀਲਾਉ tk +Токелау tk +Tokelawu tk +Токелау tk +டோகேலா tk +Токилау tk +โทเคเลา tk +Tokelauça tk +Токелау tk +Токелау tk +托克劳 tk +托克勞 tk +Turkmenistan tm +تركمانستان tm +Türkmənistan tm +Туркмэністан tm +Туркменистан tm +তুর্কমেনিস্তান tm +Turcmenistan tm +Turkmenistán tm +Twrcmenistan tm +Τουρκμενιστάν tm +Turkmenujo tm +Turkmenistán tm +Türkmenistan tm +ترکمنستان tm +Turkménistan tm +An Tuircméanastáin tm +Turkmenistán tm +טורקמניסטן tm +तुर्कमेनिस्तान tm +Türkmenisztán tm +Túrkmenistan tm +トルクメニスタン tm +ទួគមេនីស្តង់ tm +투르크메니스탄 tm +ຕຸລະກີ tm +Turkmenistāna tm +Туркменистан tm +Туркменстан tm +ਤੁਰਕੇਮਸਤਾਨ tm +Turquemenistão tm +Turcomenistão tm +Turcmenistan tm +Туркменистан tm +Turikimenisitani tm +Туркменистан tm +துர்க்மெனிஸ்தான் tm +Туркманистон tm +เตอร์กเมนิสถาน tm +Türkmenistan tm +Туркменістан tm +Туркманистон tm +Turcmenistan tm +土库曼斯坦 tm +土庫曼 tm +Tunisia tn +Tunisië tn +تونس tn +Tunis tn +Туніс tn +Тунис tn +টিউনিসিয়া tn +Tunizi tn +Tunis tn +Tunísia tn +Tunisko tn +Tiwnisia tn +Tunesien tn +Tunesien tn +Τυνησία tn +Tunizio tn +Túnez tn +Tuneesia tn +تونس tn +Tunesia tn +Tunisie tn +Tunisie tn +An Túinéis tn +Túnez tn +תוניסיה tn +ट्यूनीशिया tn +Tunis tn +Tunézia tn +Túnis tn +チュニジア tn +ទុយនេស៊ី tn +튀니지 tn +ລັດເຊີຍ tn +Tunisas tn +Tunisija tn +Тунис tn +Тунис tn +Tuneżija tn +Tunesien tn +Tunisie tn +ਟੁਨੀਸ਼ੀਆ tn +Tunezja tn +Tunísia tn +Tunísia tn +Тунис tn +Tuniziya tn +Tunisko tn +Tunizija tn +Тунис tn +Tunis tn +I-Tunisia tn +Tunisien tn +துனிசியா tn +Тунис tn +ตูนีเซีย tn +Tunus tn +Туніс tn +Тунис tn +Tunizeye tn +突尼斯 tn +突尼西亞 tn +Tonga to +تونغا to +Tonqa to +Тонга to +Тонга to +টোংগা to +Inizi Tonga to +Τόνγκα to +Tongo to +تونگو to +טונגה to +टोंगा to +トンガ to +តុងហ្គោ to +통가 to +ໂຊນາ to +Тонга to +Тонга to +ਟਾਂਗਾ to +Тонга to +Тонга to +டோங்கா to +Тонго to +ตองก้า to +Тонга to +Тонга to +汤加 to +東加 to +East Timor tp +Oos Timor tp +تيمور الشرقية tp +Şərqi Timor tp +Усходні Тымор tp +Източен Тимор tp +পূর্ব টিমর tp +Timor reter tp +Istočni Timor tp +Timor Est tp +Východní Timor tp +Dwyrain Timor tp +Østtimor tp +Ost-Timor tp +Ανατολικό Τιμόρ tp +Orienta Timoro tp +Timor oriental tp +Ida-Timor tp +Ekialdeko Timor tp +تیمور شرقی tp +Itä-Timor tp +Timor oriental tp +Oost Timor tp +Tíomór Thoir tp +Timor do Leste tp +מזרח טימור tp +पूर्वी तिमोर tp +Istočni Timor tp +Kelet-Timor tp +Austur-Tímor tp +Timor Est tp +東ティモール tp +ទីម័រ​ខាង​កើត tp +동티모르 tp +ວັນແລະເວລາ tp +Rytų Timoras tp +Austrumtimora tp +Источен Тимор tp +Зүүн тимор tp +Timor Timur tp +Timor tal-Lvant tp +Øst-Timor tp +Oosttimor tp +Oost Timor tp +Aust-Timor tp +ਪੂਰਬੀ ਤਾਮੋਰ tp +Timor Wschodni tp +Timor Leste tp +Timor Leste tp +Timorul de Est tp +Восточный Тимор tp +Timoro y'Uburasirazuba tp +Nuorta-Timor tp +Východný Timor tp +Vzhodni Timor tp +Источни Тимор tp +Istočni Timor tp +Östtimor tp +கிழக்கு திமார் tp +Тимури Шарқ tp +ติมอร์ตะวันออก tp +Doğu Timur tp +Çığış Timor tp +Східний Тімор tp +Шарқий Тимур tp +Đông Timo tp +Timor Ess tp +东帝汶 tp +東帝汶 tp +Turkey tr +Turkeye tr +تركيا tr +Türkiyə tr +Турцыя tr +Турция tr +তুর্কী tr +Turkia tr +Turska tr +Turquia tr +Turecko tr +Twrci tr +Tyrkiet tr +Türkei tr +Τουρκία tr +Turkujo tr +Turquía tr +Türgi tr +Turkia tr +ترکیه tr +Turkki tr +Turkaland tr +Turquie tr +Turkije tr +An Tuirc tr +Turquia tr +טורקיה tr +तुर्की tr +Turska tr +Törökország tr +Turki tr +Tyrkland tr +Turchia tr +トルコ tr +ទួរគី tr +터키 tr +ຕຸລະກີ tr +Turkija tr +Turcija tr +Турција tr +Турк tr +Turki tr +Turkija tr +Tyrkia tr +Törkei tr +Turkije tr +Tyrkia tr +Turquia tr +ਤੁਰਕੀ tr +Turcja tr +Turquia tr +Turquia tr +Turcia tr +Турция tr +Turukiya tr +Durka tr +Turecko tr +Turčija tr +Турска tr +Turska tr +I-Turkey tr +Turkiet tr +துருக்கி tr +Туркиё tr +ตุรกี tr +Türkiye tr +Törkiä tr +Туреччина tr +Туркия tr +Thổ Nhĩ Kì tr +Turkeye tr +土耳其 tr +土耳其 tr +Trinidad and Tobago tt +Trinidad en Tobago tt +ترينيداد و توباغو tt +Trinidad və Tabaqo tt +Трынідад і Табага tt +Тринидад и Тобаго tt +ত্রিনিদাদ এবং টোবাগো tt +Trinidad ha Tobago tt +Trinidad i Tobago tt +Trinidad i Tobago tt +Trinidad a Tobago tt +Ynysoedd Trinidad a Thobago tt +Trinidad og Tobago tt +Trinidad und Tobago tt +Τρίνινταντ και Τομπάγκο tt +Trinidado kaj Tobago tt +Trinidad y Tobago tt +Trinidad ja Tobago tt +Trinidad eta Tobago tt +ترینیداد و تُباگو tt +Trinidad ja Tobago tt +Trinidad og Tobago tt +Trinidad et Tobago tt +Trinidad en Tobago tt +Oileán na Tríonóide agus Tobága tt +Trinidade e Tobago tt +טרינידד וטובגו tt +ट्रिनिडाड और टोबैगो tt +Trinidad i Tobago tt +Trinidad és Tobago tt +Trinidad dan Tobago tt +Trínidad og Tóbagó tt +Trinidad e Tobago tt +トリニダードトバコ tt +ទ្រីនីដាដ និង​​ តូបាហ្គោ tt +트리니다드 토바고 tt +ຕີນິແດດແລະໂທບາໂກ tt +Trinidadas ir Tobagas tt +Trinidada un Tobago tt +Тринидад и Тобаго tt +Тринида ба Тобаго tt +Trinidad dan Tobago tt +Trinidad u Tobago tt +Trinidad og Tobago tt +Trinidad un Tobago tt +Trinidad en Tobago tt +Trinidad og Tobago tt +Trinidad le Tobago tt +Trinidad e Tobago tt +ਤਰੀਨੀਡਾਡ ਤੇ ਤੋਬਾਗੋ tt +Trinidad i Tobago tt +Trindade e Tobago tt +Trinidad e Tobago tt +Trinidad şi Tobago tt +Тринидад и Тобаго tt +Tirinida na Tobago tt +Trinidad ja Tobago tt +Trinidad a Tobago tt +Trinidad in Tabago tt +Тринидад и Тобаго tt +Trinidad i Tobago tt +I-Trinidad kanye neTobago tt +Trinidad och Tobago tt +ட்ரினிடாட் & டொபாகோ tt +Туриндод ва Тубогу tt +ตรีนิแดดและโทบาโก tt +Trinidad veTabago tt +Trinidad wä Tobago tt +Республіка Трінідад та Тобаго tt +Тринидад ва Тобаго tt +Trinidad na Tobago tt +Trinidad và Tobago tt +Trinité et Tobago tt +Trinidad ne Tobago tt +特立尼达和多巴哥 tt +千里達及托貝哥 tt +Trinidad knaye ne-Tobago tt +Tuvalu tv +توفالو tv +Тувалу tv +Тувалу tv +টুভালু tv +Twfalw tv +Τουβαλού tv +Tuvalo tv +توالو tv +טובאלו tv +तुवालू tv +Túvalú tv +ツバル tv +ទុយវ៉ាលុយ tv +투발루 tv +ຊູລູ tv +Тувалу tv +Тувалу tv +ਤੁਵਾਲੂ tv +Тувалу tv +Тувалу tv +துவலு tv +Тувалу tv +ตูวาลู tv +Tuvaluça tv +Тувалу tv +Тувалу tv +Touvalou tv +图瓦卢 tv +吐瓦魯 tv +Taiwan tw +تايوان tw +Tayvan tw +Тайвань tw +Тайван tw +তাইওয়ান tw +Tajvan tw +Ταϊβάν tw +Tajvano tw +Taiwán tw +تایوان tw +Taivan tw +Taïwan tw +An Téaváin tw +Taiwán tw +טיוואן tw +ताईवान tw +Tajvan tw +Tajvan tw +Taívan tw +台湾 tw +តៃវ៉ាន់ tw +대만 tw +ໃຕ້ຫວັນ tw +Taivanis tw +Taivāna tw +Тајван tw +Тайван tw +Tajwan tw +ਤਾਈਵਾਨ tw +Tajwan tw +Formosa tw +Taivan tw +Тайвань tw +Tayiwani tw +Tajvan tw +Тајван tw +Tajvan tw +I-Taiwan tw +தாய்வான் tw +Тойвон tw +ไต้หวัน tw +Tayvan tw +Taywan tw +Тайвань tw +Тайван tw +Đài Loan tw +中国台湾 tw +台灣 tw +Tanzania, United Republic of tz +Tanzanië, Vereenigde Republiek van tz +جمهورية تنزانيا المتحدة tz +Tanzaniya tz +Злучаная Рэспубліка Танзанія tz +Танзания tz +তানজানিয়া tz +Tanzanija, Ujedinjena Republika tz +Tanzània, República Unida de tz +Tanzánie tz +Tansania, Gweriniaeth Unedig tz +Tanzania tz +Tansania, vereinigte Republik tz +Τανζανία, Ενωμένη δημοκρατία της tz +Tanzanio, Unuiĝinta Respubliko de tz +Tanzania, Republica de tz +Tansaania tz +Tanaziar Errepublika Batua tz +جمهوری متحده تانزانیا tz +Tansanian yhdistäytynyt tasavalta tz +Tanzanie, République unie de tz +Tanzanië, Ferienigd republyk fan tz +An Tansáin tz +República Unida de Tanzánia tz +טנזניה, הרפובליקה המאוחדת של tz +तंजानिया यूनाइटेड रिपब्लिक tz +Ujedinjena Republika Tanzanija tz +Tanzánia tz +Tansanía tz +Tanzania tz +タンザニア,共和国連邦 tz +តង់ហ្សានី tz +탄자니아 합중국 tz +ໂດມິນິກັນ tz +Tanzanijos Respublika tz +Tanzānija tz +Танзанија, Обединета Република tz +Танканы нэгдсэн улс tz +Republik Bersatu Tanzania tz +Tanżania tz +Tanzania tz +Tansania tz +Tanzania, Verenigde republiek van tz +Tanzania tz +ਤਾਨਜ਼ੂਈਆ, ਸੰਯੁਕਤ ਗਣਰਾਜ tz +Zjednoczna Republika Tanzanii tz +República da União da Tanzânia tz +República da Tanzânia tz +Tanzania, Republica Unită tz +Танзания tz +Tanzaniya, Repubulika Yunze Ubumwe ya tz +Tanzania tz +Tanzánia, Spojená republika tz +Tanzanija, Združena republika tz +Танзанија, Уједињена Република tz +Tanzanija, Ujedinjena Republika tz +Förenade republiken Tanzania tz +டான்ஜாநியா, ஐக்கிய குடியரசு tz +Ҷумҳурии Муттаҳидаи Тонзониё tz +สาธารณรัฐแทนซาเนีย tz +Tanzanya tz +Tanzania, Berläşkän Cömhüriätläre tz +Танзанія, об'єднана республіка tz +Танзания Бирлашган Республикаси tz +Tanzania, Cộng hoà thống nhât tz +Tanzaneye tz +坦桑尼亚联合共和国 tz +坦尚尼亞 tz +Ukraine ua +Ukraïne ua +أوكرانيا ua +Ukrayna ua +Украіна ua +Украйна ua +ইউক্রেন ua +Ukraina ua +Ukrajina ua +Ucraïna ua +Ukrajina ua +Wcr?in ua +Ουκρανία ua +Ukrainio ua +Ucrania ua +Ukraina ua +Ukrania ua +اکراین ua +Ukraina ua +Ukraina ua +Oekraïne ua +An Úcráin ua +Ucrania ua +אוקראינה ua +उक्रेन ua +Ukrajina ua +Ukrajna ua +Ukraina ua +Úkraína ua +Ucraina ua +ウクライナ ua +អ៊ុយក្រែន ua +우크라이나 ua +ຍູເຄຣນ ua +Ukraina ua +Ukraina ua +Украина ua +Украйн ua +Ukranja ua +Ukraina ua +Oekraïne ua +Ukraina ua +Ucraina ua +ਯੂਕਰੇਨ ua +Ukraina ua +Ucrânia ua +Ucrânia ua +Ucraina ua +Украина ua +Ukerene ua +Ukraina ua +Ukrajina ua +Ukrajina ua +Украјина ua +Ukrajina ua +I-Ukraine ua +Ukraina ua +உக்ரெய்ன் ua +Украина ua +ยูเครน ua +Ukrayna ua +Ukrain ua +Україна ua +Украина ua +Ukraina ua +Oucrinne ua +乌克兰 ua +烏克蘭 ua +Uganda ug +أوغندا ug +Uqanda ug +Уганда ug +Уганда ug +ইউগাণ্ডা ug +Ouganda ug +Wganda ug +Ουγκάντα ug +Ugando ug +اوگاندا ug +Ouganda ug +אוגנדה ug +उगांडा ug +Úganda ug +ウガンダ ug +អ៊ូហ្គង់ដា ug +우간다 ug +ແພນດ້າ ug +Уганда ug +Уганда ug +ਯੂਗਾਂਡਾ ug +Уганда ug +Уганда ug +உகான்டா ug +Угондо ug +ยูกันดา ug +Уганда ug +Уганда ug +Ouganda ug +乌干达 ug +烏干達 ug +United States of America us +Vereenigde State van Amerika us +الولايات المتحدة الأمريكية us +Amerika Birləşmiş Ştatları us +Злучаныя Штаты Амэрыкі us +САЩ us +মার্কিন যুক্তরাষ্ট্র us +Stadoù-Unanet Amerika us +Sjedinjene Američke Države us +Estats Units d'Amèrica us +Spojené státy americké us +Unol Daleithau America us +USA us +USA us +Ηνωμένες Πολιτείες της Αμερικής us +Usono us +Estados Unidos de América us +Ameerika Ühendriigid us +Ameriketako Estatu Batuak us +ایالات متحده‌ی آمریکا us +Yhdysvallat us +Sambandsríki Amerika (USA) us +États Unis d'Amérique us +Ferienigde Staten fan Amerika us +Stáit Aontaithe Mheiriceá us +Estados Unidos de América us +ארצות הברית us +संयुक्त राज्य अमेरिका us +Sjedinjene Američke Države us +Amerikai Egyesült Államok us +Amerika Serikat us +Bandaríkin us +Stati Uniti d'America us +アメリカ合衆国 us +សហរដ្ឋអាមេរិក us +미 합중국 us +ສະຫະລັດອາເມລິກາ us +Jungtinės Amerikos Valstijos us +Amerikas Savienotās Valstis us +Соединети Американски Држави us +АНУ us +Amerika Syarikat us +Stati Uniti us +USA us +Vereenigte Staten vun Amerika us +Verenigde Staten van Amerika us +USA us +Estats Units d'Amèrica us +ਸੰਯੁਕਤ ਰਾਜ ਅਮਰੀਕਾ us +Stany Zjednoczone Ameryki us +Estados Unidos da América us +Estados Unidos da América us +Statele Unite ale Americii us +Соединённые Штаты Америки us +Leta Zunze Ubumwe z'Amerika us +Amerihká ovttastuvvan stáhtat us +USA us +Združene države Amerike us +Сједињене америчке државе us +Sjedinjene američke države us +I-United States of America us +Amerikas förenta stater us +ஐக்கிய அமெரிக்கா us +Иёлоти Муттаҳидаи Амрико us +สหรัฐอเมริกา us +Amerika Birleşik Devletleri us +Amerika Quşma Ştatları us +США us +Америка Қўшма Штатлари us +mashango o tangananaho a America us +Hợp chủng quốc Hoa Kỳ us +Estats Unis us +United States ye Melika us +美国 us +美利堅合眾國 us +Uruguay uy +الأوروغواي uy +Uruqvay uy +Уругвай uy +Уругвай uy +উরুগুয়ে uy +Urugvaj uy +Uruguai uy +Wrwgw?i uy +Ουρουγουάη uy +Urugvajo uy +Uruguai uy +اروگویه uy +Uragua uy +Uruguai uy +אורוגואי uy +उरूग्वे uy +Urugvaj uy +Úrúgvæ uy +ウルグアイ uy +អ៊ុយរុយហ្គាយ uy +우루과이 uy +ອຸລຸກກວຍ uy +Urugvajus uy +Urugvaja uy +Уругвај uy +Уругвай uy +Urugwaj uy +Uruguai uy +ਉਰੂਗਵੇ uy +Urugwaj uy +Uruguai uy +Uruguai uy +Uruguai uy +Уругвай uy +Irigwe uy +Uruguaj uy +Urugvaj uy +Уругвај uy +Urugvaj uy +I-Uruguay uy +உருகுவே uy +Уругвай uy +อุรุกวัย uy +Уругвай uy +Уругвай uy +Ourougway uy +乌拉圭 uy +烏拉圭 uy +Uzbekistan uz +أوزبكستان uz +Özbəkistan uz +Узбэкістан uz +Узбекистан uz +উজবেকিস্তান uz +Ouzbekistan uz +Uzbekistán uz +Wsbecist?n uz +Usbekistan uz +Ουζμπεκιστάν uz +Uzbekujo uz +Uzbekistán uz +Usbekistan uz +ازبکستان uz +Ouzbékistan uz +Úisbéiceastáin uz +Uzbekistán uz +אוזבקיסטן uz +उज्बेकिस्तान uz +Üzbegisztán uz +Úsbekistan uz +ウズベキスタン uz +អ៊ូហ្សបេគីស្តង់ uz +우즈베키스탄 uz +ເດນ່ງນ uz +Uzbekistāna uz +Узбекистан uz +Узбекстан uz +Użbekistan uz +Usbekistan uz +Usbekistan uz +Usbekistan uz +ਉਜ਼ੇਬਕਸਤਾਨ uz +Uzbequistão uz +Uzbequistão uz +Узбекистан uz +Uzibekisitani uz +Usbekistan uz +Узбекистан uz +உஸ்பெகிஸ்தான் uz +Ӯзбекистон uz +อุซเบกิสถาน uz +Özbekistan uz +Özbäkstan uz +Узбекистан uz +Ўзбекистон uz +Ouzbekistan uz +乌兹别克斯坦 uz +烏茲別克 uz +Vatican City va +Vatikaan Stad va +مدينة الفاتيكان va +Vatican Şəhəri va +Ватыкан va +Ватикана va +ভ্যাটিকান সিটি va +Ker Vatikan va +Vatikan va +Ciutat del Vaticà va +Vatikán va +Dinas y Fatican va +Vatikanstaten va +Vatikanstadt va +Βατικανό va +Vatikano va +Vaticano va +Vatikan va +Batikano Hiria va +شهر واتیکان va +Vatikaani va +Vatican va +Vaticaanstad va +An Chathaoir Naofa va +Cidade do Vaticano va +הוותיקן va +वेटिकन सिटी va +Vatikan va +Vatikán va +Vatíkanið va +Città del Vaticano va +バチカン市国 va +ក្រុង​វ៉ាទីកង់ va +바티칸 시티 va +ລັດເວີຍ va +Vatikāns va +Ватикан va +Ватикан сити va +Vatikan va +Vatikanstaten va +Vatikaan va +Vaticaanstad va +Vatikanstaten va +ਵਾਟੀਕੇਨ ਸਿਟੀ va +Watykan va +Cidade do Vaticano va +Cidade do Vaticano va +Vatican, Oraşul va +Ватикан va +Umujyi wa Vatikani va +Vatikanstáhta va +Vatikán va +Vatikan va +Ватикан va +Vatikan va +Vatikanstaten va +வாடிகன் நகரம் va +Шаҳри Ватикан va +นครรัฐวาติกัน va +Vatikan va +Vatikan va +Ватікан va +Ватикан Шаҳри va +Thành phố Vatican va +Vatican va +梵蒂冈 va +梵諦岡城 va +St. Vincent and the Grenadines vc +St. Vincent en die Grenadene vc +سانت فينسنت و الغرينادين vc +St. Vincent və Grenadines vc +Сэнт-Вінсэнт і Грэнадыны vc +Св. Винсет и Гренадините vc +সেন্ট ভিনসেন্ট ও গ্রেনাডিন vc +S. Visant hag ar Grenadinez vc +Sveti Vincent i Grenadini vc +St. Vincent i les Granadines vc +St. Vincent a Grenadiny vc +Ynysoedd St. Finsent a'r Grenadinau vc +St. Vincent og Grenadinerne vc +St. Vincent und Grenadinen vc +Άγιος Βικέντιος και Γρεναδίνες vc +Sent-Vincento kaj la Grenadinoj vc +San Vicente y las Granadinas vc +St. Vincent ja Grenadiinid vc +St. Vincent eta Grenadines vc +سن وینسن و گرادینس vc +St. Vincent ja Grenadiinit vc +Sankta Vinsent og Grenadinoyggjar vc +St Vincent et les Grenadines vc +St. Vincent en de Grenadines vc +St. Vincent agus Grenadines vc +Santo Vicente e as Granadinas vc +סנט וינסנט והגרנדינים vc +सेंट विंसेंट तथा ग्रेनेडाइन्स vc +St. Vincent és Grenadines vc +St. Vincent dan the Grenadines vc +Sankti Vinsent og Grenadíneyjar vc +Saint Vincent e Grenadines vc +セントヴィンセントグレナディン vc +សង់វាំងសង់ និង ​ហ្គ្រីណាឌីន vc +세인트 빈센트 그레나딘 vc +ເຊີນວິນແຊນ ແລະເກນາດີນ vc +Šv. Vincentas ir Grenadinai vc +Sentvinsenta un Grenadīnes vc +Св. Винсент и Гренадите vc +St. Винсент ба Гренадин vc +St. Vincent dan Grenadines vc +St. Vinċenz u l-Grenadini vc +St. Vincent og Grenadinene vc +St. Vincent un de Grenadinen vc +St. Vincent en de Grenadines vc +St. Vincent og Grenadinane vc +St. Vincent le Grenadines vc +St. Vincent e les Granadines vc +ਸੇਂਟ ਵੀਨਸੈਂਟ ਤੇ ਗਰੀਨਾਜੀਨਸ vc +St. Vincent i Grenadyny vc +São Vicente e Granadinas vc +São Vicente e Grenadines vc +Sf. Vincent şi Grenadines vc +Сент-Винсент и Гренадины vc +Mutagatifu Visenti na Gerenadine vc +St. Vincent ja the Grenadiinnat vc +St. Vincent a Grenadines vc +Sv. Vincent in Grenadini vc +Св. Винсент и Гренадини vc +Sv. Vinsent i Grenadini vc +I-St. Vincent and the Grenadines vc +St. Vincent och Grenadinerna vc +செயின்ட் வின்சென்ட் மற்றும் க்ரீனாடைன்ஸ் vc +Синт Винсент ва Гренадина vc +เกาะเซนต์วินเซนต์ vc +St. Vincent ve Grenadines vc +Sain Vinsent wä Grenadinnär vc +Сент-Вінсент і Гренадіни vc +Сент-Винсент ва Гренадина vc +St. Vincent na Grenadines vc +St. Vincent và Grenadines vc +St. Vincint et les Grenadines vc +St. Vincent ne Grenadines vc +圣文森特和格林纳丁斯 vc +聖文森及格納那丁 vc +I-St. Vincent kanye ne-Grenadines vc +Venezuela ve +فنزويلا ve +Venesuella ve +Вэнэсуэла ve +Венесуела ve +ভেনেজুয়েলা ve +Venecuela ve +Veneçuela ve +Feneswela ve +Βενεζουέλα ve +Venezuelo ve +Venetsueela ve +ونزویلا ve +Venesuela ve +Vénézuela ve +Veiniséala ve +ונצואלה ve +वेनेजुएला ve +Venecuela ve +Venesúela ve +ベネズェラ ve +វេណេហ្សុ៊យអេឡា ve +베네수엘라 ve +ເວເນຊຸເອລາ ve +Venesuela ve +Venecuēla ve +Венецуела ve +Винессуел ve +Veneżwela ve +ਵੈਂਨਜ਼ੂਏਲਾ ve +Wenezuela ve +Венесуэла ve +Venezuwela ve +Венецуела ve +Venecuela ve +I-Venezuela ve +வெனிசுலா ve +Винизуэлло ve +เวเนซุเอลา ve +Венесуела ve +Венесуэла ve +Venezwela ve +委内瑞拉 ve +委內瑞拉 ve +Virgin Islands, British vg +Virgin Eilande, Brits vg +الجزر العذراء, بريطانيا vg +Virgin Adaları, Britanya vg +Брытанскія Віргінскія астравы vg +Британски Вирджински острови vg +ভার্জিন আইল্যাণ্ডস, ব্রিটিশ vg +Djevičanska ostrva, Britanska vg +Illes Verges, Angleses vg +Ynysoedd yr Wyryf, Prydeinig vg +Britiske jomfruøer vg +Virgin-Inseln, britisch vg +Παρθένοι Νήσοι, Βρετανικές vg +Virgininsuloj, Britaj vg +Islas Vírgenes Británicas vg +Briti Neitsisaared vg +Britaniar Irla Birjinak vg +جزایر ویرجین انگلیسی vg +Brittien Neitsytsaaret vg +Îles Vierges britanniques vg +Virgin Eilannen, Britse vg +Oileáin Bhriotanacha na Maighdean vg +Illas Virxes, Británicas vg +איי הבתולה, בריטי vg +वर्जिन आइलैंड, ब्रिटिश vg +Djevičansko otočje, Britanski vg +Virgin-szigetek (brit) vg +Bresku Jómfrúareyjar vg +Isole Vergini Britanniche vg +英領バージン諸島 vg +កោះ​ស្មោង អង់គ្លេស vg +영국령 버진 제도 vg +Britu Virdžinu salas vg +Девствени Острови, Британски vg +Виржин арлууд, британи vg +Kepulauan Virgin, British vg +Jomfruøyene (Storbritannia) vg +Britsche Jumferninseln vg +Virgin Eilanden, Britse vg +Jomfruøyane (Storbritannia) vg +ਵੀਰਗੀਨ ਟਾਪੂ, ਬਰਤਾਨੀਆ vg +Wyspy Dziewicze (Brytyjskie) vg +Ilhas Virgens, Inglaterra vg +Ilhas Virgens, Inglaterra vg +Insulele Virgine, Anglia vg +Виргинские Британские острова vg +Ibirwa by'Isugi, Nyongereza vg +Panenské Ostrovy, Britské vg +Deviški otoki, Britanski vg +Девичанска острва, Британска vg +Devičanska ostrva, Britanska vg +Brittiska Jungfruöarna vg +விர்ஜின் தீவுகள், பிரிட்டிஷ் vg +Ҷазираи Вирҷиния, Бритониё vg +หมู่เกาะเวอร์จิน, อังกฤษ vg +Virgin Adaları (İngiltere) vg +Virgin Utrawları, Britan vg +Віргінські острови (Британія) vg +Англия Виржин Ороллари vg +Quần đảo Trinh nữ, Vưong quốc Anh vg +Iyes Viedjes, britanikes vg +英属维京群岛 vg +英屬維爾京群島 vg +Virgin Islands, U.S. vi +Virgin Eilande, VSA vi +الجزر العذراء, الولايات المتحدة vi +Virgin Adaları, ABŞ vi +Амэрыканскія Віргінскія астравы vi +Американски Вирджински острови vi +ভার্জিন আইল্যাণ্ডস, মার্কিন যুক্তরাষ্ট্র vi +Djevičanska ostrva, Američka vi +Illes Verges, Americanes vi +Panenské ostrovy, U.S. vi +Ynysoedd yr Wyryf, Americanaidd vi +Jomfruøerne vi +Virgin-Inseln, amerikanisch vi +Παρθένοι Νήσοι, Η.Π.A. vi +Virgininsuloj, Usonaj vi +Islas Vírgenes Americanas vi +USA Neitsisaared vi +Estatu Batuar Irla Birjinak vi +جزایر ویرجین امریکا. vi +USA:n Neitsytsaaret vi +Îles Vierges américaines vi +Virgin Eilannen, U.S. vi +Oileáin na Maighdean S.A.M. vi +Illas Virxes, U.S. vi +איי הבתולה, ארצות־הברית vi +वर्जिन आइलैंड, यू.एस. vi +Djevičansko otočje, SAD vi +Virgin-szigetek (USA) vi +Bandarísku Jómfrúareyjar vi +Isole Vergini Americane vi +米領バージン諸島 vi +កោះ​ស្មោង អាមេរិក vi +미국령 버진 제도 vi +Virdžinu salas, ASV. vi +Девствени Острови, САД vi +Виржин арлууд, АНУ vi +Kepulauan Virgin, U.S. vi +Jomfruøyene (USA) vi +Jumferninseln, U.S. vi +Virgin Eilanden, U.S. vi +Jomfruøyane (USA) vi +ਵੀਰਗੀਨ ਟਾਪੂ, ਅਮਰੀਕਾ vi +Wyspy Dziewicze (USA) vi +Ilhas Virgens, E.U.A. vi +Ilhas Virgens, EUA vi +Insulele Virgine, S.U.A. vi +Виргинские острова (США) vi +Ibirwa by'Isugi, U.S. vi +Panenské Ostrovy, Americké vi +Deviški otoki, ZDA vi +Девичанска острва, САД vi +Devičanska ostrva, SAD vi +Amerikanska Jungfruöarna vi +விர்ஜின் தீவுகள், U.S. vi +Ҷазираи Вирҷиния, Ш.М.А vi +หมู่เกาะเวอร์จิน, สหรัฐอเมริกา vi +Virgin Adaları (ABD) vi +Virgin Utrawları, AQŞ vi +Віргінські острови (США) vi +АҚШ Виржин Ороллари vi +Quần đảo Trinh nữ, Hoa Kỳ vi +Iyes Viedjes, etazunyinnes vi +美属维京群岛 vi +美屬維爾京群島 vi +Vietnam vn +Viëtnam vn +فييتنام vn +Vyetnam vn +Віетнам vn +Виетнам vn +ভিয়েতনাম vn +Vijetnam vn +Panenské ostrovy, U.K. vn +Fiet-nam vn +Βιετνάμ vn +Vjetnamio vn +ویتنام vn +Viëtnam vn +Vítneam vn +וייטנאם vn +विएतनाम vn +Vijetnam vn +Víetnam vn +ベトナム vn +វៀតណាម vn +베트남 vn +ຫວງດນາມ vn +Vietnamas vn +Vjetnama vn +Виетнам vn +Витнам vn +Vjetnam vn +Viëtnam vn +ਵੀਅਤਨਾਮ vn +Wietnam vn +Vietname vn +Vietnã vn +Вьетнам vn +Viyetinamu vn +Вијетнам vn +Vijetnam vn +I-Vietnam vn +வியட்நாம் vn +Ветнам vn +เวียตนาม vn +В'єтнам vn +Ветнам vn +Việt Nam vn +越南 vn +越南 vn +Vanuatu vu +فانواتو vu +Вануату vu +Вануату vu +ভানুয়াটু vu +Fanwatw vu +Βανουάτου vu +Vanuatuo vu +وانواتو vu +Vanuatú vu +ונואטו vu +वनौतू vu +Vanúatú vu +バヌアツ vu +វ៉ានុយអាទុយ vu +바누아투 vu +ຈີນ vu +Вануату vu +Вануату vu +ਵਾਨੁਆਟੂ vu +Vanatu vu +Вануату vu +Vanuwatu vu +Вануату vu +வனடு vu +Вануату vu +แวนัวตู vu +Вануату vu +Вануату vu +瓦努阿图 vu +萬那杜 vu +Wallis and Futuna wf +Wallis en Futuna wf +واليس و فوتونا wf +Vallis və Futuna wf +Ўоліс і Футуна wf +Острови Уолис и Футина wf +ওয়ালিস এবং ফুটুনা wf +Wallis ha Futuna wf +Valis i Futuna wf +Wallis i Futuna wf +Wallis a Futuna wf +Ynysoedd Walis a Ffwtwna wf +Wallis- og Futuna-øerne wf +Wallis und Futuna wf +Βαλίς και Φουτούνα wf +Valiso kaj Futuno wf +Wallis y Futuna wf +Wallis ja Futuna wf +Wallis eta Futuna wf +والیس و فوتونا wf +Wallis ja Futuna wf +Wallis et Futuna wf +Wallis en Futuna wf +Bhailís agus Futúna wf +Wallis e Futuna wf +ואליס ופוטונה wf +वालिस तथा फुतुना wf +Wallis i Futuna wf +Wallis és Futuna wf +Wallis- og Fútúnaeyjar wf +Wallis e Futuna wf +仏領ワリスフツナ諸島 wf +월리스 후투나 제도 wf +ປັກອິນພາບ wf +Volisa salas un Futuna wf +Валис и Футуна wf +Вилямс ба футуна wf +Wallis dan Futuna wf +Wallis u Futuna wf +Wallis og Futuna wf +Wallis un Futuna wf +Wallis en Futuna wf +Wallis og Futuna wf +ਵਾਲਿਸ਼ ਤੇ ਫੂਟੂਨਾ wf +Wallis i Futuna wf +Wallis e Futuna wf +Wallis e Futuna wf +Wallis şi Futuna wf +Острова Уоллис и Футуна wf +Walisi na Futuna wf +Wallis ja Futuna wf +Wallis a Futuna wf +Wallis in Futuna wf +Валис и Футуна wf +Valis i Futuna wf +Wallis och Futuna wf +வாலிஸ் மற்றும் ப்யுடனா wf +Уэлс ва Футуна wf +วอลลิสและฟูทูนา wf +Wallis ve Futuna wf +Wallis wä Futuna wf +Уоллис і Футуна wf +Уоллис ва Футуна Ороллари wf +Wallis và Futuna wf +Wallis et Futuna wf +瓦利斯和富图纳群岛 wf +瓦利斯群島和富圖納群島 wf +Samoa ws +ساموا ws +Самоа ws +Самоа ws +সামোয়া ws +Inizi Samoe ws +Σαμόα ws +Samoo ws +ساموآ ws +Samó ws +סמואה ws +सामोआ ws +Szamoa ws +Samóa ws +サモア ws +សាមូអា ws +사모아 제도 ws +ໂຊນາ ws +Самоа ws +Самолоа ws +ਸਾਮੋਆ ws +Самоа ws +Samowa ws +Самоа ws +சாமோயா ws +Самоа ws +ซามัว ws +Самоа ws +Самоа ws +Samowa ws +萨摩亚群岛 ws +薩摩亞 ws +Yemen ye +اليمن ye +Yəmən ye +Емен ye +Йемен ye +ইয়েমেন ye +Ihlemeñ ye +Jemen ye +Iemen ye +Jemen ye +Yr Iemen ye +Jemen ye +Υεμένη ye +Jemeno ye +Jeemen ye +یمن ye +Jemen ye +Jemen ye +Jemen ye +Éimin ye +Iemen ye +תימן ye +यमन ye +Jemen ye +Jemen ye +Jemen ye +イエメン ye +យេមែន ye +예멘 ye +ເດມອນ ye +Jemenas ye +Jemena ye +Јемен ye +Емен ye +Yaman ye +Jemen ye +Jemen ye +Jemen ye +Jemen ye +Jemen ye +ਯਮਨ ye +Jemen ye +Iémen ye +Йемен ye +Yemeni ye +Jemen ye +Jemen ye +Jemen ye +Јемен ye +Jemen ye +I-Yemen ye +Jemen ye +யேமன் ye +Яман ye +เยเมน ye +Ємен ye +Яман ye +也门 ye +葉門 ye +Serbia and Montenegro yu +Serbië en Montenegro yu +Сърбия и Черна гора yu +সার্বিয়া এবং মন্টেনিগ্রো yu +Serbi ha Montenegro yu +Sèrbia i Montenegro yu +Srbsko a Černá hora yu +Serbien og Montenegro yu +Serbien und Montenegro yu +Σερβία - Μαυροβούνιο yu +Serbia y Montenegro yu +Serbia ja Tšernogooria yu +Serbia eta Montenegro yu +Serbia ja Montenegro yu +Serbie and Monténégro yu +Servië en Montenegro yu +Sérbia e Montenegro yu +Szerbia és Montenegró yu +Serbía og Svartfjallaland yu +Serbia e Montenegro yu +セルビアモンテネグロ yu +សែប៊ី និង ម៉ុងតេណេហ្ក្រូ yu +Serbija ir Juodkalnija yu +Србија и Црна Гора yu +Serbia og Montenegro yu +Serbien un Montenegro yu +Servië en Montenegro yu +Serbia og Montenegro yu +ਸਰਬੀਆ ਅਤੇ ਮਾਂਤਾਂਗਰੋ yu +Serbia i Czarnogóra yu +Sérvia e Montenegro yu +Sérvia e Montenegro yu +Сербия и Черногория yu +Seribiya na Montenegoro yu +Serbia ja Montenegro yu +Srbija in Črna gora yu +Србија и Црна Гора yu +Srbija i Crna Gora yu +Serbien och Montenegro yu +เซอร์เบีย และมอนติเนโกร yu +Sırbistan Karadağ yu +Serbia wä Montenegro yu +Сербія і Чорногорія yu +Сербия ва Монтенегро yu +塞尔维亚和黑山 yu +塞爾維亞和黑山 yu +South Africa za +Suid-Afrika za +جنوب أفريقيا za +Cənubi Afrika za +Паўднёвая Афрыка za +Южна Африка za +দক্ষিণ আফ্রিকা za +Suafrika za +Južna Afrika za +Sudàfrica za +Jižní Afrika za +De Affrica za +Sydafrikanske republik za +Südafrika za +Νότια Αφρική za +Sudafriko za +Sudáfrica za +Lõuna-Aafrika za +Hego Afrika za +آفریقای جنوبی za +Etelä-Afrikka za +Suðurafrika za +Afrique du sud za +Sûd-Afrika za +An Afraic Theas za +África do Sur za +דרום אפריקה za +दक्षिणी अफ्रीका za +Južna Afrika za +Dél-Afrika za +Afrika Selatan za +Suður-Afríka za +Sud Africa za +南アフリカ za +អាហ្វ្រិក​ខាង​ត្បូង za +남 아프리카 공화국 za +ແອບພິກາໃຕ້ za +Afrika, Pietų za +Dienvidāfrika za +Јужна Африка za +Өмнөд африк za +Afrika Selatan za +Afrika t'Isfel za +Sør-Afrika za +Söödafrika za +Zuid-Afrika za +Sør-Afrika za +Afrika Borwa za +Sudafrica za +ਦੱਖਣੀ ਅਫਰੀਕਾ za +Afryka Południowa za +África do Sul za +África do Sul za +Africa de Sud za +Южная Африка za +Afurika Yepfo za +Lulli-Afrihká za +Južná Afrika za +Južna Afrika za +Јужна Африка za +Južna Afrika za +I-South Africa za +Sydafrika za +தென் ஆப்ரிக்கா za +Африқои Ҷанубӣ za +แอฟริกาใต้ za +Güney Afrika za +Könyaq Afrika za +Південна Африка za +Жанубий Африка za +Afurika tshipembe za +Nam Phi za +Nonne Afrike za +Mzantsi Afrika za +南非 za +南非 za +Emzantsi Afrika za +Zambia zm +Zambië zm +زامبيا zm +Zambiya zm +Замбія zm +Замбия zm +জামবিয়া zm +Zambi zm +Zàmbia zm +Zambie zm +Sambia zm +Sambia zm +Ζάμπια zm +Zambio zm +Sambia zm +زامبیا zm +Sambia zm +Zambie zm +An tSaimbia zm +Zámbia zm +זמביה zm +ज़ाम्बिया zm +Zambija zm +Sambía zm +ザンビア zm +ហ្សាំប៊ី zm +잠비아 zm +ຈາໄມກາ້ zm +Zambija zm +Замбија zm +Замби zm +Żambia zm +Sambia zm +ਜੈਂਬੀਆ zm +Zâmbia zm +Zâmbia zm +Замбия zm +Zambiya zm +Zambija zm +Замбија zm +Zambija zm +ஜாம்பியா zm +Зомбиё zm +แซมเบีย zm +Замбія zm +Замбия zm +Zambeye zm +赞比亚 zm +尚比亞 zm +Zimbabwe zw +زيمبابوي zw +Zimbabve zw +Зымбабвэ zw +Зимбабве zw +জিম্বাবোয়ে zw +Zimbabve zw +Simbabwe zw +Simbabwe zw +Ζιμπάμπουε zw +Zimbabvo zw +زیمبابوه zw +An tSiombáib zw +Zimbabué zw +זימבבווה zw +जिम्बाबवे zw +Zimbabve zw +Simbabve zw +ジンバブエ zw +ហ្ស៊ីមបាបវ៉េ zw +짐바브웨 zw +ລິຊາ zw +Zimbabve zw +Зимбабве zw +Замбабив zw +Żimbabwe zw +Simbabwe zw +ਜਿੰਬਾਬਵੇਂ zw +Zimbabue zw +Зимбабве zw +Zimbabve zw +Зимбабве zw +Zimbabve zw +ஜிம்பாபே zw +Зимбобве zw +ซิมบับเว zw +Зімбабве zw +Зимбабве zw +Zimbabwè zw +津巴布韦 zw +辛巴威 zw +Czech Republic cz diff --git a/tdeabc/distributionlist.cpp b/tdeabc/distributionlist.cpp new file mode 100644 index 000000000..ee058ecdf --- /dev/null +++ b/tdeabc/distributionlist.cpp @@ -0,0 +1,298 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include +#include + +#include "distributionlist.h" + +using namespace KABC; + +DistributionList::DistributionList( DistributionListManager *manager, + const TQString &name ) : + mManager( manager ), mName( name ) +{ + mManager->insert( this ); +} + +DistributionList::~DistributionList() +{ + mManager->remove( this ); +} + +void DistributionList::setName( const TQString &name ) +{ + mName = name; +} + +TQString DistributionList::name() const +{ + return mName; +} + +void DistributionList::insertEntry( const Addressee &a, const TQString &email ) +{ + Entry e( a, email ); + + TQValueList::Iterator it; + for( it = mEntries.begin(); it != mEntries.end(); ++it ) { + if ( (*it).addressee.uid() == a.uid() ) { + /** + We have to check if both email addresses contains no data, + a simple 'email1 == email2' wont work here + */ + if ( ( (*it).email.isNull() && email.isEmpty() ) || + ( (*it).email.isEmpty() && email.isNull() ) || + ( (*it).email == email ) ) { + *it = e; + return; + } + } + } + mEntries.append( e ); +} + +void DistributionList::removeEntry( const Addressee &a, const TQString &email ) +{ + TQValueList::Iterator it; + for( it = mEntries.begin(); it != mEntries.end(); ++it ) { + if ( (*it).addressee.uid() == a.uid() && (*it).email == email ) { + mEntries.remove( it ); + return; + } + } +} + +TQStringList DistributionList::emails() const +{ + TQStringList emails; + + Entry::List::ConstIterator it; + for( it = mEntries.begin(); it != mEntries.end(); ++it ) { + Addressee a = (*it).addressee; + TQString email = (*it).email.isEmpty() ? a.fullEmail() : + a.fullEmail( (*it).email ); + + if ( !email.isEmpty() ) { + emails.append( email ); + } + } + + return emails; +} + +DistributionList::Entry::List DistributionList::entries() const +{ + return mEntries; +} + +typedef TQValueList< QPair > MissingEntryList; + +class DistributionListManager::DistributionListManagerPrivate +{ + public: + AddressBook *mAddressBook; + TQMap< TQString, MissingEntryList > mMissingEntries; +}; + +DistributionListManager::DistributionListManager( AddressBook *ab ) + : d( new DistributionListManagerPrivate ) +{ + d->mAddressBook = ab; + mLists.setAutoDelete( true ); +} + +DistributionListManager::~DistributionListManager() +{ + mLists.clear(); + + delete d; + d = 0; +} + +DistributionList *DistributionListManager::list( const TQString &name ) +{ + DistributionList *list; + for( list = mLists.first(); list; list = mLists.next() ) { + if ( list->name() == name ) return list; + } + + return 0; +} + +void DistributionListManager::insert( DistributionList *l ) +{ + if ( !l ) + return; + + DistributionList *list; + for( list = mLists.first(); list; list = mLists.next() ) { + if ( list->name() == l->name() ) { + mLists.remove( list ); + break; + } + } + mLists.append( l ); +} + +void DistributionListManager::remove( DistributionList *l ) +{ + if ( !l ) + return; + + DistributionList *list; + for( list = mLists.first(); list; list = mLists.next() ) { + if ( list->name() == l->name() ) { + mLists.remove( list ); + return; + } + } +} + +TQStringList DistributionListManager::listNames() +{ + TQStringList names; + + DistributionList *list; + for( list = mLists.first(); list; list = mLists.next() ) { + names.append( list->name() ); + } + + return names; +} + +bool DistributionListManager::load() +{ + KSimpleConfig cfg( locateLocal( "data", "tdeabc/distlists" ) ); + + TQMap entryMap = cfg.entryMap( "DistributionLists" ); + cfg.setGroup( "DistributionLists" ); + + // clear old lists + mLists.clear(); + d->mMissingEntries.clear(); + + TQMap::ConstIterator it; + for( it = entryMap.constBegin(); it != entryMap.constEnd(); ++it ) { + TQString name = it.key(); + TQStringList value = cfg.readListEntry( name ); + + kdDebug(5700) << "DLM::load(): " << name << ": " << value.join(",") << endl; + + DistributionList *list = new DistributionList( this, name ); + + MissingEntryList missingEntries; + TQStringList::ConstIterator entryIt = value.constBegin(); + while( entryIt != value.constEnd() ) { + TQString id = *entryIt++; + TQString email = *entryIt; + + kdDebug(5700) << "----- Entry " << id << endl; + + Addressee a = d->mAddressBook->findByUid( id ); + if ( !a.isEmpty() ) { + list->insertEntry( a, email ); + } else { + missingEntries.append( qMakePair( id, email ) ); + } + + if ( entryIt == value.end() ) + break; + ++entryIt; + } + + d->mMissingEntries.insert( name, missingEntries ); + } + + return true; +} + +bool DistributionListManager::save() +{ + kdDebug(5700) << "DistListManager::save()" << endl; + + KSimpleConfig cfg( locateLocal( "data", "tdeabc/distlists" ) ); + + cfg.deleteGroup( "DistributionLists" ); + cfg.setGroup( "DistributionLists" ); + + DistributionList *list; + for( list = mLists.first(); list; list = mLists.next() ) { + kdDebug(5700) << " Saving '" << list->name() << "'" << endl; + + TQStringList value; + const DistributionList::Entry::List entries = list->entries(); + DistributionList::Entry::List::ConstIterator it; + for( it = entries.begin(); it != entries.end(); ++it ) { + value.append( (*it).addressee.uid() ); + value.append( (*it).email ); + } + + if ( d->mMissingEntries.find( list->name() ) != d->mMissingEntries.end() ) { + const MissingEntryList missList = d->mMissingEntries[ list->name() ]; + MissingEntryList::ConstIterator missIt; + for ( missIt = missList.begin(); missIt != missList.end(); ++missIt ) { + value.append( (*missIt).first ); + value.append( (*missIt).second ); + } + } + + cfg.writeEntry( list->name(), value ); + } + + cfg.sync(); + + return true; +} + +DistributionListWatcher* DistributionListWatcher::mSelf = 0; + +DistributionListWatcher::DistributionListWatcher() + : TQObject( tqApp, "DistributionListWatcher" ) +{ + mDirWatch = new KDirWatch; + mDirWatch->addFile( locateLocal( "data", "tdeabc/distlists" ) ); + + connect( mDirWatch, TQT_SIGNAL( dirty( const TQString& ) ), TQT_SIGNAL( changed() ) ); + mDirWatch->startScan(); +} + +DistributionListWatcher::~DistributionListWatcher() +{ + delete mDirWatch; + mDirWatch = 0; +} + +DistributionListWatcher *DistributionListWatcher::self() +{ + kdWarning( !tqApp ) << "No TQApplication object available, you'll get a memleak!" << endl; + + if ( !mSelf ) + mSelf = new DistributionListWatcher(); + + return mSelf; +} + +#include "distributionlist.moc" diff --git a/tdeabc/distributionlist.h b/tdeabc/distributionlist.h new file mode 100644 index 000000000..78d182467 --- /dev/null +++ b/tdeabc/distributionlist.h @@ -0,0 +1,217 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_DISTRIBUTIONLIST_H +#define KABC_DISTRIBUTIONLIST_H + +#include + +#include "addressbook.h" + +namespace KABC { + +class DistributionListManager; + +/** + @short Distribution list of email addresses + + This class represents a list of email addresses. Each email address is + associated with an address book entry. If the address book entry changes, the + entry in the distribution list is automatically updated. +*/ +class KABC_EXPORT DistributionList +{ + public: + /** + @short Distribution List Entry + + This class represents an entry of a distribution list. It consists of an + addressee and an email address. If the email address is null, the + preferred email address of the addressee is used. + */ + struct Entry + { + typedef TQValueList List; + + Entry() {} + Entry( const Addressee &_addressee, const TQString &_email ) : + addressee( _addressee ), email( _email ) {} + + Addressee addressee; + TQString email; + }; + + /** + Create distribution list object. + + @param manager Managing object of this list. + @param name Name of this list. + */ + DistributionList( DistributionListManager *manager, const TQString &name ); + + /** + Destructor. + */ + ~DistributionList(); + + /** + Set name of this list. The name is used as key by the + DistributinListManager. + */ + void setName( const TQString & ); + + /** + Get name of this list. + */ + TQString name() const; + + /** + Insert an entry into this distribution list. If the entry already exists + nothing happens. + */ + void insertEntry( const Addressee &, const TQString &email=TQString::null ); + + /** + Remove an entry from this distribution list. If the entry doesn't exist + nothing happens. + */ + void removeEntry( const Addressee &, const TQString &email=TQString::null ); + + /** + Return list of email addresses, which belong to this distributon list. + These addresses can be directly used by e.g. a mail client. + */ + TQStringList emails() const; + + /** + Return list of entries belonging to this distribution list. This function + is mainly useful for a distribution list editor. + */ + Entry::List entries() const; + + private: + DistributionListManager *mManager; + TQString mName; + + Entry::List mEntries; +}; + +/** + @short Manager of distribution lists + + This class represents a collection of distribution lists, which are associated + with a given address book. +*/ +class KABC_EXPORT DistributionListManager +{ + public: + /** + Create manager for given address book. + */ + DistributionListManager( AddressBook * ); + + /** + Destructor. + */ + ~DistributionListManager(); + + /** + Return distribution list with given name. + */ + DistributionList *list( const TQString &name ); // KDE4: add bool caseSensitive = true + + /** + Insert distribution list. If a list with this name already exists, nothing + happens. The passed object is deleted by the manager. + */ + void insert( DistributionList * ); + + /** + Remove distribution list. If a list with this name doesn't exist, nothing + happens. + */ + void remove( DistributionList * ); + + /** + Return names of all distribution lists managed by this manager. + */ + TQStringList listNames(); + + /** + Load distribution lists form disk. + */ + bool load(); + + /** + Save distribution lists to disk. + */ + bool save(); + + private: + class DistributionListManagerPrivate; + DistributionListManagerPrivate *d; + + TQPtrList mLists; +}; + +/** + @short Watchdog for distribution lists + + This class provides a changed() signal that i emitted when the + distribution lists has changed in some way. + + Exapmle: + + \code + KABC::DistributionListWatcher *watchdog = KABC::DistributionListWatcher::self() + + connect( watchdog, TQT_SIGNAL( changed() ), TQT_SLOT( doSomething() ) ); + \endcode +*/ + +class KABC_EXPORT DistributionListWatcher : public TQObject +{ + Q_OBJECT + + public: + /** + * Returns the watcher object. + */ + static DistributionListWatcher *self(); + + signals: + /** + * This signal is emmitted whenever the distribution lists has + * changed (if a list was added or removed, when a list was + * renamed or the entries of the list changed). + */ + void changed(); + + protected: + DistributionListWatcher(); + ~DistributionListWatcher(); + + private: + static DistributionListWatcher* mSelf; + KDirWatch *mDirWatch; +}; + +} +#endif diff --git a/tdeabc/distributionlistdialog.cpp b/tdeabc/distributionlistdialog.cpp new file mode 100644 index 000000000..8cd22e8fd --- /dev/null +++ b/tdeabc/distributionlistdialog.cpp @@ -0,0 +1,399 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "addressbook.h" +#include "addresseedialog.h" +#include "distributionlist.h" + +#include "distributionlistdialog.h" +#include "distributionlistdialog.moc" + +using namespace KABC; + +DistributionListDialog::DistributionListDialog( AddressBook *addressBook, TQWidget *parent) + : KDialogBase( parent, "", true, i18n("Configure Distribution Lists"), Ok, Ok, true) +{ + mEditor = new DistributionListEditorWidget( addressBook, this ); + setMainWidget( mEditor ); + + connect( this, TQT_SIGNAL( okClicked() ), mEditor, TQT_SLOT( save() ) ); +} + +DistributionListDialog::~DistributionListDialog() +{ +} + +// TODO KDE4: Add d-pointer to EmailSelector, make sEmailMap a member variable +static TQMap *sEmailMap = 0; + +EmailSelector::EmailSelector( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ) : + KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, + parent ) +{ + if (!sEmailMap) + sEmailMap = new TQMap(); + TQFrame *topFrame = plainPage(); + TQBoxLayout *topLayout = new TQVBoxLayout( topFrame ); + + mButtonGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"), + topFrame ); + topLayout->addWidget( mButtonGroup ); + + TQStringList::ConstIterator it; + for( it = emails.begin(); it != emails.end(); ++it ) { + TQRadioButton *button = new TQRadioButton( *it, mButtonGroup ); + sEmailMap->insert( button, *it ); + if ( (*it) == current ) { + mButtonGroup->setButton(mButtonGroup->id(button)); + } + } +} + +TQString EmailSelector::selected() +{ + TQButton *button = mButtonGroup->selected(); + if ( button ) return (*sEmailMap)[button]; + return TQString::null; +} + +TQString EmailSelector::getEmail( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ) +{ + EmailSelector *dlg = new EmailSelector( emails, current, parent ); + dlg->exec(); + + TQString result = dlg->selected(); + + delete dlg; + + return result; +} + +class EntryItem : public TQListViewItem +{ + public: + EntryItem( TQListView *parent, const Addressee &addressee, + const TQString &email=TQString::null ) : + TQListViewItem( parent ), + mAddressee( addressee ), + mEmail( email ) + { + setText( 0, addressee.realName() ); + if( email.isEmpty() ) { + setText( 1, addressee.preferredEmail() ); + setText( 2, i18n("Yes") ); + } else { + setText( 1, email ); + setText( 2, i18n("No") ); + } + } + + Addressee addressee() const + { + return mAddressee; + } + + TQString email() const + { + return mEmail; + } + + private: + Addressee mAddressee; + TQString mEmail; +}; + +DistributionListEditorWidget::DistributionListEditorWidget( AddressBook *addressBook, TQWidget *parent) : + TQWidget( parent ), + mAddressBook( addressBook ) +{ + kdDebug(5700) << "DistributionListEditor()" << endl; + + TQBoxLayout *topLayout = new TQVBoxLayout( this ); + topLayout->setSpacing( KDialog::spacingHint() ); + + TQBoxLayout *nameLayout = new TQHBoxLayout( topLayout) ; + + mNameCombo = new TQComboBox( this ); + nameLayout->addWidget( mNameCombo ); + connect( mNameCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( updateEntryView() ) ); + + mNewButton = new TQPushButton( i18n("New List..."), this ); + nameLayout->addWidget( mNewButton ); + connect( mNewButton, TQT_SIGNAL( clicked() ), TQT_SLOT( newList() ) ); + + mEditButton = new TQPushButton( i18n("Rename List..."), this ); + nameLayout->addWidget( mEditButton ); + connect( mEditButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editList() ) ); + + mRemoveButton = new TQPushButton( i18n("Remove List"), this ); + nameLayout->addWidget( mRemoveButton ); + connect( mRemoveButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeList() ) ); + + TQGridLayout *gridLayout = new TQGridLayout( topLayout, 3, 3 ); + gridLayout->setColStretch(1, 1); + + TQLabel *listLabel = new TQLabel( i18n("Available addresses:"), this ); + gridLayout->addWidget( listLabel, 0, 0 ); + + mListLabel = new TQLabel( this ); + gridLayout->addMultiCellWidget( mListLabel, 0, 0, 1, 2 ); + + mAddresseeView = new TQListView( this ); + mAddresseeView->addColumn( i18n("Name") ); + mAddresseeView->addColumn( i18n("Preferred Email") ); + mAddresseeView->setAllColumnsShowFocus( true ); + gridLayout->addWidget( mAddresseeView, 1, 0 ); + connect( mAddresseeView, TQT_SIGNAL( selectionChanged() ), + TQT_SLOT( slotSelectionAddresseeViewChanged() ) ); + connect( mAddresseeView, TQT_SIGNAL( doubleClicked( TQListViewItem * ) ), + TQT_SLOT( addEntry() ) ); + + mAddEntryButton = new TQPushButton( i18n("Add Entry"), this ); + mAddEntryButton->setEnabled(false); + gridLayout->addWidget( mAddEntryButton, 2, 0 ); + connect( mAddEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addEntry() ) ); + + mEntryView = new TQListView( this ); + mEntryView->addColumn( i18n("Name") ); + mEntryView->addColumn( i18n("Email") ); + mEntryView->addColumn( i18n("Use Preferred") ); + mEntryView->setEnabled(false); + mEntryView->setAllColumnsShowFocus( true ); + gridLayout->addMultiCellWidget( mEntryView, 1, 1, 1, 2 ); + connect( mEntryView, TQT_SIGNAL( selectionChanged() ), + TQT_SLOT( slotSelectionEntryViewChanged() ) ); + + mChangeEmailButton = new TQPushButton( i18n("Change Email..."), this ); + gridLayout->addWidget( mChangeEmailButton, 2, 1 ); + connect( mChangeEmailButton, TQT_SIGNAL( clicked() ), TQT_SLOT( changeEmail() ) ); + + mRemoveEntryButton = new TQPushButton( i18n("Remove Entry"), this ); + gridLayout->addWidget( mRemoveEntryButton, 2, 2 ); + connect( mRemoveEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeEntry() ) ); + + mManager = new DistributionListManager( mAddressBook ); + mManager->load(); + + updateAddresseeView(); + updateNameCombo(); +} + +DistributionListEditorWidget::~DistributionListEditorWidget() +{ + kdDebug(5700) << "~DistributionListEditor()" << endl; + + delete mManager; +} + +void DistributionListEditorWidget::save() +{ + mManager->save(); +} + +void DistributionListEditorWidget::slotSelectionEntryViewChanged() +{ + EntryItem *entryItem = static_cast( mEntryView->selectedItem() ); + bool state=entryItem; + + mChangeEmailButton->setEnabled(state); + mRemoveEntryButton->setEnabled(state); +} + +void DistributionListEditorWidget::newList() +{ + bool ok; + TQString name = KInputDialog::getText( i18n( "New Distribution List" ), + i18n( "Please enter &name:" ), TQString::null, &ok ); + if (!ok) return; + + new DistributionList( mManager, name ); + + mNameCombo->clear(); + mNameCombo->insertStringList( mManager->listNames() ); + mNameCombo->setCurrentItem( mNameCombo->count() - 1 ); + + updateEntryView(); + slotSelectionAddresseeViewChanged(); +} + +void DistributionListEditorWidget::editList() +{ + TQString oldName = mNameCombo->currentText(); + bool ok; + TQString name = KInputDialog::getText( i18n( "Distribution List" ), + i18n( "Please change &name:" ), oldName, &ok ); + if (!ok) return; + + DistributionList *list = mManager->list( oldName ); + list->setName( name ); + + mNameCombo->clear(); + mNameCombo->insertStringList( mManager->listNames() ); + mNameCombo->setCurrentItem( mNameCombo->count() - 1 ); + + updateEntryView(); + slotSelectionAddresseeViewChanged(); +} + +void DistributionListEditorWidget::removeList() +{ + int result = KMessageBox::warningContinueCancel( this, + i18n("Delete distribution list '%1'?") .arg( mNameCombo->currentText() ), + TQString::null, KStdGuiItem::del() ); + + if ( result != KMessageBox::Continue ) return; + + mManager->remove( mManager->list( mNameCombo->currentText() ) ); + mNameCombo->removeItem( mNameCombo->currentItem() ); + + updateEntryView(); + slotSelectionAddresseeViewChanged(); +} + +void DistributionListEditorWidget::addEntry() +{ + AddresseeItem *addresseeItem = + static_cast( mAddresseeView->selectedItem() ); + + if( !addresseeItem ) { + kdDebug(5700) << "DLE::addEntry(): No addressee selected." << endl; + return; + } + + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) { + kdDebug(5700) << "DLE::addEntry(): No dist list '" << mNameCombo->currentText() << "'" << endl; + return; + } + + list->insertEntry( addresseeItem->addressee() ); + updateEntryView(); + slotSelectionAddresseeViewChanged(); +} + +void DistributionListEditorWidget::removeEntry() +{ + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) return; + + EntryItem *entryItem = + static_cast( mEntryView->selectedItem() ); + if ( !entryItem ) return; + + list->removeEntry( entryItem->addressee(), entryItem->email() ); + delete entryItem; +} + +void DistributionListEditorWidget::changeEmail() +{ + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) return; + + EntryItem *entryItem = + static_cast( mEntryView->selectedItem() ); + if ( !entryItem ) return; + + TQString email = EmailSelector::getEmail( entryItem->addressee().emails(), + entryItem->email(), this ); + list->removeEntry( entryItem->addressee(), entryItem->email() ); + list->insertEntry( entryItem->addressee(), email ); + + updateEntryView(); +} + +void DistributionListEditorWidget::updateEntryView() +{ + if ( mNameCombo->currentText().isEmpty() ) { + mListLabel->setText( i18n("Selected addressees:") ); + } else { + mListLabel->setText( i18n("Selected addresses in '%1':") + .arg( mNameCombo->currentText() ) ); + } + + mEntryView->clear(); + + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) { + mEditButton->setEnabled(false); + mRemoveButton->setEnabled(false); + mChangeEmailButton->setEnabled(false); + mRemoveEntryButton->setEnabled(false); + mAddresseeView->setEnabled(false); + mEntryView->setEnabled(false); + return; + } else { + mEditButton->setEnabled(true); + mRemoveButton->setEnabled(true); + mAddresseeView->setEnabled(true); + mEntryView->setEnabled(true); + } + + DistributionList::Entry::List entries = list->entries(); + DistributionList::Entry::List::ConstIterator it; + for( it = entries.begin(); it != entries.end(); ++it ) { + new EntryItem( mEntryView, (*it).addressee, (*it).email ); + } + + EntryItem *entryItem = static_cast( mEntryView->selectedItem() ); + bool state=entryItem; + + mChangeEmailButton->setEnabled(state); + mRemoveEntryButton->setEnabled(state); +} + +void DistributionListEditorWidget::updateAddresseeView() +{ + mAddresseeView->clear(); + + AddressBook::Iterator it; + for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { + new AddresseeItem( mAddresseeView, *it ); + } +} + +void DistributionListEditorWidget::updateNameCombo() +{ + mNameCombo->insertStringList( mManager->listNames() ); + + updateEntryView(); +} + +void DistributionListEditorWidget::slotSelectionAddresseeViewChanged() +{ + AddresseeItem *addresseeItem = + static_cast( mAddresseeView->selectedItem() ); + bool state=addresseeItem; + mAddEntryButton->setEnabled( state && !mNameCombo->currentText().isEmpty()); +} diff --git a/tdeabc/distributionlistdialog.h b/tdeabc/distributionlistdialog.h new file mode 100644 index 000000000..1bd6fc788 --- /dev/null +++ b/tdeabc/distributionlistdialog.h @@ -0,0 +1,139 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_DISTRIBUTIONLISTDIALOG_H +#define KABC_DISTRIBUTIONLISTDIALOG_H + +#include + +#include + +class TQListView; +class TQComboBox; +class TQButtonGroup; + +namespace KABC { + +class AddressBook; +class DistributionListEditorWidget; +class DistributionListManager; + +/** + @short Frontend to create distribution lists + + Creating a new DistributionListDialog does automatically + load all addressees and distribution lists from the config + files. The changes will be saved when clicking the 'OK' + button. + + Example: + + \code + KABC::DistributionListDialog *dlg = new + KABC::DistributionListDialog( KABC::StdAddressBook::self(), this ); + + dlg->exec(); + \endcode +*/ +class KABC_EXPORT DistributionListDialog : public KDialogBase +{ + Q_OBJECT + + public: + /** + Constructor. + + @param ab The addressbook, the addressees should be used from + @param parent The parent widget + */ + DistributionListDialog( AddressBook *ab, TQWidget *parent ); + + /** + Destructor. + */ + virtual ~DistributionListDialog(); + + private: + DistributionListEditorWidget *mEditor; + + struct Data; + Data *d; +}; + +/** + @short Helper class +*/ +class KABC_EXPORT EmailSelector : public KDialogBase +{ + public: + EmailSelector( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ); + + TQString selected(); + + static TQString getEmail( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ); + + private: + TQButtonGroup *mButtonGroup; +}; + +/** + @short Helper class +*/ +class KABC_EXPORT DistributionListEditorWidget : public TQWidget +{ + Q_OBJECT + + public: + DistributionListEditorWidget( AddressBook *, TQWidget *parent ); + virtual ~DistributionListEditorWidget(); + + private slots: + void newList(); + void editList(); + void removeList(); + void addEntry(); + void removeEntry(); + void changeEmail(); + void updateEntryView(); + void updateAddresseeView(); + void updateNameCombo(); + void slotSelectionEntryViewChanged(); + void slotSelectionAddresseeViewChanged(); + void save(); + + private: + TQComboBox *mNameCombo; + TQLabel *mListLabel; + TQListView *mEntryView; + TQListView *mAddresseeView; + + AddressBook *mAddressBook; + DistributionListManager *mManager; + TQPushButton *mNewButton, *mEditButton, *mRemoveButton; + TQPushButton *mChangeEmailButton, *mRemoveEntryButton, *mAddEntryButton; + + struct Data; + Data *d; +}; + +} +#endif diff --git a/tdeabc/distributionlisteditor.cpp b/tdeabc/distributionlisteditor.cpp new file mode 100644 index 000000000..5c26c8121 --- /dev/null +++ b/tdeabc/distributionlisteditor.cpp @@ -0,0 +1,310 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "addressbook.h" +#include "addresseedialog.h" +#include "distributionlist.h" + +#include "distributionlisteditor.h" +#include "distributionlisteditor.moc" + +using namespace KABC; + +EmailSelectDialog::EmailSelectDialog( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ) : + KDialogBase( KDialogBase::Plain, i18n("Select Email Address"), Ok, Ok, + parent ) +{ + TQFrame *topFrame = plainPage(); + TQBoxLayout *topLayout = new TQVBoxLayout( topFrame ); + + mButtonGroup = new TQButtonGroup( 1, Qt::Horizontal, i18n("Email Addresses"), + topFrame ); + mButtonGroup->setRadioButtonExclusive( true ); + topLayout->addWidget( mButtonGroup ); + + TQStringList::ConstIterator it; + for( it = emails.begin(); it != emails.end(); ++it ) { + TQRadioButton *button = new TQRadioButton( *it, mButtonGroup ); + if ( (*it) == current ) { + button->setDown( true ); + } + } +} + +TQString EmailSelectDialog::selected() +{ + TQButton *button = mButtonGroup->selected(); + if ( button ) return button->text(); + return TQString::null; +} + +TQString EmailSelectDialog::getEmail( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ) +{ + EmailSelectDialog *dlg = new EmailSelectDialog( emails, current, parent ); + dlg->exec(); + + TQString result = dlg->selected(); + + delete dlg; + + return result; +} + +class EditEntryItem : public TQListViewItem +{ + public: + EditEntryItem( TQListView *parent, const Addressee &addressee, + const TQString &email=TQString::null ) : + TQListViewItem( parent ), + mAddressee( addressee ), + mEmail( email ) + { + setText( 0, addressee.realName() ); + if( email.isEmpty() ) { + setText( 1, addressee.preferredEmail() ); + setText( 2, i18n("Yes") ); + } else { + setText( 1, email ); + setText( 2, i18n("No") ); + } + } + + Addressee addressee() const + { + return mAddressee; + } + + TQString email() const + { + return mEmail; + } + + private: + Addressee mAddressee; + TQString mEmail; +}; + +DistributionListEditor::DistributionListEditor( AddressBook *addressBook, TQWidget *parent) : + TQWidget( parent ), + mAddressBook( addressBook ) +{ + kdDebug(5700) << "DistributionListEditor()" << endl; + + TQBoxLayout *topLayout = new TQVBoxLayout( this ); + topLayout->setMargin( KDialog::marginHint() ); + topLayout->setSpacing( KDialog::spacingHint() ); + + TQBoxLayout *nameLayout = new TQHBoxLayout( topLayout) ; + + mNameCombo = new TQComboBox( this ); + nameLayout->addWidget( mNameCombo ); + connect( mNameCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( updateEntryView() ) ); + + newButton = new TQPushButton( i18n("New List"), this ); + nameLayout->addWidget( newButton ); + connect( newButton, TQT_SIGNAL( clicked() ), TQT_SLOT( newList() ) ); + + removeButton = new TQPushButton( i18n("Remove List"), this ); + nameLayout->addWidget( removeButton ); + connect( removeButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeList() ) ); + + mEntryView = new TQListView( this ); + mEntryView->addColumn( i18n("Name") ); + mEntryView->addColumn( i18n("Email") ); + mEntryView->addColumn( i18n("Use Preferred") ); + topLayout->addWidget( mEntryView ); + connect(mEntryView,TQT_SIGNAL(selectionChanged ()),this, TQT_SLOT(slotSelectionEntryViewChanged())); + + changeEmailButton = new TQPushButton( i18n("Change Email"), this ); + topLayout->addWidget( changeEmailButton ); + connect( changeEmailButton, TQT_SIGNAL( clicked() ), TQT_SLOT( changeEmail() ) ); + + removeEntryButton = new TQPushButton( i18n("Remove Entry"), this ); + topLayout->addWidget( removeEntryButton ); + connect( removeEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( removeEntry() ) ); + + addEntryButton = new TQPushButton( i18n("Add Entry"), this ); + topLayout->addWidget( addEntryButton ); + connect( addEntryButton, TQT_SIGNAL( clicked() ), TQT_SLOT( addEntry() ) ); + + mAddresseeView = new TQListView( this ); + mAddresseeView->addColumn( i18n("Name") ); + mAddresseeView->addColumn( i18n("Preferred Email") ); + topLayout->addWidget( mAddresseeView ); + + + connect(mAddresseeView,TQT_SIGNAL(selectionChanged ()),this, TQT_SLOT(slotSelectionAddresseeViewChanged())); + + mManager = new DistributionListManager( mAddressBook ); + mManager->load(); + + updateAddresseeView(); + updateNameCombo(); + removeButton->setEnabled(!mManager->listNames().isEmpty()); +} + +DistributionListEditor::~DistributionListEditor() +{ + kdDebug(5700) << "~DistributionListEditor()" << endl; + + mManager->save(); + delete mManager; +} + +void DistributionListEditor::slotSelectionEntryViewChanged() +{ + EditEntryItem *entryItem = dynamic_cast( mEntryView->selectedItem() ); + bool state = (entryItem != 0L); + + changeEmailButton->setEnabled(state); + removeEntryButton->setEnabled(state); +} + +void DistributionListEditor::newList() +{ + bool ok = false; + TQString name = KInputDialog::getText( i18n("New Distribution List"), + i18n("Please enter name:"), + TQString::null, &ok, this ); + if ( !ok ) + return; + + new DistributionList( mManager, name ); + + mNameCombo->insertItem( name ); + removeButton->setEnabled(true); + updateEntryView(); +} + +void DistributionListEditor::removeList() +{ + mManager->remove( mManager->list( mNameCombo->currentText() ) ); + mNameCombo->removeItem( mNameCombo->currentItem() ); + removeButton->setEnabled(!mManager->listNames().isEmpty()); + addEntryButton->setEnabled( !mNameCombo->currentText().isEmpty()); + updateEntryView(); +} + +void DistributionListEditor::addEntry() +{ + AddresseeItem *addresseeItem = + dynamic_cast( mAddresseeView->selectedItem() ); + + if( !addresseeItem ) { + kdDebug(5700) << "DLE::addEntry(): No addressee selected." << endl; + return; + } + + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) { + kdDebug(5700) << "DLE::addEntry(): No dist list '" << mNameCombo->currentText() << "'" << endl; + return; + } + + list->insertEntry( addresseeItem->addressee() ); + updateEntryView(); + slotSelectionAddresseeViewChanged(); +} + +void DistributionListEditor::removeEntry() +{ + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) return; + + EditEntryItem *entryItem = + dynamic_cast( mEntryView->selectedItem() ); + if ( !entryItem ) return; + + list->removeEntry( entryItem->addressee(), entryItem->email() ); + delete entryItem; +} + +void DistributionListEditor::changeEmail() +{ + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) return; + + EditEntryItem *entryItem = + dynamic_cast( mEntryView->selectedItem() ); + if ( !entryItem ) return; + + TQString email = EmailSelectDialog::getEmail( entryItem->addressee().emails(), + entryItem->email(), this ); + list->removeEntry( entryItem->addressee(), entryItem->email() ); + list->insertEntry( entryItem->addressee(), email ); + + updateEntryView(); +} + +void DistributionListEditor::updateEntryView() +{ + DistributionList *list = mManager->list( mNameCombo->currentText() ); + if ( !list ) return; + + mEntryView->clear(); + DistributionList::Entry::List entries = list->entries(); + DistributionList::Entry::List::ConstIterator it; + for( it = entries.begin(); it != entries.end(); ++it ) { + new EditEntryItem( mEntryView, (*it).addressee, (*it).email ); + } + EditEntryItem *entryItem = dynamic_cast( mEntryView->selectedItem() ); + bool state = (entryItem != 0L); + + changeEmailButton->setEnabled(state); + removeEntryButton->setEnabled(state); +} + +void DistributionListEditor::updateAddresseeView() +{ + mAddresseeView->clear(); + + AddressBook::Iterator it; + for( it = mAddressBook->begin(); it != mAddressBook->end(); ++it ) { + new AddresseeItem( mAddresseeView, *it ); + } +} + +void DistributionListEditor::updateNameCombo() +{ + mNameCombo->insertStringList( mManager->listNames() ); + + updateEntryView(); +} + +void DistributionListEditor::slotSelectionAddresseeViewChanged() +{ + AddresseeItem *addresseeItem = + dynamic_cast( mAddresseeView->selectedItem() ); + bool state = (addresseeItem != 0L); + addEntryButton->setEnabled( state && !mNameCombo->currentText().isEmpty()); +} diff --git a/tdeabc/distributionlisteditor.h b/tdeabc/distributionlisteditor.h new file mode 100644 index 000000000..faec280e6 --- /dev/null +++ b/tdeabc/distributionlisteditor.h @@ -0,0 +1,86 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef KABC_DISTRIBUTIONLISTEDITOR_H +#define KABC_DISTRIBUTIONLISTEDITOR_H + +#include + +#include + +class TQListView; +class TQComboBox; +class TQButtonGroup; + +namespace KABC { + +class AddressBook; +class DistributionListManager; + +class KABC_EXPORT EmailSelectDialog : public KDialogBase +{ + public: + EmailSelectDialog( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ); + + TQString selected(); + + static TQString getEmail( const TQStringList &emails, const TQString ¤t, + TQWidget *parent ); + + private: + TQButtonGroup *mButtonGroup; +}; + +/** + @obsolete +*/ +class DistributionListEditor : public TQWidget +{ + Q_OBJECT + public: + DistributionListEditor( AddressBook *, TQWidget *parent ); + virtual ~DistributionListEditor(); + + private slots: + void newList(); + void removeList(); + void addEntry(); + void removeEntry(); + void changeEmail(); + void updateEntryView(); + void updateAddresseeView(); + void updateNameCombo(); + void slotSelectionEntryViewChanged(); + void slotSelectionAddresseeViewChanged(); + + private: + TQComboBox *mNameCombo; + TQListView *mEntryView; + TQListView *mAddresseeView; + + AddressBook *mAddressBook; + DistributionListManager *mManager; + TQPushButton *newButton, *removeButton; + TQPushButton *changeEmailButton,*removeEntryButton,*addEntryButton; +}; + +} + +#endif diff --git a/tdeabc/errorhandler.cpp b/tdeabc/errorhandler.cpp new file mode 100644 index 000000000..d2245e44f --- /dev/null +++ b/tdeabc/errorhandler.cpp @@ -0,0 +1,55 @@ +/* + This file is part of libkabc. + + Copyright (c) 2002 Tobias Koenig + Copyright (c) 2003 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include + +#include "errorhandler.h" + +using namespace KABC; + +void ConsoleErrorHandler::error( const TQString &msg ) +{ + // no debug area is ok here + kdError() << msg << endl; +} + + +void GUIErrorHandler::error( const TQString &msg ) +{ + KMessageBox::error( 0, msg, i18n( "Error in libkabc" ) ); +} + + +GuiErrorHandler::GuiErrorHandler( TQWidget *parent ) + : mParent( parent ) +{ +} + +void GuiErrorHandler::error( const TQString &msg ) +{ + if (tqApp) + KMessageBox::error( mParent, msg ); +} diff --git a/tdeabc/errorhandler.h b/tdeabc/errorhandler.h new file mode 100644 index 000000000..9a316541d --- /dev/null +++ b/tdeabc/errorhandler.h @@ -0,0 +1,95 @@ +/* + This file is part of libkabc. + + Copyright (c) 2002 Tobias Koenig + Copyright (c) 2003 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef KABC_ERRORHANDLER_H +#define KABC_ERRORHANDLER_H + +#include + +#include + +class TQWidget; + +namespace KABC { + +/** + Abstract class that provides displaying of error messages. + We need this to make libkabc gui independent on the one side + and provide user friendly error messages on the other side. + Use @p ConsoleErrorHandler or @p GuiErrorHandler in your + application or provide your own ErrorHandler. +*/ +class KABC_EXPORT ErrorHandler +{ + public: + /** + Show error message. + */ + virtual void error( const TQString &msg ) = 0; +}; + +/** + This class prints the error messages to stderr via kdError(). +*/ +class KABC_EXPORT ConsoleErrorHandler : public ErrorHandler +{ + public: + virtual void error( const TQString &msg ); +}; + +/** + This class shows messages boxes for every + error message. + + \deprecated Use GuiErrorHandler instead. +*/ +class KABC_EXPORT GUIErrorHandler : public ErrorHandler +{ + public: + virtual void error( const TQString &msg ); +}; + +/** + This class shows messages boxes for every + error message. +*/ +class KABC_EXPORT GuiErrorHandler : public ErrorHandler +{ + public: + /** + Create error handler. + + \param parent Widget which is used as parent for the error dialogs. + */ + GuiErrorHandler( TQWidget *parent ); + + virtual void error( const TQString &msg ); + + private: + TQWidget *mParent; + + class Private; + Private *d; +}; + +} + +#endif diff --git a/tdeabc/field.h b/tdeabc/field.h new file mode 100644 index 000000000..118ce2d51 --- /dev/null +++ b/tdeabc/field.h @@ -0,0 +1,176 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_FIELD_H +#define KABC_FIELD_H + +#include +#include + +#include "addressee.h" + +class TDEConfig; + +namespace KABC { + +class KABC_EXPORT Field +{ + class FieldImpl; + friend class FieldImpl; + +public: + typedef TQValueList List; + + /** + * @li @p All - + * @li @p Frequent - + * @li @p Address - + * @li @p Email - + * @li @p Personal - + * @li @p Organization - + * @li @p CustomCategory - + */ + enum FieldCategory + { + All = 0x0, + Frequent = 0x01, + Address = 0x02, + Email = 0x04, + Personal = 0x08, + Organization = 0x10, + CustomCategory = 0x20 + }; + + /** + * Returns the translated label for this field. + */ + virtual TQString label(); + + /** + * Returns the ored categories the field belongs to. + */ + virtual int category(); + + /** + * Returns the translated label for field category. + */ + static TQString categoryLabel( int category ); + + /** + * Returns a string representation of the value the field has in the given + * Addressee. Returns TQString::null, if it is not possible to convert the + * value to a string. + */ + virtual TQString value( const KABC::Addressee & ); + + /** + * Sets the value of the field in the given Addressee. Returns true on success + * or false, if the given string couldn't be converted to a valid value. + */ + virtual bool setValue( KABC::Addressee &, const TQString & ); + + /** + * Returns a string, that can be used for sorting. + */ + TQString sortKey( const KABC::Addressee & ); + + /** + * Returns, if the field is a user-defined field. + */ + virtual bool isCustom(); + + /** + * Returns, if the field is equal with @a field. + */ + virtual bool equals( Field *field ); + + /** + * Returns a list of all fields. + */ + static Field::List allFields(); + + /** + * Returns a list of the default fields. + */ + static Field::List defaultFields(); + + /** + * Creates a custom field. + * + * @param label The label for this field + * @param category The category of this field + * @param key Unique key for this field + * @param app Unique app name for this field + */ + static Field *createCustomField( const TQString &label, int category, + const TQString &key, const TQString &app ); + + /** + * Delete all fields from list. + */ + static void deleteFields(); + + /** + * Save the field settings to a config file. + * + * @param cfg The config file object + * @param identifier The unique identifier + * @param fields The list of the fields + */ + static void saveFields( TDEConfig *cfg, const TQString &identifier, + const Field::List &fields ); + /** + * This is the same as above, with the difference, that + * the list is stored in TDEGlobal::config() in group "KABCFields". + */ + static void saveFields( const TQString &identifier, + const Field::List &fields ); + + /** + * Load the field settings from a config file. + * + * @param cfg The config file object + * @param identifier The unique identifier + */ + static Field::List restoreFields( TDEConfig *cfg, const TQString &identifier ); + + /** + * This is the same as above, with the difference, that + * the list is loaded from TDEGlobal::config() from group "KABCFields". + */ + static Field::List restoreFields( const TQString &identifier ); + +protected: + static void createField( int id, int category = 0 ); + static void createDefaultField( int id, int category = 0 ); + +private: + Field( FieldImpl * ); + virtual ~Field(); + + FieldImpl *mImpl; + + static Field::List mAllFields; + static Field::List mDefaultFields; + static Field::List mCustomFields; +}; + +} +#endif diff --git a/tdeabc/format.h b/tdeabc/format.h new file mode 100644 index 000000000..ed036673c --- /dev/null +++ b/tdeabc/format.h @@ -0,0 +1,49 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef KABC_FORMAT_H +#define KABC_FORMAT_H + +#include + +#include + +namespace KABC { + +class AddressBook; + +/** + @deprecated use FormatPlugin instead +*/ +class KABC_EXPORT_DEPRECATED Format +{ + public: + /** + Load addressbook from file. + */ + virtual bool load( AddressBook *, const TQString &fileName ) = 0; + /** + Save addressbook to file. + */ + virtual bool save( AddressBook *, const TQString &fileName ) = 0; +}; + +} + +#endif diff --git a/tdeabc/formatfactory.cpp b/tdeabc/formatfactory.cpp new file mode 100644 index 000000000..0795957a2 --- /dev/null +++ b/tdeabc/formatfactory.cpp @@ -0,0 +1,168 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include + +#include "vcardformatplugin.h" + +#include "formatfactory.h" + +using namespace KABC; + +FormatFactory *FormatFactory::mSelf = 0; +static KStaticDeleter factoryDeleter; + +FormatFactory *FormatFactory::self() +{ + kdDebug(5700) << "FormatFactory::self()" << endl; + + if ( !mSelf ) + factoryDeleter.setObject( mSelf, new FormatFactory ); + + return mSelf; +} + +FormatFactory::FormatFactory() +{ + mFormatList.setAutoDelete( true ); + + // dummy entry for default format + FormatInfo *info = new FormatInfo; + info->library = ""; + info->nameLabel = i18n( "vCard" ); + info->descriptionLabel = i18n( "vCard Format" ); + mFormatList.insert( "vcard", info ); + + const TQStringList list = TDEGlobal::dirs()->findAllResources( "data" ,"tdeabc/formats/*.desktop", true, true ); + for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it ) + { + KSimpleConfig config( *it, true ); + + if ( !config.hasGroup( "Misc" ) || !config.hasGroup( "Plugin" ) ) + continue; + + info = new FormatInfo; + + config.setGroup( "Plugin" ); + TQString type = config.readEntry( "Type" ); + info->library = config.readEntry( "X-TDE-Library" ); + + config.setGroup( "Misc" ); + info->nameLabel = config.readEntry( "Name" ); + info->descriptionLabel = config.readEntry( "Comment", i18n( "No description available." ) ); + + mFormatList.insert( type, info ); + } +} + +FormatFactory::~FormatFactory() +{ + mFormatList.clear(); +} + +TQStringList FormatFactory::formats() +{ + TQStringList retval; + + // make sure 'vcard' is the first entry + retval << "vcard"; + + TQDictIterator it( mFormatList ); + for ( ; it.current(); ++it ) + if ( it.currentKey() != "vcard" ) + retval << it.currentKey(); + + return retval; +} + +FormatInfo *FormatFactory::info( const TQString &type ) +{ + if ( type.isEmpty() ) + return 0; + else + return mFormatList[ type ]; +} + +FormatPlugin *FormatFactory::format( const TQString& type ) +{ + FormatPlugin *format = 0; + + if ( type.isEmpty() ) + return 0; + + if ( type == "vcard" ) { + format = new VCardFormatPlugin; + format->setType( type ); + format->setNameLabel( i18n( "vCard" ) ); + format->setDescriptionLabel( i18n( "vCard Format" ) ); + return format; + } + + FormatInfo *fi = mFormatList[ type ]; + if (!fi) + return 0; + TQString libName = fi->library; + + KLibrary *library = openLibrary( libName ); + if ( !library ) + return 0; + + void *format_func = library->symbol( "format" ); + + if ( format_func ) { + format = ((FormatPlugin* (*)())format_func)(); + format->setType( type ); + format->setNameLabel( fi->nameLabel ); + format->setDescriptionLabel( fi->descriptionLabel ); + } else { + kdDebug( 5700 ) << "'" << libName << "' is not a format plugin." << endl; + return 0; + } + + return format; +} + + +KLibrary *FormatFactory::openLibrary( const TQString& libName ) +{ + KLibrary *library = 0; + + TQString path = KLibLoader::findLibrary( TQFile::encodeName( libName ) ); + + if ( path.isEmpty() ) { + kdDebug( 5700 ) << "No format plugin library was found!" << endl; + return 0; + } + + library = KLibLoader::self()->library( TQFile::encodeName( path ) ); + + if ( !library ) { + kdDebug( 5700 ) << "Could not load library '" << libName << "'" << endl; + return 0; + } + + return library; +} diff --git a/tdeabc/formatfactory.h b/tdeabc/formatfactory.h new file mode 100644 index 000000000..ff9da5504 --- /dev/null +++ b/tdeabc/formatfactory.h @@ -0,0 +1,101 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_FORMATFACTORY_H +#define KABC_FORMATFACTORY_H + +#include +#include + +#include +#include + +#include "formatplugin.h" + +namespace KABC { + +struct FormatInfo +{ + TQString library; + TQString nameLabel; + TQString descriptionLabel; +}; + +/** + * Class for loading format plugins. + * + * Example: + * + * \code + * KABC::FormatFactory *factory = KABC::FormatFactory::self(); + * + * TQStringList list = factory->formats(); + * TQStringList::Iterator it; + * for ( it = list.begin(); it != list.end(); ++it ) { + * KABC::FormatPlugin *format = factory->format( (*it) ); + * // do something with format + * } + * \endcode + */ +class KABC_EXPORT FormatFactory +{ + public: + + /** + Destructor. + */ + ~FormatFactory(); + + /** + * Returns the global format factory. + */ + static FormatFactory *self(); + + /** + * Returns a pointer to a format object or a null pointer + * if format type doesn't exist. + * + * @param type The type of the format, returned by formats() + */ + FormatPlugin *format( const TQString &type ); + + /** + * Returns a list of all available format types. + */ + TQStringList formats(); + + /** + * Returns the info structure for a special type. + */ + FormatInfo *info( const TQString &type ); + + protected: + FormatFactory(); + + private: + KLibrary *openLibrary( const TQString& libName ); + + static FormatFactory *mSelf; + + TQDict mFormatList; +}; + +} +#endif diff --git a/tdeabc/formatplugin.h b/tdeabc/formatplugin.h new file mode 100644 index 000000000..33f4beea0 --- /dev/null +++ b/tdeabc/formatplugin.h @@ -0,0 +1,73 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_FORMATPLUGIN_H +#define KABC_FORMATPLUGIN_H + +#include + +#include "plugin.h" +#include "resource.h" + +namespace KABC { + +class AddressBook; +class Addressee; + +/** + * @short Base class for address book formats. + * + * This class provides an abstract interface for ResourceFile and + * ResourceDir formats. + * + * @internal + */ +class KABC_EXPORT FormatPlugin : public Plugin +{ +public: + + /** + * Load single addressee from file. + */ + virtual bool load( Addressee &, TQFile *file ) = 0; + + /** + * Load whole addressbook from file. + */ + virtual bool loadAll( AddressBook *, Resource *, TQFile *file ) = 0; + + /** + * Save a single Addressee to file. + */ + virtual void save( const Addressee &, TQFile *file ) = 0; + + /** + * Save whole addressbook to file. + */ + virtual void saveAll( AddressBook *, Resource *, TQFile *file ) = 0; + + /** + * Checks if given file contains the right format + */ + virtual bool checkFormat( TQFile *file ) const = 0; +}; + +} +#endif diff --git a/tdeabc/formats/CMakeLists.txt b/tdeabc/formats/CMakeLists.txt new file mode 100644 index 000000000..d7a9e0fc9 --- /dev/null +++ b/tdeabc/formats/CMakeLists.txt @@ -0,0 +1,47 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_BINARY_DIR}/kabc + ${CMAKE_SOURCE_DIR}/kabc + + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### other data ################################ + +install( FILES binary.desktop DESTINATION ${DATA_INSTALL_DIR}/tdeabc/formats ) + + +##### kabcformat_binary ######################### + +set( target kabcformat_binary ) + +set( ${target}_SRCS + binaryformat.cpp +) + +tde_add_kpart( ${target} AUTOMOC + SOURCES ${${target}_SRCS} + LINK tdeabc-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdeabc/formats/Makefile.am b/tdeabc/formats/Makefile.am new file mode 100644 index 000000000..d769d88d7 --- /dev/null +++ b/tdeabc/formats/Makefile.am @@ -0,0 +1,22 @@ +INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) + +kde_module_LTLIBRARIES = kabcformat_binary.la + +kabcformat_binary_la_SOURCES = binaryformat.cpp +kabcformat_binary_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) \ + -no-undefined +kabcformat_binary_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(LIB_TDECORE) +kabcformat_binary_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + +# these are the headers for your project +noinst_HEADERS = binaryformat.h + +# let automoc handle all of the meta source files (moc) +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabcformat_binary.pot + +linkdir = $(kde_datadir)/tdeabc/formats +link_DATA = binary.desktop +EXTRA_DIST = $(link_DATA) diff --git a/tdeabc/formats/binary.desktop b/tdeabc/formats/binary.desktop new file mode 100644 index 000000000..993286ad5 --- /dev/null +++ b/tdeabc/formats/binary.desktop @@ -0,0 +1,89 @@ +[Misc] +Name=Binary +Name[af]=Binêre +Name[ar]=ثنائي +Name[az]=İcraçı +Name[be]=Двайковы +Name[bg]=Двоичен +Name[bn]=বাইনারি +Name[br]=Binarel +Name[bs]=Binarno +Name[ca]=Binari +Name[cs]=Binární +Name[csb]=Binarny +Name[cy]=Deuaidd +Name[da]=Binær +Name[de]=Binär +Name[el]=Δυαδικό +Name[eo]=Duuma +Name[es]=Binario +Name[et]=Binaar +Name[eu]=Bitarra +Name[fa]=دوگانی +Name[fi]=Binääri +Name[fr]=Binaire +Name[fy]=Binêr +Name[ga]=Dénártha +Name[gl]=Binário +Name[he]=בינרית +Name[hi]=द्विचर +Name[hr]=Binarno +Name[hsb]=Binarny +Name[hu]=Bináris +Name[id]=Biner +Name[is]=Tvíunda +Name[it]=Binario +Name[ja]=バイナリ +Name[ka]=ორობითი +Name[kk]=Бинарлық +Name[km]=គោលពីរ +Name[ko]=바이너리 +Name[lb]=Binär +Name[lt]=Dvejetainis +Name[lv]=Binārs +Name[mk]=Бинарен +Name[mn]=Бинар +Name[ms]=Binari +Name[mt]=Binarju +Name[nb]=Binær +Name[nds]=Bineer +Name[ne]=बाइनरी +Name[nl]=Binair +Name[nn]=Binær +Name[nso]=Tselapedi +Name[pa]=ਬਾਈਨਰੀ +Name[pl]=Binarny +Name[pt]=Binário +Name[pt_BR]=Binário +Name[ro]=Binar +Name[ru]=Двоичный +Name[rw]=Nyabibiri +Name[se]=Binára +Name[sk]=Binárny +Name[sl]=Dvojiško +Name[sq]=Binarë +Name[sr]=Бинарни +Name[sr@Latn]=Binarni +Name[ss]=Lokuhamab ngakubili +Name[sv]=Binär +Name[ta]=இருமம் +Name[te]=ద్వియాశం +Name[tg]=Дутартиба +Name[th]=ไบนารี +Name[tr]=İkili +Name[tt]=Binar +Name[uk]=Двійковий +Name[uz]=Binar +Name[uz@cyrillic]=Бинар +Name[ven]=Zwivhili +Name[vi]=Nhị phân +Name[wa]=Binaire +Name[xh]=Ephindwe kabini +Name[zh_CN]=二进制 +Name[zh_HK]=二進位 +Name[zh_TW]=二進位 +Name[zu]=Okuhambisana ngambili + +[Plugin] +Type=binary +X-TDE-Library=kabcformat_binary diff --git a/tdeabc/formats/binaryformat.cpp b/tdeabc/formats/binaryformat.cpp new file mode 100644 index 000000000..f37146e57 --- /dev/null +++ b/tdeabc/formats/binaryformat.cpp @@ -0,0 +1,221 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include "addressbook.h" +#include "addressee.h" +#include "picture.h" +#include "sound.h" + +#include "binaryformat.h" + +#define BINARY_FORMAT_VERSION 1 + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT FormatPlugin *format() + { + return new BinaryFormat; + } +} + +bool BinaryFormat::load( Addressee &addressee, TQFile *file ) +{ + kdDebug(5700) << "BinaryFormat::load()" << endl; + TQDataStream stream( file ); + + if ( !checkHeader( stream ) ) + return false; + + loadAddressee( addressee, stream ); + + return true; +} + +bool BinaryFormat::loadAll( AddressBook*, Resource *resource, TQFile *file ) +{ + kdDebug(5700) << "BinaryFormat::loadAll()" << endl; + + TQDataStream stream( file ); + + if ( !checkHeader( stream ) ) + return false; + + TQ_UINT32 entries; + + stream >> entries; + + for ( uint i = 0; i < entries; ++i ) { + Addressee addressee; + loadAddressee( addressee, stream ); + addressee.setResource( resource ); + addressee.setChanged( false ); + resource->insertAddressee( addressee ); + } + + return true; +} + +void BinaryFormat::save( const Addressee &addressee, TQFile *file ) +{ + kdDebug(5700) << "BinaryFormat::save()" << endl; + + TQDataStream stream( file ); + + writeHeader( stream ); + + TQ_UINT32 entries = 1; + stream << entries; + saveAddressee( addressee, stream ); +} + +void BinaryFormat::saveAll( AddressBook*, Resource *resource, TQFile *file ) +{ + kdDebug(5700) << "BinaryFormat::saveAll()" << endl; + + TQ_UINT32 counter = 0; + TQDataStream stream( file ); + + writeHeader( stream ); + // set dummy number of entries + stream << counter; + + Resource::Iterator it; + for ( it = resource->begin(); it != resource->end(); ++it ) { + saveAddressee( (*it), stream ); + counter++; + (*it).setChanged( false ); + } + + // set real number of entries + stream.device()->at( 2 * sizeof( TQ_UINT32 ) ); + stream << counter; +} + +bool BinaryFormat::checkFormat( TQFile *file ) const +{ + kdDebug(5700) << "BinaryFormat::checkFormat()" << endl; + + TQDataStream stream( file ); + + return checkHeader( stream ); +} + +bool BinaryFormat::checkHeader( TQDataStream &stream ) const +{ + TQ_UINT32 magic, version; + + stream >> magic >> version; + + TQFile *file = dynamic_cast( stream.device() ); + + if ( !file ) { + kdError() << i18n("Not a file?") << endl; + return false; + } + + if ( magic != 0x2e93e ) { + kdError() << TQString(i18n("File '%1' is not binary format.").arg( file->name() )) << endl; + return false; + } + + if ( version != BINARY_FORMAT_VERSION ) { + kdError() << TQString(i18n("File '%1' is the wrong version.").arg( file->name() )) << endl; + return false; + } + + return true; +} + +void BinaryFormat::writeHeader( TQDataStream &stream ) +{ + TQ_UINT32 magic, version; + + magic = 0x2e93e; + version = BINARY_FORMAT_VERSION; + + stream << magic << version; +} + +void BinaryFormat::loadAddressee( Addressee &addressee, TQDataStream &stream ) +{ + stream >> addressee; +/* + // load pictures + Picture photo = addressee.photo(); + Picture logo = addressee.logo(); + + if ( photo.isIntern() ) { + TQImage img; + if ( !img.load( locateLocal( "data", "tdeabc/photos/" ) + addressee.uid() ) ) + kdDebug(5700) << "No photo available for '" << addressee.uid() << "'." << endl; + + addressee.setPhoto( img ); + } + + if ( logo.isIntern() ) { + TQImage img; + if ( !img.load( locateLocal( "data", "tdeabc/logos/" ) + addressee.uid() ) ) + kdDebug(5700) << "No logo available for '" << addressee.uid() << "'." << endl; + + addressee.setLogo( img ); + } + + // load sound + // TODO: load sound data from file +*/ +} + +void BinaryFormat::saveAddressee( const Addressee &addressee, TQDataStream &stream ) +{ + stream << addressee; +/* + // load pictures + Picture photo = addressee.photo(); + Picture logo = addressee.logo(); + + if ( photo.isIntern() ) { + TQImage img = photo.data(); + TQString fileName = locateLocal( "data", "tdeabc/photos/" ) + addressee.uid(); + + if ( !img.save( fileName, "PNG" ) ) + kdDebug(5700) << "Unable to save photo for '" << addressee.uid() << "'." << endl; + } + + if ( logo.isIntern() ) { + TQImage img = logo.data(); + TQString fileName = locateLocal( "data", "tdeabc/logos/" ) + addressee.uid(); + + if ( !img.save( fileName, "PNG" ) ) + kdDebug(5700) << "Unable to save logo for '" << addressee.uid() << "'." << endl; + } + + // save sound + // TODO: save the sound data to file +*/ +} diff --git a/tdeabc/formats/binaryformat.h b/tdeabc/formats/binaryformat.h new file mode 100644 index 000000000..09efde41a --- /dev/null +++ b/tdeabc/formats/binaryformat.h @@ -0,0 +1,69 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef KABC_BINARYFORMAT_H +#define KABC_BINARYFORMAT_H + +#include "formatplugin.h" + +namespace KABC { + +class AddressBook; +class Addressee; + +/** + @short binary file format for addressbook entries. +*/ +class BinaryFormat : public FormatPlugin +{ +public: + /** + * Load single addressee from file. + */ + bool load( Addressee &, TQFile *file ); + + /** + * Load whole addressee from file. + */ + bool loadAll( AddressBook *, Resource *, TQFile *file ); + + /** + * Save single addressee to file. + */ + void save( const Addressee &, TQFile *file ); + + /** + * Save all addressees to file. + */ + void saveAll( AddressBook *, Resource *, TQFile *file ); + + /** + * Check for valid format of a file. + */ + bool checkFormat( TQFile *file ) const; + +private: + void loadAddressee( Addressee &, TQDataStream & ); + void saveAddressee( const Addressee &, TQDataStream & ); + bool checkHeader( TQDataStream & ) const; + void writeHeader( TQDataStream & ); +}; + +} +#endif diff --git a/tdeabc/geo.cpp b/tdeabc/geo.cpp new file mode 100644 index 000000000..44f9851e4 --- /dev/null +++ b/tdeabc/geo.cpp @@ -0,0 +1,109 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include "geo.h" + +using namespace KABC; + +Geo::Geo() + : mLatitude( 91 ), mLongitude( 181 ), mValidLat( false ), mValidLong( false ) +{ +} + +Geo::Geo( float latitude, float longitude ) +{ + setLatitude( latitude ); + setLongitude( longitude ); +} + +void Geo::setLatitude( float latitude ) +{ + if ( latitude >= -90 && latitude <= 90 ) { + mLatitude = latitude; + mValidLat = true; + } else { + mLatitude = 91; + mValidLat = false; + } +} + +float Geo::latitude() const +{ + return mLatitude; +} + +void Geo::setLongitude( float longitude) +{ + if ( longitude >= -180 && longitude <= 180 ) { + mLongitude = longitude; + mValidLong = true; + } else { + mLongitude = 181; + mValidLong = false; + } +} + +float Geo::longitude() const +{ + return mLongitude; +} + +bool Geo::isValid() const +{ + return mValidLat && mValidLong; +} + +bool Geo::operator==( const Geo &g ) const +{ + if ( !g.isValid() && !isValid() ) return true; + if ( !g.isValid() || !isValid() ) return false; + if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude ) return true; + return false; +} + +bool Geo::operator!=( const Geo &g ) const +{ + if ( !g.isValid() && !isValid() ) return false; + if ( !g.isValid() || !isValid() ) return true; + if ( g.mLatitude == mLatitude && g.mLongitude == mLongitude ) return false; + return true; +} + +TQString Geo::asString() const +{ + return "(" + TQString::number(mLatitude) + "," + TQString::number(mLongitude) + ")"; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Geo &geo ) +{ + return s << (float)geo.mLatitude << (float)geo.mLongitude; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Geo &geo ) +{ + s >> geo.mLatitude >> geo.mLongitude; + + geo.mValidLat = true; + geo.mValidLong = true; + + return s; +} diff --git a/tdeabc/geo.h b/tdeabc/geo.h new file mode 100644 index 000000000..cac6abaff --- /dev/null +++ b/tdeabc/geo.h @@ -0,0 +1,101 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_GEO_H +#define KABC_GEO_H + +#include + +#include + +namespace KABC { + +/** + @short Geographic position + + This class represents a geographic position. +*/ +class KABC_EXPORT Geo +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Geo & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Geo & ); + + public: + /** + Construct invalid geographics position object. + */ + Geo(); + + /** + Construct geographics position object. + + @param latitude Geographical latitude + @param longitude Geographical longitude + */ + Geo( float latitude, float longitude ); + + /** + Sets the latitude. + */ + void setLatitude( float ); + + /** + Returns the latitude. + */ + float latitude() const; + + /** + Sets the longitude. + */ + void setLongitude( float ); + + /** + Returns the longitude. + */ + float longitude() const; + + /** + Returns, if this object contains a valid geographical position. + */ + bool isValid() const; + + bool operator==( const Geo & ) const; + bool operator!=( const Geo & ) const; + + /** + Returns string representation of geographical position. + */ + TQString asString() const; + + private: + float mLatitude; + float mLongitude; + + bool mValid; + bool mValidLat; + bool mValidLong; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Geo & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Geo & ); + +} + +#endif diff --git a/tdeabc/kabc_manager.desktop b/tdeabc/kabc_manager.desktop new file mode 100644 index 000000000..0af910f52 --- /dev/null +++ b/tdeabc/kabc_manager.desktop @@ -0,0 +1,76 @@ +[Desktop Entry] +Name=Contacts +Name[af]=Kontakte +Name[ar]=المراسلين +Name[be]=Кантакты +Name[br]=Darempredoù +Name[bs]=Kontakti +Name[ca]=Contactes +Name[cs]=Kontakty +Name[csb]=Łączbë +Name[cy]=Cysylltau +Name[da]=Kontakter +Name[de]=Kontakte +Name[el]=Επαφές +Name[eo]=Kontaktoj +Name[es]=Contactos +Name[et]=Kontaktid +Name[eu]=Kontaktuak +Name[fa]=تماسها +Name[fi]=Yhteystiedot +Name[fy]=Kontakten +Name[ga]=Teagmhálacha +Name[gl]=Contactos +Name[he]=אנשי קשר +Name[hi]=सम्पर्क +Name[hr]=Kontakti +Name[hsb]=Adresy +Name[hu]=Névjegyek +Name[id]=Kontak +Name[is]=Tengiliðir +Name[it]=Contatti +Name[ja]=コンタクト +Name[ka]=კონტაქტები +Name[kk]=Контакттар +Name[km]=ទំនាក់ទំនង +Name[ku]=Tekilî +Name[lb]=Kontakter +Name[lt]=Kontaktai +Name[lv]=Kontakti +Name[mk]=Контакти +Name[ms]=Hubungan +Name[nb]=Kontakter +Name[nds]=Kontakten +Name[ne]=सम्पर्क +Name[nl]=Contactpersonen +Name[nn]=Kontaktar +Name[pa]=ਸੰਪਰਕ +Name[pl]=Kontakty +Name[pt]=Contactos +Name[pt_BR]=Contatos +Name[ro]=Contacte +Name[ru]=Контакты +Name[rw]=Amaderesi +Name[se]=Oktavuođat +Name[sk]=Kontakty +Name[sl]=Stiki +Name[sr]=Контакти +Name[sr@Latn]=Kontakti +Name[sv]=Kontakter +Name[ta]=தொடர்புகள் +Name[te]=సంప్రదింపులు +Name[tg]=Алоқаҳо +Name[th]=รายชื่อติดต่อ +Name[tr]=Bağlantılar +Name[tt]=Elemtälär +Name[uk]=Контакти +Name[uz]=Aloqalar +Name[uz@cyrillic]=Алоқалар +Name[vi]=Liên lạc +Name[zh_CN]=联系人 +Name[zh_HK]=聯絡人 +Name[zh_TW]=聯絡人 +Type=Service +ServiceTypes=KResources/Manager + +X-TDE-ResourceFamily=contact diff --git a/tdeabc/key.cpp b/tdeabc/key.cpp new file mode 100644 index 000000000..08d9c6872 --- /dev/null +++ b/tdeabc/key.cpp @@ -0,0 +1,153 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include "key.h" + +using namespace KABC; + +Key::Key( const TQString &text, int type ) + : mTextData( text ), mIsBinary( false ), mType( type ) +{ + mId = TDEApplication::randomString(8); +} + +Key::~Key() +{ +} + +bool Key::operator==( const Key &k ) const +{ + if ( mIsBinary != k.mIsBinary ) return false; + if ( mIsBinary ) + if ( mBinaryData != k.mBinaryData ) return false; + else + if ( mTextData != k.mTextData ) return false; + if ( mType != k.mType ) return false; + if ( mCustomTypeString != k.mCustomTypeString ) return false; + + return true; +} + +bool Key::operator!=( const Key &k ) const +{ + return !( k == *this ); +} + +void Key::setId( const TQString &id ) +{ + mId = id; +} + +TQString Key::id() const +{ + return mId; +} + +void Key::setBinaryData( const TQByteArray &binary ) +{ + mBinaryData = binary; + mIsBinary = true; +} + +TQByteArray Key::binaryData() const +{ + return mBinaryData; +} + +void Key::setTextData( const TQString &text ) +{ + mTextData = text; + mIsBinary = false; +} + +TQString Key::textData() const +{ + return mTextData; +} + +bool Key::isBinary() const +{ + return mIsBinary; +} + +void Key::setType( int type ) +{ + mType = type; +} + +void Key::setCustomTypeString( const TQString &custom ) +{ + mCustomTypeString = custom; +} + +int Key::type() const +{ + return mType; +} + +TQString Key::customTypeString() const +{ + return mCustomTypeString; +} + +Key::TypeList Key::typeList() +{ + TypeList list; + list << X509; + list << PGP; + list << Custom; + + return list; +} + +TQString Key::typeLabel( int type ) +{ + switch ( type ) { + case X509: + return i18n( "X509" ); + break; + case PGP: + return i18n( "PGP" ); + break; + case Custom: + return i18n( "Custom" ); + break; + default: + return i18n( "Unknown type" ); + break; + } +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Key &key ) +{ + return s << key.mId << key.mIsBinary << key.mTextData << key.mBinaryData << + key.mCustomTypeString << key.mType; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Key &key ) +{ + s >> key.mId >> key.mIsBinary >> key.mTextData >> key.mBinaryData >> + key.mCustomTypeString >> key.mType; + + return s; +} diff --git a/tdeabc/key.h b/tdeabc/key.h new file mode 100644 index 000000000..08df0264d --- /dev/null +++ b/tdeabc/key.h @@ -0,0 +1,150 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_KEY_H +#define KABC_KEY_H + +#include + +#include + +namespace KABC { + +/** + * @short A class to store an encryption key. + */ +class KABC_EXPORT Key +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Key & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Key & ); + +public: + typedef TQValueList List; + typedef TQValueList TypeList; + + /** + * Key types + * + * @li X509 - X509 key + * @li PGP - Pretty Good Privacy key + * @li Custom - Custom or IANA conform key + */ + enum Types { + X509, + PGP, + Custom + }; + + /** + * Constructor. + * + * @param text The text data. + * @param type The key type, see Types. + */ + Key( const TQString &text = TQString::null, int type = PGP ); + + /** + * Destructor. + */ + ~Key(); + + bool operator==( const Key & ) const; + bool operator!=( const Key & ) const; + + /** + * Sets the unique identifier. + */ + void setId( const TQString &id ); + + /** + * Returns the unique identifier. + */ + TQString id() const; + + /** + * Sets binary data. + */ + void setBinaryData( const TQByteArray &binary ); + + /** + * Returns the binary data. + */ + TQByteArray binaryData() const; + + /** + * Sets text data. + */ + void setTextData( const TQString &text ); + + /** + * Returns the text data. + */ + TQString textData() const; + + /** + * Returns whether the key contains binary or text data. + */ + bool isBinary() const; + + /** + * Sets the type, see Type. + */ + void setType( int type ); + + /** + * Sets custom type string. + */ + void setCustomTypeString( const TQString &custom ); + + /** + * Returns the type, see Type. + */ + int type() const; + + /** + * Returns the custom type string. + */ + TQString customTypeString() const; + + /** + * Returns a list of all available key types. + */ + static TypeList typeList(); + + /** + * Returns a translated label for a given key type. + */ + static TQString typeLabel( int type ); + +private: + TQByteArray mBinaryData; + TQString mId; + TQString mTextData; + TQString mCustomTypeString; + + int mIsBinary; + int mType; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Key & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Key & ); + +} +#endif diff --git a/tdeabc/ldapclient.cpp b/tdeabc/ldapclient.cpp new file mode 100644 index 000000000..1c2b2d833 --- /dev/null +++ b/tdeabc/ldapclient.cpp @@ -0,0 +1,427 @@ +/* kldapclient.cpp - LDAP access + * Copyright (C) 2002 Klarälvdalens Datakonsult AB + * + * Author: Steffen Hansen + * + * Ported to KABC by Daniel Molkentin + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + + +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include "ldapclient.h" +#include "ldif.h" +#include "ldapurl.h" + +using namespace KABC; + +class LdapClient::LdapClientPrivate{ +public: + TQString bindDN; + TQString pwdBindDN; + LDIF ldif; +}; + +TQString LdapObject::toString() const +{ + TQString result = TQString::fromLatin1( "\ndn: %1\n" ).arg( dn ); + for ( LdapAttrMap::ConstIterator it = attrs.begin(); it != attrs.end(); ++it ) { + TQString attr = it.key(); + for ( LdapAttrValue::ConstIterator it2 = (*it).begin(); it2 != (*it).end(); ++it2 ) { + result += TQString::fromUtf8( LDIF::assembleLine( attr, *it2, 76 ) ) + "\n"; + } + } + + return result; +} + +void LdapObject::clear() +{ + dn = TQString::null; + attrs.clear(); +} + +void LdapObject::assign( const LdapObject& that ) +{ + if ( &that != this ) { + dn = that.dn; + attrs = that.attrs; + client = that.client; + } +} + +LdapClient::LdapClient( TQObject* parent, const char* name ) + : TQObject( parent, name ), mJob( 0 ), mActive( false ) +{ + d = new LdapClientPrivate; +} + +LdapClient::~LdapClient() +{ + cancelQuery(); + delete d; d = 0; +} + +void LdapClient::setHost( const TQString& host ) +{ + mHost = host; +} + +void LdapClient::setPort( const TQString& port ) +{ + mPort = port; +} + +void LdapClient::setBase( const TQString& base ) +{ + mBase = base; +} + +void LdapClient::setBindDN( const TQString& bindDN ) +{ + d->bindDN = bindDN; +} + +void LdapClient::setPwdBindDN( const TQString& pwdBindDN ) +{ + d->pwdBindDN = pwdBindDN; +} + +void LdapClient::setAttrs( const TQStringList& attrs ) +{ + mAttrs = attrs; +} + +void LdapClient::startQuery( const TQString& filter ) +{ + cancelQuery(); + LDAPUrl url; + + url.setProtocol( "ldap" ); + url.setUser( d->bindDN ); + url.setPass( d->pwdBindDN ); + url.setHost( mHost ); + url.setPort( mPort.toUInt() ); + url.setDn( mBase ); + url.setAttributes( mAttrs ); + url.setScope( mScope == "one" ? LDAPUrl::One : LDAPUrl::Sub ); + url.setFilter( "("+filter+")" ); + + kdDebug(5700) << "Doing query: " << url.prettyURL() << endl; + + startParseLDIF(); + mActive = true; + mJob = TDEIO::get( url, false, false ); + connect( mJob, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( slotData( TDEIO::Job*, const TQByteArray& ) ) ); + connect( mJob, TQT_SIGNAL( infoMessage( TDEIO::Job*, const TQString& ) ), + this, TQT_SLOT( slotInfoMessage( TDEIO::Job*, const TQString& ) ) ); + connect( mJob, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( slotDone() ) ); +} + +void LdapClient::cancelQuery() +{ + if ( mJob ) { + mJob->kill(); + mJob = 0; + } + + mActive = false; +} + +void LdapClient::slotData( TDEIO::Job*, const TQByteArray& data ) +{ +#ifndef NDEBUG // don't create the QString +// TQString str( data ); +// kdDebug(5700) << "LdapClient: Got \"" << str << "\"\n"; +#endif + parseLDIF( data ); +} + +void LdapClient::slotInfoMessage( TDEIO::Job*, const TQString & ) +{ + //tqDebug("Job said \"%s\"", info.latin1()); +} + +void LdapClient::slotDone() +{ + endParseLDIF(); + mActive = false; +#if 0 + for ( TQValueList::Iterator it = mObjects.begin(); it != mObjects.end(); ++it ) { + tqDebug( (*it).toString().latin1() ); + } +#endif + int err = mJob->error(); + if ( err && err != TDEIO::ERR_USER_CANCELED ) { + emit error( TDEIO::buildErrorString( err, TQString("%1:%2").arg( mHost ).arg( mPort ) ) ); + } + emit done(); +} + +void LdapClient::startParseLDIF() +{ + mCurrentObject.clear(); + mLastAttrName = 0; + mLastAttrValue = 0; + mIsBase64 = false; + d->ldif.startParsing(); +} + +void LdapClient::endParseLDIF() +{ +} + +void LdapClient::parseLDIF( const TQByteArray& data ) +{ + if ( data.size() ) { + d->ldif.setLDIF( data ); + } else { + d->ldif.endLDIF(); + } + + LDIF::ParseVal ret; + TQString name; + do { + ret = d->ldif.nextItem(); + switch ( ret ) { + case LDIF::Item: + { + name = d->ldif.attr(); + // Must make a copy! TQByteArray is explicitely shared + TQByteArray value = d->ldif.val().copy(); + mCurrentObject.attrs[ name ].append( value ); + break; + } + case LDIF::EndEntry: + mCurrentObject.dn = d->ldif.dn(); + mCurrentObject.client = this; + emit result( mCurrentObject ); + mCurrentObject.clear(); + break; + default: + break; + } + } while ( ret != LDIF::MoreData ); +} + +TQString LdapClient::bindDN() const +{ + return d->bindDN; +} + +TQString LdapClient::pwdBindDN() const +{ + return d->pwdBindDN; +} + +LdapSearch::LdapSearch() + : mActiveClients( 0 ), mNoLDAPLookup( false ) +{ + if ( !KProtocolInfo::isKnownProtocol( KURL("ldap://localhost") ) ) { + mNoLDAPLookup = true; + return; + } + + // stolen from KAddressBook + TDEConfig config( "kabldaprc", true ); + config.setGroup( "LDAP" ); + int numHosts = config.readUnsignedNumEntry( "NumSelectedHosts"); + if ( !numHosts ) { + mNoLDAPLookup = true; + return; + } else { + for ( int j = 0; j < numHosts; j++ ) { + LdapClient* ldapClient = new LdapClient( this ); + + TQString host = config.readEntry( TQString( "SelectedHost%1" ).arg( j ), "" ).stripWhiteSpace(); + if ( !host.isEmpty() ) + ldapClient->setHost( host ); + + TQString port = TQString::number( config.readUnsignedNumEntry( TQString( "SelectedPort%1" ).arg( j ) ) ); + if ( !port.isEmpty() ) + ldapClient->setPort( port ); + + TQString base = config.readEntry( TQString( "SelectedBase%1" ).arg( j ), "" ).stripWhiteSpace(); + if ( !base.isEmpty() ) + ldapClient->setBase( base ); + + TQString bindDN = config.readEntry( TQString( "SelectedBind%1" ).arg( j ) ).stripWhiteSpace(); + if ( !bindDN.isEmpty() ) + ldapClient->setBindDN( bindDN ); + + TQString pwdBindDN = config.readEntry( TQString( "SelectedPwdBind%1" ).arg( j ) ); + if ( !pwdBindDN.isEmpty() ) + ldapClient->setPwdBindDN( pwdBindDN ); + + TQStringList attrs; + attrs << "cn" << "mail" << "givenname" << "sn"; + ldapClient->setAttrs( attrs ); + + connect( ldapClient, TQT_SIGNAL( result( const KABC::LdapObject& ) ), + this, TQT_SLOT( slotLDAPResult( const KABC::LdapObject& ) ) ); + connect( ldapClient, TQT_SIGNAL( done() ), + this, TQT_SLOT( slotLDAPDone() ) ); + connect( ldapClient, TQT_SIGNAL( error( const TQString& ) ), + this, TQT_SLOT( slotLDAPError( const TQString& ) ) ); + + mClients.append( ldapClient ); + } + } + + connect( &mDataTimer, TQT_SIGNAL( timeout() ), TQT_SLOT( slotDataTimer() ) ); +} + +void LdapSearch::startSearch( const TQString& txt ) +{ + if ( mNoLDAPLookup ) + return; + + cancelSearch(); + + int pos = txt.find( '\"' ); + if( pos >= 0 ) + { + ++pos; + int pos2 = txt.find( '\"', pos ); + if( pos2 >= 0 ) + mSearchText = txt.mid( pos , pos2 - pos ); + else + mSearchText = txt.mid( pos ); + } else + mSearchText = txt; + + TQString filter = TQString( "|(cn=%1*)(mail=%2*)(givenName=%3*)(sn=%4*)" ) + .arg( mSearchText ).arg( mSearchText ).arg( mSearchText ).arg( mSearchText ); + + TQValueList< LdapClient* >::Iterator it; + for ( it = mClients.begin(); it != mClients.end(); ++it ) { + (*it)->startQuery( filter ); + ++mActiveClients; + } +} + +void LdapSearch::cancelSearch() +{ + TQValueList< LdapClient* >::Iterator it; + for ( it = mClients.begin(); it != mClients.end(); ++it ) + (*it)->cancelQuery(); + + mActiveClients = 0; + mResults.clear(); +} + +void LdapSearch::slotLDAPResult( const KABC::LdapObject& obj ) +{ + mResults.append( obj ); + if ( !mDataTimer.isActive() ) + mDataTimer.start( 500, true ); +} + +void LdapSearch::slotLDAPError( const TQString& ) +{ + slotLDAPDone(); +} + +void LdapSearch::slotLDAPDone() +{ + if ( --mActiveClients > 0 ) + return; + + finish(); +} + +void LdapSearch::slotDataTimer() +{ + TQStringList lst; + LdapResultList reslist; + makeSearchData( lst, reslist ); + if ( !lst.isEmpty() ) + emit searchData( lst ); + if ( !reslist.isEmpty() ) + emit searchData( reslist ); +} + +void LdapSearch::finish() +{ + mDataTimer.stop(); + + slotDataTimer(); // emit final bunch of data + emit searchDone(); +} + +void LdapSearch::makeSearchData( TQStringList& ret, LdapResultList& resList ) +{ + TQString search_text_upper = mSearchText.upper(); + + TQValueList< KABC::LdapObject >::ConstIterator it1; + for ( it1 = mResults.begin(); it1 != mResults.end(); ++it1 ) { + TQString name, mail, givenname, sn; + + LdapAttrMap::ConstIterator it2; + for ( it2 = (*it1).attrs.begin(); it2 != (*it1).attrs.end(); ++it2 ) { + TQString tmp = TQString::fromUtf8( (*it2).first(), (*it2).first().size() ); + if ( it2.key() == "cn" ) + name = tmp; // TODO loop? + else if( it2.key() == "mail" ) + mail = tmp; + else if( it2.key() == "givenName" ) + givenname = tmp; + else if( it2.key() == "sn" ) + sn = tmp; + } + + if( mail.isEmpty()) + continue; // nothing, bad entry + else if ( name.isEmpty() ) + ret.append( mail ); + else { + kdDebug(5700) << "<" << name << "><" << mail << ">" << endl; + ret.append( TQString( "%1 <%2>" ).arg( name ).arg( mail ) ); + } + + LdapResult sr; + sr.clientNumber = mClients.findIndex( (*it1).client ); + sr.name = name; + sr.email = mail; + resList.append( sr ); + } + + mResults.clear(); +} + +bool LdapSearch::isAvailable() const +{ + return !mNoLDAPLookup; +} + + + +#include "ldapclient.moc" diff --git a/tdeabc/ldapclient.h b/tdeabc/ldapclient.h new file mode 100644 index 000000000..f43a644ce --- /dev/null +++ b/tdeabc/ldapclient.h @@ -0,0 +1,248 @@ +/* kldapclient.h - LDAP access + * Copyright (C) 2002 Klarälvdalens Datakonsult AB + * + * Author: Steffen Hansen + * + * This file is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This file is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA + */ + + +#ifndef KABC_LDAPCLIENT_H +#define KABC_LDAPCLIENT_H + + +#include +#include +#include +#include +#include +#include +#include + +#include + +namespace KABC { + +class LdapClient; +typedef TQValueList LdapAttrValue; +typedef TQMap LdapAttrMap; + +/** + * This class is internal. Binary compatibiliy might be broken any time + * without notification. Do not use it. + * + * We mean it! + * + */ +class KABC_EXPORT LdapObject +{ + public: + LdapObject() + : dn( TQString::null ), client( 0 ) {} + explicit LdapObject( const TQString& _dn, LdapClient* _cl ) : dn( _dn ), client( _cl ) {} + LdapObject( const LdapObject& that ) { assign( that ); } + + LdapObject& operator=( const LdapObject& that ) + { + assign( that ); + return *this; + } + + TQString toString() const; + + void clear(); + + TQString dn; + LdapAttrMap attrs; + LdapClient* client; + + protected: + void assign( const LdapObject& that ); + + private: + //class LdapObjectPrivate* d; +}; + +/** + * This class is internal. Binary compatibiliy might be broken any time + * without notification. Do not use it. + * + * We mean it! + * + */ +class KABC_EXPORT LdapClient : public TQObject +{ + Q_OBJECT + + public: + LdapClient( TQObject* parent = 0, const char* name = 0 ); + virtual ~LdapClient(); + + /*! returns true if there is a query running */ + bool isActive() const { return mActive; } + + signals: + /*! Emitted when the query is done */ + void done(); + + /*! Emitted in case of error */ + void error( const TQString& ); + + /*! Emitted once for each object returned + * from the query + */ + void result( const KABC::LdapObject& ); + + public slots: + /*! + * Set the name or IP of the LDAP server + */ + void setHost( const TQString& host ); + TQString host() const { return mHost; } + + /*! + * Set the port of the LDAP server + * if using a nonstandard port + */ + void setPort( const TQString& port ); + TQString port() const { return mPort; } + + /*! + * Set the base DN + */ + void setBase( const TQString& base ); + TQString base() const { return mBase; } + + /*! + * Set the bind DN + */ + void setBindDN( const TQString& bindDN ); + TQString bindDN() const; + + /*! + * Set the bind password DN + */ + void setPwdBindDN( const TQString& pwdBindDN ); + TQString pwdBindDN() const; + + /*! Set the attributes that should be + * returned, or an empty list if + * all attributes are wanted + */ + void setAttrs( const TQStringList& attrs ); + TQStringList attrs() const { return mAttrs; } + + void setScope( const TQString scope ) { mScope = scope; } + + /*! + * Start the query with filter filter + */ + void startQuery( const TQString& filter ); + + /*! + * Abort a running query + */ + void cancelQuery(); + + protected slots: + void slotData( TDEIO::Job*, const TQByteArray &data ); + void slotInfoMessage( TDEIO::Job*, const TQString &info ); + void slotDone(); + + protected: + void startParseLDIF(); + void parseLDIF( const TQByteArray& data ); + void endParseLDIF(); + + TQString mHost; + TQString mPort; + TQString mBase; + TQString mScope; + TQStringList mAttrs; + + TQGuardedPtr mJob; + bool mActive; + + LdapObject mCurrentObject; + TQCString mBuf; + TQCString mLastAttrName; + TQCString mLastAttrValue; + bool mIsBase64; + + private: + class LdapClientPrivate; + LdapClientPrivate* d; +}; + +/** + * Structure describing one result returned by a LDAP query + */ +struct LdapResult { + TQString name; ///< full name + TQString email; ///< email + int clientNumber; ///< for sorting +}; +typedef TQValueList LdapResultList; + + +/** + * This class is internal. Binary compatibiliy might be broken any time + * without notification. Do not use it. + * + * We mean it! + * + */ +class KABC_EXPORT LdapSearch : public TQObject +{ + Q_OBJECT + + public: + LdapSearch(); + + void startSearch( const TQString& txt ); + void cancelSearch(); + bool isAvailable() const; + + signals: + /// Results, assembled as "Full Name " + /// (This signal can be emitted many times) + void searchData( const TQStringList& ); + /// Another form for the results, with separate fields + /// (This signal can be emitted many times) + void searchData( const KABC::LdapResultList& ); + void searchDone(); + + private slots: + void slotLDAPResult( const KABC::LdapObject& ); + void slotLDAPError( const TQString& ); + void slotLDAPDone(); + void slotDataTimer(); + + private: + void finish(); + void makeSearchData( TQStringList& ret, LdapResultList& resList ); + TQValueList< LdapClient* > mClients; + TQString mSearchText; + TQTimer mDataTimer; + int mActiveClients; + bool mNoLDAPLookup; + TQValueList< LdapObject > mResults; + + private: + class LdapSearchPrivate* d; +}; + +} +#endif // KABC_LDAPCLIENT_H diff --git a/tdeabc/ldapconfigwidget.cpp b/tdeabc/ldapconfigwidget.cpp new file mode 100644 index 000000000..fa092754e --- /dev/null +++ b/tdeabc/ldapconfigwidget.cpp @@ -0,0 +1,626 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi György + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include + +#include "ldapconfigwidget.h" +#include "ldapconfigwidget.moc" + +using namespace KABC; + +LdapConfigWidget::LdapConfigWidget( TQWidget* parent, + const char* name, WFlags fl ) : TQWidget( parent, name, fl ) +{ + mProg = 0; + mFlags = 0; + mainLayout = new TQGridLayout( this, 12, 4, 0, + KDialog::spacingHint() ); +} + +LdapConfigWidget::LdapConfigWidget( int flags, TQWidget* parent, + const char* name, WFlags fl ) : TQWidget( parent, name, fl ) +{ + mFlags = flags; + mProg = 0; + mainLayout = new TQGridLayout( this, 12, 4, 0, + KDialog::spacingHint() ); + initWidget(); +} + +LdapConfigWidget::~LdapConfigWidget() +{ +} + +void LdapConfigWidget::initWidget() +{ + TQLabel *label; + + mUser = mPassword = mHost = mDn = mBindDN = mRealm = mFilter = 0; + mPort = mVer = mTimeLimit = mSizeLimit = 0; + mAnonymous = mSimple = mSASL = mSecNO = mSecTLS = mSecSSL = 0; + mEditButton = mQueryMech = 0; + mMech = 0; + int row = 0; + int col; + + if ( mFlags & W_USER ) { + label = new TQLabel( i18n( "User:" ), this ); + mUser = new KLineEdit( this, "kcfg_ldapuser" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mUser, row, row, 1, 3 ); + row++; + } + + if ( mFlags & W_BINDDN ) { + label = new TQLabel( i18n( "Bind DN:" ), this ); + mBindDN = new KLineEdit( this, "kcfg_ldapbinddn" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mBindDN, row, row, 1, 3 ); + row++; + } + + if ( mFlags & W_REALM ) { + label = new TQLabel( i18n( "Realm:" ), this ); + mRealm = new KLineEdit( this, "kcfg_ldaprealm" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mRealm, row, row, 1, 3 ); + row++; + } + + if ( mFlags & W_PASS ) { + label = new TQLabel( i18n( "Password:" ), this ); + mPassword = new KLineEdit( this, "kcfg_ldappassword" ); + mPassword->setEchoMode( KLineEdit::Password ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mPassword, row, row, 1, 3 ); + row++; + } + + if ( mFlags & W_HOST ) { + label = new TQLabel( i18n( "Host:" ), this ); + mHost = new KLineEdit( this, "kcfg_ldaphost" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mHost, row, row, 1, 3 ); + row++; + } + + col = 0; + if ( mFlags & W_PORT ) { + label = new TQLabel( i18n( "Port:" ), this ); + mPort = new TQSpinBox( 0, 65535, 1, this, "kcfg_ldapport" ); + mPort->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); + mPort->setValue( 389 ); + + mainLayout->addWidget( label, row, col ); + mainLayout->addWidget( mPort, row, col+1 ); + col += 2; + } + + if ( mFlags & W_VER ) { + label = new TQLabel( i18n( "LDAP version:" ), this ); + mVer = new TQSpinBox( 2, 3, 1, this, "kcfg_ldapver" ); + mVer->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); + mVer->setValue( 3 ); + mainLayout->addWidget( label, row, col ); + mainLayout->addWidget( mVer, row, col+1 ); + } + if ( mFlags & ( W_PORT | W_VER ) ) row++; + + col = 0; + if ( mFlags & W_SIZELIMIT ) { + label = new TQLabel( i18n( "Size limit:" ), this ); + mSizeLimit = new TQSpinBox( 0, 9999999, 1, this, "kcfg_ldapsizelimit" ); + mSizeLimit->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); + mSizeLimit->setValue( 0 ); + mSizeLimit->setSpecialValueText( i18n("Default") ); + mainLayout->addWidget( label, row, col ); + mainLayout->addWidget( mSizeLimit, row, col+1 ); + col += 2; + } + + if ( mFlags & W_TIMELIMIT ) { + label = new TQLabel( i18n( "Time limit:" ), this ); + mTimeLimit = new TQSpinBox( 0, 9999999, 1, this, "kcfg_ldaptimelimit" ); + mTimeLimit->setSizePolicy( TQSizePolicy( TQSizePolicy::Maximum, TQSizePolicy::Preferred ) ); + mTimeLimit->setValue( 0 ); + mTimeLimit->setSuffix( i18n(" sec") ); + mTimeLimit->setSpecialValueText( i18n("Default") ); + mainLayout->addWidget( label, row, col ); + mainLayout->addWidget( mTimeLimit, row, col+1 ); + } + if ( mFlags & ( W_SIZELIMIT | W_TIMELIMIT ) ) row++; + + if ( mFlags & W_DN ) { + label = new TQLabel( i18n( "Distinguished Name", "DN:" ), this ); + mDn = new KLineEdit( this, "kcfg_ldapdn" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mDn, row, row, 1, 1 ); + //without host query doesn't make sense + if ( mHost ) { + TQPushButton *dnquery = new TQPushButton( i18n( "Query Server" ), this ); + connect( dnquery, TQT_SIGNAL( clicked() ), TQT_SLOT( mQueryDNClicked() ) ); + mainLayout->addMultiCellWidget( dnquery, row, row, 2, 3 ); + } + row++; + } + + if ( mFlags & W_FILTER ) { + label = new TQLabel( i18n( "Filter:" ), this ); + mFilter = new KLineEdit( this, "kcfg_ldapfilter" ); + + mainLayout->addWidget( label, row, 0 ); + mainLayout->addMultiCellWidget( mFilter, row, row, 1, 3 ); + row++; + } + + if ( mFlags & W_SECBOX ) { + TQHButtonGroup *btgroup = new TQHButtonGroup( i18n( "Security" ), this ); + mSecNO = new TQRadioButton( i18n( "No" ), btgroup, "kcfg_ldapnosec" ); + mSecTLS = new TQRadioButton( i18n( "TLS" ), btgroup, "kcfg_ldaptls" ); + mSecSSL = new TQRadioButton( i18n( "SSL" ), btgroup, "kcfg_ldapssl" ); + mainLayout->addMultiCellWidget( btgroup, row, row, 0, 3 ); + + connect( mSecNO, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPPort() ) ); + connect( mSecTLS, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPPort() ) ); + connect( mSecSSL, TQT_SIGNAL( clicked() ), TQT_SLOT( setLDAPSPort( ) ) ); + + mSecNO->setChecked( true ); + row++; + } + + if ( mFlags & W_AUTHBOX ) { + + TQButtonGroup *authbox = + new TQButtonGroup( 3, Qt::Horizontal, i18n( "Authentication" ), this ); + + mAnonymous = new TQRadioButton( i18n( "Anonymous" ), authbox, "kcfg_ldapanon" ); + mSimple = new TQRadioButton( i18n( "Simple" ), authbox, "kcfg_ldapsimple" ); + mSASL = new TQRadioButton( i18n( "SASL" ), authbox, "kcfg_ldapsasl" ); + + label = new TQLabel( i18n( "SASL mechanism:" ), authbox ); + mMech = new KComboBox( false, authbox, "kcfg_ldapsaslmech" ); + mMech->setEditable( true ); + mMech->insertItem( "DIGEST-MD5" ); + mMech->insertItem( "GSSAPI" ); + mMech->insertItem( "PLAIN" ); + + //without host query doesn't make sense + if ( mHost ) { + mQueryMech = new TQPushButton( i18n( "Query Server" ), authbox ); + connect( mQueryMech, TQT_SIGNAL( clicked() ), TQT_SLOT( mQueryMechClicked() ) ); + } + + mainLayout->addMultiCellWidget( authbox, row, row+1, 0, 3 ); + + connect( mAnonymous, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setAnonymous(int) ) ); + connect( mSimple, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setSimple(int) ) ); + connect( mSASL, TQT_SIGNAL( stateChanged(int) ), TQT_SLOT( setSASL(int) ) ); + + mAnonymous->setChecked( true ); + } + +} + +void LdapConfigWidget::loadData( TDEIO::Job*, const TQByteArray& d ) +{ + LDIF::ParseVal ret; + + if ( d.size() ) { + mLdif.setLDIF( d ); + } else { + mLdif.endLDIF(); + } + do { + ret = mLdif.nextItem(); + if ( ret == LDIF::Item && mLdif.attr().lower() == mAttr ) { + mProg->progressBar()->advance( 1 ); + mQResult.push_back( TQString::fromUtf8( mLdif.val(), mLdif.val().size() ) ); + } + } while ( ret != LDIF::MoreData ); +} + +void LdapConfigWidget::loadResult( TDEIO::Job* job) +{ + int error = job->error(); + if ( error && error != TDEIO::ERR_USER_CANCELED ) + mErrorMsg = job->errorString(); + else + mErrorMsg = ""; + + mCancelled = false; + mProg->close(); +} + +void LdapConfigWidget::sendQuery() +{ + LDAPUrl _url; + + mQResult.clear(); + mCancelled = true; + + _url.setProtocol( ( mSecSSL && mSecSSL->isChecked() ) ? "ldaps" : "ldap" ); + if ( mHost ) _url.setHost( mHost->text() ); + if ( mPort ) _url.setPort( mPort->value() ); + _url.setDn( "" ); + _url.setAttributes( mAttr ); + _url.setScope( LDAPUrl::Base ); + if ( mVer ) _url.setExtension( "x-ver", TQString::number( mVer->value() ) ); + if ( mSecTLS && mSecTLS->isChecked() ) _url.setExtension( "x-tls", "" ); + + kdDebug(5700) << "sendQuery url: " << _url.prettyURL() << endl; + mLdif.startParsing(); + TDEIO::Job *job = TDEIO::get( _url, true, false ); + job->addMetaData("no-auth-prompt","true"); + connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( loadData( TDEIO::Job*, const TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( loadResult( TDEIO::Job* ) ) ); + + if ( mProg == NULL ) + mProg = new KProgressDialog( this, 0, i18n("LDAP Query"), _url.prettyURL(), true ); + else + mProg->setLabel( _url.prettyURL() ); + mProg->progressBar()->setValue( 0 ); + mProg->progressBar()->setTotalSteps( 1 ); + mProg->exec(); + if ( mCancelled ) { + kdDebug(5700) << "query cancelled!" << endl; + job->kill( true ); + } else { + if ( !mErrorMsg.isEmpty() ) KMessageBox::error( this, mErrorMsg ); + } +} + +void LdapConfigWidget::mQueryMechClicked() +{ + mAttr = "supportedsaslmechanisms"; + sendQuery(); + if ( !mQResult.isEmpty() ) { + mQResult.sort(); + mMech->clear(); + mMech->insertStringList( mQResult ); + } +} + +void LdapConfigWidget::mQueryDNClicked() +{ + mAttr = "namingcontexts"; + sendQuery(); + if ( !mQResult.isEmpty() ) mDn->setText( mQResult.first() ); +} + +void LdapConfigWidget::setAnonymous( int state ) +{ + if ( state == TQButton::Off ) return; + if ( mUser ) mUser->setEnabled(false); + if ( mPassword ) mPassword->setEnabled(false); + if ( mBindDN ) mBindDN->setEnabled(false); + if ( mRealm ) mRealm->setEnabled(false); + if ( mMech ) mMech->setEnabled(false); + if ( mQueryMech ) mQueryMech->setEnabled(false); +} + +void LdapConfigWidget::setSimple( int state ) +{ + if ( state == TQButton::Off ) return; + if ( mUser ) mUser->setEnabled(true); + if ( mPassword ) mPassword->setEnabled(true); + if ( mBindDN ) mBindDN->setEnabled(false); + if ( mRealm ) mRealm->setEnabled(false); + if ( mMech ) mMech->setEnabled(false); + if ( mQueryMech ) mQueryMech->setEnabled(false); +} + +void LdapConfigWidget::setSASL( int state ) +{ + if ( state == TQButton::Off ) return; + if ( mUser ) mUser->setEnabled(true); + if ( mPassword ) mPassword->setEnabled(true); + if ( mBindDN ) mBindDN->setEnabled(true); + if ( mRealm ) mRealm->setEnabled(true); + if ( mMech ) mMech->setEnabled(true); + if ( mQueryMech ) mQueryMech->setEnabled(true); +} + +void LdapConfigWidget::setLDAPPort() +{ + mPort->setValue( 389 ); +} + +void LdapConfigWidget::setLDAPSPort() +{ + mPort->setValue( 636 ); +} + + +LDAPUrl LdapConfigWidget::url() const +{ + LDAPUrl _url; + if ( mSecSSL && mSecSSL->isChecked() ) + _url.setProtocol( "ldaps" ); + else + _url.setProtocol( "ldap" ); + + if ( mUser ) _url.setUser( mUser->text() ); + if ( mPassword ) _url.setPass( mPassword->text() ); + if ( mHost ) _url.setHost( mHost->text() ); + if ( mPort ) _url.setPort( mPort->value() ); + if ( mDn ) _url.setDn( mDn->text() ); + if ( mVer ) _url.setExtension( "x-ver", TQString::number( mVer->value() ) ); + if ( mSizeLimit && mSizeLimit->value() != 0 ) + _url.setExtension( "x-sizelimit", TQString::number( mSizeLimit->value() ) ); + if ( mTimeLimit && mTimeLimit->value() != 0 ) + _url.setExtension( "x-timelimit", TQString::number( mTimeLimit->value() ) ); + if ( mSecTLS && mSecTLS->isChecked() ) _url.setExtension( "x-tls","" ); + if ( mFilter && !mFilter->text().isEmpty() ) + _url.setFilter( mFilter->text() ); + if ( mSASL && mSASL->isChecked() ) { + _url.setExtension( "x-sasl", "" ); + _url.setExtension( "x-mech", mMech->currentText() ); + if ( mBindDN && !mBindDN->text().isEmpty() ) + _url.setExtension( "bindname", mBindDN->text() ); + if ( mRealm && !mRealm->text().isEmpty() ) + _url.setExtension( "x-realm", mRealm->text() ); + } + return ( _url ); +} + +void LdapConfigWidget::setUser( const TQString &user ) +{ + if ( mUser ) mUser->setText( user ); +} + +TQString LdapConfigWidget::user() const +{ + return ( mUser ? mUser->text() : TQString::null ); +} + +void LdapConfigWidget::setPassword( const TQString &password ) +{ + if ( mPassword ) mPassword->setText( password ); +} + +TQString LdapConfigWidget::password() const +{ + return ( mPassword ? mPassword->text() : TQString::null ); +} + +void LdapConfigWidget::setBindDN( const TQString &binddn ) +{ + if ( mBindDN ) mBindDN->setText( binddn ); +} + +TQString LdapConfigWidget::bindDN() const +{ + return ( mBindDN ? mBindDN->text() : TQString::null ); +} + +void LdapConfigWidget::setRealm( const TQString &realm ) +{ + if ( mRealm ) mRealm->setText( realm ); +} + +TQString LdapConfigWidget::realm() const +{ + return ( mRealm ? mRealm->text() : TQString::null ); +} + +void LdapConfigWidget::setHost( const TQString &host ) +{ + if ( mHost ) mHost->setText( host ); +} + +TQString LdapConfigWidget::host() const +{ + return ( mHost ? mHost->text() : TQString::null ); +} + +void LdapConfigWidget::setPort( int port ) +{ + if ( mPort ) mPort->setValue( port ); +} + +int LdapConfigWidget::port() const +{ + return ( mPort ? mPort->value() : 389 ); +} + +void LdapConfigWidget::setVer( int ver ) +{ + if ( mVer ) mVer->setValue( ver ); +} + +int LdapConfigWidget::ver() const +{ + return ( mVer ? mVer->value() : 3 ); +} + +void LdapConfigWidget::setDn( const TQString &dn ) +{ + if ( mDn ) mDn->setText( dn ); +} + +TQString LdapConfigWidget::dn() const +{ + return ( mDn ? mDn->text() : TQString::null ); +} + +void LdapConfigWidget::setFilter( const TQString &filter ) +{ + if ( mFilter ) mFilter->setText( filter ); +} + +TQString LdapConfigWidget::filter() const +{ + return ( mFilter ? mFilter->text() : TQString::null ); +} + +void LdapConfigWidget::setMech( const TQString &mech ) +{ + if ( mMech == 0 ) return; + if ( !mech.isEmpty() ) { + int i = 0; + while ( i < mMech->count() ) { + if ( mMech->text( i ) == mech ) break; + i++; + } + if ( i == mMech->count() ) mMech->insertItem( mech ); + mMech->setCurrentItem( i ); + } +} + +TQString LdapConfigWidget::mech() const +{ + return ( mMech ? mMech->currentText() : TQString::null ); +} + +void LdapConfigWidget::setSecNO( bool b ) +{ + if ( mSecNO ) mSecNO->setChecked( b ); +} + +bool LdapConfigWidget::isSecNO() const +{ + return ( mSecNO ? mSecNO->isChecked() : true ); +} + +void LdapConfigWidget::setSecTLS( bool b ) +{ + if ( mSecTLS ) mSecTLS->setChecked( b ); +} + +bool LdapConfigWidget::isSecTLS() const +{ + return ( mSecTLS ? mSecTLS->isChecked() : false ); +} + +void LdapConfigWidget::setSecSSL( bool b ) +{ + if ( mSecSSL ) mSecSSL->setChecked( b ); +} + +bool LdapConfigWidget::isSecSSL() const +{ + return ( mSecSSL ? mSecSSL->isChecked() : false ); +} + +void LdapConfigWidget::setAuthAnon( bool b ) +{ + if ( mAnonymous ) mAnonymous->setChecked( b ); +} + +bool LdapConfigWidget::isAuthAnon() const +{ + return ( mAnonymous ? mAnonymous->isChecked() : true ); +} + +void LdapConfigWidget::setAuthSimple( bool b ) +{ + if ( mSimple ) mSimple->setChecked( b ); +} + +bool LdapConfigWidget::isAuthSimple() const +{ + return ( mSimple ? mSimple->isChecked() : false ); +} + +void LdapConfigWidget::setAuthSASL( bool b ) +{ + if ( mSASL ) mSASL->setChecked( b ); +} + +bool LdapConfigWidget::isAuthSASL() const +{ + return ( mSASL ? mSASL->isChecked() : false ); +} + +void LdapConfigWidget::setSizeLimit( int sizelimit ) +{ + if ( mSizeLimit ) mSizeLimit->setValue( sizelimit ); +} + +int LdapConfigWidget::sizeLimit() const +{ + return ( mSizeLimit ? mSizeLimit->value() : 0 ); +} + +void LdapConfigWidget::setTimeLimit( int timelimit ) +{ + if ( mTimeLimit ) mTimeLimit->setValue( timelimit ); +} + +int LdapConfigWidget::timeLimit() const +{ + return ( mTimeLimit ? mTimeLimit->value() : 0 ); +} + +int LdapConfigWidget::flags() const +{ + return mFlags; +} + +void LdapConfigWidget::setFlags( int flags ) +{ + mFlags = flags; + + // First delete all the child widgets. + // FIXME: I hope it's correct + const TQObjectList ch = childrenListObject(); + TQObjectList ch2 = ch; + TQObject *obj; + TQWidget *widget; + + obj = ch2.first(); + while ( obj != 0 ) { + widget = dynamic_cast (obj); + if ( widget && TQT_BASE_OBJECT(widget->parent()) == TQT_BASE_OBJECT(this) ) { + mainLayout->remove( widget ); + delete ( widget ); + } + obj = ch2.next(); + } + // Re-create child widgets according to the new flags + initWidget(); +} diff --git a/tdeabc/ldapconfigwidget.h b/tdeabc/ldapconfigwidget.h new file mode 100644 index 000000000..7071bce10 --- /dev/null +++ b/tdeabc/ldapconfigwidget.h @@ -0,0 +1,300 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi György + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef LDAPCONFIGWIDGET_H +#define LDAPCONFIGWIDGET_H + +#include +#include +#include + +#include +#include +#include + +class TQGridLayout; +class TQSpinBox; +class TQPushButton; +class TQCheckBox; +class TQRadioButton; +class KComboBox; +class KLineEdit; +class KProgressDialog; + +namespace KABC { + + /** + @short LDAP Configuration widget + + This class can be used to query the user for LDAP connection parameters. + It's TDEConfigXT compatible, using widget names starting with kcfg_ + */ + + class KABC_EXPORT LdapConfigWidget : public TQWidget + { + Q_OBJECT + + TQ_PROPERTY( LCW_Flags flags READ flagsProp WRITE setFlagsProp ) + TQ_PROPERTY( TQString user READ user WRITE setUser ) + TQ_PROPERTY( TQString password READ password WRITE setPassword ) + TQ_PROPERTY( TQString bindDN READ bindDN WRITE setBindDN ) + TQ_PROPERTY( TQString realm READ realm WRITE setRealm ) + TQ_PROPERTY( TQString host READ host WRITE setHost ) + TQ_PROPERTY( int port READ port WRITE setPort ) + TQ_PROPERTY( int ver READ ver WRITE setVer ) + TQ_PROPERTY( TQString dn READ dn WRITE setDn ) + TQ_PROPERTY( TQString filter READ filter WRITE setFilter ) + TQ_PROPERTY( TQString mech READ mech WRITE setMech ) + TQ_PROPERTY( bool secNO READ isSecNO WRITE setSecNO ) + TQ_PROPERTY( bool secSSL READ isSecSSL WRITE setSecSSL ) + TQ_PROPERTY( bool secTLS READ isSecSSL WRITE setSecTLS ) + TQ_PROPERTY( bool authAnon READ isAuthAnon WRITE setAuthAnon ) + TQ_PROPERTY( bool authSimple READ isAuthSimple WRITE setAuthSimple ) + TQ_PROPERTY( bool authSASL READ isAuthSASL WRITE setAuthSASL ) + TQ_PROPERTY( int sizeLimit READ sizeLimit WRITE setSizeLimit ) + TQ_PROPERTY( int timeLimit READ timeLimit WRITE setTimeLimit ) + TQ_SETS ( LCW_Flags ) + + public: + + enum LCW_Flags { + W_USER = 0x1, + W_PASS = 0x2, + W_BINDDN = 0x4, + W_REALM = 0x8, + W_HOST = 0x10, + W_PORT = 0x20, + W_VER = 0x40, + W_DN = 0x80, + W_FILTER = 0x100, + W_SECBOX = 0x400, + W_AUTHBOX = 0x800, + W_TIMELIMIT = 0x1000, + W_SIZELIMIT = 0x2000, + W_ALL = 0xFFFFFFF + }; + + /** Constructs an empty configuration widget. + * You need to call setFlags() after this. + */ + LdapConfigWidget( TQWidget* parent = 0, + const char* name = 0, WFlags fl = 0 ); + /** Constructs a configuration widget */ + LdapConfigWidget( int flags, TQWidget* parent = 0, + const char* name = 0, WFlags fl = 0 ); + /** Destructs a configuration widget */ + virtual ~LdapConfigWidget(); + + /** Sets the user name. Kconfig widget name: kcfg_ldapuser */ + void setUser( const TQString &user ); + /** Gets the user name. Kconfig widget name: kcfg_ldapuser */ + TQString user() const; + + /** Sets the password. Kconfig widget name: kcfg_ldappassword */ + void setPassword( const TQString &password ); + /** Gets the password. Kconfig widget name: kcfg_ldappassword */ + TQString password() const; + + /** + * Sets the bind dn. Useful for SASL proxy auth. + * Kconfig widget name: kcfg_ldapbinddn + */ + void setBindDN( const TQString &binddn ); + /** Gets the bind dn. Kconfig widget name: kcfg_ldapbinddn*/ + TQString bindDN() const; + + /** Sets the SASL realm. Kconfig widget name: kcfg_ldaprealm */ + void setRealm( const TQString &realm ); + /** Gets the SASL realm. Kconfig widget name: kcfg_ldaprealm */ + TQString realm() const; + + /** Sets the host name. Kconfig widget name: kcfg_ldaphost */ + void setHost( const TQString &host ); + /** Gets the host name. Kconfig widget name: kcfg_ldaphost */ + TQString host() const; + + /** Sets the LDAP port. Kconfig widget name: kcfg_ldapport */ + void setPort( int port ); + /** Gets the LDAP port. Kconfig widget name: kcfg_ldapport */ + int port() const; + + /** Sets the LDAP protocol version. Kconfig widget name: kcfg_ldapver */ + void setVer( int ver ); + /** Gets the LDAP protocol version. Kconfig widget name: kcfg_ldapver */ + int ver() const; + + /** Sets the LDAP Base DN. Kconfig widget name: kcfg_ldapdn */ + void setDn( const TQString &dn ); + /** Gets the LDAP Base DN. Kconfig widget name: kcfg_ldapdn */ + TQString dn() const; + + /** Sets the LDAP Filter. Kconfig widget name: kcfg_ldapfilter */ + void setFilter( const TQString &filter ); + /** Gets the LDAP Filter. Kconfig widget name: kcfg_ldapfilter */ + TQString filter() const; + + /** Sets the SASL Mechanism. Kconfig widget name: kcfg_ldapsaslmech */ + void setMech( const TQString &mech ); + /** Gets the SASL Mechanism. Kconfig widget name: kcfg_ldapsaslmech */ + TQString mech() const; + + /** + * Sets the configuration to no transport security. + * Kconfig widget name: kcfg_ldapnosec + */ + void setSecNO( bool b = true ); + /** + * Returns true if no transport security selected. + * Kconfig widget name: kcfg_ldapnosec + */ + bool isSecNO() const; + + /** + * Sets the configuration to TLS. + * Kconfig widget name: kcfg_ldaptls + */ + void setSecTLS( bool b = true ); + /** + * Returns true if TLS selected. + * Kconfig widget name: kcfg_ldaptls + */ + bool isSecTLS() const; + + /** + * Sets the configuration to SSL. + * Kconfig widget name: kcfg_ldapssl + */ + void setSecSSL( bool b = true ); + /** + * Returns true if SSL selected. + * Kconfig widget name: kcfg_ldapssl + */ + bool isSecSSL() const; + + /** + * Sets the authentication to anonymous. + * Kconfig widget name: kcfg_ldapanon + */ + void setAuthAnon( bool b = true ); + /** + * Returns true if Anonymous authentication selected. + * Kconfig widget name: kcfg_ldapanon + */ + bool isAuthAnon() const; + + /** + * Sets the authentication to simple. + * Kconfig widget name: kcfg_ldapsimple + */ + void setAuthSimple( bool b = true ); + /** + * Returns true if Simple authentication selected. + * Kconfig widget name: kcfg_ldapsimple + */ + bool isAuthSimple() const; + + /** + * Sets the authentication to SASL. + * Kconfig widget name: kcfg_ldapsasl + */ + void setAuthSASL( bool b = true ); + /** + * Returns true if SASL authentication selected. + * Kconfig widget name: kcfg_ldapsasl + */ + bool isAuthSASL() const; + + /** + * Sets the size limit. + * TDEConfig widget name: kcfg_ldapsizelimit + */ + void setSizeLimit( int sizelimit ); + /** + * Returns the size limit. + * TDEConfig widget name: kcfg_ldapsizelimit + */ + int sizeLimit() const; + + /** + * Sets the time limit. + * TDEConfig widget name: kcfg_ldaptimelimit + */ + void setTimeLimit( int timelimit ); + /** + * Returns the time limit. + * TDEConfig widget name: kcfg_ldaptimelimit + */ + int timeLimit() const; + + int flags() const; + void setFlags( int flags ); + inline LCW_Flags flagsProp() const { return (LCW_Flags)flags(); } + inline void setFlagsProp( LCW_Flags flags ) { setFlags((int)flags); } + + /** + * Returns a LDAP Url constructed from the settings given. + * Extensions are filled for use in the LDAP ioslave + */ + KABC::LDAPUrl url() const; + + private slots: + void setLDAPPort(); + void setLDAPSPort(); + void setAnonymous( int state ); + void setSimple( int state ); + void setSASL( int state ); + void mQueryDNClicked(); + void mQueryMechClicked(); + void loadData( TDEIO::Job*, const TQByteArray& ); + void loadResult( TDEIO::Job* ); + private: + + int mFlags; + LDIF mLdif; + TQStringList mQResult; + TQString mAttr; + + KLineEdit *mUser; + KLineEdit *mPassword; + KLineEdit *mHost; + TQSpinBox *mPort, *mVer, *mSizeLimit, *mTimeLimit; + KLineEdit *mDn, *mBindDN, *mRealm; + KLineEdit *mFilter; + TQRadioButton *mAnonymous,*mSimple,*mSASL; + TQCheckBox *mSubTree; + TQPushButton *mEditButton; + TQPushButton *mQueryMech; + TQRadioButton *mSecNO,*mSecTLS,*mSecSSL; + KComboBox *mMech; + + TQString mErrorMsg; + bool mCancelled; + KProgressDialog *mProg; + + TQGridLayout *mainLayout; + class LDAPConfigWidgetPrivate; + LDAPConfigWidgetPrivate *d; + + void sendQuery(); + void initWidget(); + }; +} + +#endif diff --git a/tdeabc/ldapurl.cpp b/tdeabc/ldapurl.cpp new file mode 100644 index 000000000..9032c16d3 --- /dev/null +++ b/tdeabc/ldapurl.cpp @@ -0,0 +1,201 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi György + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "ldapurl.h" + +using namespace KABC; + +LDAPUrl::LDAPUrl() +{ + m_scope = Base; +} + +LDAPUrl::LDAPUrl(const KURL &_url) + : KURL(_url), m_extensions() +{ + m_dn = path(); + if ( !TQDir::isRelativePath(m_dn) ) +#ifdef Q_WS_WIN + m_dn.remove(0,3); // e.g. "c:/" +#else + m_dn.remove(0,1); +#endif + parseQuery(); +} + +void LDAPUrl::setDn( const TQString &dn) +{ + m_dn = dn; + if ( !TQDir::isRelativePath(m_dn) ) +#ifdef Q_WS_WIN + m_dn.remove(0,3); // e.g. "c:/" +#else + m_dn.remove(0,1); +#endif + setPath(m_dn); +} + +bool LDAPUrl::hasExtension( const TQString &key ) const +{ + return m_extensions.contains( key ); +} + +LDAPUrl::Extension LDAPUrl::extension( const TQString &key ) const +{ + TQMap::const_iterator it; + + it = m_extensions.find( key ); + if ( it != m_extensions.constEnd() ) + return (*it); + else { + Extension ext; + ext.value = ""; + ext.critical = false; + return ext; + } +} + +TQString LDAPUrl::extension( const TQString &key, bool &critical ) const +{ + Extension ext; + + ext = extension( key ); + critical = ext.critical; + return ext.value; +} + +void LDAPUrl::setExtension( const TQString &key, const LDAPUrl::Extension &ext ) +{ + m_extensions[ key ] = ext; + updateQuery(); +} + +void LDAPUrl::setExtension( const TQString &key, const TQString &value, bool critical ) +{ + Extension ext; + ext.value = value; + ext.critical = critical; + setExtension( key, ext ); +} + +void LDAPUrl::removeExtension( const TQString &key ) +{ + m_extensions.remove( key ); + updateQuery(); +} + +void LDAPUrl::updateQuery() +{ + Extension ext; + TQMap::iterator it; + TQString q = "?"; + + // set the attributes to query + if ( m_attributes.count() > 0 ) q += m_attributes.join(","); + + // set the scope + q += "?"; + switch( m_scope ) { + case Sub: + q += "sub"; + break; + case One: + q += "one"; + break; + case Base: + q += "base"; + break; + } + + // set the filter + q += "?"; + if ( m_filter != "(objectClass=*)" && !m_filter.isEmpty() ) + q += m_filter; + + // set the extensions + q += "?"; + for ( it = m_extensions.begin(); it != m_extensions.end(); ++it ) { + if ( it.data().critical ) q += "!"; + q += it.key(); + if ( !it.data().value.isEmpty() ) + q += "=" + it.data().value; + q += ","; + } + while ( q.endsWith("?") || q.endsWith(",") ) + q.remove( q.length() - 1, 1 ); + + setQuery(q); + kdDebug(5700) << "LDAP URL updateQuery(): " << prettyURL() << endl; +} + +void LDAPUrl::parseQuery() +{ + Extension ext; + TQStringList extensions; + TQString q = query(); + // remove first ? + if (q.startsWith("?")) + q.remove(0,1); + + // split into a list + TQStringList url_items = TQStringList::split("?", q, true); + + m_attributes.clear(); + m_scope = Base; + m_filter = "(objectClass=*)"; + m_extensions.clear(); + + int i = 0; + for ( TQStringList::Iterator it = url_items.begin(); it != url_items.end(); ++it, i++ ) { + switch (i) { + case 0: + m_attributes = TQStringList::split(",", (*it), false); + break; + case 1: + if ( (*it) == "sub" ) m_scope = Sub; else + if ( (*it) == "one") m_scope = One; + break; + case 2: + m_filter = decode_string( *it ); + break; + case 3: + extensions = TQStringList::split(",", (*it), false); + break; + } + } + + TQString name,value; + for ( TQStringList::Iterator it = extensions.begin(); it != extensions.end(); ++it ) { + ext.critical = false; + name = decode_string( (*it).section('=',0,0) ).lower(); + value = decode_string( (*it).section('=',1) ); + if ( name.startsWith("!") ) { + ext.critical = true; + name.remove(0, 1); + } + kdDebug(5700) << "LDAPUrl extensions name= " << name << " value: " << value << endl; + ext.value = value.replace( "%2", "," ); + setExtension( name, ext ); + } +} diff --git a/tdeabc/ldapurl.h b/tdeabc/ldapurl.h new file mode 100644 index 000000000..0c2693758 --- /dev/null +++ b/tdeabc/ldapurl.h @@ -0,0 +1,110 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi György + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _K_LDAPURL_H_ +#define _K_LDAPURL_H_ + +#include +#include +#include + +#include + +namespace KABC { + +/** + * LDAPUrl + + * LDAPUrl implements an RFC 2255 compliant LDAP Url parser, with minimal + * differences. LDAP Urls implemented by this class has the following format: + * ldap[s]://[user[:password]@]hostname[:port]["/" [dn ["?" [attributes] + * ["?" [scope] ["?" [filter] ["?" extensions]]]]]] + */ + + + class KABC_EXPORT LDAPUrl : public KURL + { + public: + + struct Extension { + TQString value; + bool critical; + }; + + typedef enum Scope { Base, One, Sub }; + + /** Constructs an empty KLDAPUrl. */ + LDAPUrl(); + /** Constructs a KLDAPUrl from a KURL. */ + LDAPUrl( const KURL &url ); + + /** + * Returns the dn part of the LDAP Url (same as path(), but slash removed + * from the beginning). + */ + const TQString& dn() const { return m_dn; } + /** Sets the the dn part of the LDAP Url. */ + void setDn( const TQString &dn ); + + /** Returns the attributes part of the LDAP Url */ + const TQStringList &attributes() { return m_attributes; } + /** Sets the attributes part of the LDAP Url */ + void setAttributes( const TQStringList &attributes ) + { m_attributes=attributes; updateQuery(); } + + /** Returns the scope part of the LDAP Url */ + Scope scope() const { return m_scope; } + /** Sets the scope part of the LDAP Url */ + void setScope(Scope scope) { m_scope = scope; updateQuery(); } + + /** Returns the filter part of the LDAP Url */ + const TQString &filter() const { return m_filter; } + /** Sets the filter part of the LDAP Url */ + void setFilter( TQString filter ) { m_filter = filter; updateQuery(); } + + /** Returns if the specified extension exists in the LDAP Url */ + bool hasExtension( const TQString &key ) const; + /** Returns the specified extension */ + Extension extension( const TQString &key ) const; + /** Returns the specified extension */ + TQString extension( const TQString &key, bool &critical ) const; + /** Sets the specified extension key with the value and criticality in ext */ + void setExtension( const TQString &key, const Extension &ext ); + /** Sets the specified extension key with the value and criticality specified */ + void setExtension( const TQString &key, const TQString &value, bool critical = false ); + /** Removes the specified extension */ + void removeExtension( const TQString &key ); + /** Updates the query component from the attributes, scope, filter and extensions */ + void updateQuery(); + + protected: + void parseQuery(); + + private: + + TQMap m_extensions; + TQString m_dn; + TQStringList m_attributes; + Scope m_scope; + TQString m_filter; + }; +} + +#endif diff --git a/tdeabc/ldif.cpp b/tdeabc/ldif.cpp new file mode 100644 index 000000000..408f5223f --- /dev/null +++ b/tdeabc/ldif.cpp @@ -0,0 +1,365 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi György + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include "ldif.h" + +using namespace KABC; + +LDIF::LDIF() +{ + startParsing(); +} + +LDIF::~LDIF() +{ +} + +TQCString LDIF::assembleLine( const TQString &fieldname, const TQByteArray &value, + uint linelen, bool url ) +{ + bool safe = false; + bool isDn; + TQCString result; + uint i; + + if ( url ) { + result = fieldname.utf8() + ":< " + TQCString( value.data(), value.size()+1 ); + } else { + isDn = fieldname.lower() == "dn"; + //SAFE-INIT-CHAR + if ( value.size() > 0 && value[0] > 0 && value[0] != '\n' && + value[0] != '\r' && value[0] != ':' && value[0] != '<' ) safe = true; + + //SAFE-CHAR + if ( safe ) { + for ( i=1; i < value.size(); i++ ) { + //allow utf-8 in Distinguished Names + if ( ( isDn && value[i] == 0 ) || + ( !isDn && value[i] <= 0 ) || + value[i] == '\r' || value[i] == '\n' ) { + safe = false; + break; + } + } + } + + if ( value.size() == 0 ) safe = true; + + if( safe ) { + result = fieldname.utf8() + ": " + TQCString( value.data(), value.size()+1 ); + } else { + result = fieldname.utf8() + ":: " + KCodecs::base64Encode( value, false ); + } + + if ( linelen > 0 ) { + i = (fieldname.length()+2) > linelen ? fieldname.length()+2 : linelen; + while ( i < result.length() ) { + result.insert( i, "\n " ); + i += linelen+2; + } + } + } + return result; +} + +TQCString LDIF::assembleLine( const TQString &fieldname, const TQCString &value, + uint linelen, bool url ) +{ + TQCString ret; + TQByteArray tmp; + uint valuelen = value.length(); + const char *data = value.data(); + + tmp.setRawData( data, valuelen ); + ret = assembleLine( fieldname, tmp, linelen, url ); + tmp.resetRawData( data, valuelen ); + return ret; + +} + +TQCString LDIF::assembleLine( const TQString &fieldname, const TQString &value, + uint linelen, bool url ) +{ + return assembleLine( fieldname, value.utf8(), linelen, url ); +} + +bool LDIF::splitLine( const TQCString &line, TQString &fieldname, TQByteArray &value ) +{ + int position; + TQByteArray tmp; + int linelen; + const char *data; + +// kdDebug(5700) << "splitLine line: " << TQString::fromUtf8(line) << endl; + + position = line.find( ":" ); + if ( position == -1 ) { + // strange: we did not find a fieldname + fieldname = ""; + TQCString str; + str = line.stripWhiteSpace(); + linelen = str.length(); + data = str.data(); + tmp.setRawData( data, linelen ); + value = tmp.copy(); + tmp.resetRawData( data, linelen ); +// kdDebug(5700) << "value : " << value[0] << endl; + return false; + } + + linelen = line.length(); + + if ( linelen > ( position + 1 ) && line[ position + 1 ] == ':' ) { + // String is BASE64 encoded -> decode it now. + fieldname = TQString::fromUtf8( + line.left( position ).stripWhiteSpace() ); + if ( linelen <= ( position + 3 ) ) { + value.resize( 0 ); + return false; + } + data = &line.data()[ position + 3 ]; + tmp.setRawData( data, linelen - position - 3 ); + KCodecs::base64Decode( tmp, value ); + tmp.resetRawData( data, linelen - position - 3 ); + return false; + } + + if ( linelen > ( position + 1 ) && line[ position + 1 ] == '<' ) { + // String is an URL. + fieldname = TQString::fromUtf8( + line.left( position ).stripWhiteSpace() ); + if ( linelen <= ( position + 3 ) ) { + value.resize( 0 ); + return false; + } + data = &line.data()[ position + 3]; + tmp.setRawData( data, linelen - position - 3 ); + value = tmp.copy(); + tmp.resetRawData( data, linelen - position - 3 ); + return true; + } + + fieldname = TQString::fromUtf8(line.left( position ).stripWhiteSpace()); + if ( linelen <= ( position + 2 ) ) { + value.resize( 0 ); + return false; + } + data = &line.data()[ position + 2 ]; + tmp.setRawData( data, linelen - position - 2 ); + value = tmp.copy(); + tmp.resetRawData( data, linelen - position - 2 ); + return false; +} + +bool LDIF::splitControl( const TQCString &line, TQString &oid, bool &critical, + TQByteArray &value ) +{ + TQString tmp; + critical = false; + bool url = splitLine( line, tmp, value ); + + kdDebug(5700) << "splitControl: value: " << TQString(TQString::fromUtf8(value, value.size())) << endl; + if ( tmp.isEmpty() ) { + tmp = TQString::fromUtf8( value, value.size() ); + value.resize( 0 ); + } + if ( tmp.right( 4 ) == "true" ) { + critical = true; + tmp.truncate( tmp.length() - 5 ); + } else if ( tmp.right( 5 ) == "false" ) { + critical = false; + tmp.truncate( tmp.length() - 6 ); + } + oid = tmp; + return url; +} + +LDIF::ParseVal LDIF::processLine() +{ + + if ( mIsComment ) return None; + + ParseVal retval = None; + if ( mLastParseVal == EndEntry ) mEntryType = Entry_None; + + mUrl = splitLine( line, mAttr, mVal ); + + TQString attrLower = mAttr.lower(); + + switch ( mEntryType ) { + case Entry_None: + if ( attrLower == "version" ) { + if ( !mDn.isEmpty() ) retval = Err; + } else if ( attrLower == "dn" ) { + kdDebug(5700) << "ldapentry dn: " << TQString(TQString::fromUtf8( mVal, mVal.size() )) << endl; + mDn = TQString::fromUtf8( mVal, mVal.size() ); + mModType = Mod_None; + retval = NewEntry; + } else if ( attrLower == "changetype" ) { + if ( mDn.isEmpty() ) + retval = Err; + else { + TQString tmpval = TQString::fromUtf8( mVal, mVal.size() ); + kdDebug(5700) << "changetype: " << tmpval << endl; + if ( tmpval == "add" ) mEntryType = Entry_Add; + else if ( tmpval == "delete" ) mEntryType = Entry_Del; + else if ( tmpval == "modrdn" || tmpval == "moddn" ) { + mNewRdn = ""; + mNewSuperior = ""; + mDelOldRdn = true; + mEntryType = Entry_Modrdn; + } + else if ( tmpval == "modify" ) mEntryType = Entry_Mod; + else retval = Err; + } + } else if ( attrLower == "control" ) { + mUrl = splitControl( TQCString( mVal, mVal.size() + 1 ), mOid, mCritical, mVal ); + retval = Control; + } else if ( !mAttr.isEmpty() && mVal.size() > 0 ) { + mEntryType = Entry_Add; + retval = Item; + } + break; + case Entry_Add: + if ( mAttr.isEmpty() && mVal.size() == 0 ) + retval = EndEntry; + else + retval = Item; + break; + case Entry_Del: + if ( mAttr.isEmpty() && mVal.size() == 0 ) + retval = EndEntry; + else + retval = Err; + break; + case Entry_Mod: + if ( mModType == Mod_None ) { + kdDebug(5700) << "tdeio_ldap: new modtype " << mAttr << endl; + if ( mAttr.isEmpty() && mVal.size() == 0 ) { + retval = EndEntry; + } else if ( attrLower == "add" ) { + mModType = Mod_Add; + } else if ( attrLower == "replace" ) { + mModType = Mod_Replace; + mAttr = TQString::fromUtf8( mVal, mVal.size() ); + mVal.resize( 0 ); + retval = Item; + } else if ( attrLower == "delete" ) { + mModType = Mod_Del; + mAttr = TQString::fromUtf8( mVal, mVal.size() ); + mVal.resize( 0 ); + retval = Item; + } else { + retval = Err; + } + } else { + if ( mAttr.isEmpty() ) { + if ( TQString::fromUtf8( mVal, mVal.size() ) == "-" ) { + mModType = Mod_None; + } else if ( mVal.size() == 0 ) { + retval = EndEntry; + } else + retval = Err; + } else + retval = Item; + } + break; + case Entry_Modrdn: + if ( mAttr.isEmpty() && mVal.size() == 0 ) + retval = EndEntry; + else if ( attrLower == "newrdn" ) + mNewRdn = TQString::fromUtf8( mVal, mVal.size() ); + else if ( attrLower == "newsuperior" ) + mNewSuperior = TQString::fromUtf8( mVal, mVal.size() ); + else if ( attrLower == "deleteoldrdn" ) { + if ( mVal.size() > 0 && mVal[0] == '0' ) + mDelOldRdn = false; + else if ( mVal.size() > 0 && mVal[0] == '1' ) + mDelOldRdn = true; + else + retval = Err; + } else + retval = Err; + break; + } + return retval; +} + +LDIF::ParseVal LDIF::nextItem() +{ + ParseVal retval = None; + char c=0; + + while( retval == None ) { + if ( mPos < mLdif.size() ) { + c = mLdif[mPos]; + mPos++; + if ( mIsNewLine && c == '\r' ) continue; //handle \n\r line end + if ( mIsNewLine && ( c == ' ' || c == '\t' ) ) { //line folding + mIsNewLine = false; + continue; + } + if ( mIsNewLine ) { + mIsNewLine = false; + retval = processLine(); + mLastParseVal = retval; + line.resize( 0 ); + mIsComment = ( c == '#' ); + } + if ( c == '\n' || c == '\r' ) { + mLineNo++; + mIsNewLine = true; + continue; + } + } else { + retval = MoreData; + break; + } + + if ( !mIsComment ) line += c; + } + return retval; +} + +void LDIF::endLDIF() +{ + TQByteArray tmp( 3 ); + tmp[ 0 ] = '\n'; + tmp[ 1 ] = '\n'; + tmp[ 2 ] = '\n'; + mLdif = tmp; + mPos = 0; +} + +void LDIF::startParsing() +{ + mPos = mLineNo = 0; + mDelOldRdn = false; + mEntryType = Entry_None; + mModType = Mod_None; + mDn = mNewRdn = mNewSuperior = ""; + line = ""; + mIsNewLine = false; + mIsComment = false; + mLastParseVal = None; +} diff --git a/tdeabc/ldif.h b/tdeabc/ldif.h new file mode 100644 index 000000000..f4da5f4f3 --- /dev/null +++ b/tdeabc/ldif.h @@ -0,0 +1,182 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Szombathelyi Gyorgy + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef _K_LDIF_H_ +#define _K_LDIF_H_ + +#include +#include +#include + +#include + +namespace KABC { + + /** + * LDIF + + * LDIF implements an RFC 2849 compliant LDIF parser. LDIF files are used to + * represent directory information on LDAP-based servers, or to describe a set + * of changes which are to be applied to a directory. + */ + + class KABC_EXPORT LDIF + { + public: + + enum ParseVal{ None, NewEntry, EndEntry, Item, Control, Err, MoreData }; + enum EntryType{ Entry_None, Entry_Add, Entry_Del, Entry_Mod, Entry_Modrdn }; + enum ModType{ Mod_None, Mod_Add, Mod_Replace, Mod_Del }; + LDIF(); + virtual ~LDIF(); + + /** + * Assembles fieldname and value into a valid LDIF line, BASE64 encodes the + * value if neccessary and optionally splits into more lines. + * @param fieldname The name of the entry. + * @param value The value of the entry. + * @param linelen Maximum length of the lines in the result. + * @param url If true, encode value as url ( use :< ). + */ + static TQCString assembleLine( const TQString &fieldname, + const TQByteArray &value, uint linelen=0, bool url=false ); + /** + * This is the same as the above function, the only difference that + * this accepts TQCString as the value. + */ + static TQCString assembleLine( const TQString &fieldname, + const TQCString &value, uint linelen=0, bool url=false ); + /** + * This is the same as the above function, the only difference that + * this accepts TQString as the value. + */ + static TQCString assembleLine( const TQString &fieldname, + const TQString &value, uint linelen=0, bool url=false ); + + /** + * Splits one line from an LDIF file to attribute and value components. + * @returns true if value is an URL, false otherwise + */ + static bool splitLine( const TQCString &line, TQString &fieldname, TQByteArray &value ); + /** + * Splits a control specification (without the "control:" directive) + * @param line is the control directive + * @param oid will contain the OID + * @param critical will contain the criticality of control + * @param value is the control value + */ + static bool splitControl( const TQCString &line, TQString &oid, bool &critical, + TQByteArray &value ); + /** + * Starts the parsing of a new LDIF + */ + void startParsing(); + /** + * Process one LDIF line + */ + ParseVal processLine(); + /** + * Process the LDIF until a complete item can be returned + * @returns NewEntry if a new DN encountered, + * Item if a new item returned, + * Err if the LDIF contains error, + * EndEntry if the parser reached the end of the current entry + * and MoreData if the parser encountered the end of the current chunk of + * the LDIF. If you want to finish the parsing after receiving + * MoreData, then call endLDIF(), so the parser can safely flush + * the current entry. + */ + ParseVal nextItem(); + /** + * Sets a chunk of LDIF. Call before startParsing(), or if nextItem() returned + * MoreData. + */ + void setLDIF( const TQByteArray &ldif ) { mLdif = ldif; mPos = 0; } + /** + * Indicates the end of the LDIF file/stream. Call if nextItem() returned + * MoreData, but actually you don't have more data. + */ + void endLDIF(); + /** + * Returns the requested LDAP operation extracted from the current entry. + */ + EntryType entryType() const { return mEntryType; } + /** + * Returns the LDAP modify request type if entryType() returned Entry_Mod. + */ + int modType() const { return mModType; } + /** + * Returns the Distinguished Name of the current entry. + */ + const TQString& dn() const { return mDn; } + /** + * Returns the new Relative Distinguished Name if modType() returned Entry_Modrdn. + */ + const TQString& newRdn() const { return mNewRdn; } + /** + * Returns the new parent of the entry if modType() returned Entry_Modrdn. + */ + const TQString& newSuperior() const { return mNewSuperior; } + /** + * Returns if the delete of the old RDN is required. + */ + bool delOldRdn() const { return mDelOldRdn; } + /** + * Returns the attribute name. + */ + const TQString& attr() const { return mAttr; } + /** + * Returns the attribute value. + */ + const TQByteArray& val() const { return mVal; } + /** + * Returns if val() is an url + */ + bool isUrl() const { return mUrl; } + /** + * Returns the criticality level when modType() returned Control. + */ + bool critical() const { return mCritical; } + /** + * Returns the OID when modType() returned Control. + */ + const TQString& oid() const { return mOid; } + /** + * Returns the line number which the parser processes. + */ + uint lineNo() const { return mLineNo; } + private: + int mModType; + bool mDelOldRdn, mUrl; + TQString mDn,mAttr,mNewRdn,mNewSuperior, mOid; + TQByteArray mLdif, mVal; + EntryType mEntryType; + + bool mIsNewLine, mIsComment,mCritical; + ParseVal mLastParseVal; + uint mPos,mLineNo; + TQCString line; + + class LDIFPrivate; + LDIFPrivate *d; + }; +} + +#endif diff --git a/tdeabc/ldifconverter.cpp b/tdeabc/ldifconverter.cpp new file mode 100644 index 000000000..dcab83a40 --- /dev/null +++ b/tdeabc/ldifconverter.cpp @@ -0,0 +1,573 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Helge Deller + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +/* + Useful links: + - http://tldp.org/HOWTO/LDAP-Implementation-HOWTO/schemas.html + - http://www.faqs.org/rfcs/rfc2849.html + + Not yet handled items: + - objectclass microsoftaddressbook + - info, + - initials, + - otherfacsimiletelephonenumber, + - otherpager, + - physicaldeliveryofficename, +*/ + +#include +#include +#include +#include + +#include +#include +#include + +#include "addressee.h" +#include "address.h" + +#include "ldif.h" +#include "ldifconverter.h" +#include "vcardconverter.h" + +using namespace KABC; + +/* generate LDIF stream */ + +bool LDIFConverter::addresseeToLDIF( const AddresseeList &addrList, TQString &str ) +{ + AddresseeList::ConstIterator it; + for ( it = addrList.begin(); it != addrList.end(); ++it ) { + addresseeToLDIF( *it, str ); + } + return true; +} + + + +static void ldif_out( TQTextStream &t, TQString formatStr, TQString value ) +{ + if ( value.isEmpty() ) + return; + + TQCString txt = LDIF::assembleLine( formatStr, value, 72 ); + + // write the string + t << TQString::fromUtf8(txt) << "\n"; +} + +bool LDIFConverter::addresseeToLDIF( const Addressee &addr, TQString &str ) +{ + if ( addr.isEmpty() ) + return false; + + TQTextStream t( str, IO_WriteOnly|IO_Append ); + t.setEncoding( TQTextStream::UnicodeUTF8 ); + + const Address homeAddr = addr.address( Address::Home ); + const Address workAddr = addr.address( Address::Work ); + + ldif_out( t, "dn", TQString( "cn=%1,mail=%2" ) + .arg( TQString(addr.formattedName()).simplifyWhiteSpace() ) + .arg( addr.preferredEmail() ) ); + ldif_out( t, "givenname", addr.givenName() ); + ldif_out( t, "sn", addr.familyName() ); + ldif_out( t, "cn", TQString(addr.formattedName()).simplifyWhiteSpace() ); + ldif_out( t, "uid", addr.uid() ); + ldif_out( t, "nickname", addr.nickName() ); + ldif_out( t, "xmozillanickname", addr.nickName() ); + + ldif_out( t, "mail", addr.preferredEmail() ); + if ( addr.emails().count() > 1 ) + ldif_out( t, "mozillasecondemail", addr.emails()[ 1 ] ); +//ldif_out( t, "mozilla_AIMScreenName: %1\n", "screen_name" ); + + ldif_out( t, "telephonenumber", addr.phoneNumber( PhoneNumber::Work ).number() ); + ldif_out( t, "facsimiletelephonenumber", addr.phoneNumber( PhoneNumber::Fax ).number() ); + ldif_out( t, "homephone", addr.phoneNumber( PhoneNumber::Home ).number() ); + ldif_out( t, "mobile", addr.phoneNumber( PhoneNumber::Cell ).number() ); // Netscape 7 + ldif_out( t, "cellphone", addr.phoneNumber( PhoneNumber::Cell ).number() ); // Netscape 4.x + ldif_out( t, "pager", addr.phoneNumber( PhoneNumber::Pager ).number() ); + ldif_out( t, "pagerphone", addr.phoneNumber( PhoneNumber::Pager ).number() ); + + ldif_out( t, "streethomeaddress", homeAddr.street() ); + ldif_out( t, "postalcode", workAddr.postalCode() ); + ldif_out( t, "postofficebox", workAddr.postOfficeBox() ); + + TQStringList streets = TQStringList::split( '\n', homeAddr.street() ); + if ( streets.count() > 0 ) + ldif_out( t, "homepostaladdress", streets[ 0 ] ); // Netscape 7 + if ( streets.count() > 1 ) + ldif_out( t, "mozillahomepostaladdress2", streets[ 1 ] ); // Netscape 7 + ldif_out( t, "mozillahomelocalityname", homeAddr.locality() ); // Netscape 7 + ldif_out( t, "mozillahomestate", homeAddr.region() ); + ldif_out( t, "mozillahomepostalcode", homeAddr.postalCode() ); + ldif_out( t, "mozillahomecountryname", Address::ISOtoCountry(homeAddr.country()) ); + ldif_out( t, "locality", workAddr.locality() ); + ldif_out( t, "streetaddress", workAddr.street() ); // Netscape 4.x + + streets = TQStringList::split( '\n', workAddr.street() ); + if ( streets.count() > 0 ) + ldif_out( t, "postaladdress", streets[ 0 ] ); + if ( streets.count() > 1 ) + ldif_out( t, "mozillapostaladdress2", streets[ 1 ] ); + ldif_out( t, "countryname", Address::ISOtoCountry(workAddr.country()) ); + ldif_out( t, "l", workAddr.locality() ); + ldif_out( t, "c", Address::ISOtoCountry(workAddr.country()) ); + ldif_out( t, "st", workAddr.region() ); + + ldif_out( t, "title", addr.title() ); + ldif_out( t, "vocation", addr.prefix() ); + ldif_out( t, "ou", addr.role() ); + ldif_out( t, "o", addr.organization() ); + ldif_out( t, "organization", addr.organization() ); + ldif_out( t, "organizationname", addr.organization() ); + + // Compatibility with older kabc versions. + if ( !addr.department().isEmpty() ) + ldif_out( t, "department", addr.department() ); + else + ldif_out( t, "department", addr.custom("KADDRESSBOOK", "X-Department") ); + + ldif_out( t, "workurl", addr.url().prettyURL() ); + ldif_out( t, "homeurl", addr.url().prettyURL() ); + ldif_out( t, "description", addr.note() ); + if (addr.revision().isValid()) + ldif_out(t, "modifytimestamp", dateToVCardString( TQT_TQDATETIME_OBJECT(addr.revision())) ); + + t << "objectclass: top\n"; + t << "objectclass: person\n"; + t << "objectclass: organizationalPerson\n"; + + t << "\n"; + + return true; +} + + +/* convert from LDIF stream */ + +bool LDIFConverter::LDIFToAddressee( const TQString &str, AddresseeList &addrList, TQDateTime dt ) +{ + if (str.isEmpty()) + return true; + + bool endldif = false, end = false; + LDIF ldif; + LDIF::ParseVal ret; + const char *latinstr = str.latin1(); + int latinstrlen = tqstrlen( latinstr ); + TQByteArray data; + Addressee a; + Address homeAddr, workAddr; + + data.setRawData( latinstr, latinstrlen ); + ldif.setLDIF( data ); + if (!dt.isValid()) + dt = TQDateTime::currentDateTime(); + a.setRevision(dt); + homeAddr = Address( Address::Home ); + workAddr = Address( Address::Work ); + + do { + ret = ldif.nextItem(); + switch ( ret ) { + case LDIF::Item: { + TQString fieldname = ldif.attr().lower(); + TQString value = TQString::fromUtf8( ldif.val(), ldif.val().size() ); + evaluatePair( a, homeAddr, workAddr, fieldname, value ); + break; + } + case LDIF::EndEntry: + // if the new address is not empty, append it + if ( !a.formattedName().isEmpty() || !a.name().isEmpty() || + !a.familyName().isEmpty() ) { + if ( !homeAddr.isEmpty() ) + a.insertAddress( homeAddr ); + if ( !workAddr.isEmpty() ) + a.insertAddress( workAddr ); + addrList.append( a ); + } + a = Addressee(); + a.setRevision(dt); + homeAddr = Address( Address::Home ); + workAddr = Address( Address::Work ); + break; + case LDIF::MoreData: { + if ( endldif ) + end = true; + else { + ldif.endLDIF(); + endldif = true; + break; + } + } + default: + break; + } + } while ( !end ); + + data.resetRawData( latinstr, latinstrlen ); + + return true; +} + +bool LDIFConverter::evaluatePair( Addressee &a, Address &homeAddr, + Address &workAddr, + TQString &fieldname, TQString &value ) +{ + if ( fieldname == TQString::fromLatin1( "dn" ) ) // ignore & return false! + return false; + + if ( fieldname.startsWith("#") ) { + return true; + } + + if ( fieldname.isEmpty() && !a.note().isEmpty() ) { + // some LDIF export filters are borken and add additional + // comments on stand-alone lines. Just add them to the notes for now. + a.setNote( a.note() + "\n" + value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "givenname" ) ) { + a.setGivenName( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "xmozillanickname") || + fieldname == TQString::fromLatin1( "nickname") ) { + a.setNickName( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "sn" ) ) { + a.setFamilyName( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "uid" ) ) { + a.setUid( value ); + return true; + } + if ( fieldname == TQString::fromLatin1( "mail" ) || + fieldname == TQString::fromLatin1( "mozillasecondemail" ) ) { // mozilla + if ( a.emails().findIndex( value ) == -1 ) + a.insertEmail( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "title" ) ) { + a.setTitle( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "vocation" ) ) { + a.setPrefix( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "cn" ) ) { + a.setFormattedName( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "o" ) || + fieldname == TQString::fromLatin1( "organization" ) || // Exchange + fieldname == TQString::fromLatin1( "organizationname" ) ) { // Exchange + a.setOrganization( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "description" ) ) { +addComment: + if ( !a.note().isEmpty() ) + a.setNote( a.note() + "\n" ); + a.setNote( a.note() + value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "custom1" ) || + fieldname == TQString::fromLatin1( "custom2" ) || + fieldname == TQString::fromLatin1( "custom3" ) || + fieldname == TQString::fromLatin1( "custom4" ) ) { + goto addComment; + } + + if ( fieldname == TQString::fromLatin1( "homeurl" ) || + fieldname == TQString::fromLatin1( "workurl" ) ) { + if (a.url().isEmpty()) { + a.setUrl( KURL( value ) ); + return true; + } + if ( a.url().prettyURL() == KURL(value).prettyURL() ) + return true; + // TODO: current version of kabc only supports one URL. + // TODO: change this with KDE 4 + } + + if ( fieldname == TQString::fromLatin1( "homephone" ) ) { + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Home ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "telephonenumber" ) ) { + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Work ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mobile" ) ) { // mozilla/Netscape 7 + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Cell ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "cellphone" ) ) { + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Cell ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "pager" ) || // mozilla + fieldname == TQString::fromLatin1( "pagerphone" ) ) { // mozilla + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Pager ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "facsimiletelephonenumber" ) ) { + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Fax ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "xmozillaanyphone" ) ) { // mozilla + a.insertPhoneNumber( PhoneNumber( value, PhoneNumber::Work ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "street" ) || + fieldname == TQString::fromLatin1( "streethomeaddress" ) ) { + homeAddr.setStreet( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "postaladdress" ) ) { // mozilla + workAddr.setStreet( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillapostaladdress2" ) ) { // mozilla + workAddr.setStreet( workAddr.street() + TQString::fromLatin1( "\n" ) + value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "postalcode" ) ) { + workAddr.setPostalCode( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "postofficebox" ) ) { + workAddr.setPostOfficeBox( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "homepostaladdress" ) ) { // Netscape 7 + homeAddr.setStreet( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillahomepostaladdress2" ) ) { // mozilla + homeAddr.setStreet( homeAddr.street() + TQString::fromLatin1( "\n" ) + value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillahomelocalityname" ) ) { // mozilla + homeAddr.setLocality( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillahomestate" ) ) { // mozilla + homeAddr.setRegion( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillahomepostalcode" ) ) { // mozilla + homeAddr.setPostalCode( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "mozillahomecountryname" ) ) { // mozilla + if ( value.length() <= 2 ) + value = Address::ISOtoCountry(value); + homeAddr.setCountry( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "locality" ) ) { + workAddr.setLocality( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "streetaddress" ) ) { // Netscape 4.x + workAddr.setStreet( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "countryname" ) || + fieldname == TQString::fromLatin1( "c" ) ) { // mozilla + if ( value.length() <= 2 ) + value = Address::ISOtoCountry(value); + workAddr.setCountry( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "l" ) ) { // mozilla + workAddr.setLocality( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "st" ) ) { + workAddr.setRegion( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "ou" ) ) { + a.setRole( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "department" ) ) { + a.setDepartment( value ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "member" ) ) { + // this is a mozilla list member (cn=xxx, mail=yyy) + TQStringList list( TQStringList::split( ',', value ) ); + TQString name, email; + + TQStringList::Iterator it; + for ( it = list.begin(); it != list.end(); ++it ) { + if ( (*it).startsWith( "cn=" ) ) + name = (*it).mid( 3 ).stripWhiteSpace(); + if ( (*it).startsWith( "mail=" ) ) + email = (*it).mid( 5 ).stripWhiteSpace(); + } + if ( !name.isEmpty() && !email.isEmpty() ) + email = " <" + email + ">"; + a.insertEmail( name + email ); + a.insertCategory( i18n( "List of Emails" ) ); + return true; + } + + if ( fieldname == TQString::fromLatin1( "modifytimestamp" ) ) { + if (value == TQString::fromLatin1("0Z")) // ignore + return true; + TQDateTime dt = VCardStringToDate( value ); + if ( dt.isValid() ) { + a.setRevision(dt); + return true; + } + } + + if ( fieldname == TQString::fromLatin1( "objectclass" ) ) // ignore + return true; + + kdWarning() << TQString(TQString("LDIFConverter: Unknown field for '%1': '%2=%3'\n") + .arg(a.formattedName()).arg(fieldname).arg(value)); + + return true; +} + +/* The following functions are obsoleted. Similar functionality can be found + * in the LDIF class */ + +bool LDIFConverter::parseSingleLine( Addressee &a, Address &homeAddr, + Address &workAddr, TQString &line ) +{ + if ( line.isEmpty() ) + return true; + + TQString fieldname, value; + TQByteArray val; + + LDIF::splitLine( line.latin1(), fieldname, val ); + value = TQString::fromUtf8( val.data(), val.size() ); + return evaluatePair( a, homeAddr, workAddr, fieldname, value); +} + + +bool LDIFConverter::splitLine( TQString &line, TQString &fieldname, TQString &value) +{ + TQByteArray val; + bool ret = LDIF::splitLine( line.latin1(), fieldname, val ); + value = TQString::fromUtf8( val.data(), val.size() ); + return ret; +} + + +TQString LDIFConverter::makeLDIFfieldString( TQString formatStr, TQString value, bool allowEncode ) +{ + if ( value.isEmpty() ) + return TQString(); + + // append format if not given + if (formatStr.find(':') == -1) + formatStr.append(": %1\n"); + + // check if base64-encoding is needed + bool printable = true; + unsigned int i, len; + len = value.length(); + for (i = 0; i=0) + formatStr.insert(p, ':'); + } + + // generate the new string and split it to 72 chars/line + TQCString txt = TQString(formatStr.arg(value)).utf8(); + + if (allowEncode) { + len = txt.length(); + if (len && txt[len-1] == '\n') + --len; + i = 72; + while (i < len) { + txt.insert(i, "\n "); + i += 72+1; + len += 2; + } + } + + return TQString::fromUtf8(txt); +} + diff --git a/tdeabc/ldifconverter.h b/tdeabc/ldifconverter.h new file mode 100644 index 000000000..a8052a65f --- /dev/null +++ b/tdeabc/ldifconverter.h @@ -0,0 +1,100 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Helge Deller + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 only as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_LDIFCONVERTER_H +#define KABC_LDIFCONVERTER_H + +#include +#include + +#include "addressee.h" +#include "addresseelist.h" + +namespace KABC { + + /** + * A set of functions to convert a string with LDIF information to addressees + * and vice versa. It is useful for addressbook import- and exportfilters + * and might be used to read and write Mozilla and Netscape addresssbooks. + */ + + namespace LDIFConverter { + + /** + * Converts a LDIF string to a list of addressees. + * + * @param str The vcard string. + * @param addrList The addresseelist. + * @param dt The date & time value of the last modification (e.g. file modification time). + * @since 3.2 + */ + KABC_EXPORT bool LDIFToAddressee( const TQString &str, AddresseeList &addrList, TQDateTime dt = TQDateTime::currentDateTime() ); + + /** + * Converts a list of addressees to a LDIF string. + * + * @param addrList The addresseelist. + * @param str The LDIF string. + * @since 3.2 + */ + KABC_EXPORT bool addresseeToLDIF( const AddresseeList &addrList, TQString &str ); + + /** + * Converts an addressee to a LDIF string. + * + * @param addr The addressee. + * @param str The LDIF string. + * @since 3.2 + */ + KABC_EXPORT bool addresseeToLDIF( const Addressee &addr, TQString &str ); + + /** + * @deprecated + * Obsoleted - please use LDIF::assembleLine() + * Returns a LDIF compatible string representing a given field/value pair. + * If necessary, the value parameter will be base64encoded and split into multiple. + * This function will return an empty string if the given value is empty. + * + * @param field The LDAP field name or a complete LDIF field string (e.g. "cn" or "cn = %1\n"). + * @param value The value for this field. + * @param allowEncode Set to false if you wish no encoding of the value. + * @since 3.2 + */ + KABC_EXPORT TQString makeLDIFfieldString( TQString field, TQString value, bool allowEncode = true ) KDE_DEPRECATED; + + + + /* internal functions - do not use !! */ + + /** No need for this function anymore - use LDIF::splitLine() + evaluatePair() */ + KABC_EXPORT bool parseSingleLine( Addressee &a, + Address &homeAddr, Address &workAddr, TQString &line ); + + /** No need for this function anymore - use LDIF::splitLine() */ + KABC_EXPORT bool splitLine( TQString &line, TQString &fieldname, TQString &value); + + + KABC_EXPORT bool evaluatePair( Addressee &a, Address &homeAddr, Address &workAddr, + TQString &fieldname, TQString &value ); + + } + +} +#endif + diff --git a/tdeabc/lock.cpp b/tdeabc/lock.cpp new file mode 100644 index 000000000..a78cb4c5b --- /dev/null +++ b/tdeabc/lock.cpp @@ -0,0 +1,162 @@ +/* + This file is part of libkabc. + Copyright (c) 2001,2003 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "lock.h" + +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include + +using namespace KABC; + +Lock::Lock( const TQString &identifier ) + : mIdentifier( identifier ) +{ + mIdentifier.replace( "/", "_" ); +} + +Lock::~Lock() +{ + unlock(); +} + +TQString Lock::locksDir() +{ + return locateLocal( "data", "tdeabc/lock/" ); +} + +bool Lock::readLockFile( const TQString &filename, int &pid, TQString &app ) +{ + TQFile file( filename ); + if ( !file.open( IO_ReadOnly ) ) return false; + + TQTextStream t( &file ); + pid = t.readLine().toInt(); + app = t.readLine(); + + return true; +} + +bool Lock::writeLockFile( const TQString &filename ) +{ + TQFile file( filename ); + if ( !file.open( IO_WriteOnly ) ) return false; + TQTextStream t( &file ); + t << ::getpid() << endl << TQString( TDEGlobal::instance()->instanceName() ); + + return true; +} + +TQString Lock::lockFileName() const +{ + return locksDir() + mIdentifier + ".lock"; +} + +bool Lock::lock() +{ + kdDebug(5700) << "Lock::lock()" << endl; + + TQString lockName = lockFileName(); + kdDebug(5700) << "-- lock name: " << lockName << endl; + + if ( TQFile::exists( lockName ) ) { // check if it is a stale lock file + int pid; + TQString app; + + if ( !readLockFile( lockFileName(), pid, app ) ) { + mError = i18n("Unable to open lock file."); + return false; + } + + int retval = ::kill( pid, 0 ); + if ( retval == -1 && errno == ESRCH ) { // process doesn't exists anymore + TQFile::remove( lockName ); + kdWarning(5700) << "Removed stale lock file from process '" << app << "'" + << endl; + } else { + TQString identifier( mIdentifier ); + identifier.replace( '_', '/' ); + + mError = i18n("The address book '%1' is locked by application '%2'.\nIf you believe this is incorrect, just remove the lock file from '%3'") + .arg( identifier ).arg( app ).arg( locateLocal( "data", "tdeabc/lock/*.lock" ) ); + return false; + } + } + + TQString lockUniqueName; + lockUniqueName = mIdentifier + kapp->randomString( 8 ); + mLockUniqueName = locateLocal( "data", "tdeabc/lock/" + lockUniqueName ); + kdDebug(5700) << "-- lock unique name: " << mLockUniqueName << endl; + + // Create unique file + writeLockFile( mLockUniqueName ); + + // Create lock file + int result = ::link( TQFile::encodeName( mLockUniqueName ), + TQFile::encodeName( lockName ) ); + + if ( result == 0 ) { + mError = ""; + emit locked(); + return true; + } + + // TODO: check stat + + mError = i18n("Error"); + return false; +} + +bool Lock::unlock() +{ + int pid; + TQString app; + if ( readLockFile( lockFileName(), pid, app ) ) { + if ( pid == getpid() ) { + TQFile::remove( lockFileName() ); + TQFile::remove( mLockUniqueName ); + emit unlocked(); + } else { + mError = i18n("Unlock failed. Lock file is owned by other process: %1 (%2)") + .arg( app ).arg( TQString::number( pid ) ); + kdDebug() << "Lock::unlock(): " << mError << endl; + return false; + } + } + + mError = ""; + return true; +} + +TQString Lock::error() const +{ + return mError; +} + +#include "lock.moc" diff --git a/tdeabc/lock.h b/tdeabc/lock.h new file mode 100644 index 000000000..addc2032f --- /dev/null +++ b/tdeabc/lock.h @@ -0,0 +1,88 @@ +/* + This file is part of libkabc. + + Copyright (c) 2001,2003 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef KABC_LOCK_H +#define KABC_LOCK_H + +#include +#include + +#include + +namespace KABC { + +/** + This class provides locking functionality for a file, directory or an + arbitrary string-represented resource. +*/ +class KABC_EXPORT Lock : public TQObject +{ + Q_OBJECT + public: + /** + Constructor. + + @param identifier An identifier for the resource to be locked, e.g. a file + name. + */ + Lock( const TQString &identifier ); + + /** + Destruct lock object. This also removes the lock on the resource. + */ + ~Lock(); + + /** + Lock resource. + */ + virtual bool lock(); + + /** + Unlock resource. + */ + virtual bool unlock(); + + virtual TQString error() const; + + TQString lockFileName() const; + + static bool readLockFile( const TQString &filename, int &pid, TQString &app ); + static bool writeLockFile( const TQString &filename ); + + static TQString locksDir(); + + signals: + void locked(); + void unlocked(); + + private: + TQString mIdentifier; + + TQString mLockUniqueName; + + TQString mError; + + class Private; + Private *d; +}; + +} + +#endif diff --git a/tdeabc/locknull.cpp b/tdeabc/locknull.cpp new file mode 100644 index 000000000..5f3ee06c7 --- /dev/null +++ b/tdeabc/locknull.cpp @@ -0,0 +1,63 @@ +/* + This file is part of libkabc. + + Copyright (c) 2003 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "locknull.h" + +#include +#include + +using namespace KABC; + +LockNull::LockNull( bool allowAccess ) + : Lock( TQString::null ), mAllowAccess( allowAccess ) +{ +} + +LockNull::~LockNull() +{ + unlock(); +} + +bool LockNull::lock() +{ + if ( !mAllowAccess ) return false; + + kdWarning() << "LockNull::lock() force success. Doesn't actually lock." + << endl; + + emit locked(); + + return true; +} + +bool LockNull::unlock() +{ + emit unlocked(); + return true; +} + +TQString LockNull::error() const +{ + if ( mAllowAccess ) + return i18n("LockNull: All locks succeed but no actual locking is done."); + else + return i18n("LockNull: All locks fail."); +} diff --git a/tdeabc/locknull.h b/tdeabc/locknull.h new file mode 100644 index 000000000..dfefe122a --- /dev/null +++ b/tdeabc/locknull.h @@ -0,0 +1,54 @@ +/* + This file is part of libkabc. + + Copyright (c) 2003 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef KABC_LOCKNULL_H +#define KABC_LOCKNULL_H + +#include + +#include "lock.h" + +namespace KABC { + +/** + This class provides a lock without actually locking. It can be constructed in + two ways: One that let all locks succeed and one that let all locks fail. +*/ +class KABC_EXPORT LockNull : public Lock +{ + public: + LockNull( bool allowAccess ); + ~LockNull(); + + bool lock(); + bool unlock(); + + TQString error() const; + + private: + bool mAllowAccess; + + class Private; + Private *d; +}; + +} + +#endif diff --git a/tdeabc/phonenumber.cpp b/tdeabc/phonenumber.cpp new file mode 100644 index 000000000..fd2468c73 --- /dev/null +++ b/tdeabc/phonenumber.cpp @@ -0,0 +1,213 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include "phonenumber.h" + +using namespace KABC; + +PhoneNumber::PhoneNumber() : + mType( Home ) +{ + init(); +} + +PhoneNumber::PhoneNumber( const TQString &number, int type ) : + mType( type ) +{ + init(); + + validateNumber( number ); +} + +PhoneNumber::~PhoneNumber() +{ +} + +void PhoneNumber::init() +{ + mId = TDEApplication::randomString( 8 ); +} + +void PhoneNumber::validateNumber( const TQString &number ) +{ + mNumber = number; + + // remove line breaks + mNumber = mNumber.replace( '\n', "" ); + mNumber = mNumber.replace( '\r', "" ); +} + +bool PhoneNumber::operator==( const PhoneNumber &p ) const +{ + if ( mNumber != p.mNumber ) return false; + if ( mType != p.mType ) return false; + + return true; +} + +bool PhoneNumber::operator!=( const PhoneNumber &p ) const +{ + return !( p == *this ); +} + +void PhoneNumber::setId( const TQString &id ) +{ + mId = id; +} + +TQString PhoneNumber::id() const +{ + return mId; +} + +void PhoneNumber::setNumber( const TQString &number ) +{ + validateNumber( number ); +} + +TQString PhoneNumber::number() const +{ + return mNumber; +} + +void PhoneNumber::setType( int type ) +{ + mType = type; +} + +int PhoneNumber::type() const +{ + return mType; +} + +TQString PhoneNumber::typeLabel() const +{ + TQString label; + bool first = true; + + const TypeList list = typeList(); + + TypeList::ConstIterator it; + for ( it = list.begin(); it != list.end(); ++it ) { + if ( ( type() & (*it) ) && ( (*it) != Pref ) ) { + label.append( ( first ? "" : "/" ) + typeLabel( *it ) ); + if ( first ) + first = false; + } + } + + return label; +} + +TQString PhoneNumber::label() const +{ + return typeLabel( type() ); +} + +PhoneNumber::TypeList PhoneNumber::typeList() +{ + static TypeList list; + + if ( list.isEmpty() ) { + list << Home << Work << Msg << Pref << Voice << Fax << Cell << Video + << Bbs << Modem << Car << Isdn << Pcs << Pager; + } + + return list; +} + +TQString PhoneNumber::label( int type ) +{ + return typeLabel( type ); +} + +TQString PhoneNumber::typeLabel( int type ) +{ + if ( type & Pref ) + return i18n( "Preferred phone", "Preferred" ); + + switch ( type ) { + case Home: + return i18n("Home phone", "Home"); + break; + case Work: + return i18n("Work phone", "Work"); + break; + case Msg: + return i18n("Messenger"); + break; + case Pref: + return i18n("Preferred Number"); + break; + case Voice: + return i18n("Voice"); + break; + case Fax: + return i18n("Fax"); + break; + case Cell: + return i18n("Mobile Phone", "Mobile" ); + break; + case Video: + return i18n("Video"); + break; + case Bbs: + return i18n("Mailbox"); + break; + case Modem: + return i18n("Modem"); + break; + case Car: + return i18n("Car Phone", "Car" ); + break; + case Isdn: + return i18n("ISDN"); + break; + case Pcs: + return i18n("PCS"); + break; + case Pager: + return i18n("Pager"); + break; + case Home | Fax: + return i18n("Home Fax"); + break; + case Work | Fax: + return i18n("Work Fax"); + break; + default: + return i18n("Other"); + } +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const PhoneNumber &phone ) +{ + return s << phone.mId << phone.mType << phone.mNumber; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, PhoneNumber &phone ) +{ + s >> phone.mId >> phone.mType >> phone.mNumber; + + return s; +} diff --git a/tdeabc/phonenumber.h b/tdeabc/phonenumber.h new file mode 100644 index 000000000..3e6ae0941 --- /dev/null +++ b/tdeabc/phonenumber.h @@ -0,0 +1,161 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_PHONENUMBER_H +#define KABC_PHONENUMBER_H + +#include +#include + +#include + +namespace KABC { + +/** + @short Phonenumber information. + + This class provides phone number information. A phone number is classified by + a type. The following types are available, it's possible to use multiple types + Types for a number by combining them through a logical or. +*/ +class KABC_EXPORT PhoneNumber +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const PhoneNumber & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, PhoneNumber & ); + + public: + typedef TQValueList List; + typedef TQValueList TypeList; + + /** + @li @p Home - Home number + @li @p Work - Office number + @li @p Msg - Messaging + @li @p Pref - Preferred number + @li @p Voice - Voice + @li @p Fax - Fax machine + @li @p Cell - Cell phone + @li @p Video - Video phone + @li @p Bbs - Mailbox + @li @p Modem - Modem + @li @p Car - Car phone + @li @p Isdn - ISDN connection + @li @p Pcs - Personal Communication Service + @li @p Pager - Pager + */ + enum Types { Home = 1, Work = 2, Msg = 4, Pref = 8, Voice = 16, Fax = 32, + Cell = 64, Video = 128, Bbs = 256, Modem = 512, Car = 1024, + Isdn = 2048, Pcs = 4096, Pager = 8192 }; + + /** + Create an empty phone number object. + */ + PhoneNumber(); + + /** + Create a phonenumber object. + + @param number Number + @param type Type as defined in enum. Multiple types can be + specified by combining them by a logical or. + */ + PhoneNumber( const TQString &number, int type = Home ); + + /** + Destructor. + */ + ~PhoneNumber(); + + bool operator==( const PhoneNumber & ) const; + bool operator!=( const PhoneNumber & ) const; + + /** + Sets the unique identifier. + */ + void setId( const TQString &id ); + + /** + Returns the unique identifier. + */ + TQString id() const; + + /** + Sets the number. + */ + void setNumber( const TQString & ); + + /** + Returns the number. + */ + TQString number() const; + + /** + Sets the type. Multiple types can be specified by combining them by + a logical or. + */ + void setType( int ); + + /** + Returns the type. Can be a multiple types combined by a logical or. + */ + int type() const; + + /** + Returns a translated string of all types the address has. + */ + TQString typeLabel() const; + + /** + Returns the translated label for phone number depending on its type. + */ + TQString label() const; + + /** + Returns a list of all available types + */ + static TypeList typeList(); + + /** + Returns the translated label for phone number type. + */ + static TQString typeLabel( int type ); + + /** + Returns the translated label for phone number type. + @obsolete + */ + static TQString label( int type ); + + private: + void init(); + void validateNumber( const TQString& ); + + TQString mId; + + int mType; + TQString mNumber; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const PhoneNumber & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, PhoneNumber & ); + +} + +#endif diff --git a/tdeabc/picture.cpp b/tdeabc/picture.cpp new file mode 100644 index 000000000..4ddd3f537 --- /dev/null +++ b/tdeabc/picture.cpp @@ -0,0 +1,120 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "picture.h" + +using namespace KABC; + +Picture::Picture() + : mIntern( false ) +{ +} + +Picture::Picture( const TQString &url ) + : mUrl( url ), mIntern( false ) +{ +} + +Picture::Picture( const TQImage &data ) + : mData( data ), mIntern( true ) +{ +} + +Picture::~Picture() +{ +} + +bool Picture::operator==( const Picture &p ) const +{ + if ( mIntern != p.mIntern ) return false; + + if ( mIntern ) { + if ( mData != p.mData ) + return false; + } else { + if ( mUrl != p.mUrl ) + return false; + } + + return true; +} + +bool Picture::operator!=( const Picture &p ) const +{ + return !( p == *this ); +} + +void Picture::setUrl( const TQString &url ) +{ + mUrl = url; + mIntern = false; +} + +void Picture::setData( const TQImage &data ) +{ + mData = data; + mIntern = true; +} + +void Picture::setType( const TQString &type ) +{ + mType = type; +} + +bool Picture::isIntern() const +{ + return mIntern; +} + +TQString Picture::url() const +{ + return mUrl; +} + +TQImage Picture::data() const +{ + return mData; +} + +TQString Picture::type() const +{ + return mType; +} + +TQString Picture::asString() const +{ + if ( mIntern ) + return "intern picture"; + else + return mUrl; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Picture &picture ) +{ + return s << picture.mIntern << picture.mUrl << picture.mType; +// return s << picture.mIntern << picture.mUrl << picture.mType << picture.mData; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Picture &picture ) +{ + s >> picture.mIntern >> picture.mUrl >> picture.mType; +// s >> picture.mIntern >> picture.mUrl >> picture.mType >> picture.mData; + return s; +} diff --git a/tdeabc/picture.h b/tdeabc/picture.h new file mode 100644 index 000000000..e6ed690c2 --- /dev/null +++ b/tdeabc/picture.h @@ -0,0 +1,128 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_PICTURE_H +#define KABC_PICTURE_H + +#include + +#include + +namespace KABC { + +class KABC_EXPORT Picture +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Picture & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Picture & ); + +public: + + /** + * Consturctor. Creates an empty object. + */ + Picture(); + + /** + * Consturctor. + * + * @param url A URL that describes the position of the picture file. + */ + Picture( const TQString &url ); + + /** + * Consturctor. + * + * @param data The raw data of the picture. + */ + Picture( const TQImage &data ); + + /** + * Destructor. + */ + ~Picture(); + + + bool operator==( const Picture & ) const; + bool operator!=( const Picture & ) const; + + /** + * Sets a URL for the location of the picture file. When using this + * function, isIntern() will return 'false' until you use + * setData(). + * + * @param url The location URL of the picture file. + */ + void setUrl( const TQString &url ); + + /** + * Sets the raw data of the picture. When using this function, + * isIntern() will return 'true' until you use setUrl(). + * + * @param data The raw data of the picture. + */ + void setData( const TQImage &data ); + + /** + * Sets the type of the picture. + */ + void setType( const TQString &type ); + + /** + * Returns whether the picture is described by a URL (extern) or + * by the raw data (intern). + * When this method returns 'true' you can use data() to + * get the raw data. Otherwise you can request the URL of this + * picture by url() and load the raw data from that location. + */ + bool isIntern() const; + + /** + * Returns the location URL of this picture. + */ + TQString url() const; + + /** + * Returns the raw data of this picture. + */ + TQImage data() const; + + /** + * Returns the type of this picture. + */ + TQString type() const; + + /** + * Returns string representation of the picture. + */ + TQString asString() const; + +private: + TQString mUrl; + TQString mType; + TQImage mData; + + int mIntern; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Picture & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Picture & ); + +} +#endif diff --git a/tdeabc/plugin.cpp b/tdeabc/plugin.cpp new file mode 100644 index 000000000..a53192559 --- /dev/null +++ b/tdeabc/plugin.cpp @@ -0,0 +1,61 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "plugin.h" + +using namespace KABC; + +Plugin::Plugin() +{ +} + +Plugin::~Plugin() +{ +} + +void Plugin::setType( const TQString& type ) +{ + mType = type; +} + +TQString Plugin::type() const +{ + return mType; +} + +void Plugin::setNameLabel( const TQString& label ) +{ + mNameLabel = label; +} + +TQString Plugin::nameLabel() const +{ + return mNameLabel; +} + +void Plugin::setDescriptionLabel( const TQString& label ) +{ + mDescriptionLabel = label; +} + +TQString Plugin::descriptionLabel() const +{ + return mDescriptionLabel; +} diff --git a/tdeabc/plugin.h b/tdeabc/plugin.h new file mode 100644 index 000000000..0c8e3b338 --- /dev/null +++ b/tdeabc/plugin.h @@ -0,0 +1,52 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_PLUGIN_H +#define KABC_PLUGIN_H + +#include + +#include + +namespace KABC { + +class KABC_EXPORT Plugin +{ +public: + Plugin(); + virtual ~Plugin(); + + virtual void setType( const TQString& type ); + virtual TQString type() const; + + virtual void setNameLabel( const TQString& label ); + virtual TQString nameLabel() const; + + virtual void setDescriptionLabel( const TQString& label ); + virtual TQString descriptionLabel() const; + +private: + TQString mType; + TQString mNameLabel; + TQString mDescriptionLabel; +}; + +} +#endif diff --git a/tdeabc/plugins/CMakeLists.txt b/tdeabc/plugins/CMakeLists.txt new file mode 100644 index 000000000..597486816 --- /dev/null +++ b/tdeabc/plugins/CMakeLists.txt @@ -0,0 +1,15 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +add_subdirectory( file ) +add_subdirectory( dir ) +add_subdirectory( net ) +add_subdirectory( ldaptdeio ) diff --git a/tdeabc/plugins/Makefile.am b/tdeabc/plugins/Makefile.am new file mode 100644 index 000000000..bdedbec0f --- /dev/null +++ b/tdeabc/plugins/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = file dir net ldaptdeio diff --git a/tdeabc/plugins/dir/CMakeLists.txt b/tdeabc/plugins/dir/CMakeLists.txt new file mode 100644 index 000000000..fd4161342 --- /dev/null +++ b/tdeabc/plugins/dir/CMakeLists.txt @@ -0,0 +1,73 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/kabc + ${CMAKE_SOURCE_DIR}/kabc + + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + resourcedir.h + DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) + + +##### other data ################################ + +install( FILES dir.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) + + +##### kabc_dir (library) ######################## + +set( target kabc_dir ) + +set( ${target}_SRCS + resourcedir.cpp resourcedirconfig.cpp +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 1.0.0 + LINK tdeabc-shared + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### kabc_dir (module) ######################### + +set( target kabc_dir ) + +set( ${target}_SRCS + resourcedirplugin.cpp +) + +tde_add_kpart( ${target} + SOURCES ${${target}_SRCS} + LINK kabc_dir-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdeabc/plugins/dir/Makefile.am b/tdeabc/plugins/dir/Makefile.am new file mode 100644 index 000000000..94ddad3cc --- /dev/null +++ b/tdeabc/plugins/dir/Makefile.am @@ -0,0 +1,28 @@ +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc -I$(top_builddir) $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourcedirconfig.h + +lib_LTLIBRARIES = libkabc_dir.la +libkabc_dir_la_SOURCES = resourcedir.cpp resourcedirconfig.cpp +libkabc_dir_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined +libkabc_dir_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(top_builddir)/tderesources/libtderesources.la $(LIB_TDECORE) $(LIB_TDEFILE) $(LIB_TDEUI) +libkabc_dir_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + +kde_module_LTLIBRARIES = kabc_dir.la +kabc_dir_la_SOURCES = resourcedirplugin.cpp +kabc_dir_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -no-undefined +kabc_dir_la_LIBADD = libkabc_dir.la $(LIB_QT) $(LIB_TDECORE) + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_dir.pot + +kabcincludedir = $(includedir)/kabc +kabcinclude_HEADERS = resourcedir.h + +servicedir = $(kde_servicesdir)/tderesources/kabc +service_DATA = dir.desktop + +resourcedirplugin.lo: ../../addressee.h diff --git a/tdeabc/plugins/dir/dir.desktop b/tdeabc/plugins/dir/dir.desktop new file mode 100644 index 000000000..a841040f9 --- /dev/null +++ b/tdeabc/plugins/dir/dir.desktop @@ -0,0 +1,92 @@ +[Desktop Entry] +Name=Directory +Name[af]=Gids +Name[ar]=دليل +Name[az]=Cərgə +Name[be]=Тэчка +Name[bn]=ডিরেক্টরি +Name[br]=Renkell +Name[bs]=Direktorij +Name[ca]=Directori +Name[cs]=Adresář +Name[csb]=Katalog +Name[cy]=Cyfeiriadur +Name[da]=Mappe +Name[de]=Verzeichnis +Name[el]=Κατάλογος +Name[eo]=Dosierujo +Name[es]=Directorio +Name[et]=Kataloog +Name[eu]=Direktorioa +Name[fa]=فهرست راهنما +Name[fi]=Hakemisto +Name[fo]=Fíluskrá +Name[fr]=Dossier +Name[fy]=Map +Name[ga]=Comhadlann +Name[gl]=Directório +Name[he]=ספריה +Name[hi]=डिरेक्ट्री +Name[hr]=Mapa +Name[hsb]=Zapisk +Name[hu]=Könyvtár +Name[id]=Direktori +Name[is]=Mappa +Name[it]=Cartella +Name[ja]=ディレクトリ +Name[ka]=დასტა +Name[kk]=Каталог +Name[km]=ថត +Name[ko]=자료방 +Name[ku]=Peldank +Name[lb]=Verzeechnis +Name[lt]=Aplankas +Name[lv]=Direktorija +Name[mk]=Именик +Name[mn]=Лавлах +Name[ms]=Direktori +Name[mt]=Direttorju +Name[nb]=Katalog +Name[nds]=Orner +Name[ne]=डाइरेक्टरी +Name[nl]=Map +Name[nn]=Katalog +Name[nso]=Tshupetso +Name[oc]=Directori +Name[pa]=ਡਾਇਰੈਕਟਰੀ +Name[pl]=Katalog +Name[pt]=Directoria +Name[pt_BR]=Diretório +Name[ro]=Director +Name[ru]=Каталог +Name[rw]=ububiko +Name[se]=Ohcu +Name[sk]=Priečinok +Name[sl]=Imenik +Name[sq]=Fioka +Name[sr]=Фасцикла +Name[sr@Latn]=Fascikla +Name[ss]=I-directory +Name[sv]=Katalog +Name[ta]=அடைவு +Name[te]=డైరక్టరి +Name[tg]=Феҳраст +Name[th]=ไดเรกทอรี +Name[tr]=Dizin +Name[tt]=Törgäk +Name[uk]=Каталог +Name[uz]=Jild +Name[uz@cyrillic]=Жилд +Name[ven]=Tsumbavhulwo +Name[vi]=Thư mục +Name[wa]=Ridant +Name[xh]=Ulawulo +Name[zh_CN]=目录 +Name[zh_HK]=目錄 +Name[zh_TW]=目錄 +Name[zu]=Uhlu lwamafayela +X-TDE-Library=kabc_dir +Type=Service +ServiceTypes=KResources/Plugin +X-TDE-ResourceFamily=contact +X-TDE-ResourceType=dir diff --git a/tdeabc/plugins/dir/resourcedir.cpp b/tdeabc/plugins/dir/resourcedir.cpp new file mode 100644 index 000000000..53f178a6d --- /dev/null +++ b/tdeabc/plugins/dir/resourcedir.cpp @@ -0,0 +1,310 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 - 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "addressbook.h" +#include "formatfactory.h" +#include "resourcedirconfig.h" +#include "stdaddressbook.h" +#include "lock.h" + +#include "resourcedir.h" + +using namespace KABC; + +extern "C" +{ + void *init_kabc_dir() + { + return new KRES::PluginFactory(); + } +} + + +ResourceDir::ResourceDir( const TDEConfig *config ) + : Resource( config ), mAsynchronous( false ) +{ + if ( config ) { + init( config->readPathEntry( "FilePath", StdAddressBook::directoryName() ), + config->readEntry( "FileFormat", "vcard" ) ); + } else { + init( StdAddressBook::directoryName(), "vcard" ); + } +} + +ResourceDir::ResourceDir( const TQString &path, const TQString &format ) + : Resource( 0 ), mAsynchronous( false ) +{ + init( path, format ); +} + +void ResourceDir::init( const TQString &path, const TQString &format ) +{ + mFormatName = format; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); + + if ( !mFormat ) { + mFormatName = "vcard"; + mFormat = factory->format( mFormatName ); + } + + mLock = 0; + + connect( &mDirWatch, TQT_SIGNAL( dirty(const TQString&) ), TQT_SLOT( pathChanged() ) ); + connect( &mDirWatch, TQT_SIGNAL( created(const TQString&) ), TQT_SLOT( pathChanged() ) ); + connect( &mDirWatch, TQT_SIGNAL( deleted(const TQString&) ), TQT_SLOT( pathChanged() ) ); + + setPath( path ); +} + +ResourceDir::~ResourceDir() +{ + delete mFormat; + mFormat = 0; +} + +void ResourceDir::writeConfig( TDEConfig *config ) +{ + Resource::writeConfig( config ); + + if ( mPath == StdAddressBook::directoryName() ) + config->deleteEntry( "FilePath" ); + else + config->writePathEntry( "FilePath", mPath ); + + config->writeEntry( "FileFormat", mFormatName ); +} + +Ticket *ResourceDir::requestSaveTicket() +{ + kdDebug(5700) << "ResourceDir::requestSaveTicket()" << endl; + + if ( !addressBook() ) return 0; + + delete mLock; + mLock = new Lock( mPath ); + + if ( mLock->lock() ) { + addressBook()->emitAddressBookLocked(); + } else { + addressBook()->error( mLock->error() ); + kdDebug(5700) << "ResourceFile::requestSaveTicket(): Unable to lock path '" + << mPath << "': " << mLock->error() << endl; + return 0; + } + + return createTicket( this ); +} + +void ResourceDir::releaseSaveTicket( Ticket *ticket ) +{ + delete ticket; + + delete mLock; + mLock = 0; +} + +bool ResourceDir::doOpen() +{ + TQDir dir( mPath ); + if ( !dir.exists() ) { // no directory available + return dir.mkdir( dir.path() ); + } else { + TQString testName = dir.entryList( TQDir::Files )[0]; + if ( testName.isNull() || testName.isEmpty() ) // no file in directory + return true; + + TQFile file( mPath + "/" + testName ); + if ( file.open( IO_ReadOnly ) ) + return true; + + if ( file.size() == 0 ) + return true; + + bool ok = mFormat->checkFormat( &file ); + file.close(); + return ok; + } +} + +void ResourceDir::doClose() +{ +} + +bool ResourceDir::load() +{ + kdDebug(5700) << "ResourceDir::load(): '" << mPath << "'" << endl; + + mAsynchronous = false; + + TQDir dir( mPath ); + TQStringList files = dir.entryList( TQDir::Files ); + + TQStringList::Iterator it; + bool ok = true; + for ( it = files.begin(); it != files.end(); ++it ) { + TQFile file( mPath + "/" + (*it) ); + + if ( !file.open( IO_ReadOnly ) ) { + addressBook()->error( i18n( "Unable to open file '%1' for reading" ).arg( file.name() ) ); + ok = false; + continue; + } + + if ( !mFormat->loadAll( addressBook(), this, &file ) ) + ok = false; + + file.close(); + } + + return ok; +} + +bool ResourceDir::asyncLoad() +{ + mAsynchronous = true; + + bool ok = load(); + if ( !ok ) + emit loadingError( this, i18n( "Loading resource '%1' failed!" ) + .arg( resourceName() ) ); + else + emit loadingFinished( this ); + + return ok; +} + +bool ResourceDir::save( Ticket * ) +{ + kdDebug(5700) << "ResourceDir::save(): '" << mPath << "'" << endl; + + Addressee::Map::Iterator it; + bool ok = true; + + mDirWatch.stopScan(); + + for ( it = mAddrMap.begin(); it != mAddrMap.end(); ++it ) { + if ( !it.data().changed() ) + continue; + + TQFile file( mPath + "/" + (*it).uid() ); + if ( !file.open( IO_WriteOnly ) ) { + addressBook()->error( i18n( "Unable to open file '%1' for writing" ).arg( file.name() ) ); + continue; + } + + mFormat->save( *it, &file ); + + // mark as unchanged + (*it).setChanged( false ); + + file.close(); + } + + mDirWatch.startScan(); + + return ok; +} + +bool ResourceDir::asyncSave( Ticket *ticket ) +{ + bool ok = save( ticket ); + if ( !ok ) + emit savingError( this, i18n( "Saving resource '%1' failed!" ) + .arg( resourceName() ) ); + else + emit savingFinished( this ); + + return ok; +} + +void ResourceDir::setPath( const TQString &path ) +{ + mDirWatch.stopScan(); + if ( mDirWatch.contains( mPath ) ) + mDirWatch.removeDir( mPath ); + + mPath = path; + mDirWatch.addDir( mPath, true ); + mDirWatch.startScan(); +} + +TQString ResourceDir::path() const +{ + return mPath; +} + +void ResourceDir::setFormat( const TQString &format ) +{ + mFormatName = format; + + if ( mFormat ) + delete mFormat; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); +} + +TQString ResourceDir::format() const +{ + return mFormatName; +} + +void ResourceDir::pathChanged() +{ + if ( !addressBook() ) + return; + + clear(); + if ( mAsynchronous ) + asyncLoad(); + else { + load(); + addressBook()->emitAddressBookChanged(); + } +} + +void ResourceDir::removeAddressee( const Addressee& addr ) +{ + TQFile::remove( mPath + "/" + addr.uid() ); + mAddrMap.erase( addr.uid() ); +} + +#include "resourcedir.moc" diff --git a/tdeabc/plugins/dir/resourcedir.h b/tdeabc/plugins/dir/resourcedir.h new file mode 100644 index 000000000..dc3bdbd23 --- /dev/null +++ b/tdeabc/plugins/dir/resourcedir.h @@ -0,0 +1,113 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 - 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_RESOURCEDIR_H +#define KABC_RESOURCEDIR_H + +#include +#include + +#include + +#include + +class TQTimer; + +namespace KABC { + +class FormatPlugin; +class Lock; + +/** + @internal +*/ +class KABC_EXPORT ResourceDir : public Resource +{ + Q_OBJECT + + public: + ResourceDir( const TDEConfig* ); + ResourceDir( const TQString &path, const TQString &type = "vcard" ); + ~ResourceDir(); + + virtual void writeConfig( TDEConfig* ); + + virtual bool doOpen(); + virtual void doClose(); + + virtual Ticket *requestSaveTicket(); + virtual void releaseSaveTicket( Ticket* ); + + virtual bool load(); + virtual bool asyncLoad(); + virtual bool save( Ticket* ticket ); + virtual bool asyncSave( Ticket* ticket ); + + /** + Set path to be used for saving. + */ + void setPath( const TQString & ); + + /** + Return path used for loading and saving the address book. + */ + TQString path() const; + + /** + Set the format by name. + */ + void setFormat( const TQString &format ); + + /** + Returns the format name. + */ + TQString format() const; + + /** + Remove a addressee from its source. + This method is mainly called by KABC::AddressBook. + */ + virtual void removeAddressee( const Addressee& addr ); + + protected slots: + void pathChanged(); + + protected: + void init( const TQString &path, const TQString &format ); + + private: + FormatPlugin *mFormat; + + KDirWatch mDirWatch; + + TQString mPath; + TQString mFormatName; + + Lock *mLock; + + bool mAsynchronous; + + class ResourceDirPrivate; + ResourceDirPrivate *d; +}; + +} + +#endif diff --git a/tdeabc/plugins/dir/resourcedirconfig.cpp b/tdeabc/plugins/dir/resourcedirconfig.cpp new file mode 100644 index 000000000..2807872f8 --- /dev/null +++ b/tdeabc/plugins/dir/resourcedirconfig.cpp @@ -0,0 +1,107 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include +#include + +#include "formatfactory.h" +#include "resourcedir.h" +#include "stdaddressbook.h" + +#include "resourcedirconfig.h" + +using namespace KABC; + +ResourceDirConfig::ResourceDirConfig( TQWidget* parent, const char* name ) + : KRES::ConfigWidget( parent, name ) +{ + TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2, 0, + KDialog::spacingHint() ); + + TQLabel *label = new TQLabel( i18n( "Format:" ), this ); + mFormatBox = new KComboBox( this ); + + mainLayout->addWidget( label, 0, 0 ); + mainLayout->addWidget( mFormatBox, 0, 1 ); + + label = new TQLabel( i18n( "Location:" ), this ); + mFileNameEdit = new KURLRequester( this ); + mFileNameEdit->setMode( KFile::Directory ); + + mainLayout->addWidget( label, 1, 0 ); + mainLayout->addWidget( mFileNameEdit, 1, 1 ); + + FormatFactory *factory = FormatFactory::self(); + TQStringList formats = factory->formats(); + TQStringList::Iterator it; + for ( it = formats.begin(); it != formats.end(); ++it ) { + FormatInfo *info = factory->info( *it ); + if ( info ) { + mFormatTypes << (*it); + mFormatBox->insertItem( info->nameLabel ); + } + } + + mInEditMode = false; +} + +void ResourceDirConfig::setEditMode( bool value ) +{ + mFormatBox->setEnabled( !value ); + mInEditMode = value; +} + +void ResourceDirConfig::loadSettings( KRES::Resource *res ) +{ + ResourceDir *resource = dynamic_cast( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceDirConfig::loadSettings(): cast failed" << endl; + return; + } + + mFormatBox->setCurrentItem( mFormatTypes.findIndex( resource->format() ) ); + + mFileNameEdit->setURL( resource->path() ); + if ( mFileNameEdit->url().isEmpty() ) + mFileNameEdit->setURL( KABC::StdAddressBook::directoryName() ); +} + +void ResourceDirConfig::saveSettings( KRES::Resource *res ) +{ + ResourceDir *resource = dynamic_cast( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceDirConfig::loadSettings(): cast failed" << endl; + return; + } + + if ( mInEditMode ) + resource->setFormat( mFormatTypes[ mFormatBox->currentItem() ] ); + + resource->setPath( mFileNameEdit->url() ); +} + +#include "resourcedirconfig.moc" diff --git a/tdeabc/plugins/dir/resourcedirconfig.h b/tdeabc/plugins/dir/resourcedirconfig.h new file mode 100644 index 000000000..9df1778d3 --- /dev/null +++ b/tdeabc/plugins/dir/resourcedirconfig.h @@ -0,0 +1,54 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef RESOURCEDIRCONFIG_H +#define RESOURCEDIRCONFIG_H + +#include +#include + +#include + +namespace KABC { + +class KABC_EXPORT ResourceDirConfig : public KRES::ConfigWidget +{ + Q_OBJECT + +public: + ResourceDirConfig( TQWidget* parent = 0, const char* name = 0 ); + + void setEditMode( bool value ); + +public slots: + void loadSettings( KRES::Resource* ); + void saveSettings( KRES::Resource* ); + +private: + KComboBox* mFormatBox; + KURLRequester* mFileNameEdit; + + TQStringList mFormatTypes; + + bool mInEditMode; +}; + +} +#endif diff --git a/tdeabc/plugins/dir/resourcedirplugin.cpp b/tdeabc/plugins/dir/resourcedirplugin.cpp new file mode 100644 index 000000000..a2bd6d138 --- /dev/null +++ b/tdeabc/plugins/dir/resourcedirplugin.cpp @@ -0,0 +1,32 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 - 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "resourcedir.h" +#include "resourcedirconfig.h" + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT void *init_kabc_dir() + { + return new KRES::PluginFactory(); + } +} diff --git a/tdeabc/plugins/evolution/Makefile.am b/tdeabc/plugins/evolution/Makefile.am new file mode 100644 index 000000000..2c22cf376 --- /dev/null +++ b/tdeabc/plugins/evolution/Makefile.am @@ -0,0 +1,19 @@ +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourceevo.h dbwrapper.h + +kde_module_LTLIBRARIES = kabc_evo.la + +kabc_evo_la_SOURCES = dbwrapper.cpp resourceevo.cpp + +kabc_evo_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +kabc_evo_la_LIBADD = ../../../tdeabc/libkabc.la ../../../tdeui/libtdeui.la -ldb ../../../tdeabc/vcardparser/libvcards.la + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_evolution.pot + +servicedir = $(kde_servicesdir)/tderesources/kabc +service_DATA = evolution.desktop diff --git a/tdeabc/plugins/evolution/README b/tdeabc/plugins/evolution/README new file mode 100644 index 000000000..7dfefce00 --- /dev/null +++ b/tdeabc/plugins/evolution/README @@ -0,0 +1,15 @@ +A Resource using DB3 to access the evolution +addressbook make sure the wombat is not running +In future versions I may use bonobo to access it... + + +DESIGN: +The Format vs Resource idea is somehow not applyable to the +Evolution PAS + +Format would be vCard and Resource would be DB3.. +BUT +Format get's a QFile* pointer which is just not usable +with a DB3 +INSTEAD we will use the vCardImpl directly to convert +a string to Addressee \ No newline at end of file diff --git a/tdeabc/plugins/evolution/dbwrapper.cpp b/tdeabc/plugins/evolution/dbwrapper.cpp new file mode 100644 index 000000000..fbdff165a --- /dev/null +++ b/tdeabc/plugins/evolution/dbwrapper.cpp @@ -0,0 +1,187 @@ +#include + +#include + +#include "dbwrapper.h" + + +using namespace Evolution; + +struct DBIterator::Data { + DBWrapper *wrapper; + TQString key; + TQString data; + DBC* cursor; + bool atEnd; +}; + +DBIterator::DBIterator( DBWrapper* wra) { + data = new Data; + data->wrapper = wra; + data->atEnd = false; + data->cursor = 0l; +} +DBIterator::DBIterator( const DBIterator& copy ) { + data = new Data; + data->wrapper = copy.data->wrapper; + data->key = copy.data->key; + data->data = copy.data->data; + data->atEnd = copy.data->atEnd; + if (copy.data->cursor ) + copy.data->cursor->c_dup(copy.data->cursor, &data->cursor, 0 ); + else + data->cursor = 0l; +} +DBIterator::~DBIterator() { + if (data->cursor) + data->cursor->c_close(data->cursor); + delete data; +} +DBIterator& DBIterator::operator=( const DBIterator& rhs ) { + if ( *this == rhs ) + return *this; + if (data->cursor) + data->cursor->c_close(data->cursor); + delete data; + data = new Data; + data->wrapper = rhs.data->wrapper; + data->key = rhs.data->key; + data->data = rhs.data->data; + data->atEnd = rhs.data->atEnd; + if ( rhs.data->cursor ) + rhs.data->cursor->c_dup(rhs.data->cursor, &data->cursor, 0 ); + else + data->cursor = 0l; + + return *this; +} +TQString DBIterator::key()const{ + return data->key; +} +TQString DBIterator::value()const { + return data->data; +} +TQString DBIterator::operator*() { + return data->data; +} +DBIterator& DBIterator::operator++() { + DBT key, val; + ::memset(&key, 0, sizeof(key) ); + ::memset(&val, 0, sizeof(val) ); + if ( data->cursor ) + if ( data->cursor->c_get(data->cursor, &key, &val,DB_NEXT ) != 0 ) + data->atEnd = true; + data->key = TQString::fromUtf8( (char*)key.data, key.size ); + data->data = TQString::fromUtf8( (char*)val.data, val.size ); + return *this; +} +DBIterator& DBIterator::operator--() { + DBT key, val; + ::memset(&key, 0, sizeof(key) ); + ::memset(&val, 0, sizeof(val) ); + if ( data->cursor ) + if ( data->cursor->c_get(data->cursor, &key, &val,DB_PREV ) != 0 ) + data->atEnd = true; + data->key = TQString::fromUtf8( (char*)key.data, key.size ); + data->data = TQString::fromUtf8( (char*)val.data, val.size ); + return *this; +} +bool DBIterator::operator==( const DBIterator& rhs ) { + if ( data->atEnd && data->atEnd == rhs.data->atEnd ) return true; + + return false; +} +bool DBIterator::operator!=( const DBIterator& rhs ) { + return !this->operator==(rhs ); +} +struct DBWrapper::Data { + DB* db; + bool only; +}; +DBWrapper::DBWrapper() { + data = new Data; + (void)db_create(&data->db, NULL, 0 ); + data->only = false; +} +DBWrapper::~DBWrapper() { + data->db->close(data->db, 0 ); + delete data; +} +bool DBWrapper::open( const TQString& file, bool on) { + data->only = on; + return !data->db->open(data->db, TQFile::encodeName( file ), NULL, DB_HASH, 0, 0666 ); +} +bool DBWrapper::save() { + return true; +} +DBIterator DBWrapper::begin() { + DBIterator it(this); + DBC* cursor; + DBT key, val; + int ret; + ret = data->db->cursor(data->db, NULL, &cursor, 0 ); + if (ret ) { + it.data->atEnd = true; + return it; + } + + ::memset(&key, 0, sizeof(key) ); + ::memset(&val, 0, sizeof(val) ); + ret = cursor->c_get(cursor, &key, &val, DB_FIRST ); + if (ret ) { + it.data->atEnd = true; + return it; + } + + it.data->cursor = cursor; + it.data->key = TQString::fromUtf8((char*)key.data, key.size ); + it.data->data = TQString::fromUtf8((char*)val.data, val.size ); + + return it; +} +DBIterator DBWrapper::end() { + DBIterator it(this); + it.data->atEnd = true; + + return it; +} +bool DBWrapper::find( const TQString& _key, TQString& _val ) { + DBT key, val; + ::memset(&key, 0, sizeof(key) ); + ::memset(&val, 0, sizeof(val) ); + + TQCString db_key = _key.local8Bit(); + key.data = db_key.data(); + key.size = db_key.size(); + + int ret = data->db->get(data->db, NULL, &key, &val, 0 ); + if (!ret) { + _val = TQString::fromUtf8( (char*)val.data, val.size ); + tqWarning("key: %s val: %sXXX", (char*)key.data, (char*)val.data ); + return true; + } + return false; +} +bool DBWrapper::add( const TQString& _key, const TQString& _val ) { + TQCString db_key = _key.local8Bit(); + TQCString db_val = _val.local8Bit(); + DBT key, val; + ::memset(&key, 0, sizeof(key) ); + ::memset(&val, 0, sizeof(val) ); + + key.data = db_key.data(); + key.size = db_key.size(); + val.data = db_val.data(); + val.size = db_val.size(); + + return !data->db->put(data->db, NULL, &key, &val, 0 ); +} +bool DBWrapper::remove( const TQString& _key ) { + TQCString db_key = _key.local8Bit(); + DBT key; + memset(&key, 0, sizeof(key) ); + key.data = db_key.data(); + key.size = db_key.size(); + + return !data->db->del(data->db, NULL, &key, 0 ); +} diff --git a/tdeabc/plugins/evolution/dbwrapper.h b/tdeabc/plugins/evolution/dbwrapper.h new file mode 100644 index 000000000..e5e0a2c33 --- /dev/null +++ b/tdeabc/plugins/evolution/dbwrapper.h @@ -0,0 +1,60 @@ +#ifndef KABC_EVOLUTION_DB_WRAPPER +#define KABC_EVOLUTION_DB_WRAPPER + +#include + +#include +#include + +namespace Evolution { + + class DBWrapper; + class DBIterator { + friend class DBWrapper; + public: + DBIterator( DBWrapper* = 0l ); + ~DBIterator(); + + DBIterator( const DBIterator& ); + DBIterator &operator=( const DBIterator& ); + + TQString key()const; + TQString value()const; + + TQString operator*(); + + DBIterator &operator++(); + DBIterator &operator--(); + + bool operator==( const DBIterator& ); + bool operator!=( const DBIterator& ); + private: + struct Data; + Data* data; + }; + class DBWrapper { + public: + DBWrapper(); + ~DBWrapper(); + + TQString lastError()const; + + bool open( const TQString& file, bool readOnly = false); + bool save(); + DBIterator begin(); + DBIterator end(); + + bool find( const TQString& key, TQString& value ); + bool add( const TQString& key, const TQString& val ); + bool remove( const TQString& key ); + private: + // DBT element( const TQString& ); + struct Data; + Data* data; + + }; + +} + + +#endif diff --git a/tdeabc/plugins/evolution/evolution.desktop b/tdeabc/plugins/evolution/evolution.desktop new file mode 100644 index 000000000..98030e906 --- /dev/null +++ b/tdeabc/plugins/evolution/evolution.desktop @@ -0,0 +1,26 @@ +[Desktop Entry] +Name=Evolution +Name[be]=Эвалюцыя +Name[bn]=ইভোলিউশন +Name[eo]=Evoluo +Name[fa]=اوولوشن +Name[hi]=एवॉल्यूशन +Name[ko]=에볼루션 +Name[mn]=Хөгжил +Name[ne]=इभोल्युसन +Name[pa]=ਏਵੂਲੇਸ਼ਨ +Name[sr]=Еволуција +Name[sr@Latn]=Evolucija +Name[ta]=படிப்படியான வளர்ச்சி +Name[te]=ఎవల్యుషన్ +Name[th]=เอฟโวลูชัน +Name[tt]=Üseş +Name[ven]=Tsikoni +Name[wa]=Evolucion +Name[xh]=Utshintsho lwendawo ngokwenqanawa +Name[zu]=Evolushini +X-TDE-Library=kabc_evo +Type=Service +ServiceTypes=KResources/Plugin +X-TDE-ResourceFamily=contact +X-TDE-ResourceType=evolution diff --git a/tdeabc/plugins/evolution/resourceevo.cpp b/tdeabc/plugins/evolution/resourceevo.cpp new file mode 100644 index 000000000..e6545f738 --- /dev/null +++ b/tdeabc/plugins/evolution/resourceevo.cpp @@ -0,0 +1,132 @@ +#include + +#include +#include +#include + +#include + +#include + +#include "dbwrapper.h" +#include "resourceevo.h" + +using namespace Evolution; +using namespace KABC; + +class EvolutionFactory : public KRES::PluginFactoryBase +{ + public: + KRES::Resource *resource( const TDEConfig *config ) + { + return new ResourceEvolution( config ); + } + + KRES::ConfigWidget *configWidget( TQWidget * ) + { + return 0; + } +}; + +extern "C" +{ + KDE_EXPORT void *init_kabc_evo() + { + return ( new EvolutionFactory() ); + } +} + +ResourceEvolution::ResourceEvolution( const TDEConfig* conf ) + : Resource( conf ), mWrap(0l) +{ + m_isOpen = false; +} +ResourceEvolution::~ResourceEvolution() { + delete mWrap; +} +bool ResourceEvolution::doOpen() { + mWrap = new DBWrapper; + if (!mWrap->open( TQDir::homeDirPath() + "/evolution/local/Contacts/addressbook.db" ) ) { + return false; + } + + TQString val; + if (!mWrap->find( "PAS-DB-VERSION", val ) ) + return false; + + if (!val.startsWith("0.2") ) + return false; + + m_isOpen = true; + + return true; +} +void ResourceEvolution::doClose() { + delete mWrap; + mWrap = 0l; + m_isOpen = false; +} +Ticket* ResourceEvolution::requestSaveTicket() { + if ( !addressBook() ) return 0; + return createTicket( this ); +} +/* + * skip the first key + */ + +bool ResourceEvolution::load() { + /* doOpen never get's called :( */ + if (!doOpen()) return false; + if (!mWrap ) return false; // open first! + + DBIterator it = mWrap->begin(); + // skip the "PAS-DB-VERSION" + + for ( ; it != mWrap->end(); ++it ) { + if ( it.key().startsWith("PAS-DB-VERSION") ) + continue; + + tqWarning( "val:%s", it.value().latin1() ); + VCardTool tool; + TQString str = it.value().stripWhiteSpace(); + Addressee::List list = tool.parseVCards( str ); + if (!list.first().isEmpty() ) { + Addressee adr = list.first(); + adr.setResource(this); + addressBook()->insertAddressee( adr ); + } + } + return true; +} +bool ResourceEvolution::save( Ticket* ticket ) { + delete ticket; + if (!m_isOpen ) return false; + + // just delete the summary so evolution will regenerate it + // on next start up + (void)TQFile::remove( TQDir::homeDirPath() + "/evolution/local/Contacts/addressbook.db.summary" ); + + + AddressBook::Iterator it; + Addressee::List list; + for ( it = addressBook()->begin(); it !=addressBook()->end(); ++it ) { + if ( (*it).resource() != this || !(*it).changed() ) + continue; + + // remove, convert add set unchanged false + list.clear(); + mWrap->remove( (*it).uid() ); + VCardTool tool; + list.append( (*it) ); + mWrap->add( (*it).uid(), tool.createVCards( list, VCard::v2_1) ); + + (*it).setChanged( false ); + } + + return true; +} +void ResourceEvolution::removeAddressee( const Addressee& rem) { + if (!m_isOpen) return; + + mWrap->remove( rem.uid() ); +} diff --git a/tdeabc/plugins/evolution/resourceevo.h b/tdeabc/plugins/evolution/resourceevo.h new file mode 100644 index 000000000..29e163e1c --- /dev/null +++ b/tdeabc/plugins/evolution/resourceevo.h @@ -0,0 +1,23 @@ +#include "resource.h" + +namespace Evolution { + class DBWrapper; +} + +namespace KABC { + class ResourceEvolution : public Resource { + public: + ResourceEvolution( const TDEConfig* config ); + ~ResourceEvolution(); + + bool doOpen(); + void doClose(); + Ticket* requestSaveTicket(); + bool load(); + bool save( Ticket* ticket ); + void removeAddressee( const Addressee& ); + private: + Evolution::DBWrapper *mWrap; + bool m_isOpen : 1; + }; +} diff --git a/tdeabc/plugins/file/CMakeLists.txt b/tdeabc/plugins/file/CMakeLists.txt new file mode 100644 index 000000000..6c17d2dc7 --- /dev/null +++ b/tdeabc/plugins/file/CMakeLists.txt @@ -0,0 +1,73 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/kabc + ${CMAKE_SOURCE_DIR}/kabc + + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + resourcefile.h + DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) + + +##### other data ################################ + +install( FILES file.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) + + +##### kabc_file (library) ####################### + +set( target kabc_file ) + +set( ${target}_SRCS + resourcefile.cpp resourcefileconfig.cpp +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 1.0.0 + LINK tdeabc-shared + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### kabc_file (module) ######################## + +set( target kabc_file ) + +set( ${target}_SRCS + resourcefileplugin.cpp +) + +tde_add_kpart( ${target} + SOURCES ${${target}_SRCS} + LINK kabc_file-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdeabc/plugins/file/Makefile.am b/tdeabc/plugins/file/Makefile.am new file mode 100644 index 000000000..d00ffea3f --- /dev/null +++ b/tdeabc/plugins/file/Makefile.am @@ -0,0 +1,28 @@ +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourcefileconfig.h + +lib_LTLIBRARIES = libkabc_file.la +libkabc_file_la_SOURCES = resourcefile.cpp resourcefileconfig.cpp +libkabc_file_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined +libkabc_file_la_LIBADD = $(LIB_KABC) $(LIB_QT) $(top_builddir)/tderesources/libtderesources.la $(LIB_TDEFILE) $(LIB_TDECORE) $(LIB_TDEUI) +libkabc_file_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + + +kde_module_LTLIBRARIES = kabc_file.la +kabc_file_la_SOURCES = resourcefileplugin.cpp +kabc_file_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -no-undefined +kabc_file_la_LIBADD = libkabc_file.la $(LIB_QT) $(LIB_TDECORE) +kabc_file_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_file.pot + +kabcincludedir = $(includedir)/kabc +kabcinclude_HEADERS = resourcefile.h + +servicedir = $(kde_servicesdir)/tderesources/kabc +service_DATA = file.desktop diff --git a/tdeabc/plugins/file/file.desktop b/tdeabc/plugins/file/file.desktop new file mode 100644 index 000000000..1359dd1c6 --- /dev/null +++ b/tdeabc/plugins/file/file.desktop @@ -0,0 +1,82 @@ +[Desktop Entry] +Name=File +Name[af]=Lêer +Name[ar]=ملفّ +Name[az]=Fayl +Name[be]=Файл +Name[bn]=ফাইল +Name[br]=Restr +Name[bs]=Datoteka +Name[ca]=Fitxer +Name[cs]=Soubor +Name[csb]=Lopk +Name[cy]=Ffeil +Name[da]=Fil +Name[de]=Datei +Name[el]=Αρχείο +Name[eo]=Dosiero +Name[es]=Archivo +Name[et]=Fail +Name[eu]=Fitxategia +Name[fa]=پرونده +Name[fi]=Tiedosto +Name[fr]=Fichier +Name[fy]=Triem +Name[ga]=Comhad +Name[gl]=Ficheiro +Name[he]=קובץ +Name[hi]=फ़ाइल +Name[hr]=Datoteka +Name[hsb]=Dataja +Name[hu]=Fájl +Name[id]=Berkas +Name[is]=Skrá +Name[ja]=ファイル +Name[ka]=ფაილი +Name[kk]=Файл +Name[km]=ឯកសារ +Name[ko]=파일 +Name[lb]=Datei +Name[lt]=Byla +Name[lv]=Fails +Name[mk]=Датотека +Name[mn]=Файл +Name[ms]=Fail +Name[nb]=Fil +Name[nds]=Datei +Name[ne]=फाइल +Name[nl]=Bestand +Name[nn]=Fil +Name[pa]=ਫਾਇਲ +Name[pl]=Plik +Name[pt]=Ficheiro +Name[pt_BR]=Arquivo +Name[ro]=Fişier +Name[ru]=Файл +Name[rw]=Idosiye +Name[se]=Fiila +Name[sk]=Súbor +Name[sl]=Datoteka +Name[sq]=Skedë +Name[sr]=Фајл +Name[sr@Latn]=Fajl +Name[sv]=Fil +Name[ta]=கோப்பு +Name[te]=దస్త్రం +Name[tg]=Файл +Name[th]=แฟ้ม +Name[tr]=Dosya +Name[tt]=Birem +Name[uk]=Файл +Name[uz]=Fayl +Name[uz@cyrillic]=Файл +Name[vi]=Tập tin +Name[wa]=Fitchî +Name[zh_CN]=文件 +Name[zh_HK]=檔案 +Name[zh_TW]=檔案 +X-TDE-Library=kabc_file +Type=Service +ServiceTypes=KResources/Plugin +X-TDE-ResourceFamily=contact +X-TDE-ResourceType=file diff --git a/tdeabc/plugins/file/resourcefile.cpp b/tdeabc/plugins/file/resourcefile.cpp new file mode 100644 index 000000000..b29cf33c3 --- /dev/null +++ b/tdeabc/plugins/file/resourcefile.cpp @@ -0,0 +1,395 @@ +/* + This file is part of libkabc. + + Copyright (c) 2001,2003 Cornelius Schumacher + Copyright (c) 2006 Tom Abers + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "formatfactory.h" +#include "resourcefileconfig.h" +#include "stdaddressbook.h" +#include "lock.h" + +#include "resourcefile.h" + +using namespace KABC; + +ResourceFile::ResourceFile( const TDEConfig *config ) + : Resource( config ), mFormat( 0 ), + mAsynchronous( false ) +{ + TQString fileName, formatName; + + if ( config ) { + fileName = config->readPathEntry( "FileName", StdAddressBook::fileName() ); + formatName = config->readEntry( "FileFormat", "vcard" ); + } else { + fileName = StdAddressBook::fileName(); + formatName = "vcard"; + } + + init( fileName, formatName ); +} + +ResourceFile::ResourceFile( const TQString &fileName, + const TQString &formatName ) + : Resource( 0 ), mFormat( 0 ), + mAsynchronous( false ) +{ + init( fileName, formatName ); +} + +void ResourceFile::init( const TQString &fileName, const TQString &formatName ) +{ + mFormatName = formatName; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); + + if ( !mFormat ) { + mFormatName = "vcard"; + mFormat = factory->format( mFormatName ); + } + + connect( &mDirWatch, TQT_SIGNAL( dirty(const TQString&) ), TQT_SLOT( fileChanged() ) ); + connect( &mDirWatch, TQT_SIGNAL( created(const TQString&) ), TQT_SLOT( fileChanged() ) ); + connect( &mDirWatch, TQT_SIGNAL( deleted(const TQString&) ), TQT_SLOT( fileChanged() ) ); + + setFileName( fileName ); + + mLock = 0; +} + +ResourceFile::~ResourceFile() +{ + delete mFormat; + mFormat = 0; +} + +void ResourceFile::writeConfig( TDEConfig *config ) +{ + Resource::writeConfig( config ); + + if ( mFileName == StdAddressBook::fileName() ) + config->deleteEntry( "FileName" ); + else + config->writePathEntry( "FileName", mFileName ); + + config->writeEntry( "FileFormat", mFormatName ); +} + +Ticket *ResourceFile::requestSaveTicket() +{ + kdDebug(5700) << "ResourceFile::requestSaveTicket()" << endl; + + if ( !addressBook() ) return 0; + + delete mLock; + mLock = new Lock( mFileName ); + + if ( mLock->lock() ) { + addressBook()->emitAddressBookLocked(); + } else { + addressBook()->error( mLock->error() ); + kdDebug(5700) << "ResourceFile::requestSaveTicket(): Unable to lock file '" + << mFileName << "': " << mLock->error() << endl; + return 0; + } + + return createTicket( this ); +} + +void ResourceFile::releaseSaveTicket( Ticket *ticket ) +{ + delete ticket; + + delete mLock; + mLock = 0; + + addressBook()->emitAddressBookUnlocked(); +} + +bool ResourceFile::doOpen() +{ + TQFile file( mFileName ); + + if ( !file.exists() ) { + // try to create the file + bool ok = file.open( IO_WriteOnly ); + if ( ok ) + file.close(); + + return ok; + } else { + TQFileInfo fileInfo( mFileName ); + if ( readOnly() || !fileInfo.isWritable() ) { + if ( !file.open( IO_ReadOnly ) ) + return false; + } else { + if ( !file.open( IO_ReadWrite ) ) + return false; + } + + if ( file.size() == 0 ) { + file.close(); + kdDebug() << "File size is zero. Evaluating backups" << endl; + for (int i=0; i!=20; i++) + { + TQFile backup( mFileName + "__" + TQString::number(i) ); + kdDebug() << "Evaluating" << backup.name() << " size: " << backup.size() << endl; + if ( backup.size() != 0 ) + { + kdDebug() << "Restoring backup " << i << endl; + const TQString src = mFileName + "__" + TQString::number(i); + const TQString dest = mFileName; + + // remove dest + TQFile::remove( dest ); + + // copy src to dest + if ( backup.open( IO_ReadOnly ) ) { + const TQByteArray data = backup.readAll(); + + TQFile out( dest ); + if ( out.open( IO_WriteOnly ) ) { + out.writeBlock( data ); + out.close(); + } + + backup.close(); + } + return true; + } + } + return true; + } + + bool ok = mFormat->checkFormat( &file ); + file.close(); + + return ok; + } +} + +void ResourceFile::doClose() +{ +} + +bool ResourceFile::load() +{ + kdDebug(5700) << "ResourceFile::load(): '" << mFileName << "'" << endl; + + mAsynchronous = false; + + TQFile file( mFileName ); + if ( !file.open( IO_ReadOnly ) ) { + addressBook()->error( i18n( "Unable to open file '%1'." ).arg( mFileName ) ); + return false; + } + + clear(); + + return mFormat->loadAll( addressBook(), this, &file ); +} + +bool ResourceFile::asyncLoad() +{ + kdDebug(5700) << "ResourceFile::asyncLoad()" << endl; + + mAsynchronous = true; + + bool ok = load(); + + if ( !ok ) + emitLoadingError(); + else + emitLoadingFinished(); + + return true; +} + +bool ResourceFile::save( Ticket * ) +{ + kdDebug(5700) << "ResourceFile::save()" << endl; + + // Only do the logrotate dance when the __0 file is not 0 bytes. + TQFile file( mFileName + "__0" ); + if ( file.size() != 0 ) { + const TQString last = mFileName + "__20"; + kdDebug() << "deleting " << last << endl; + + TQFile::remove( last ); + + for (int i=19; i>=0; i--) + { + const TQString src = mFileName + "__" + TQString::number(i); + const TQString dest = mFileName + "__" + TQString::number(i+1); + kdDebug() << "moving " << src << " -> " << dest << endl; + + // copy src to dest + TQFile in( src ); + if ( in.open( IO_ReadOnly ) ) { + const TQByteArray data = in.readAll(); + + TQFile out( dest ); + if ( out.open( IO_WriteOnly ) ) { + out.writeBlock( data ); + out.close(); + } + + in.close(); + } + + // remove src + TQFile::remove( src ); + } + } else + kdDebug() << "Not starting logrotate __0 is 0 bytes." << endl; + + TQString extension = "__0"; + (void) KSaveFile::backupFile( mFileName, TQString::null /*directory*/, + extension ); + + mDirWatch.stopScan(); + + KSaveFile saveFile( mFileName ); + bool ok = false; + + if ( saveFile.status() == 0 && saveFile.file() ) { + mFormat->saveAll( addressBook(), this, saveFile.file() ); + ok = saveFile.close(); + } + + if ( !ok ) { + saveFile.abort(); + addressBook()->error( i18n( "Unable to save file '%1'." ).arg( mFileName ) ); + } + + mDirWatch.startScan(); + + return ok; +} + +bool ResourceFile::asyncSave( Ticket *ticket ) +{ + kdDebug(5700) << "ResourceFile::asyncSave()" << endl; + + bool ok = save( ticket ); + + if ( !ok ) + TQTimer::singleShot( 0, this, TQT_SLOT( emitSavingError() ) ); + else + TQTimer::singleShot( 0, this, TQT_SLOT( emitSavingFinished() ) ); + + return ok; +} + +void ResourceFile::setFileName( const TQString &fileName ) +{ + mDirWatch.stopScan(); + if ( mDirWatch.contains( mFileName ) ) + mDirWatch.removeFile( mFileName ); + + mFileName = fileName; + + mDirWatch.addFile( mFileName ); + mDirWatch.startScan(); +} + +TQString ResourceFile::fileName() const +{ + return mFileName; +} + +void ResourceFile::setFormat( const TQString &format ) +{ + mFormatName = format; + delete mFormat; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); +} + +TQString ResourceFile::format() const +{ + return mFormatName; +} + +void ResourceFile::fileChanged() +{ + kdDebug(5700) << "ResourceFile::fileChanged(): " << mFileName << endl; + + if ( !addressBook() ) + return; + + if ( mAsynchronous ) + asyncLoad(); + else { + load(); + kdDebug() << "addressBookChanged() " << endl; + addressBook()->emitAddressBookChanged(); + } +} + +void ResourceFile::removeAddressee( const Addressee &addr ) +{ + TQFile::remove( TQFile::encodeName( locateLocal( "data", "tdeabc/photos/" ) + addr.uid() ) ); + TQFile::remove( TQFile::encodeName( locateLocal( "data", "tdeabc/logos/" ) + addr.uid() ) ); + TQFile::remove( TQFile::encodeName( locateLocal( "data", "tdeabc/sounds/" ) + addr.uid() ) ); + + mAddrMap.erase( addr.uid() ); +} + +void ResourceFile::emitSavingFinished() +{ + emit savingFinished( this ); +} + +void ResourceFile::emitSavingError() +{ + emit savingError( this, i18n( "Unable to save file '%1'." ).arg( mFileName ) ); +} + +void ResourceFile::emitLoadingFinished() +{ + emit loadingFinished( this ); +} + +void ResourceFile::emitLoadingError() +{ + emit loadingError( this, i18n( "Problems during parsing file '%1'." ).arg( mFileName ) ); +} + +#include "resourcefile.moc" diff --git a/tdeabc/plugins/file/resourcefile.h b/tdeabc/plugins/file/resourcefile.h new file mode 100644 index 000000000..a77f55798 --- /dev/null +++ b/tdeabc/plugins/file/resourcefile.h @@ -0,0 +1,162 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_RESOURCEFILE_H +#define KABC_RESOURCEFILE_H + +#include +#include + +#include + +#include + +namespace KABC { + +class FormatPlugin; +class ResourceConfigWidget; +class Lock; + +/** + This resource allows access to a local file. +*/ +class KABC_EXPORT ResourceFile : public Resource +{ + Q_OBJECT + + public: + /** + Constructor. + + @param cfg The config object where custom resource settings are stored. + */ + ResourceFile( const TDEConfig *cfg ); + + /** + Construct file resource on file @arg fileName using format @arg formatName. + */ + ResourceFile( const TQString &fileName, const TQString &formatName = "vcard" ); + + /** + Destructor. + */ + ~ResourceFile(); + + /** + Writes the config back. + */ + virtual void writeConfig( TDEConfig *cfg ); + + /** + Tries to open the file and checks for the proper format. + This method should be called before load(). + */ + virtual bool doOpen(); + + /** + Closes the file again. + */ + virtual void doClose(); + + /** + Requests a save ticket, that is used by save() + */ + virtual Ticket *requestSaveTicket(); + + virtual void releaseSaveTicket( Ticket* ); + + /** + Loads all addressees from file to the address book. + Returns true if all addressees could be loaded otherwise false. + */ + virtual bool load(); + + virtual bool asyncLoad(); + + /** + Saves all addresses from address book to file. + Returns true if all addressees could be saved otherwise false. + + @param ticket The ticket returned by requestSaveTicket() + */ + virtual bool save( Ticket *ticket ); + + virtual bool asyncSave( Ticket *ticket ); + + /** + Set name of file to be used for saving. + */ + void setFileName( const TQString & ); + + /** + Return name of file used for loading and saving the address book. + */ + TQString fileName() const; + + /** + Sets a new format by name. + */ + void setFormat( const TQString &name ); + + /** + Returns the format name. + */ + TQString format() const; + + /** + Remove a addressee from its source. + This method is mainly called by KABC::AddressBook. + */ + virtual void removeAddressee( const Addressee& addr ); + + private slots: + void emitLoadingFinished(); + void emitLoadingError(); + void emitSavingFinished(); + void emitSavingError(); + + protected slots: + void fileChanged(); + + protected: + void init( const TQString &fileName, const TQString &format ); + + bool lock( const TQString &fileName ); + void unlock( const TQString &fileName ); + + private: + TQString mFileName; + TQString mFormatName; + + FormatPlugin *mFormat; + + Lock *mLock; + + KDirWatch mDirWatch; + + bool mAsynchronous; + + class ResourceFilePrivate; + ResourceFilePrivate *d; +}; + +} + +#endif diff --git a/tdeabc/plugins/file/resourcefileconfig.cpp b/tdeabc/plugins/file/resourcefileconfig.cpp new file mode 100644 index 000000000..7c3f4da15 --- /dev/null +++ b/tdeabc/plugins/file/resourcefileconfig.cpp @@ -0,0 +1,118 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include +#include + +#include + +#include "formatfactory.h" +#include "resourcefile.h" +#include "stdaddressbook.h" + +#include "resourcefileconfig.h" + +using namespace KABC; + +ResourceFileConfig::ResourceFileConfig( TQWidget* parent, const char* name ) + : ConfigWidget( parent, name ) +{ + TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2, 0, + KDialog::spacingHint() ); + + TQLabel *label = new TQLabel( i18n( "Format:" ), this ); + mFormatBox = new KComboBox( this ); + + mainLayout->addWidget( label, 0, 0 ); + mainLayout->addWidget( mFormatBox, 0, 1 ); + + label = new TQLabel( i18n( "Location:" ), this ); + mFileNameEdit = new KURLRequester( this ); + + connect( mFileNameEdit, TQT_SIGNAL( textChanged( const TQString & ) ), + TQT_SLOT( checkFilePermissions( const TQString & ) ) ); + + mainLayout->addWidget( label, 1, 0 ); + mainLayout->addWidget( mFileNameEdit, 1, 1 ); + + FormatFactory *factory = FormatFactory::self(); + TQStringList formats = factory->formats(); + TQStringList::Iterator it; + for ( it = formats.begin(); it != formats.end(); ++it ) { + FormatInfo *info = factory->info( *it ); + if ( info ) { + mFormatTypes << (*it); + mFormatBox->insertItem( info->nameLabel ); + } + } + + mInEditMode = false; +} + +void ResourceFileConfig::setEditMode( bool value ) +{ + mFormatBox->setEnabled( !value ); + mInEditMode = value; +} + +void ResourceFileConfig::loadSettings( KRES::Resource *res ) +{ + ResourceFile *resource = dynamic_cast( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceFileConfig::loadSettings(): cast failed" << endl; + return; + } + + mFormatBox->setCurrentItem( mFormatTypes.findIndex( resource->format() ) ); + + mFileNameEdit->setURL( resource->fileName() ); + if ( mFileNameEdit->url().isEmpty() ) + mFileNameEdit->setURL( KABC::StdAddressBook::fileName() ); +} + +void ResourceFileConfig::saveSettings( KRES::Resource *res ) +{ + ResourceFile *resource = dynamic_cast( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceFileConfig::saveSettings(): cast failed" << endl; + return; + } + + if ( !mInEditMode ) + resource->setFormat( mFormatTypes[ mFormatBox->currentItem() ] ); + + resource->setFileName( mFileNameEdit->url() ); +} + +void ResourceFileConfig::checkFilePermissions( const TQString& fileName ) +{ + // If file exist but is not writeable... + if ( access( TQFile::encodeName( fileName ), F_OK ) == 0 ) + emit setReadOnly( access( TQFile::encodeName( fileName ), W_OK ) < 0 ); +} + +#include "resourcefileconfig.moc" diff --git a/tdeabc/plugins/file/resourcefileconfig.h b/tdeabc/plugins/file/resourcefileconfig.h new file mode 100644 index 000000000..18c217eda --- /dev/null +++ b/tdeabc/plugins/file/resourcefileconfig.h @@ -0,0 +1,57 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef RESOURCEFILECONFIG_H +#define RESOURCEFILECONFIG_H + +#include +#include + +#include + +namespace KABC { + +class KABC_EXPORT ResourceFileConfig : public KRES::ConfigWidget +{ + Q_OBJECT + +public: + ResourceFileConfig( TQWidget* parent = 0, const char* name = 0 ); + + void setEditMode( bool value ); + +public slots: + void loadSettings( KRES::Resource *resource ); + void saveSettings( KRES::Resource *resource ); + +protected slots: + void checkFilePermissions( const TQString& fileName ); + +private: + KComboBox* mFormatBox; + KURLRequester* mFileNameEdit; + bool mInEditMode; + + TQStringList mFormatTypes; +}; + +} + +#endif diff --git a/tdeabc/plugins/file/resourcefileplugin.cpp b/tdeabc/plugins/file/resourcefileplugin.cpp new file mode 100644 index 000000000..4dce19bc0 --- /dev/null +++ b/tdeabc/plugins/file/resourcefileplugin.cpp @@ -0,0 +1,32 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "resourcefile.h" +#include "resourcefileconfig.h" + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT void *init_kabc_file() + { + return new KRES::PluginFactory(); + } +} diff --git a/tdeabc/plugins/ldaptdeio/CMakeLists.txt b/tdeabc/plugins/ldaptdeio/CMakeLists.txt new file mode 100644 index 000000000..820f6e017 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/CMakeLists.txt @@ -0,0 +1,73 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/kabc + ${CMAKE_SOURCE_DIR}/kabc + + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefiles +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + resourceldaptdeio.h + DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) + + +##### other data ################################ + +install( FILES ldaptdeio.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) + + +##### kabc_ldaptdeio ############################## + +set( target kabc_ldaptdeio ) + +set( ${target}_SRCS + resourceldaptdeio.cpp resourceldaptdeioconfig.cpp +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 1.0.0 + LINK tdeabc-shared + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### kabc_ldaptdeio ############################## + +set( target kabc_ldaptdeio ) + +set( ${target}_SRCS + resourceldaptdeioplugin.cpp +) + +tde_add_kpart( ${target} + SOURCES ${${target}_SRCS} + LINK kabc_ldaptdeio-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdeabc/plugins/ldaptdeio/Makefile.am b/tdeabc/plugins/ldaptdeio/Makefile.am new file mode 100644 index 000000000..bc81d13d8 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/Makefile.am @@ -0,0 +1,28 @@ +INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourceldaptdeioconfig.h + +lib_LTLIBRARIES = libkabc_ldaptdeio.la +libkabc_ldaptdeio_la_SOURCES = resourceldaptdeio.cpp resourceldaptdeioconfig.cpp +libkabc_ldaptdeio_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined +libkabc_ldaptdeio_la_LIBADD = $(LIB_KABC) $(LIB_KIO) $(LIB_QT) $(top_builddir)/tderesources/libtderesources.la $(LIB_TDEUI) $(LIB_TDECORE) +libkabc_ldaptdeio_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + +kde_module_LTLIBRARIES = kabc_ldaptdeio.la +kabc_ldaptdeio_la_SOURCES = resourceldaptdeioplugin.cpp +kabc_ldaptdeio_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +kabc_ldaptdeio_la_LIBADD = libkabc_ldaptdeio.la $(LIB_QT) $(LIB_TDECORE) + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_ldaptdeio.pot + +kabcincludedir = $(includedir)/kabc +kabcinclude_HEADERS = resourceldaptdeio.h + +servicedir = $(kde_servicesdir)/tderesources/kabc +service_DATA = ldaptdeio.desktop + +resourceldaptdeioplugin.lo: ../../addressee.h diff --git a/tdeabc/plugins/ldaptdeio/ldaptdeio.desktop b/tdeabc/plugins/ldaptdeio/ldaptdeio.desktop new file mode 100644 index 000000000..9bcd13337 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/ldaptdeio.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=LDAP +Name[bn]=এল-ডি-এ-পি (LDAP) +Name[hi]=एलडीएपी (LDAP) +Name[te]=ఎల్డిఏపి +X-TDE-Library=kabc_ldaptdeio +Type=Service +ServiceTypes=KResources/Plugin +X-TDE-ResourceFamily=contact +X-TDE-ResourceType=ldaptdeio diff --git a/tdeabc/plugins/ldaptdeio/resourceldaptdeio.cpp b/tdeabc/plugins/ldaptdeio/resourceldaptdeio.cpp new file mode 100644 index 000000000..ea1a4294c --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/resourceldaptdeio.cpp @@ -0,0 +1,1041 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + Copyright (c) 2004 Szombathelyi György + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include "resourceldaptdeio.h" +#include "resourceldaptdeioconfig.h" + +using namespace KABC; + +// Hack from Netaccess +void tqt_enter_modal( TQWidget *widget ); +void tqt_leave_modal( TQWidget *widget ); + +class ResourceLDAPTDEIO::ResourceLDAPTDEIOPrivate +{ + public: + LDIF mLdif; + bool mTLS,mSSL,mSubTree; + TQString mResultDn; + Addressee mAddr; + Address mAd; + Resource::Iterator mSaveIt; + bool mSASL; + TQString mMech; + TQString mRealm, mBindDN; + LDAPUrl mLDAPUrl; + int mVer, mSizeLimit, mTimeLimit, mRDNPrefix; + int mError; + int mCachePolicy; + bool mReadOnly; + bool mAutoCache; + TQString mCacheDst; + KTempFile *mTmp; +}; + +ResourceLDAPTDEIO::ResourceLDAPTDEIO( const TDEConfig *config ) + : Resource( config ) +{ + d = new ResourceLDAPTDEIOPrivate; + if ( config ) { + TQMap attrList; + TQStringList attributes = config->readListEntry( "LdapAttributes" ); + for ( uint pos = 0; pos < attributes.count(); pos += 2 ) + mAttributes.insert( attributes[ pos ], attributes[ pos + 1 ] ); + + mUser = config->readEntry( "LdapUser" ); + mPassword = KStringHandler::obscure( config->readEntry( "LdapPassword" ) ); + mDn = config->readEntry( "LdapDn" ); + mHost = config->readEntry( "LdapHost" ); + mPort = config->readNumEntry( "LdapPort", 389 ); + mFilter = config->readEntry( "LdapFilter" ); + mAnonymous = config->readBoolEntry( "LdapAnonymous" ); + d->mTLS = config->readBoolEntry( "LdapTLS" ); + d->mSSL = config->readBoolEntry( "LdapSSL" ); + d->mSubTree = config->readBoolEntry( "LdapSubTree" ); + d->mSASL = config->readBoolEntry( "LdapSASL" ); + d->mMech = config->readEntry( "LdapMech" ); + d->mRealm = config->readEntry( "LdapRealm" ); + d->mBindDN = config->readEntry( "LdapBindDN" ); + d->mVer = config->readNumEntry( "LdapVer", 3 ); + d->mTimeLimit = config->readNumEntry( "LdapTimeLimit", 0 ); + d->mSizeLimit = config->readNumEntry( "LdapSizeLimit", 0 ); + d->mRDNPrefix = config->readNumEntry( "LdapRDNPrefix", 0 ); + d->mCachePolicy = config->readNumEntry( "LdapCachePolicy", 0 ); + d->mAutoCache = config->readBoolEntry( "LdapAutoCache", true ); + } else { + mPort = 389; + mAnonymous = true; + mUser = mPassword = mHost = mFilter = mDn = ""; + d->mMech = d->mRealm = d->mBindDN = ""; + d->mTLS = d->mSSL = d->mSubTree = d->mSASL = false; + d->mVer = 3; d->mRDNPrefix = 0; + d->mTimeLimit = d->mSizeLimit = 0; + d->mCachePolicy = Cache_No; + d->mAutoCache = true; + } + d->mCacheDst = TDEGlobal::dirs()->saveLocation("cache", "ldaptdeio") + "/" + + type() + "_" + identifier(); + init(); +} + +ResourceLDAPTDEIO::~ResourceLDAPTDEIO() +{ + delete d; +} + +void ResourceLDAPTDEIO::enter_loop() +{ + TQWidget dummy(0,0,(WFlags)(WType_Dialog | WShowModal)); + dummy.setFocusPolicy( TQ_NoFocus ); + tqt_enter_modal(&dummy); + tqApp->enter_loop(); + tqt_leave_modal(&dummy); +} + +void ResourceLDAPTDEIO::entries( TDEIO::Job*, const TDEIO::UDSEntryList & list ) +{ + TDEIO::UDSEntryListConstIterator it = list.begin(); + TDEIO::UDSEntryListConstIterator end = list.end(); + for (; it != end; ++it) { + TDEIO::UDSEntry::ConstIterator it2 = (*it).begin(); + for( ; it2 != (*it).end(); it2++ ) { + if ( (*it2).m_uds == TDEIO::UDS_URL ) { + KURL tmpurl( (*it2).m_str ); + d->mResultDn = tmpurl.path(); + kdDebug(7125) << "findUid(): " << d->mResultDn << endl; + if ( d->mResultDn.startsWith("/") ) d->mResultDn.remove(0,1); + return; + } + } + } +} + +void ResourceLDAPTDEIO::listResult( TDEIO::Job *job) +{ + d->mError = job->error(); + if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) + mErrorMsg = job->errorString(); + else + mErrorMsg = ""; + tqApp->exit_loop(); +} + +TQString ResourceLDAPTDEIO::findUid( const TQString &uid ) +{ + LDAPUrl url( d->mLDAPUrl ); + TDEIO::UDSEntry entry; + + mErrorMsg = d->mResultDn = ""; + + url.setAttributes("dn"); + url.setFilter( "(" + mAttributes[ "uid" ] + "=" + uid + ")" + mFilter ); + url.setExtension( "x-dir", "one" ); + + kdDebug(7125) << "ResourceLDAPTDEIO::findUid() uid: " << uid << " url " << + url.prettyURL() << endl; + + TDEIO::ListJob * listJob = TDEIO::listDir( url, false /* no GUI */ ); + connect( listJob, + TQT_SIGNAL( entries( TDEIO::Job *, const TDEIO::UDSEntryList& ) ), + TQT_SLOT( entries( TDEIO::Job*, const TDEIO::UDSEntryList& ) ) ); + connect( listJob, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( listResult( TDEIO::Job* ) ) ); + + enter_loop(); + return d->mResultDn; +} + +TQCString ResourceLDAPTDEIO::addEntry( const TQString &attr, const TQString &value, bool mod ) +{ + TQCString tmp; + if ( !attr.isEmpty() ) { + if ( mod ) tmp += LDIF::assembleLine( "replace", attr ) + "\n"; + tmp += LDIF::assembleLine( attr, value ) + "\n"; + if ( mod ) tmp += "-\n"; + } + return ( tmp ); +} + +bool ResourceLDAPTDEIO::AddresseeToLDIF( TQByteArray &ldif, const Addressee &addr, + const TQString &olddn ) +{ + TQCString tmp; + TQString dn; + TQByteArray data; + bool mod = false; + + if ( olddn.isEmpty() ) { + //insert new entry + switch ( d->mRDNPrefix ) { + case 1: + dn = mAttributes[ "uid" ] + "=" + addr.uid() + "," +mDn; + break; + case 0: + default: + dn = mAttributes[ "commonName" ] + "=" + addr.assembledName() + "," +mDn; + break; + } + } else { + //modify existing entry + mod = true; + if ( olddn.startsWith( mAttributes[ "uid" ] ) ) { + dn = mAttributes[ "uid" ] + "=" + addr.uid() + "," + olddn.section( ',', 1 ); + } else if ( olddn.startsWith( mAttributes[ "commonName" ] ) ) { + dn = mAttributes[ "commonName" ] + "=" + addr.assembledName() + "," + + olddn.section( ',', 1 ); + } else { + dn = olddn; + } + + if ( olddn.lower() != dn.lower() ) { + tmp = LDIF::assembleLine( "dn", olddn ) + "\n"; + tmp += "changetype: modrdn\n"; + tmp += LDIF::assembleLine( "newrdn", dn.section( ',', 0, 0 ) ) + "\n"; + tmp += "deleteoldrdn: 1\n\n"; + } + } + + + tmp += LDIF::assembleLine( "dn", dn ) + "\n"; + if ( mod ) tmp += "changetype: modify\n"; + if ( !mod ) { + tmp += "objectClass: top\n"; + TQStringList obclass = TQStringList::split( ',', mAttributes[ "objectClass" ] ); + for ( TQStringList::iterator it = obclass.begin(); it != obclass.end(); it++ ) { + tmp += LDIF::assembleLine( "objectClass", *it ) + "\n"; + } + } + + tmp += addEntry( mAttributes[ "commonName" ], addr.assembledName(), mod ); + tmp += addEntry( mAttributes[ "formattedName" ], addr.formattedName(), mod ); + tmp += addEntry( mAttributes[ "givenName" ], addr.givenName(), mod ); + tmp += addEntry( mAttributes[ "familyName" ], addr.familyName(), mod ); + tmp += addEntry( mAttributes[ "uid" ], addr.uid(), mod ); + + PhoneNumber number; + number = addr.phoneNumber( PhoneNumber::Home ); + tmp += addEntry( mAttributes[ "phoneNumber" ], number.number().utf8(), mod ); + number = addr.phoneNumber( PhoneNumber::Work ); + tmp += addEntry( mAttributes[ "telephoneNumber" ], number.number().utf8(), mod ); + number = addr.phoneNumber( PhoneNumber::Fax ); + tmp += addEntry( mAttributes[ "facsimileTelephoneNumber" ], number.number().utf8(), mod ); + number = addr.phoneNumber( PhoneNumber::Cell ); + tmp += addEntry( mAttributes[ "mobile" ], number.number().utf8(), mod ); + number = addr.phoneNumber( PhoneNumber::Pager ); + tmp += addEntry( mAttributes[ "pager" ], number.number().utf8(), mod ); + + tmp += addEntry( mAttributes[ "description" ], addr.note(), mod ); + tmp += addEntry( mAttributes[ "title" ], addr.title(), mod ); + tmp += addEntry( mAttributes[ "organization" ], addr.organization(), mod ); + + Address ad = addr.address( Address::Home ); + if ( !ad.isEmpty() ) { + tmp += addEntry( mAttributes[ "street" ], ad.street(), mod ); + tmp += addEntry( mAttributes[ "state" ], ad.region(), mod ); + tmp += addEntry( mAttributes[ "city" ], ad.locality(), mod ); + tmp += addEntry( mAttributes[ "postalcode" ], ad.postalCode(), mod ); + } + + TQStringList emails = addr.emails(); + TQStringList::ConstIterator mailIt = emails.begin(); + + if ( !mAttributes[ "mail" ].isEmpty() ) { + if ( mod ) tmp += + LDIF::assembleLine( "replace", mAttributes[ "mail" ] ) + "\n"; + if ( mailIt != emails.end() ) { + tmp += LDIF::assembleLine( mAttributes[ "mail" ], *mailIt ) + "\n"; + mailIt ++; + } + if ( mod && mAttributes[ "mail" ] != mAttributes[ "mailAlias" ] ) tmp += "-\n"; + } + + if ( !mAttributes[ "mailAlias" ].isEmpty() ) { + if ( mod && mAttributes[ "mail" ] != mAttributes[ "mailAlias" ] ) tmp += + LDIF::assembleLine( "replace", mAttributes[ "mailAlias" ] ) + "\n"; + for ( ; mailIt != emails.end(); ++mailIt ) { + tmp += LDIF::assembleLine( mAttributes[ "mailAlias" ], *mailIt ) + "\n" ; + } + if ( mod ) tmp += "-\n"; + } + + if ( !mAttributes[ "jpegPhoto" ].isEmpty() ) { + TQByteArray pic; + TQBuffer buffer( pic ); + buffer.open( IO_WriteOnly ); + addr.photo().data().save( &buffer, "JPEG" ); + + if ( mod ) tmp += + LDIF::assembleLine( "replace", mAttributes[ "jpegPhoto" ] ) + "\n"; + tmp += LDIF::assembleLine( mAttributes[ "jpegPhoto" ], pic, 76 ) + "\n"; + if ( mod ) tmp += "-\n"; + } + + tmp += "\n"; + kdDebug(7125) << "ldif: " << TQString(TQString::fromUtf8(tmp)) << endl; + ldif = tmp; + return true; +} + +void ResourceLDAPTDEIO::setReadOnly( bool value ) +{ + //save the original readonly flag, because offline using disables writing + d->mReadOnly = true; + Resource::setReadOnly( value ); +} + +void ResourceLDAPTDEIO::init() +{ + if ( mPort == 0 ) mPort = 389; + + /** + If you want to add new attributes, append them here, add a + translation string in the ctor of AttributesDialog and + handle them in the load() method below. + These are the default values + */ + if ( !mAttributes.contains("objectClass") ) + mAttributes.insert( "objectClass", "inetOrgPerson" ); + if ( !mAttributes.contains("commonName") ) + mAttributes.insert( "commonName", "cn" ); + if ( !mAttributes.contains("formattedName") ) + mAttributes.insert( "formattedName", "displayName" ); + if ( !mAttributes.contains("familyName") ) + mAttributes.insert( "familyName", "sn" ); + if ( !mAttributes.contains("givenName") ) + mAttributes.insert( "givenName", "givenName" ); + if ( !mAttributes.contains("mail") ) + mAttributes.insert( "mail", "mail" ); + if ( !mAttributes.contains("mailAlias") ) + mAttributes.insert( "mailAlias", "" ); + if ( !mAttributes.contains("phoneNumber") ) + mAttributes.insert( "phoneNumber", "homePhone" ); + if ( !mAttributes.contains("telephoneNumber") ) + mAttributes.insert( "telephoneNumber", "telephoneNumber" ); + if ( !mAttributes.contains("facsimileTelephoneNumber") ) + mAttributes.insert( "facsimileTelephoneNumber", "facsimileTelephoneNumber" ); + if ( !mAttributes.contains("mobile") ) + mAttributes.insert( "mobile", "mobile" ); + if ( !mAttributes.contains("pager") ) + mAttributes.insert( "pager", "pager" ); + if ( !mAttributes.contains("description") ) + mAttributes.insert( "description", "description" ); + + if ( !mAttributes.contains("title") ) + mAttributes.insert( "title", "title" ); + if ( !mAttributes.contains("street") ) + mAttributes.insert( "street", "street" ); + if ( !mAttributes.contains("state") ) + mAttributes.insert( "state", "st" ); + if ( !mAttributes.contains("city") ) + mAttributes.insert( "city", "l" ); + if ( !mAttributes.contains("organization") ) + mAttributes.insert( "organization", "o" ); + if ( !mAttributes.contains("postalcode") ) + mAttributes.insert( "postalcode", "postalCode" ); + + if ( !mAttributes.contains("uid") ) + mAttributes.insert( "uid", "uid" ); + if ( !mAttributes.contains("jpegPhoto") ) + mAttributes.insert( "jpegPhoto", "jpegPhoto" ); + + d->mLDAPUrl = KURL(); + if ( !mAnonymous ) { + d->mLDAPUrl.setUser( mUser ); + d->mLDAPUrl.setPass( mPassword ); + } + d->mLDAPUrl.setProtocol( d->mSSL ? "ldaps" : "ldap"); + d->mLDAPUrl.setHost( mHost ); + d->mLDAPUrl.setPort( mPort ); + d->mLDAPUrl.setDn( mDn ); + + if (!mAttributes.empty()) { + TQMap::Iterator it; + TQStringList attr; + for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) { + if ( !it.data().isEmpty() && it.key() != "objectClass" ) + attr.append( it.data() ); + } + d->mLDAPUrl.setAttributes( attr ); + } + + d->mLDAPUrl.setScope( d->mSubTree ? LDAPUrl::Sub : LDAPUrl::One ); + if ( !mFilter.isEmpty() && mFilter != "(objectClass=*)" ) + d->mLDAPUrl.setFilter( mFilter ); + d->mLDAPUrl.setExtension( "x-dir", "base" ); + if ( d->mTLS ) d->mLDAPUrl.setExtension( "x-tls", "" ); + d->mLDAPUrl.setExtension( "x-ver", TQString::number( d->mVer ) ); + if ( d->mSizeLimit ) + d->mLDAPUrl.setExtension( "x-sizelimit", TQString::number( d->mSizeLimit ) ); + if ( d->mTimeLimit ) + d->mLDAPUrl.setExtension( "x-timelimit", TQString::number( d->mTimeLimit ) ); + if ( d->mSASL ) { + d->mLDAPUrl.setExtension( "x-sasl", "" ); + if ( !d->mBindDN.isEmpty() ) d->mLDAPUrl.setExtension( "bindname", d->mBindDN ); + if ( !d->mMech.isEmpty() ) d->mLDAPUrl.setExtension( "x-mech", d->mMech ); + if ( !d->mRealm.isEmpty() ) d->mLDAPUrl.setExtension( "x-realm", d->mRealm ); + } + + d->mReadOnly = readOnly(); + + kdDebug(7125) << "resource_ldaptdeio url: " << d->mLDAPUrl.prettyURL() << endl; +} + +void ResourceLDAPTDEIO::writeConfig( TDEConfig *config ) +{ + Resource::writeConfig( config ); + + config->writeEntry( "LdapUser", mUser ); + config->writeEntry( "LdapPassword", KStringHandler::obscure( mPassword ) ); + config->writeEntry( "LdapDn", mDn ); + config->writeEntry( "LdapHost", mHost ); + config->writeEntry( "LdapPort", mPort ); + config->writeEntry( "LdapFilter", mFilter ); + config->writeEntry( "LdapAnonymous", mAnonymous ); + config->writeEntry( "LdapTLS", d->mTLS ); + config->writeEntry( "LdapSSL", d->mSSL ); + config->writeEntry( "LdapSubTree", d->mSubTree ); + config->writeEntry( "LdapSASL", d->mSASL ); + config->writeEntry( "LdapMech", d->mMech ); + config->writeEntry( "LdapVer", d->mVer ); + config->writeEntry( "LdapTimeLimit", d->mTimeLimit ); + config->writeEntry( "LdapSizeLimit", d->mSizeLimit ); + config->writeEntry( "LdapRDNPrefix", d->mRDNPrefix ); + config->writeEntry( "LdapRealm", d->mRealm ); + config->writeEntry( "LdapBindDN", d->mBindDN ); + config->writeEntry( "LdapCachePolicy", d->mCachePolicy ); + config->writeEntry( "LdapAutoCache", d->mAutoCache ); + + TQStringList attributes; + TQMap::Iterator it; + for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) + attributes << it.key() << it.data(); + + config->writeEntry( "LdapAttributes", attributes ); +} + +Ticket *ResourceLDAPTDEIO::requestSaveTicket() +{ + if ( !addressBook() ) { + kdDebug(7125) << "no addressbook" << endl; + return 0; + } + + return createTicket( this ); +} + +void ResourceLDAPTDEIO::releaseSaveTicket( Ticket *ticket ) +{ + delete ticket; +} + +bool ResourceLDAPTDEIO::doOpen() +{ + return true; +} + +void ResourceLDAPTDEIO::doClose() +{ +} + +void ResourceLDAPTDEIO::createCache() +{ + d->mTmp = NULL; + if ( d->mCachePolicy == Cache_NoConnection && d->mAutoCache ) { + d->mTmp = new KTempFile( d->mCacheDst, "tmp" ); + d->mTmp->setAutoDelete( true ); + } +} + +void ResourceLDAPTDEIO::activateCache() +{ + if ( d->mTmp && d->mError == 0 ) { + d->mTmp->close(); + rename( TQFile::encodeName( d->mTmp->name() ), TQFile::encodeName( d->mCacheDst ) ); + } + if ( d->mTmp ) { + delete d->mTmp; + d->mTmp = 0; + } +} + +TDEIO::Job *ResourceLDAPTDEIO::loadFromCache() +{ + TDEIO::Job *job = NULL; + if ( d->mCachePolicy == Cache_Always || + ( d->mCachePolicy == Cache_NoConnection && + d->mError == TDEIO::ERR_COULD_NOT_CONNECT ) ) { + + d->mAddr = Addressee(); + d->mAd = Address( Address::Home ); + //initialize ldif parser + d->mLdif.startParsing(); + + Resource::setReadOnly( true ); + + KURL url( d->mCacheDst ); + job = TDEIO::get( url, true, false ); + connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( data( TDEIO::Job*, const TQByteArray& ) ) ); + } + return job; +} + +bool ResourceLDAPTDEIO::load() +{ + kdDebug(7125) << "ResourceLDAPTDEIO::load()" << endl; + TDEIO::Job *job; + + clear(); + //clear the addressee + d->mAddr = Addressee(); + d->mAd = Address( Address::Home ); + //initialize ldif parser + d->mLdif.startParsing(); + + //set to original settings, offline use will disable writing + Resource::setReadOnly( d->mReadOnly ); + + createCache(); + if ( d->mCachePolicy != Cache_Always ) { + job = TDEIO::get( d->mLDAPUrl, true, false ); + connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( data( TDEIO::Job*, const TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( syncLoadSaveResult( TDEIO::Job* ) ) ); + enter_loop(); + } + + job = loadFromCache(); + if ( job ) { + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( syncLoadSaveResult( TDEIO::Job* ) ) ); + enter_loop(); + } + if ( mErrorMsg.isEmpty() ) { + kdDebug(7125) << "ResourceLDAPTDEIO load ok!" << endl; + return true; + } else { + kdDebug(7125) << "ResourceLDAPTDEIO load finished with error: " << mErrorMsg << endl; + addressBook()->error( mErrorMsg ); + return false; + } +} + +bool ResourceLDAPTDEIO::asyncLoad() +{ + clear(); + //clear the addressee + d->mAddr = Addressee(); + d->mAd = Address( Address::Home ); + //initialize ldif parser + d->mLdif.startParsing(); + + Resource::setReadOnly( d->mReadOnly ); + + createCache(); + if ( d->mCachePolicy != Cache_Always ) { + TDEIO::Job *job = TDEIO::get( d->mLDAPUrl, true, false ); + connect( job, TQT_SIGNAL( data( TDEIO::Job*, const TQByteArray& ) ), + this, TQT_SLOT( data( TDEIO::Job*, const TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( result( TDEIO::Job* ) ) ); + } else { + result( NULL ); + } + return true; +} + +void ResourceLDAPTDEIO::data( TDEIO::Job *, const TQByteArray &data ) +{ + if ( data.size() ) { + d->mLdif.setLDIF( data ); + if ( d->mTmp ) { + d->mTmp->file()->writeBlock( data ); + } + } else { + d->mLdif.endLDIF(); + } + + LDIF::ParseVal ret; + TQString name; + TQByteArray value; + do { + ret = d->mLdif.nextItem(); + switch ( ret ) { + case LDIF::NewEntry: + kdDebug(7125) << "new entry: " << d->mLdif.dn() << endl; + break; + case LDIF::Item: + name = d->mLdif.attr().lower(); + value = d->mLdif.val(); + if ( name == mAttributes[ "commonName" ].lower() ) { + if ( !d->mAddr.formattedName().isEmpty() ) { + TQString fn = d->mAddr.formattedName(); + d->mAddr.setNameFromString( TQString::fromUtf8( value, value.size() ) ); + d->mAddr.setFormattedName( fn ); + } else + d->mAddr.setNameFromString( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "formattedName" ].lower() ) { + d->mAddr.setFormattedName( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "givenName" ].lower() ) { + d->mAddr.setGivenName( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "mail" ].lower() ) { + d->mAddr.insertEmail( TQString::fromUtf8( value, value.size() ), true ); + } else if ( name == mAttributes[ "mailAlias" ].lower() ) { + d->mAddr.insertEmail( TQString::fromUtf8( value, value.size() ), false ); + } else if ( name == mAttributes[ "phoneNumber" ].lower() ) { + PhoneNumber phone; + phone.setNumber( TQString::fromUtf8( value, value.size() ) ); + d->mAddr.insertPhoneNumber( phone ); + } else if ( name == mAttributes[ "telephoneNumber" ].lower() ) { + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), + PhoneNumber::Work ); + d->mAddr.insertPhoneNumber( phone ); + } else if ( name == mAttributes[ "facsimileTelephoneNumber" ].lower() ) { + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), + PhoneNumber::Fax ); + d->mAddr.insertPhoneNumber( phone ); + } else if ( name == mAttributes[ "mobile" ].lower() ) { + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), + PhoneNumber::Cell ); + d->mAddr.insertPhoneNumber( phone ); + } else if ( name == mAttributes[ "pager" ].lower() ) { + PhoneNumber phone( TQString::fromUtf8( value, value.size() ), + PhoneNumber::Pager ); + d->mAddr.insertPhoneNumber( phone ); + } else if ( name == mAttributes[ "description" ].lower() ) { + d->mAddr.setNote( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "title" ].lower() ) { + d->mAddr.setTitle( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "street" ].lower() ) { + d->mAd.setStreet( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "state" ].lower() ) { + d->mAd.setRegion( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "city" ].lower() ) { + d->mAd.setLocality( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "postalcode" ].lower() ) { + d->mAd.setPostalCode( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "organization" ].lower() ) { + d->mAddr.setOrganization( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "familyName" ].lower() ) { + d->mAddr.setFamilyName( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "uid" ].lower() ) { + d->mAddr.setUid( TQString::fromUtf8( value, value.size() ) ); + } else if ( name == mAttributes[ "jpegPhoto" ].lower() ) { + KABC::Picture photo; + TQImage img( value ); + if ( !img.isNull() ) { + photo.setData( img ); + photo.setType( "image/jpeg" ); + d->mAddr.setPhoto( photo ); + } + } + + break; + case LDIF::EndEntry: { + d->mAddr.setResource( this ); + d->mAddr.insertAddress( d->mAd ); + d->mAddr.setChanged( false ); + insertAddressee( d->mAddr ); + //clear the addressee + d->mAddr = Addressee(); + d->mAd = Address( Address::Home ); + } + break; + default: + break; + } + } while ( ret != LDIF::MoreData ); +} + +void ResourceLDAPTDEIO::loadCacheResult( TDEIO::Job *job ) +{ + mErrorMsg = ""; + d->mError = job->error(); + if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) { + mErrorMsg = job->errorString(); + } + if ( !mErrorMsg.isEmpty() ) + emit loadingError( this, mErrorMsg ); + else + emit loadingFinished( this ); +} + +void ResourceLDAPTDEIO::result( TDEIO::Job *job ) +{ + mErrorMsg = ""; + if ( job ) { + d->mError = job->error(); + if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) { + mErrorMsg = job->errorString(); + } + } else { + d->mError = 0; + } + activateCache(); + + TDEIO::Job *cjob; + cjob = loadFromCache(); + if ( cjob ) { + connect( cjob, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( loadCacheResult( TDEIO::Job* ) ) ); + } else { + if ( !mErrorMsg.isEmpty() ) + emit loadingError( this, mErrorMsg ); + else + emit loadingFinished( this ); + } +} + +bool ResourceLDAPTDEIO::save( Ticket* ) +{ + kdDebug(7125) << "ResourceLDAPTDEIO save" << endl; + + d->mSaveIt = begin(); + TDEIO::Job *job = TDEIO::put( d->mLDAPUrl, -1, true, false, false ); + connect( job, TQT_SIGNAL( dataReq( TDEIO::Job*, TQByteArray& ) ), + this, TQT_SLOT( saveData( TDEIO::Job*, TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( syncLoadSaveResult( TDEIO::Job* ) ) ); + enter_loop(); + if ( mErrorMsg.isEmpty() ) { + kdDebug(7125) << "ResourceLDAPTDEIO save ok!" << endl; + return true; + } else { + kdDebug(7125) << "ResourceLDAPTDEIO finished with error: " << mErrorMsg << endl; + addressBook()->error( mErrorMsg ); + return false; + } +} + +bool ResourceLDAPTDEIO::asyncSave( Ticket* ) +{ + kdDebug(7125) << "ResourceLDAPTDEIO asyncSave" << endl; + d->mSaveIt = begin(); + TDEIO::Job *job = TDEIO::put( d->mLDAPUrl, -1, true, false, false ); + connect( job, TQT_SIGNAL( dataReq( TDEIO::Job*, TQByteArray& ) ), + this, TQT_SLOT( saveData( TDEIO::Job*, TQByteArray& ) ) ); + connect( job, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( saveResult( TDEIO::Job* ) ) ); + return true; +} + +void ResourceLDAPTDEIO::syncLoadSaveResult( TDEIO::Job *job ) +{ + d->mError = job->error(); + if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) + mErrorMsg = job->errorString(); + else + mErrorMsg = ""; + activateCache(); + + tqApp->exit_loop(); +} + +void ResourceLDAPTDEIO::saveResult( TDEIO::Job *job ) +{ + d->mError = job->error(); + if ( d->mError && d->mError != TDEIO::ERR_USER_CANCELED ) + emit savingError( this, job->errorString() ); + else + emit savingFinished( this ); +} + +void ResourceLDAPTDEIO::saveData( TDEIO::Job*, TQByteArray& data ) +{ + while ( d->mSaveIt != end() && + !(*d->mSaveIt).changed() ) d->mSaveIt++; + + if ( d->mSaveIt == end() ) { + kdDebug(7125) << "ResourceLDAPTDEIO endData" << endl; + data.resize(0); + return; + } + + kdDebug(7125) << "ResourceLDAPTDEIO saveData: " << (*d->mSaveIt).assembledName() << endl; + + AddresseeToLDIF( data, *d->mSaveIt, findUid( (*d->mSaveIt).uid() ) ); +// kdDebug(7125) << "ResourceLDAPTDEIO save LDIF: " << TQString::fromUtf8(data) << endl; + // mark as unchanged + (*d->mSaveIt).setChanged( false ); + + d->mSaveIt++; +} + +void ResourceLDAPTDEIO::removeAddressee( const Addressee& addr ) +{ + TQString dn = findUid( addr.uid() ); + + kdDebug(7125) << "ResourceLDAPTDEIO: removeAddressee: " << dn << endl; + + if ( !mErrorMsg.isEmpty() ) { + addressBook()->error( mErrorMsg ); + return; + } + if ( !dn.isEmpty() ) { + kdDebug(7125) << "ResourceLDAPTDEIO: found uid: " << dn << endl; + LDAPUrl url( d->mLDAPUrl ); + url.setPath( "/" + dn ); + url.setExtension( "x-dir", "base" ); + url.setScope( LDAPUrl::Base ); + if ( TDEIO::NetAccess::del( url, NULL ) ) mAddrMap.erase( addr.uid() ); + } else { + //maybe it's not saved yet + mAddrMap.erase( addr.uid() ); + } +} + + +void ResourceLDAPTDEIO::setUser( const TQString &user ) +{ + mUser = user; +} + +TQString ResourceLDAPTDEIO::user() const +{ + return mUser; +} + +void ResourceLDAPTDEIO::setPassword( const TQString &password ) +{ + mPassword = password; +} + +TQString ResourceLDAPTDEIO::password() const +{ + return mPassword; +} + +void ResourceLDAPTDEIO::setDn( const TQString &dn ) +{ + mDn = dn; +} + +TQString ResourceLDAPTDEIO::dn() const +{ + return mDn; +} + +void ResourceLDAPTDEIO::setHost( const TQString &host ) +{ + mHost = host; +} + +TQString ResourceLDAPTDEIO::host() const +{ + return mHost; +} + +void ResourceLDAPTDEIO::setPort( int port ) +{ + mPort = port; +} + +int ResourceLDAPTDEIO::port() const +{ + return mPort; +} + +void ResourceLDAPTDEIO::setVer( int ver ) +{ + d->mVer = ver; +} + +int ResourceLDAPTDEIO::ver() const +{ + return d->mVer; +} + +void ResourceLDAPTDEIO::setSizeLimit( int sizelimit ) +{ + d->mSizeLimit = sizelimit; +} + +int ResourceLDAPTDEIO::sizeLimit() +{ + return d->mSizeLimit; +} + +void ResourceLDAPTDEIO::setTimeLimit( int timelimit ) +{ + d->mTimeLimit = timelimit; +} + +int ResourceLDAPTDEIO::timeLimit() +{ + return d->mTimeLimit; +} + +void ResourceLDAPTDEIO::setFilter( const TQString &filter ) +{ + mFilter = filter; +} + +TQString ResourceLDAPTDEIO::filter() const +{ + return mFilter; +} + +void ResourceLDAPTDEIO::setIsAnonymous( bool value ) +{ + mAnonymous = value; +} + +bool ResourceLDAPTDEIO::isAnonymous() const +{ + return mAnonymous; +} + +void ResourceLDAPTDEIO::setIsTLS( bool value ) +{ + d->mTLS = value; +} + +bool ResourceLDAPTDEIO::isTLS() const +{ + return d->mTLS; +} +void ResourceLDAPTDEIO::setIsSSL( bool value ) +{ + d->mSSL = value; +} + +bool ResourceLDAPTDEIO::isSSL() const +{ + return d->mSSL; +} + +void ResourceLDAPTDEIO::setIsSubTree( bool value ) +{ + d->mSubTree = value; +} + +bool ResourceLDAPTDEIO::isSubTree() const +{ + return d->mSubTree; +} + +void ResourceLDAPTDEIO::setAttributes( const TQMap &attributes ) +{ + mAttributes = attributes; +} + +TQMap ResourceLDAPTDEIO::attributes() const +{ + return mAttributes; +} + +void ResourceLDAPTDEIO::setRDNPrefix( int value ) +{ + d->mRDNPrefix = value; +} + +int ResourceLDAPTDEIO::RDNPrefix() const +{ + return d->mRDNPrefix; +} + +void ResourceLDAPTDEIO::setIsSASL( bool value ) +{ + d->mSASL = value; +} + +bool ResourceLDAPTDEIO::isSASL() const +{ + return d->mSASL; +} + +void ResourceLDAPTDEIO::setMech( const TQString &mech ) +{ + d->mMech = mech; +} + +TQString ResourceLDAPTDEIO::mech() const +{ + return d->mMech; +} + +void ResourceLDAPTDEIO::setRealm( const TQString &realm ) +{ + d->mRealm = realm; +} + +TQString ResourceLDAPTDEIO::realm() const +{ + return d->mRealm; +} + +void ResourceLDAPTDEIO::setBindDN( const TQString &binddn ) +{ + d->mBindDN = binddn; +} + +TQString ResourceLDAPTDEIO::bindDN() const +{ + return d->mBindDN; +} + +void ResourceLDAPTDEIO::setCachePolicy( int pol ) +{ + d->mCachePolicy = pol; +} + +int ResourceLDAPTDEIO::cachePolicy() const +{ + return d->mCachePolicy; +} + +void ResourceLDAPTDEIO::setAutoCache( bool value ) +{ + d->mAutoCache = value; +} + +bool ResourceLDAPTDEIO::autoCache() +{ + return d->mAutoCache; +} + +TQString ResourceLDAPTDEIO::cacheDst() const +{ + return d->mCacheDst; +} + + +#include "resourceldaptdeio.moc" diff --git a/tdeabc/plugins/ldaptdeio/resourceldaptdeio.h b/tdeabc/plugins/ldaptdeio/resourceldaptdeio.h new file mode 100644 index 000000000..bf1b70ec0 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/resourceldaptdeio.h @@ -0,0 +1,171 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + Copyright (c) 2004 Szombathelyi György + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_RESOURCELDAP_H +#define KABC_RESOURCELDAP_H + +#include +#include +#include + +class TDEConfig; + +namespace KABC { + +class KABC_EXPORT ResourceLDAPTDEIO : public Resource +{ + Q_OBJECT + + public: + enum CachePolicy{ Cache_No, Cache_NoConnection, Cache_Always }; + + ResourceLDAPTDEIO( const TDEConfig* ); + virtual ~ResourceLDAPTDEIO(); + /** + * Call this after you used one of the set... methods + */ + virtual void init(); + + virtual void writeConfig( TDEConfig* ); + + virtual bool doOpen(); + virtual void doClose(); + + virtual Ticket *requestSaveTicket(); + virtual void releaseSaveTicket( Ticket* ); + + virtual bool readOnly() const { return Resource::readOnly(); } + virtual void setReadOnly( bool value ); + + virtual bool load(); + virtual bool asyncLoad(); + virtual bool save( Ticket * ticket ); + virtual bool asyncSave( Ticket * ticket ); + + virtual void removeAddressee( const Addressee& addr ); + + void setUser( const TQString &user ); + TQString user() const; + + void setPassword( const TQString &password ); + TQString password() const; + + void setRealm( const TQString &realm ); + TQString realm() const; + + void setBindDN( const TQString &binddn ); + TQString bindDN() const; + + void setDn( const TQString &dn ); + TQString dn() const; + + void setHost( const TQString &host ); + TQString host() const; + + void setPort( int port ); + int port() const; + + void setVer( int ver ); + int ver() const; + + void setSizeLimit( int sizelimit ); + int sizeLimit(); + + void setTimeLimit( int timelimit ); + int timeLimit(); + + void setFilter( const TQString &filter ); + TQString filter() const; + + void setIsAnonymous( bool value ); + bool isAnonymous() const; + + void setAttributes( const TQMap &attributes ); + TQMap attributes() const; + + void setRDNPrefix( int value ); + int RDNPrefix() const; + + void setIsTLS( bool value ); + bool isTLS() const ; + + void setIsSSL( bool value ); + bool isSSL() const; + + void setIsSubTree( bool value ); + bool isSubTree() const ; + + void setIsSASL( bool value ); + bool isSASL() const ; + + void setMech( const TQString &mech ); + TQString mech() const; + + void setCachePolicy( int pol ); + int cachePolicy() const; + + void setAutoCache( bool value ); + bool autoCache(); + + TQString cacheDst() const; + +protected slots: + void entries( TDEIO::Job*, const TDEIO::UDSEntryList& ); + void data( TDEIO::Job*, const TQByteArray& ); + void result( TDEIO::Job* ); + void listResult( TDEIO::Job* ); + void syncLoadSaveResult( TDEIO::Job* ); + void saveResult( TDEIO::Job* ); + void saveData( TDEIO::Job*, TQByteArray& ); + void loadCacheResult( TDEIO::Job* ); + + private: + TQString mUser; + TQString mPassword; + TQString mDn; + TQString mHost; + TQString mFilter; + int mPort; + bool mAnonymous; + TQMap mAttributes; + + KURL mLDAPUrl; + int mGetCounter; //KDE 4: remove + bool mErrorOccured; //KDE 4: remove + TQString mErrorMsg; + TQMap mJobMap; //KDE 4: remove + + TDEIO::Job *loadFromCache(); + void createCache(); + void activateCache(); + void enter_loop(); + TQCString addEntry( const TQString &attr, const TQString &value, bool mod ); + TQString findUid( const TQString &uid ); + bool AddresseeToLDIF( TQByteArray &ldif, const Addressee &addr, + const TQString &olddn ); + + class ResourceLDAPTDEIOPrivate; + ResourceLDAPTDEIOPrivate *d; +}; + +} + +#endif diff --git a/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp b/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp new file mode 100644 index 000000000..a6af7d065 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.cpp @@ -0,0 +1,388 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 - 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "resourceldaptdeio.h" + +#include "resourceldaptdeioconfig.h" +#include "resourceldaptdeioconfig.moc" + +using namespace KABC; + +ResourceLDAPTDEIOConfig::ResourceLDAPTDEIOConfig( TQWidget* parent, const char* name ) + : KRES::ConfigWidget( parent, name ) +{ + TQBoxLayout *mainLayout = new TQVBoxLayout( this ); + mainLayout->setAutoAdd( true ); + cfg = new LdapConfigWidget( LdapConfigWidget::W_ALL, this ); + + mSubTree = new TQCheckBox( i18n( "Sub-tree query" ), this ); + TQHBox *box = new TQHBox( this ); + box->setSpacing( KDialog::spacingHint() ); + mEditButton = new TQPushButton( i18n( "Edit Attributes..." ), box ); + mCacheButton = new TQPushButton( i18n( "Offline Use..." ), box ); + + connect( mEditButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editAttributes() ) ); + connect( mCacheButton, TQT_SIGNAL( clicked() ), TQT_SLOT( editCache() ) ); +} + +void ResourceLDAPTDEIOConfig::loadSettings( KRES::Resource *res ) +{ + ResourceLDAPTDEIO *resource = dynamic_cast( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceLDAPTDEIOConfig::loadSettings(): cast failed" << endl; + return; + } + + cfg->setUser( resource->user() ); + cfg->setPassword( resource->password() ); + cfg->setRealm( resource->realm() ); + cfg->setBindDN( resource->bindDN() ); + cfg->setHost( resource->host() ); + cfg->setPort( resource->port() ); + cfg->setVer( resource->ver() ); + cfg->setTimeLimit( resource->timeLimit() ); + cfg->setSizeLimit( resource->sizeLimit() ); + cfg->setDn( resource->dn() ); + cfg->setFilter( resource->filter() ); + cfg->setMech( resource->mech() ); + if ( resource->isTLS() ) cfg->setSecTLS(); + else if ( resource->isSSL() ) cfg->setSecSSL(); + else cfg->setSecNO(); + if ( resource->isAnonymous() ) cfg->setAuthAnon(); + else if ( resource->isSASL() ) cfg->setAuthSASL(); + else cfg->setAuthSimple(); + + mSubTree->setChecked( resource->isSubTree() ); + mAttributes = resource->attributes(); + mRDNPrefix = resource->RDNPrefix(); + mCachePolicy = resource->cachePolicy(); + mCacheDst = resource->cacheDst(); + mAutoCache = resource->autoCache(); +} + +void ResourceLDAPTDEIOConfig::saveSettings( KRES::Resource *res ) +{ + ResourceLDAPTDEIO *resource = dynamic_cast( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceLDAPTDEIOConfig::saveSettings(): cast failed" << endl; + return; + } + + resource->setUser( cfg->user() ); + resource->setPassword( cfg->password() ); + resource->setRealm( cfg->realm() ); + resource->setBindDN( cfg->bindDN() ); + resource->setHost( cfg->host() ); + resource->setPort( cfg->port() ); + resource->setVer( cfg->ver() ); + resource->setTimeLimit( cfg->timeLimit() ); + resource->setSizeLimit( cfg->sizeLimit() ); + resource->setDn( cfg->dn() ); + resource->setFilter( cfg->filter() ); + resource->setIsAnonymous( cfg->isAuthAnon() ); + resource->setIsSASL( cfg->isAuthSASL() ); + resource->setMech( cfg->mech() ); + resource->setIsTLS( cfg->isSecTLS() ); + resource->setIsSSL( cfg->isSecSSL() ); + resource->setIsSubTree( mSubTree->isChecked() ); + resource->setAttributes( mAttributes ); + resource->setRDNPrefix( mRDNPrefix ); + resource->setCachePolicy( mCachePolicy ); + resource->init(); + +} + +void ResourceLDAPTDEIOConfig::editAttributes() +{ + AttributesDialog dlg( mAttributes, mRDNPrefix, this ); + if ( dlg.exec() ) { + mAttributes = dlg.attributes(); + mRDNPrefix = dlg.rdnprefix(); + } +} + +void ResourceLDAPTDEIOConfig::editCache() +{ + LDAPUrl src; + TQStringList attr; + + src = cfg->url(); + src.setScope( mSubTree->isChecked() ? LDAPUrl::Sub : LDAPUrl::One ); + if (!mAttributes.empty()) { + TQMap::Iterator it; + TQStringList attr; + for ( it = mAttributes.begin(); it != mAttributes.end(); ++it ) { + if ( !it.data().isEmpty() && it.key() != "objectClass" ) + attr.append( it.data() ); + } + src.setAttributes( attr ); + } + src.setExtension( "x-dir", "base" ); + OfflineDialog dlg( mAutoCache, mCachePolicy, src, mCacheDst, this ); + if ( dlg.exec() ) { + mCachePolicy = dlg.cachePolicy(); + mAutoCache = dlg.autoCache(); + } + +} + +AttributesDialog::AttributesDialog( const TQMap &attributes, + int rdnprefix, + TQWidget *parent, const char *name ) + : KDialogBase( Plain, i18n( "Attributes Configuration" ), Ok | Cancel, + Ok, parent, name, true, true ) +{ + mNameDict.setAutoDelete( true ); + mNameDict.insert( "objectClass", new TQString( i18n( "Object classes" ) ) ); + mNameDict.insert( "commonName", new TQString( i18n( "Common name" ) ) ); + mNameDict.insert( "formattedName", new TQString( i18n( "Formatted name" ) ) ); + mNameDict.insert( "familyName", new TQString( i18n( "Family name" ) ) ); + mNameDict.insert( "givenName", new TQString( i18n( "Given name" ) ) ); + mNameDict.insert( "organization", new TQString( i18n( "Organization" ) ) ); + mNameDict.insert( "title", new TQString( i18n( "Title" ) ) ); + mNameDict.insert( "street", new TQString( i18n( "Street" ) ) ); + mNameDict.insert( "state", new TQString( i18n( "State" ) ) ); + mNameDict.insert( "city", new TQString( i18n( "City" ) ) ); + mNameDict.insert( "postalcode", new TQString( i18n( "Postal code" ) ) ); + mNameDict.insert( "mail", new TQString( i18n( "Email" ) ) ); + mNameDict.insert( "mailAlias", new TQString( i18n( "Email alias" ) ) ); + mNameDict.insert( "phoneNumber", new TQString( i18n( "Telephone number" ) ) ); + mNameDict.insert( "telephoneNumber", new TQString( i18n( "Work telephone number" ) ) ); + mNameDict.insert( "facsimileTelephoneNumber", new TQString( i18n( "Fax number" ) ) ); + mNameDict.insert( "mobile", new TQString( i18n( "Cell phone number" ) ) ); + mNameDict.insert( "pager", new TQString( i18n( "Pager" ) ) ); + mNameDict.insert( "description", new TQString( i18n( "Note" ) ) ); + mNameDict.insert( "uid", new TQString( i18n( "UID" ) ) ); + mNameDict.insert( "jpegPhoto", new TQString( i18n( "Photo" ) ) ); + + // default map + mDefaultMap.insert( "objectClass", "inetOrgPerson" ); + mDefaultMap.insert( "commonName", "cn" ); + mDefaultMap.insert( "formattedName", "displayName" ); + mDefaultMap.insert( "familyName", "sn" ); + mDefaultMap.insert( "givenName", "givenName" ); + mDefaultMap.insert( "title", "title" ); + mDefaultMap.insert( "street", "street" ); + mDefaultMap.insert( "state", "st" ); + mDefaultMap.insert( "city", "l" ); + mDefaultMap.insert( "organization", "o" ); + mDefaultMap.insert( "postalcode", "postalCode" ); + mDefaultMap.insert( "mail", "mail" ); + mDefaultMap.insert( "mailAlias", "" ); + mDefaultMap.insert( "phoneNumber", "homePhone" ); + mDefaultMap.insert( "telephoneNumber", "telephoneNumber" ); + mDefaultMap.insert( "facsimileTelephoneNumber", "facsimileTelephoneNumber" ); + mDefaultMap.insert( "mobile", "mobile" ); + mDefaultMap.insert( "pager", "pager" ); + mDefaultMap.insert( "description", "description" ); + mDefaultMap.insert( "uid", "uid" ); + mDefaultMap.insert( "jpegPhoto", "jpegPhoto" ); + + // overwrite the default values here + TQMap kolabMap, netscapeMap, evolutionMap, outlookMap; + + // kolab + kolabMap.insert( "formattedName", "display-name" ); + kolabMap.insert( "mailAlias", "mailalias" ); + + // evolution + evolutionMap.insert( "formattedName", "fileAs" ); + + mMapList.append( attributes ); + mMapList.append( kolabMap ); + mMapList.append( netscapeMap ); + mMapList.append( evolutionMap ); + mMapList.append( outlookMap ); + + TQFrame *page = plainPage(); + TQGridLayout *layout = new TQGridLayout( page, 4, ( attributes.count() + 4 ) >> 1, + 0, spacingHint() ); + + TQLabel *label = new TQLabel( i18n( "Template:" ), page ); + layout->addWidget( label, 0, 0 ); + mMapCombo = new KComboBox( page ); + layout->addWidget( mMapCombo, 0, 1 ); + + mMapCombo->insertItem( i18n( "User Defined" ) ); + mMapCombo->insertItem( i18n( "Kolab" ) ); + mMapCombo->insertItem( i18n( "Netscape" ) ); + mMapCombo->insertItem( i18n( "Evolution" ) ); + mMapCombo->insertItem( i18n( "Outlook" ) ); + connect( mMapCombo, TQT_SIGNAL( activated( int ) ), TQT_SLOT( mapChanged( int ) ) ); + + label = new TQLabel( i18n( "RDN prefix attribute:" ), page ); + layout->addWidget( label, 1, 0 ); + mRDNCombo = new KComboBox( page ); + layout->addWidget( mRDNCombo, 1, 1 ); + mRDNCombo->insertItem( i18n( "commonName" ) ); + mRDNCombo->insertItem( i18n( "UID" ) ); + mRDNCombo->setCurrentItem( rdnprefix ); + + TQMap::ConstIterator it; + int i, j = 0; + for ( i = 2, it = attributes.begin(); it != attributes.end(); ++it, ++i ) { + if ( mNameDict[ it.key() ] == 0 ) { + i--; + continue; + } + if ( (uint)(i - 2) == ( mNameDict.count() >> 1 ) ) { + i = 0; + j = 2; + } + kdDebug(7125) << "itkey: " << it.key() << " i: " << i << endl; + label = new TQLabel( *mNameDict[ it.key() ] + ":", page ); + KLineEdit *lineedit = new KLineEdit( page ); + mLineEditDict.insert( it.key(), lineedit ); + lineedit->setText( it.data() ); + label->setBuddy( lineedit ); + layout->addWidget( label, i, j ); + layout->addWidget( lineedit, i, j+1 ); + } + + for ( i = 1; i < mMapCombo->count(); i++ ) { + TQDictIterator it2( mLineEditDict ); + for ( ; it2.current(); ++it2 ) { + if ( mMapList[ i ].contains( it2.currentKey() ) ) { + if ( mMapList[ i ][ it2.currentKey() ] != it2.current()->text() ) break; + } else { + if ( mDefaultMap[ it2.currentKey() ] != it2.current()->text() ) break; + } + } + if ( !it2.current() ) { + mMapCombo->setCurrentItem( i ); + break; + } + } + + TDEAcceleratorManager::manage( this ); +} + +AttributesDialog::~AttributesDialog() +{ +} + +TQMap AttributesDialog::attributes() const +{ + TQMap map; + + TQDictIterator it( mLineEditDict ); + for ( ; it.current(); ++it ) + map.insert( it.currentKey(), it.current()->text() ); + + return map; +} + +int AttributesDialog::rdnprefix() const +{ + return mRDNCombo->currentItem(); +} + +void AttributesDialog::mapChanged( int pos ) +{ + + // apply first the default and than the spezific changes + TQMap::Iterator it; + for ( it = mDefaultMap.begin(); it != mDefaultMap.end(); ++it ) + mLineEditDict[ it.key() ]->setText( it.data() ); + + for ( it = mMapList[ pos ].begin(); it != mMapList[ pos ].end(); ++it ) { + if ( !it.data().isEmpty() ) { + KLineEdit *le = mLineEditDict[ it.key() ]; + if ( le ) le->setText( it.data() ); + } + } +} + +OfflineDialog::OfflineDialog( bool autoCache, int cachePolicy, const KURL &src, + const TQString &dst, TQWidget *parent, const char *name ) + : KDialogBase( Plain, i18n( "Offline Configuration" ), Ok | Cancel, + Ok, parent, name, true, true ) +{ + TQFrame *page = plainPage(); + TQVBoxLayout *layout = new TQVBoxLayout( page ); + layout->setAutoAdd( true ); + + mSrc = src; mDst = dst; + mCacheGroup = new TQButtonGroup( 1, Qt::Horizontal, + i18n("Offline Cache Policy"), page ); + + TQRadioButton *bt; + new TQRadioButton( i18n("Do not use offline cache"), mCacheGroup ); + bt = new TQRadioButton( i18n("Use local copy if no connection"), mCacheGroup ); + new TQRadioButton( i18n("Always use local copy"), mCacheGroup ); + mCacheGroup->setButton( cachePolicy ); + + mAutoCache = new TQCheckBox( i18n("Refresh offline cache automatically"), + page ); + mAutoCache->setChecked( autoCache ); + mAutoCache->setEnabled( bt->isChecked() ); + + connect( bt, TQT_SIGNAL(toggled(bool)), mAutoCache, TQT_SLOT(setEnabled(bool)) ); + + TQPushButton *lcache = new TQPushButton( i18n("Load into Cache"), page ); + connect( lcache, TQT_SIGNAL( clicked() ), TQT_SLOT( loadCache() ) ); +} + +OfflineDialog::~OfflineDialog() +{ +} + +bool OfflineDialog::autoCache() const +{ + return mAutoCache->isChecked(); +} + +int OfflineDialog::cachePolicy() const +{ + return mCacheGroup->selectedId(); +} + +void OfflineDialog::loadCache() +{ + if ( TDEIO::NetAccess::download( mSrc, mDst, this ) ) { + KMessageBox::information( this, + i18n("Successfully downloaded directory server contents!") ); + } else { + KMessageBox::error( this, + i18n("An error occurred downloading directory server contents into file %1.").arg(mDst) ); + } +} diff --git a/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.h b/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.h new file mode 100644 index 000000000..121cf639e --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/resourceldaptdeioconfig.h @@ -0,0 +1,118 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 - 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef RESOURCELDAPCONFIG_H +#define RESOURCELDAPCONFIG_H + +#include +#include +#include +#include + +#include +#include +#include +#include + + +class TQCheckBox; +class TQPushButton; +class TQSpinBox; +class TQString; + +class KComboBox; +class KLineEdit; + +namespace KABC { + +class KABC_EXPORT ResourceLDAPTDEIOConfig : public KRES::ConfigWidget +{ + Q_OBJECT + + public: + ResourceLDAPTDEIOConfig( TQWidget* parent = 0, const char* name = 0 ); + + public slots: + void loadSettings( KRES::Resource* ); + void saveSettings( KRES::Resource* ); + + private slots: + void editAttributes(); + void editCache(); + private: + TQPushButton *mEditButton, *mCacheButton; + LdapConfigWidget *cfg; + TQCheckBox *mSubTree; + TQMap mAttributes; + int mRDNPrefix, mCachePolicy; + bool mAutoCache; + TQString mCacheDst; +}; + +class AttributesDialog : public KDialogBase +{ + Q_OBJECT + + public: + AttributesDialog( const TQMap &attributes, int rdnprefix, + TQWidget *parent, const char *name = 0 ); + ~AttributesDialog(); + + TQMap attributes() const; + int rdnprefix() const; + + private slots: + void mapChanged( int pos ); + + private: + enum { UserMap, KolabMap, NetscapeMap, EvolutionMap, OutlookMap }; + + KComboBox *mMapCombo, *mRDNCombo; + TQValueList< TQMap > mMapList; + TQMap mDefaultMap; + TQDict mLineEditDict; + TQDict mNameDict; +}; + +class OfflineDialog : public KDialogBase +{ + Q_OBJECT + + public: + OfflineDialog( bool autoCache, int cachePolicy, const KURL &src, + const TQString &dst, TQWidget *parent, const char *name = 0 ); + ~OfflineDialog(); + + int cachePolicy() const; + bool autoCache() const; + + private slots: + void loadCache(); + + private: + KURL mSrc; + TQString mDst; + TQButtonGroup *mCacheGroup; + TQCheckBox *mAutoCache; +}; + +} + +#endif diff --git a/tdeabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp b/tdeabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp new file mode 100644 index 000000000..6d173eb51 --- /dev/null +++ b/tdeabc/plugins/ldaptdeio/resourceldaptdeioplugin.cpp @@ -0,0 +1,36 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "resourceldaptdeio.h" +#include "resourceldaptdeioconfig.h" + +#include +#include + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT void *init_kabc_ldaptdeio() + { + TDEGlobal::locale()->insertCatalogue("kabc_ldaptdeio"); + return new KRES::PluginFactory(); + } +} diff --git a/tdeabc/plugins/net/CMakeLists.txt b/tdeabc/plugins/net/CMakeLists.txt new file mode 100644 index 000000000..cc9564995 --- /dev/null +++ b/tdeabc/plugins/net/CMakeLists.txt @@ -0,0 +1,73 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR}/kabc + ${CMAKE_SOURCE_DIR}/kabc + + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR} + ${CMAKE_SOURCE_DIR}/dcop + ${CMAKE_SOURCE_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdeui + ${CMAKE_SOURCE_DIR}/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdeio + ${CMAKE_SOURCE_DIR}/tdeio/tdefile +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + resourcenet.h + DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) + + +##### other data ################################ + +install( FILES net.desktop DESTINATION ${SERVICES_INSTALL_DIR}/tderesources/kabc ) + + +##### kabc_net (library) ######################## + +set( target kabc_net ) + +set( ${target}_SRCS + resourcenet.cpp resourcenetconfig.cpp +) + +tde_add_library( ${target} SHARED AUTOMOC + SOURCES ${${target}_SRCS} + VERSION 1.0.0 + LINK tdeabc-shared + DESTINATION ${LIB_INSTALL_DIR} +) + + +##### kabc_net (module) ######################### + +set( target kabc_net ) + +set( ${target}_SRCS + resourcenetplugin.cpp +) + +tde_add_kpart( ${target} AUTOMOC + SOURCES ${${target}_SRCS} + LINK kabc_net-shared + DESTINATION ${PLUGIN_INSTALL_DIR} +) diff --git a/tdeabc/plugins/net/Makefile.am b/tdeabc/plugins/net/Makefile.am new file mode 100644 index 000000000..c2ded1b44 --- /dev/null +++ b/tdeabc/plugins/net/Makefile.am @@ -0,0 +1,28 @@ +INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourcenetconfig.h + +lib_LTLIBRARIES = libkabc_net.la +libkabc_net_la_SOURCES = resourcenet.cpp resourcenetconfig.cpp +libkabc_net_la_LDFLAGS = $(KDE_RPATH) $(all_libraries) -version-info 1:0:0 -no-undefined +libkabc_net_la_LIBADD = $(top_builddir)/tdeabc/libkabc.la $(LIB_KIO) +libkabc_net_la_COMPILE_FIRST = $(top_builddir)/tdeabc/addressee.h + +kde_module_LTLIBRARIES = kabc_net.la +kabc_net_la_SOURCES = resourcenetplugin.cpp +kabc_net_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) $(LIB_QT) -L../../../tdecore/.libs/ -ltdecore +kabc_net_la_LIBADD = libkabc_net.la + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_net.pot + +kabcincludedir = $(includedir)/kabc +kabcinclude_HEADERS = resourcenet.h + +servicedir = $(kde_servicesdir)/tderesources/kabc +service_DATA = net.desktop + +resourcenetplugin.lo: ../../addressee.h diff --git a/tdeabc/plugins/net/net.desktop b/tdeabc/plugins/net/net.desktop new file mode 100644 index 000000000..2c72c202d --- /dev/null +++ b/tdeabc/plugins/net/net.desktop @@ -0,0 +1,90 @@ +[Desktop Entry] +Name=Network +Name[af]=Netwerk +Name[ar]=الشبكة +Name[az]=Şəbəkə +Name[be]=Сетка +Name[bn]=নেটওয়ার্ক +Name[br]=Rouedad +Name[bs]=Mreža +Name[ca]=Xarxa +Name[cs]=Síť +Name[csb]=Sec +Name[cy]=Rhydwaith +Name[da]=Netværk +Name[de]=Netzwerk +Name[el]=Δίκτυο +Name[eo]=Reto +Name[es]=Red +Name[et]=Võrk +Name[eu]=Sarea +Name[fa]=شبکه +Name[fi]=Verkko +Name[fr]=Réseau +Name[fy]=Netwurk +Name[ga]=Líonra +Name[gl]=Rede +Name[he]=רשת +Name[hi]=नेटवर्क +Name[hr]=Mreža +Name[hsb]=Syć +Name[hu]=Hálózat +Name[id]=Jaringan +Name[is]=Net +Name[it]=Rete +Name[ja]=ネットワーク +Name[ka]=ქსელი +Name[kk]=Желі +Name[km]=បណ្តាញ +Name[ko]=네트워크 +Name[ku]=Tor +Name[lb]=Netzwierk +Name[lt]=Tinklas +Name[lv]=Tīkls +Name[mi]=Hao +Name[mk]=Мрежа +Name[mn]=Сүлжээ +Name[ms]=Jaringan +Name[nds]=Nettwark +Name[ne]=सञ्जाल +Name[nl]=Netwerk +Name[nn]=Nettverk +Name[nso]=Kgokagano +Name[oc]=Resèu +Name[pa]=ਨੈੱਟਵਰਕ +Name[pl]=Sieć +Name[pt]=Rede +Name[pt_BR]=Rede +Name[ro]=Reţea +Name[ru]=Сеть +Name[rw]=Urusobe +Name[se]=Fierbmi +Name[sk]=Sieť +Name[sl]=Omrežje +Name[sq]=Rrjeta +Name[sr]=Мрежа +Name[sr@Latn]=Mreža +Name[ss]=Luchungechunge +Name[sv]=Nätverk +Name[ta]=பிணையம் +Name[te]=కలన జాలం +Name[tg]=Шабака +Name[th]=ระบบเครือข่าย +Name[tr]=Ağ +Name[tt]=Çeltär +Name[uk]=Мережа +Name[uz]=Tarmoq +Name[uz@cyrillic]=Tarмоқ +Name[ven]=Vhukwamani +Name[vi]=mạng +Name[wa]=Rantoele +Name[xh]=Umsebenzi womnatha +Name[zh_CN]=网络 +Name[zh_HK]=網絡 +Name[zh_TW]=網路 +Name[zu]=Umsebenzi wokuxhumana okusakazekile +X-TDE-Library=kabc_net +Type=Service +ServiceTypes=KResources/Plugin +X-TDE-ResourceFamily=contact +X-TDE-ResourceType=net diff --git a/tdeabc/plugins/net/resourcenet.cpp b/tdeabc/plugins/net/resourcenet.cpp new file mode 100644 index 000000000..5a46890d8 --- /dev/null +++ b/tdeabc/plugins/net/resourcenet.cpp @@ -0,0 +1,393 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include + +#include "addressbook.h" +#include "formatfactory.h" +#include "resourcenetconfig.h" +#include "stdaddressbook.h" + +#include "resourcenet.h" + +using namespace KABC; + +class ResourceNet::ResourceNetPrivate +{ + public: + TDEIO::Job *mLoadJob; + bool mIsLoading; + + TDEIO::Job *mSaveJob; + bool mIsSaving; + + TQString mLastErrorString; +}; + +ResourceNet::ResourceNet( const TDEConfig *config ) + : Resource( config ), mFormat( 0 ), + mTempFile( 0 ), + d( new ResourceNetPrivate ) +{ + if ( config ) { + init( KURL( config->readPathEntry( "NetUrl" ) ), config->readEntry( "NetFormat" ) ); + } else { + init( KURL(), TQString("vcard").latin1() ); + } +} + +ResourceNet::ResourceNet( const KURL &url, const TQString &format ) + : Resource( 0 ), mFormat( 0 ), + mTempFile( 0 ), + d( new ResourceNetPrivate ) +{ + init( url, format ); +} + +void ResourceNet::init( const KURL &url, const TQString &format ) +{ + d->mLoadJob = 0; + d->mIsLoading = false; + d->mSaveJob = 0; + d->mIsSaving = false; + + mFormatName = format; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); + if ( !mFormat ) { + mFormatName = TQString("vcard").latin1(); + mFormat = factory->format( mFormatName ); + } + + setUrl( url ); +} + +ResourceNet::~ResourceNet() +{ + if ( d->mIsLoading ) + d->mLoadJob->kill(); + if ( d->mIsSaving ) + d->mSaveJob->kill(); + + delete d; + d = 0; + + delete mFormat; + mFormat = 0; + + deleteLocalTempFile(); +} + +void ResourceNet::writeConfig( TDEConfig *config ) +{ + Resource::writeConfig( config ); + + config->writePathEntry( "NetUrl", mUrl.url() ); + config->writeEntry( "NetFormat", mFormatName ); +} + +Ticket *ResourceNet::requestSaveTicket() +{ + kdDebug(5700) << "ResourceNet::requestSaveTicket()" << endl; + + return createTicket( this ); +} + +void ResourceNet::releaseSaveTicket( Ticket *ticket ) +{ + delete ticket; +} + +bool ResourceNet::doOpen() +{ + return true; +} + +void ResourceNet::doClose() +{ +} + +bool ResourceNet::load() +{ + TQString tempFile; + + if ( !TDEIO::NetAccess::download( mUrl, tempFile, 0 ) ) { + addressBook()->error( i18n( "Unable to download file '%1'." ).arg( mUrl.prettyURL() ) ); + return false; + } + + TQFile file( tempFile ); + if ( !file.open( IO_ReadOnly ) ) { + addressBook()->error( i18n( "Unable to open file '%1'." ).arg( tempFile ) ); + TDEIO::NetAccess::removeTempFile( tempFile ); + return false; + } + + bool result = clearAndLoad( &file ); + if ( !result ) + addressBook()->error( i18n( "Problems during parsing file '%1'." ).arg( tempFile ) ); + + TDEIO::NetAccess::removeTempFile( tempFile ); + + return result; +} + +bool ResourceNet::clearAndLoad( TQFile *file ) +{ + clear(); + return mFormat->loadAll( addressBook(), this, file ); +} + +bool ResourceNet::asyncLoad() +{ + if ( d->mIsLoading ) { + abortAsyncLoading(); + } + + if (d->mIsSaving) { + kdWarning(5700) << "Aborted asyncLoad() because we're still asyncSave()ing!" << endl; + return false; + } + + bool ok = createLocalTempFile(); + if ( ok ) + mTempFile->sync(); + ok = mTempFile->close(); + + if ( !ok ) { + emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile->name() ) ); + deleteLocalTempFile(); + return false; + } + + KURL dest; + dest.setPath( mTempFile->name() ); + + TDEIO::Scheduler::checkSlaveOnHold( true ); + d->mLoadJob = TDEIO::file_copy( mUrl, dest, -1, true, false, false ); + d->mIsLoading = true; + connect( d->mLoadJob, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( downloadFinished( TDEIO::Job* ) ) ); + + return true; +} + +void ResourceNet::abortAsyncLoading() +{ + kdDebug(5700) << "ResourceNet::abortAsyncLoading()" << endl; + + if ( d->mLoadJob ) { + d->mLoadJob->kill(); // result not emitted + d->mLoadJob = 0; + } + + deleteLocalTempFile(); + d->mIsLoading = false; +} + +void ResourceNet::abortAsyncSaving() +{ + kdDebug(5700) << "ResourceNet::abortAsyncSaving()" << endl; + + if ( d->mSaveJob ) { + d->mSaveJob->kill(); // result not emitted + d->mSaveJob = 0; + } + + deleteLocalTempFile(); + d->mIsSaving = false; +} + +bool ResourceNet::save( Ticket* ) +{ + kdDebug(5700) << "ResourceNet::save()" << endl; + + if (d->mIsSaving) { + abortAsyncSaving(); + } + + KTempFile tempFile; + tempFile.setAutoDelete( true ); + bool ok = false; + + if ( tempFile.status() == 0 && tempFile.file() ) { + saveToFile( tempFile.file() ); + tempFile.sync(); + ok = tempFile.close(); + } + + if ( !ok ) { + addressBook()->error( i18n( "Unable to save file '%1'." ).arg( tempFile.name() ) ); + return false; + } + + ok = TDEIO::NetAccess::upload( tempFile.name(), mUrl, 0 ); + if ( !ok ) + addressBook()->error( i18n( "Unable to upload to '%1'." ).arg( mUrl.prettyURL() ) ); + + return ok; +} + +bool ResourceNet::asyncSave( Ticket* ) +{ + kdDebug(5700) << "ResourceNet::asyncSave()" << endl; + + if (d->mIsSaving) { + abortAsyncSaving(); + } + + if (d->mIsLoading) { + kdWarning(5700) << "Aborted asyncSave() because we're still asyncLoad()ing!" << endl; + return false; + } + + bool ok = createLocalTempFile(); + if ( ok ) { + saveToFile( mTempFile->file() ); + mTempFile->sync(); + ok = mTempFile->close(); + } + + if ( !ok ) { + emit savingError( this, i18n( "Unable to save file '%1'." ).arg( mTempFile->name() ) ); + deleteLocalTempFile(); + return false; + } + + KURL src; + src.setPath( mTempFile->name() ); + + TDEIO::Scheduler::checkSlaveOnHold( true ); + d->mIsSaving = true; + d->mSaveJob = TDEIO::file_copy( src, mUrl, -1, true, false, false ); + connect( d->mSaveJob, TQT_SIGNAL( result( TDEIO::Job* ) ), + this, TQT_SLOT( uploadFinished( TDEIO::Job* ) ) ); + + return true; +} + +bool ResourceNet::createLocalTempFile() +{ + deleteStaleTempFile(); + mTempFile = new KTempFile(); + mTempFile->setAutoDelete( true ); + return mTempFile->status() == 0; +} + +void ResourceNet::deleteStaleTempFile() +{ + if ( hasTempFile() ) { + kdDebug(5700) << "stale temp file detected " << mTempFile->name() << endl; + deleteLocalTempFile(); + } +} + +void ResourceNet::deleteLocalTempFile() +{ + delete mTempFile; + mTempFile = 0; +} + +void ResourceNet::saveToFile( TQFile *file ) +{ + mFormat->saveAll( addressBook(), this, file ); +} + +void ResourceNet::setUrl( const KURL &url ) +{ + mUrl = url; +} + +KURL ResourceNet::url() const +{ + return mUrl; +} + +void ResourceNet::setFormat( const TQString &name ) +{ + mFormatName = name; + if ( mFormat ) + delete mFormat; + + FormatFactory *factory = FormatFactory::self(); + mFormat = factory->format( mFormatName ); +} + +TQString ResourceNet::format() const +{ + return mFormatName; +} + +void ResourceNet::downloadFinished( TDEIO::Job* ) +{ + kdDebug(5700) << "ResourceNet::downloadFinished()" << endl; + + d->mIsLoading = false; + + if ( !hasTempFile() || mTempFile->status() != 0 ) { + d->mLastErrorString = i18n( "Download failed: Unable to create temporary file" ); + TQTimer::singleShot( 0, this, TQT_SLOT( signalError() ) ); + return; + } + + TQFile file( mTempFile->name() ); + if ( file.open( IO_ReadOnly ) ) { + if ( clearAndLoad( &file ) ) + emit loadingFinished( this ); + else + emit loadingError( this, i18n( "Problems during parsing file '%1'." ).arg( mTempFile->name() ) ); + } + else { + emit loadingError( this, i18n( "Unable to open file '%1'." ).arg( mTempFile->name() ) ); + } + + deleteLocalTempFile(); +} + +void ResourceNet::uploadFinished( TDEIO::Job *job ) +{ + kdDebug(5700) << "ResourceFile::uploadFinished()" << endl; + + d->mIsSaving = false; + + if ( job->error() ) + emit savingError( this, job->errorString() ); + else + emit savingFinished( this ); + + deleteLocalTempFile(); +} + +void ResourceNet::signalError() +{ + emit loadingError( this, d->mLastErrorString ); + d->mLastErrorString.truncate( 0 ); +} + +#include "resourcenet.moc" diff --git a/tdeabc/plugins/net/resourcenet.h b/tdeabc/plugins/net/resourcenet.h new file mode 100644 index 000000000..49707081e --- /dev/null +++ b/tdeabc/plugins/net/resourcenet.h @@ -0,0 +1,117 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_RESOURCENET_H +#define KABC_RESOURCENET_H + +#include + +#include + +#include + +class TQFile; +class TQTimer; +class KTempFile; + +namespace TDEIO { +class Job; +} + +namespace KABC { + +class FormatPlugin; + +/** + @internal +*/ +class KABC_EXPORT ResourceNet : public Resource +{ + Q_OBJECT + + public: + ResourceNet( const TDEConfig* ); + ResourceNet( const KURL &url, const TQString &format ); + ~ResourceNet(); + + virtual void writeConfig( TDEConfig* ); + + virtual bool doOpen(); + virtual void doClose(); + + virtual Ticket *requestSaveTicket(); + virtual void releaseSaveTicket( Ticket* ); + + virtual bool load(); + virtual bool asyncLoad(); + virtual bool save( Ticket* ticket ); + virtual bool asyncSave( Ticket* ticket ); + + /** + Set url of directory to be used for saving. + */ + void setUrl( const KURL & ); + + /** + Return url of directory used for loading and saving the address book. + */ + KURL url() const; + + /** + Sets a new format by name. + */ + void setFormat( const TQString &name ); + + /** + Returns the format name. + */ + TQString format() const; + + protected: + void init( const KURL &url, const TQString &format ); + + private slots: + void downloadFinished( TDEIO::Job* ); + void uploadFinished( TDEIO::Job* ); + void signalError(); + + private: + bool clearAndLoad( TQFile *file ); + void saveToFile( TQFile *file ); + bool hasTempFile() const { return mTempFile != 0; } + void abortAsyncLoading(); + void abortAsyncSaving(); + bool createLocalTempFile(); + void deleteLocalTempFile(); + void deleteStaleTempFile(); + + FormatPlugin *mFormat; + TQString mFormatName; + + KURL mUrl; + KTempFile *mTempFile; + + class ResourceNetPrivate; + ResourceNetPrivate *d; +}; + +} + +#endif diff --git a/tdeabc/plugins/net/resourcenetconfig.cpp b/tdeabc/plugins/net/resourcenetconfig.cpp new file mode 100644 index 000000000..8d5903f8b --- /dev/null +++ b/tdeabc/plugins/net/resourcenetconfig.cpp @@ -0,0 +1,102 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include + +#include "formatfactory.h" +#include "resourcenet.h" +#include "stdaddressbook.h" + +#include "resourcenetconfig.h" + +using namespace KABC; + +ResourceNetConfig::ResourceNetConfig( TQWidget* parent, const char* name ) + : ConfigWidget( parent, name ), mInEditMode( false ) +{ + TQGridLayout *mainLayout = new TQGridLayout( this, 2, 2, 0, + KDialog::spacingHint() ); + + TQLabel *label = new TQLabel( i18n( "Format:" ), this ); + mFormatBox = new KComboBox( this ); + + mainLayout->addWidget( label, 0, 0 ); + mainLayout->addWidget( mFormatBox, 0, 1 ); + + label = new TQLabel( i18n( "Location:" ), this ); + mUrlEdit = new KURLRequester( this ); + mUrlEdit->setMode( KFile::File ); + + mainLayout->addWidget( label, 1, 0 ); + mainLayout->addWidget( mUrlEdit, 1, 1 ); + + FormatFactory *factory = FormatFactory::self(); + TQStringList formats = factory->formats(); + TQStringList::Iterator it; + for ( it = formats.begin(); it != formats.end(); ++it ) { + FormatInfo *info = factory->info( *it ); + if ( info ) { + mFormatTypes << (*it); + mFormatBox->insertItem( info->nameLabel ); + } + } +} + +void ResourceNetConfig::setEditMode( bool value ) +{ + mFormatBox->setEnabled( !value ); + mInEditMode = value; +} + +void ResourceNetConfig::loadSettings( KRES::Resource *res ) +{ + ResourceNet *resource = dynamic_cast( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceNetConfig::loadSettings(): cast failed" << endl; + return; + } + + mFormatBox->setCurrentItem( mFormatTypes.findIndex( resource->format() ) ); + + mUrlEdit->setURL( resource->url().url() ); +} + +void ResourceNetConfig::saveSettings( KRES::Resource *res ) +{ + ResourceNet *resource = dynamic_cast( res ); + + if ( !resource ) { + kdDebug(5700) << "ResourceNetConfig::saveSettings(): cast failed" << endl; + return; + } + + if ( !mInEditMode ) + resource->setFormat( mFormatTypes[ mFormatBox->currentItem() ] ); + + resource->setUrl( KURL( mUrlEdit->url() ) ); +} + +#include "resourcenetconfig.moc" diff --git a/tdeabc/plugins/net/resourcenetconfig.h b/tdeabc/plugins/net/resourcenetconfig.h new file mode 100644 index 000000000..3c8986122 --- /dev/null +++ b/tdeabc/plugins/net/resourcenetconfig.h @@ -0,0 +1,53 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef RESOURCENETCONFIG_H +#define RESOURCENETCONFIG_H + +#include +#include + +#include + +namespace KABC { + +class KABC_EXPORT ResourceNetConfig : public KRES::ConfigWidget +{ + Q_OBJECT + + public: + ResourceNetConfig( TQWidget* parent = 0, const char* name = 0 ); + + void setEditMode( bool value ); + + public slots: + void loadSettings( KRES::Resource *resource ); + void saveSettings( KRES::Resource *resource ); + + private: + KComboBox* mFormatBox; + KURLRequester* mUrlEdit; + + TQStringList mFormatTypes; + bool mInEditMode; +}; + +} +#endif diff --git a/tdeabc/plugins/net/resourcenetplugin.cpp b/tdeabc/plugins/net/resourcenetplugin.cpp new file mode 100644 index 000000000..189bab051 --- /dev/null +++ b/tdeabc/plugins/net/resourcenetplugin.cpp @@ -0,0 +1,32 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "resourcenet.h" +#include "resourcenetconfig.h" + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT void *init_kabc_net() + { + return new KRES::PluginFactory(); + } +} diff --git a/tdeabc/plugins/sql/Makefile.am b/tdeabc/plugins/sql/Makefile.am new file mode 100644 index 000000000..3fa3986ce --- /dev/null +++ b/tdeabc/plugins/sql/Makefile.am @@ -0,0 +1,20 @@ +INCLUDES = -I$(top_srcdir)/kabc -I$(top_builddir)/kabc $(all_includes) + +# these are the headers for your project +noinst_HEADERS = resourcesql.h resourcesqlconfig.h + +kde_module_LTLIBRARIES = kabc_sql.la + +kabc_sql_la_SOURCES = resourcesql.cpp resourcesqlconfig.cpp + +kabc_sql_la_LDFLAGS = $(all_libraries) -module $(KDE_PLUGIN) +kabc_sql_la_LIBADD = ../../libkabc.la ../../../tdeui/libtdeui.la + +METASOURCES = AUTO + +messages: rc.cpp + $(XGETTEXT) *.cpp -o $(podir)/kabc_sql.pot + +linkdir = $(kde_datadir)/tderesources/contact +link_DATA = sql.desktop +EXTRA_DIST = $(link_DATA) diff --git a/tdeabc/plugins/sql/resourcesql.cpp b/tdeabc/plugins/sql/resourcesql.cpp new file mode 100644 index 000000000..e3744eeec --- /dev/null +++ b/tdeabc/plugins/sql/resourcesql.cpp @@ -0,0 +1,338 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include +#include + +#include "resourcesql.h" +#include "resourcesqlconfig.h" + +using namespace KABC; + +extern "C" +{ + KDE_EXPORT void *init_kabc_sql() + { + return new KRES::PluginFactory(); + } +} + +ResourceSql::ResourceSql( AddressBook *ab, const TDEConfig *config ) + : Resource( ab ), mDb( 0 ) +{ + TQString user, password, db, host; + + user = config->readEntry( "SqlUser" ); + password = cryptStr( config->readEntry( "SqlPassword " ) ); + db = config->readEntry( "SqlName" ); + host = config->readEntry( "SqlHost" ); + + init( user, password, db, host ); +} + +ResourceSql::ResourceSql( AddressBook *ab, const TQString &user, + const TQString &password, const TQString &db, const TQString &host ) + : Resource( ab ), mDb( 0 ) +{ + init( user, password, db, host ); +} + +void ResourceSql::init( const TQString &user, const TQString &password, + const TQString &db, const TQString &host ) +{ + mUser = user; + mPassword = password; + mDbName = db; + mHost = host; +} + +Ticket *ResourceSql::requestSaveTicket() +{ + if ( !addressBook() ) { + kdDebug(5700) << "no addressbook" << endl; + return 0; + } + + return createTicket( this ); +} + +bool ResourceSql::open() +{ + TQStringList drivers = TQSqlDatabase::drivers(); + for ( TQStringList::Iterator it = drivers.begin(); it != drivers.end(); ++it ) { + kdDebug(5700) << "Driver: " << (*it) << endl; + } + + mDb = TQSqlDatabase::addDatabase( "QMYSQL3" ); + + if ( !mDb ) { + kdDebug(5700) << "Error. Unable to connect to database." << endl; + return false; + } + + mDb->setDatabaseName( mDbName ); + mDb->setUserName( mUser ); + mDb->setPassword( mPassword ); + mDb->setHostName( mHost ); + + if ( !mDb->open() ) { + kdDebug(5700) << "Error. Unable to open database '" << mDbName << "'." << endl; + return false; + } + + return true; +} + +void ResourceSql::close() +{ + mDb->close(); +} + +bool ResourceSql::load() +{ + TQSqlQuery query( "select addressId, name, familyName, givenName, " + "additionalName, prefix, suffix, nickname, birthday, " + "mailer, timezone, geo_latitude, geo_longitude, title, " + "role, organization, note, productId, revision, " + "sortString, url from kaddressbook_main_" + mUser ); + + while ( query.next() ) { + TQString addrId = query.value(0).toString(); + + Addressee addr; + addr.setResource( this ); + addr.setUid( addrId ); + addr.setName( query.value(1).toString() ); + addr.setFamilyName( query.value(2).toString() ); + addr.setGivenName( query.value(3).toString() ); + addr.setAdditionalName( query.value(4).toString() ); + addr.setPrefix( query.value(5).toString() ); + addr.setSuffix( query.value(6).toString() ); + addr.setNickName( query.value(7).toString() ); + addr.setBirthday( query.value(8).toDateTime() ); + addr.setMailer( query.value(9).toString() ); + addr.setTimeZone( TimeZone( query.value(10).toInt() ) ); + addr.setGeo( Geo( query.value(11).toDouble(), query.value(12).toDouble() ) ); + addr.setTitle( query.value(13).toString() ); + addr.setRole( query.value(14).toString() ); + addr.setOrganization( query.value(15).toString() ); + addr.setNote( query.value(16).toString() ); + addr.setProductId( query.value(17).toString() ); + addr.setRevision( query.value(18).toDateTime() ); + addr.setSortString( query.value(19).toString() ); + addr.setUrl( query.value(20).toString() ); + + // emails + { + TQSqlQuery emailsQuery( "select email, preferred from kaddressbook_emails " + "where addressId = '" + addrId + "'" ); + while ( emailsQuery.next() ) + addr.insertEmail( emailsQuery.value( 0 ).toString(), + emailsQuery.value( 1 ).toInt() ); + } + + // phones + { + TQSqlQuery phonesQuery( "select number, type from kaddressbook_phones " + "where addressId = '" + addrId + "'" ); + while ( phonesQuery.next() ) + addr.insertPhoneNumber( PhoneNumber( phonesQuery.value( 0 ).toString(), + phonesQuery.value( 1 ).toInt() ) ); + } + + // addresses + { + TQSqlQuery addressesQuery( "select postOfficeBox, extended, street, " + "locality, region, postalCode, country, label, type " + "from kaddressbook_addresses where addressId = '" + addrId + "'" ); + while ( addressesQuery.next() ) { + Address a; + a.setPostOfficeBox( addressesQuery.value(0).toString() ); + a.setExtended( addressesQuery.value(1).toString() ); + a.setStreet( addressesQuery.value(2).toString() ); + a.setLocality( addressesQuery.value(3).toString() ); + a.setRegion( addressesQuery.value(4).toString() ); + a.setPostalCode( addressesQuery.value(5).toString() ); + a.setCountry( addressesQuery.value(6).toString() ); + a.setLabel( addressesQuery.value(7).toString() ); + a.setType( addressesQuery.value(8).toInt() ); + + addr.insertAddress( a ); + } + } + + // categories + { + TQSqlQuery categoriesQuery( "select category from kaddressbook_categories " + "where addressId = '" + addrId + "'" ); + while ( categoriesQuery.next() ) + addr.insertCategory( categoriesQuery.value( 0 ).toString() ); + } + + // customs + { + TQSqlQuery customsQuery( "select app, name, value from kaddressbook_customs " + "where addressId = '" + addrId + "'" ); + while ( customsQuery.next() ) + addr.insertCustom( customsQuery.value( 0 ).toString(), + customsQuery.value( 1 ).toString(), + customsQuery.value( 2 ).toString()); + } + + addressBook()->insertAddressee( addr ); + } + + return true; +} + +bool ResourceSql::save( Ticket * ) +{ + // we have to delete all entries for this user and reinsert them + TQSqlQuery query( "select addressId from kaddressbook_main_" + mUser ); + + while ( query.next() ) { + TQString addrId = query.value( 0 ).toString(); + TQSqlQuery q; + + q.exec( "DELETE FROM kaddressbook_emails WHERE addressId = '" + addrId + "'" ); + q.exec( "DELETE FROM kaddressbook_phones WHERE addressId = '" + addrId + "'" ); + q.exec( "DELETE FROM kaddressbook_addresses WHERE addressId = '" + addrId + "'" ); + q.exec( "DELETE FROM kaddressbook_categories WHERE addressId = '" + addrId + "'" ); + q.exec( "DELETE FROM kaddressbook_customs WHERE addressId = '" + addrId + "'" ); + + q.exec( "DELETE FROM kaddressbook_main_" + mUser + " WHERE addressId = '" + addrId + "'" ); + } + + // let's start... + AddressBook::Iterator it; + for ( it = addressBook()->begin(); it != addressBook()->end(); ++it ) { + if ( (*it).resource() != this && (*it).resource() != 0 ) // save only my and new entries + continue; + + TQString uid = (*it).uid(); + + query.exec( "INSERT INTO kaddressbook_main_" + mUser + " VALUES ('" + + (*it).uid() + "','" + + (*it).name() + "','" + + (*it).familyName() + "','" + + (*it).givenName() + "','" + + (*it).additionalName() + "','" + + (*it).prefix() + "','" + + (*it).suffix() + "','" + + (*it).nickName() + "','" + + (*it).birthday().toString( Qt::ISODate ) + "','" + + (*it).mailer() + "','" + + TQString::number( (*it).timeZone().offset() ) + "','" + + TQString::number( (*it).geo().latitude() ) + "','" + + TQString::number( (*it).geo().longitude() ) + "','" + + (*it).title() + "','" + + (*it).role() + "','" + + (*it).organization() + "','" + + (*it).note() + "','" + + (*it).productId() + "','" + + (*it).revision().toString( Qt::ISODate ) + "','" + + (*it).sortString() + "','" + + (*it).url().url() + "')" + ); + + // emails + { + TQStringList emails = (*it).emails(); + TQStringList::ConstIterator it; + bool preferred = true; + for( it = emails.begin(); it != emails.end(); ++it ) { + query.exec("INSERT INTO kaddressbook_emails VALUES ('" + + uid + "','" + + (*it) + "','" + + TQString::number(preferred) + "')"); + preferred = false; + } + } + + // phonenumbers + { + PhoneNumber::List phoneNumberList = (*it).phoneNumbers(); + PhoneNumber::List::ConstIterator it; + for( it = phoneNumberList.begin(); it != phoneNumberList.end(); ++it ) { + query.exec("INSERT INTO kaddressbook_phones VALUES ('" + + uid + "','" + + (*it).number() + "','" + + TQString::number( (*it).type() ) + "')"); + } + } + + // postal addresses + { + Address::List addressList = (*it).addresses(); + Address::List::ConstIterator it; + for( it = addressList.begin(); it != addressList.end(); ++it ) { + query.exec("INSERT INTO kaddressbook_addresses VALUES ('" + + uid + "','" + + (*it).postOfficeBox() + "','" + + (*it).extended() + "','" + + (*it).street() + "','" + + (*it).locality() + "','" + + (*it).region() + "','" + + (*it).postalCode() + "','" + + (*it).country() + "','" + + (*it).label() + "','" + + TQString::number( (*it).type() ) + "')"); + } + } + + // categories + { + TQStringList categories = (*it).categories(); + TQStringList::ConstIterator it; + for( it = categories.begin(); it != categories.end(); ++it ) + query.exec("INSERT INTO kaddressbook_categories VALUES ('" + + uid + "','" + + (*it) + "')"); + } + + // customs + { + TQStringList list = (*it).customs(); + TQStringList::ConstIterator it; + for( it = list.begin(); it != list.end(); ++it ) { + int dashPos = (*it).find( '-' ); + int colonPos = (*it).find( ':' ); + TQString app = (*it).left( dashPos ); + TQString name = (*it).mid( dashPos + 1, colonPos - dashPos - 1 ); + TQString value = (*it).right( (*it).length() - colonPos - 1 ); + + query.exec("INSERT INTO kaddressbook_categories VALUES ('" + + uid + "','" + app + "','" + name + "','" + value + "')"); + } + } + } + + return true; +} + +TQString ResourceSql::identifier() const +{ + return mHost + "_" + mDbName; +} diff --git a/tdeabc/plugins/sql/resourcesql.h b/tdeabc/plugins/sql/resourcesql.h new file mode 100644 index 000000000..770e5b73b --- /dev/null +++ b/tdeabc/plugins/sql/resourcesql.h @@ -0,0 +1,63 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_RESOURCESQL_H +#define KABC_RESOURCESQL_H + +#include + +#include "addressbook.h" +#include "resource.h" + +class TQSqlDatabase; + +namespace KABC { + +class ResourceSql : public Resource +{ +public: + ResourceSql( AddressBook *ab, const TQString &user, const TQString &password, + const TQString &db, const TQString &host ); + ResourceSql( AddressBook *ab, const TDEConfig * ); + + bool open(); + void close(); + + Ticket *requestSaveTicket(); + + bool load(); + bool save( Ticket * ticket ); + + TQString identifier() const; + +private: + void init(const TQString &user, const TQString &password, + const TQString &db, const TQString &host ); + + TQString mUser; + TQString mPassword; + TQString mDbName; + TQString mHost; + + TQSqlDatabase *mDb; +}; + +} +#endif diff --git a/tdeabc/plugins/sql/resourcesqlconfig.cpp b/tdeabc/plugins/sql/resourcesqlconfig.cpp new file mode 100644 index 000000000..2f5b9d5b7 --- /dev/null +++ b/tdeabc/plugins/sql/resourcesqlconfig.cpp @@ -0,0 +1,95 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include + +#include "resource.h" +#include "resourcesqlconfig.h" + +using namespace KABC; + +ResourceSqlConfig::ResourceSqlConfig( TQWidget* parent, const char* name ) + : ResourceConfigWidget( parent, name ) +{ + resize( 290, 170 ); + + TQGridLayout *mainLayout = new TQGridLayout( this, 4, 2 ); + + TQLabel *label = new TQLabel( i18n( "Username:" ), this ); + mUser = new KLineEdit( this ); + + mainLayout->addWidget( label, 0, 0 ); + mainLayout->addWidget( mUser, 0, 1 ); + + label = new TQLabel( i18n( "Password:" ), this ); + mPassword = new KLineEdit( this ); + mPassword->setEchoMode( KLineEdit::Password ); + + mainLayout->addWidget( label, 1, 0 ); + mainLayout->addWidget( mPassword, 1, 1 ); + + label = new TQLabel( i18n( "Host:" ), this ); + mHost = new KLineEdit( this ); + + mainLayout->addWidget( label, 2, 0 ); + mainLayout->addWidget( mHost, 2, 1 ); + + label = new TQLabel( i18n( "Port:" ), this ); + TQVBox *box = new TQVBox(this); + mPort = new TQSpinBox(0, 65535, 1, box ); + mPort->setSizePolicy(TQSizePolicy(TQSizePolicy::Maximum, TQSizePolicy::Preferred)); + mPort->setValue(389); + new TQWidget(box, "dummy"); + + mainLayout->addWidget( label, 3, 0 ); + mainLayout->addWidget( box, 3, 1 ); + + label = new TQLabel( i18n( "Database:" ), this ); + mDbName = new KLineEdit( this ); + + mainLayout->addWidget( label, 4, 0 ); + mainLayout->addWidget( mDbName, 4, 1 ); +} + +void ResourceSqlConfig::loadSettings( TDEConfig *config ) +{ + mUser->setText( config->readEntry( "SqlUser" ) ); + mPassword->setText( KABC::Resource::cryptStr( config->readEntry( "SqlPassword" ) ) ); + mDbName->setText( config->readEntry( "SqlName" ) ); + mHost->setText( config->readEntry( "SqlHost" ) ); + mPort->setValue( config->readNumEntry( "SqlPort" ) ); +} + +void ResourceSqlConfig::saveSettings( TDEConfig *config ) +{ + config->writeEntry( "SqlUser", mUser->text() ); + config->writeEntry( "SqlPassword", KABC::Resource::cryptStr( mPassword->text() ) ); + config->writeEntry( "SqlName", mDbName->text() ); + config->writeEntry( "SqlHost", mHost->text() ); + config->writeEntry( "SqlPort", mPort->value() ); +} + +#include "resourcesqlconfig.moc" diff --git a/tdeabc/plugins/sql/resourcesqlconfig.h b/tdeabc/plugins/sql/resourcesqlconfig.h new file mode 100644 index 000000000..ae2de7d6d --- /dev/null +++ b/tdeabc/plugins/sql/resourcesqlconfig.h @@ -0,0 +1,51 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef RESOURCESQLCONFIG_H +#define RESOURCESQLCONFIG_H + +#include "resourceconfigwidget.h" + +class KLineEdit; +class TQSpinBox; + +namespace KABC { + +class ResourceSqlConfig : public ResourceConfigWidget +{ + Q_OBJECT + +public: + ResourceSqlConfig( TQWidget* parent = 0, const char* name = 0 ); + +public slots: + void loadSettings( TDEConfig *config ); + void saveSettings( TDEConfig *config ); + +private: + KLineEdit* mUser; + KLineEdit* mPassword; + KLineEdit* mDbName; + KLineEdit* mHost; + TQSpinBox* mPort; +}; + +} +#endif diff --git a/tdeabc/plugins/sql/sql.desktop b/tdeabc/plugins/sql/sql.desktop new file mode 100644 index 000000000..4ac553008 --- /dev/null +++ b/tdeabc/plugins/sql/sql.desktop @@ -0,0 +1,10 @@ +[Misc] +Name=SQL +Name[bn]=এস-কিউ-এল (SQL) +Name[hi]=एसक्यूएल (SQL) +Name[ss]=I-SQL +Name[te]=ఏస్క్యుఎల్ + +[Plugin] +Type=sql +X-TDE-Library=kabc_sql diff --git a/tdeabc/resource.cpp b/tdeabc/resource.cpp new file mode 100644 index 000000000..9613d90b5 --- /dev/null +++ b/tdeabc/resource.cpp @@ -0,0 +1,351 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include "resource.h" + +using namespace KABC; + +Ticket::Ticket( Resource *resource ) + : mResource( resource ) +{ +} + +Ticket::~Ticket() +{ +/* FIXME: avoid cycle deletion + if ( mResource ) + mResource->releaseSaveTicket( this ); +*/ +} + +Resource *Ticket::resource() +{ + return mResource; +} + +struct Resource::Iterator::IteratorData +{ + Addressee::Map::Iterator mIt; +}; + +struct Resource::ConstIterator::ConstIteratorData +{ + Addressee::Map::ConstIterator mIt; +}; + +Resource::Iterator::Iterator() +{ + d = new IteratorData; +} + +Resource::Iterator::Iterator( const Resource::Iterator &i ) +{ + d = new IteratorData; + d->mIt = i.d->mIt; +} + +Resource::Iterator &Resource::Iterator::operator=( const Resource::Iterator &i ) +{ + if ( this == &i ) + return *this; + delete d; + + d = new IteratorData; + d->mIt = i.d->mIt; + return *this; +} + +Resource::Iterator::~Iterator() +{ + delete d; +} + +const Addressee &Resource::Iterator::operator*() const +{ + return d->mIt.data(); +} + +Addressee &Resource::Iterator::operator*() +{ + return d->mIt.data(); +} + +Resource::Iterator &Resource::Iterator::operator++() +{ + (d->mIt)++; + return *this; +} + +Resource::Iterator &Resource::Iterator::operator++( int ) +{ + (d->mIt)++; + return *this; +} + +Resource::Iterator &Resource::Iterator::operator--() +{ + (d->mIt)--; + return *this; +} + +Resource::Iterator &Resource::Iterator::operator--( int ) +{ + (d->mIt)--; + return *this; +} + +bool Resource::Iterator::operator==( const Iterator &it ) +{ + return ( d->mIt == it.d->mIt ); +} + +bool Resource::Iterator::operator!=( const Iterator &it ) +{ + return ( d->mIt != it.d->mIt ); +} + +Resource::ConstIterator::ConstIterator() +{ + d = new ConstIteratorData; +} + +Resource::ConstIterator::ConstIterator( const Resource::ConstIterator &i ) +{ + d = new ConstIteratorData; + d->mIt = i.d->mIt; +} + +Resource::ConstIterator::ConstIterator( const Resource::Iterator &i ) +{ + d = new ConstIteratorData; + d->mIt = i.d->mIt; +} + +Resource::ConstIterator &Resource::ConstIterator::operator=( const Resource::ConstIterator &i ) +{ + if ( this == &i ) + return *this; + delete d; + + d = new ConstIteratorData; + d->mIt = i.d->mIt; + return *this; +} + +Resource::ConstIterator::~ConstIterator() +{ + delete d; +} + +const Addressee &Resource::ConstIterator::operator*() const +{ + return *(d->mIt); +} + +Resource::ConstIterator &Resource::ConstIterator::operator++() +{ + (d->mIt)++; + return *this; +} + +Resource::ConstIterator &Resource::ConstIterator::operator++( int ) +{ + (d->mIt)++; + return *this; +} + +Resource::ConstIterator &Resource::ConstIterator::operator--() +{ + (d->mIt)--; + return *this; +} + +Resource::ConstIterator &Resource::ConstIterator::operator--( int ) +{ + (d->mIt)--; + return *this; +} + +bool Resource::ConstIterator::operator==( const ConstIterator &it ) +{ + return ( d->mIt == it.d->mIt ); +} + +bool Resource::ConstIterator::operator!=( const ConstIterator &it ) +{ + return ( d->mIt != it.d->mIt ); +} + + +Resource::Resource( const TDEConfig *config ) + : KRES::Resource( config ), mAddressBook( 0 ) +{ +} + +Resource::~Resource() +{ +} + +Resource::Iterator Resource::begin() +{ + Iterator it; + it.d->mIt = mAddrMap.begin(); + + return it; +} + +Resource::ConstIterator Resource::begin() const +{ + ConstIterator it; + it.d->mIt = mAddrMap.constBegin(); + return it; +} + +Resource::Iterator Resource::end() +{ + Iterator it; + it.d->mIt = mAddrMap.end(); + + return it; +} + +Resource::ConstIterator Resource::end() const +{ + ConstIterator it; + it.d->mIt = mAddrMap.constEnd(); + return it; +} + +void Resource::writeConfig( TDEConfig *config ) +{ + KRES::Resource::writeConfig( config ); +} + +void Resource::setAddressBook( AddressBook *ab ) +{ + mAddressBook = ab; +} + +AddressBook *Resource::addressBook() +{ + return mAddressBook; +} + +Ticket *Resource::createTicket( Resource *resource ) +{ + return new Ticket( resource ); +} + +void Resource::insertAddressee( const Addressee &addr ) +{ + mAddrMap.insert( addr.uid(), addr ); +} + +void Resource::removeAddressee( const Addressee &addr ) +{ + mAddrMap.erase( addr.uid() ); +} + +Addressee Resource::findByUid( const TQString &uid ) +{ + Addressee::Map::ConstIterator it = mAddrMap.find( uid ); + + if ( it != mAddrMap.end() ) + return it.data(); + + return Addressee(); +} + +Addressee::List Resource::findByName( const TQString &name ) +{ + Addressee::List results; + + ConstIterator it; + for ( it = begin(); it != end(); ++it ) { + if ( name == (*it).name() ) + results.append( *it ); + } + + return results; +} + +Addressee::List Resource::findByEmail( const TQString &email ) +{ + Addressee::List results; + const TQString lowerEmail = email.lower(); + + ConstIterator it; + for ( it = begin(); it != end(); ++it ) { + const TQStringList mailList = (*it).emails(); + for ( TQStringList::ConstIterator ite = mailList.begin(); ite != mailList.end(); ++ite ) { + if ( lowerEmail == (*ite).lower() ) + results.append( *it ); + } + } + + return results; +} + +Addressee::List Resource::findByCategory( const TQString &category ) +{ + Addressee::List results; + + ConstIterator it; + for ( it = begin(); it != end(); ++it ) { + if ( (*it).hasCategory( category) ) { + results.append( *it ); + } + } + + return results; +} + +void Resource::clear() +{ + mAddrMap.clear(); +} + +bool Resource::asyncLoad() +{ + bool ok = load(); + if ( !ok ) + emit loadingError( this, i18n( "Loading resource '%1' failed!" ) + .arg( resourceName() ) ); + else + emit loadingFinished( this ); + + return ok; +} + +bool Resource::asyncSave( Ticket *ticket ) { + bool ok = save( ticket ); + if ( !ok ) + emit savingError( this, i18n( "Saving resource '%1' failed!" ) + .arg( resourceName() ) ); + else + emit savingFinished( this ); + + return ok; +} + +#include "resource.moc" diff --git a/tdeabc/resource.h b/tdeabc/resource.h new file mode 100644 index 000000000..0f5167e7b --- /dev/null +++ b/tdeabc/resource.h @@ -0,0 +1,319 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_RESOURCE_H +#define KABC_RESOURCE_H + +#include + +#include "addressbook.h" +#include "plugin.h" + +namespace KABC { + +/** + * @short Helper class for handling coordinated save of address books. + * + * This class is used as helper class for saving address book. + * @see requestSaveTicket(), save(). + */ +class KABC_EXPORT Ticket +{ + friend class Resource; + + public: + ~Ticket(); + + Resource *resource(); + + private: + Ticket( Resource *resource ); + + Resource *mResource; +}; + +/** + * @internal + */ +class KABC_EXPORT Resource : public KRES::Resource +{ + Q_OBJECT + + public: + + /** + @short Resource Iterator + + This class provides an iterator for resource entries. + By default it points to a TQValueList::Iterator, + but you can reimplement this class to fit your own needs. + */ + class KABC_EXPORT Iterator + { + public: + Iterator(); + Iterator( const Iterator & ); + virtual ~Iterator(); + + virtual Iterator &operator=( const Iterator & ); + virtual const Addressee &operator*() const; + virtual Addressee &operator*(); + virtual Iterator &operator++(); + virtual Iterator &operator++( int ); + virtual Iterator &operator--(); + virtual Iterator &operator--( int ); + virtual bool operator==( const Iterator &it ); + virtual bool operator!=( const Iterator &it ); + + struct IteratorData; + IteratorData *d; + }; + + /** + @short Resource Const Iterator + + This class provides a const iterator for resource entries. + */ + class KABC_EXPORT ConstIterator + { + public: + ConstIterator(); + ConstIterator( const ConstIterator & ); + ConstIterator( const Iterator & ); + virtual ~ConstIterator(); + + virtual ConstIterator &operator=( const ConstIterator & ); + virtual const Addressee &operator*() const ; + virtual ConstIterator &operator++(); + virtual ConstIterator &operator++( int ); + virtual ConstIterator &operator--(); + virtual ConstIterator &operator--( int ); + virtual bool operator==( const ConstIterator &it ); + virtual bool operator!=( const ConstIterator &it ); + + struct ConstIteratorData; + ConstIteratorData *d; + }; + + /** + Constructor. + + @param config The config object where the derived classes can + read out their settings. + */ + Resource( const TDEConfig *config ); + + /** + Destructor. + */ + virtual ~Resource(); + + /** + Returns an iterator pointing to the first addressee in the resource. + This iterator equals end() if the resource is empty. + */ + virtual ConstIterator begin() const; + + /** + This is an overloaded member function, provided for convenience. It + behaves essentially like the above function. + */ + virtual Iterator begin(); + + /** + Returns an iterator pointing to the last addressee in the resource. + This iterator equals begin() if the resource is empty. + */ + virtual ConstIterator end() const; + + /** + This is an overloaded member function, provided for convenience. It + behaves essentially like the above function. + */ + virtual Iterator end(); + + /** + Returns a pointer to the addressbook. + */ + AddressBook *addressBook(); + + /** + Writes the resource specific config to file. + */ + virtual void writeConfig( TDEConfig *config ); + + /** + Request a ticket, you have to pass through save() to + allow locking. The resource has to create its locks + in this function. + */ + virtual Ticket *requestSaveTicket() = 0; + + /** + Releases the ticket previousely requested with requestSaveTicket(). + The resource has to remove its locks in this function. + This function is also responsible for deleting the ticket. + */ + virtual void releaseSaveTicket( Ticket* ) = 0; + + /** + Loads all addressees synchronously. + + @returns Whether the loading was successfully. + */ + virtual bool load() = 0; + + /** + Loads all addressees asyncronously. You have to make sure that either + the loadingFinished() or loadingError() signal is emitted from within + this function. + + The default implementation simply calls the synchronous load. + + @return Whether the synchronous part of loading was successfully. + */ + virtual bool asyncLoad(); + + /** + Insert an addressee into the resource. + */ + virtual void insertAddressee( const Addressee& ); + + /** + Removes an addressee from resource. + */ + virtual void removeAddressee( const Addressee& addr ); + + /** + Saves all addressees synchronously. + + @param ticket You have to release the ticket later with + releaseSaveTicket() explicitely. + @return Whether the saving was successfully. + */ + virtual bool save( Ticket *ticket ) = 0; + + /** + Saves all addressees asynchronously. You have to make sure that either + the savingFinished() or savingError() signal is emitted from within + this function. + + The default implementation simply calls the synchronous save. + + @param ticket You have to release the ticket later with + releaseSaveTicket() explicitely. + @return Whether the saving was successfully. + */ + virtual bool asyncSave( Ticket *ticket ); + + /** + Searches an addressee with the specified unique identifier. + + @param uid The unique identifier you are looking for. + @return The addressee with the specified unique identifier or an + empty addressee. + */ + virtual Addressee findByUid( const TQString &uid ); + + /** + Searches all addressees which match the specified name. + + @param name The name you are looking for. + @return A list of all matching addressees. + */ + virtual Addressee::List findByName( const TQString &name ); + + /** + Searches all addressees which match the specified email address. + + @param email The email address you are looking for. + @return A list of all matching addressees. + */ + virtual Addressee::List findByEmail( const TQString &email ); + + /** + Searches all addressees which belongs to the specified category. + + @param category The category you are looking for. + @return A list of all matching addressees. + */ + virtual Addressee::List findByCategory( const TQString &category ); + + /** + Removes all addressees from the resource. + */ + virtual void clear(); + + /** + @internal + + Sets the address book of the resource. + */ + void setAddressBook( AddressBook* ); + + signals: + /** + This signal is emitted when the resource has finished the loading of all + addressees from the backend to the internal cache. + + @param resource The pointer to the resource which emitted this signal. + */ + void loadingFinished( Resource *resource ); + + /** + This signal is emitted when an error occured during loading the + addressees from the backend to the internal cache. + + @param resource The pointer to the resource which emitted this signal. + @param msg A translated error message. + */ + void loadingError( Resource *resource, const TQString &msg ); + + /** + This signal is emitted when the resource has finished the saving of all + addressees from the internal cache to the backend. + + @param resource The pointer to the resource which emitted this signal. + */ + void savingFinished( Resource *resource ); + + /** + This signal is emitted when an error occured during saving the + addressees from the internal cache to the backend. + + @param resource The pointer to the resource which emitted this signal. + @param msg A translated error message. + */ + void savingError( Resource *resource, const TQString &msg ); + + protected: + Ticket *createTicket( Resource * ); + Addressee::Map mAddrMap; + + private: + AddressBook *mAddressBook; + + class ResourcePrivate; + ResourcePrivate *d; +}; + +} + +#endif diff --git a/tdeabc/resourceselectdialog.cpp b/tdeabc/resourceselectdialog.cpp new file mode 100644 index 000000000..92f770ed4 --- /dev/null +++ b/tdeabc/resourceselectdialog.cpp @@ -0,0 +1,111 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include + +#include +#include + +#include "resource.h" +#include "addressbook.h" + +#include "resourceselectdialog.h" + +using namespace KABC; + +ResourceSelectDialog::ResourceSelectDialog( AddressBook *ab, TQWidget *parent, const char *name ) + : KDialog( parent, name, true ) +{ + setCaption( i18n( "Resource Selection" ) ); + resize( 300, 200 ); + + TQVBoxLayout *mainLayout = new TQVBoxLayout( this ); + mainLayout->setMargin( marginHint() ); + + TQGroupBox *groupBox = new TQGroupBox( 2, Qt::Horizontal, this ); + groupBox->setTitle( i18n( "Resources" ) ); + + mResourceId = new TDEListBox( groupBox ); + + mainLayout->addWidget( groupBox ); + + mainLayout->addSpacing( 10 ); + + KButtonBox *buttonBox = new KButtonBox( this ); + + buttonBox->addStretch(); + buttonBox->addButton( KStdGuiItem::ok(), TQT_TQOBJECT(this), TQT_SLOT( accept() ) ); + buttonBox->addButton( KStdGuiItem::cancel(), TQT_TQOBJECT(this), TQT_SLOT( reject() ) ); + buttonBox->layout(); + + mainLayout->addWidget( buttonBox ); + + // setup listbox + uint counter = 0; + TQPtrList list = ab->resources(); + for ( uint i = 0; i < list.count(); ++i ) { + Resource *resource = list.at( i ); + if ( resource && !resource->readOnly() ) { + mResourceMap.insert( counter, resource ); + mResourceId->insertItem( resource->resourceName() ); + counter++; + } + } + + mResourceId->setCurrentItem( 0 ); +} + +Resource *ResourceSelectDialog::resource() +{ + if ( mResourceId->currentItem() != -1 ) + return mResourceMap[ mResourceId->currentItem() ]; + else + return 0; +} + +Resource *ResourceSelectDialog::getResource( AddressBook *ab, TQWidget *parent ) +{ + TQPtrList resources = ab->resources(); + if ( resources.count() == 1 ) return resources.first(); + + Resource *found = 0; + Resource *r = resources.first(); + while( r ) { + if ( !r->readOnly() ) { + if ( found ) { + found = 0; + break; + } else { + found = r; + } + } + r = resources.next(); + } + if ( found ) return found; + + ResourceSelectDialog dlg( ab, parent ); + if ( dlg.exec() == KDialog::Accepted ) return dlg.resource(); + else return 0; +} + +#include "resourceselectdialog.moc" diff --git a/tdeabc/resourceselectdialog.h b/tdeabc/resourceselectdialog.h new file mode 100644 index 000000000..f5f2d6984 --- /dev/null +++ b/tdeabc/resourceselectdialog.h @@ -0,0 +1,57 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_RESOURCESELECTDIALOG_H +#define KABC_RESOURCESELECTDIALOG_H + +#include + +#include +#include + +class TDEListBox; + +namespace KABC { + +class AddressBook; +class Resource; + +/** + This class is @deprecated, use KRES::SelectDialog instead. + */ +class KABC_EXPORT_DEPRECATED ResourceSelectDialog : KDialog +{ + Q_OBJECT + + public: + ResourceSelectDialog( AddressBook *ab, TQWidget *parent = 0, + const char *name = 0); + Resource *resource(); + + static Resource *getResource( AddressBook *ab, TQWidget *parent = 0 ); + + private: + TDEListBox *mResourceId; + TQMap mResourceMap; +}; + +} + +#endif diff --git a/tdeabc/scripts/Makefile.am b/tdeabc/scripts/Makefile.am new file mode 100644 index 000000000..7715fba5c --- /dev/null +++ b/tdeabc/scripts/Makefile.am @@ -0,0 +1,6 @@ +EXTRA_DIST = $(srcdir)/makeaddressee \ + $(srcdir)/addressee.src.cpp \ + $(srcdir)/addressee.src.h \ + $(srcdir)/entrylist \ + $(srcdir)/field.src.cpp + diff --git a/tdeabc/scripts/addressee.src.cpp b/tdeabc/scripts/addressee.src.cpp new file mode 100644 index 000000000..7514b4a1d --- /dev/null +++ b/tdeabc/scripts/addressee.src.cpp @@ -0,0 +1,1127 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + Copyright (c) 2003 Carsten Pfeiffer + Copyright (c) 2005 Ingo Kloecker + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include +#include +#include + +#include "addresseehelper.h" +#include "field.h" +#include "resource.h" +#include "sortmode.h" + +#include "addressee.h" + +using namespace KABC; + +static bool matchBinaryPattern( int value, int pattern ); + +template +static bool listEquals( const TQValueList&, const TQValueList& ); +static bool emailsEquals( const TQStringList&, const TQStringList& ); + +KABC::SortMode *Addressee::mSortMode = 0; + +struct Addressee::AddresseeData : public TDEShared +{ + TQString uid; + TQString uri; + --VARIABLES-- + + PhoneNumber::List phoneNumbers; + Address::List addresses; + Key::List keys; + TQStringList emails; + TQStringList categories; + TQStringList custom; + + Resource *resource; + + bool empty :1; + bool changed :1; +}; + +Addressee::AddresseeData* Addressee::shared_null = 0; + +Addressee::AddresseeData* Addressee::makeSharedNull() +{ + Addressee::shared_null = new AddresseeData; + shared_null->_TDEShared_ref(); //just in case (we should add KSD) + shared_null->empty = true; + shared_null->changed = false; + shared_null->resource = 0; + return shared_null; +} + +Addressee::Addressee() +{ + mData = shared_null ? shared_null : makeSharedNull(); +} + +Addressee::~Addressee() +{ +} + +Addressee::Addressee( const Addressee &a ) +{ + mData = a.mData; +} + +Addressee &Addressee::operator=( const Addressee &a ) +{ + if ( this == &a ) + return (*this); + + mData = a.mData; + return (*this); +} + +void Addressee::detach() +{ + if ( mData.data() == shared_null ) { + mData = new AddresseeData; + mData->empty = true; + mData->changed = false; + mData->resource = 0; + mData->uid = TDEApplication::randomString( 10 ); + return; + } else if ( mData.count() == 1 ) return; + + AddresseeData data = *mData; + mData = new AddresseeData( data ); +} + +bool Addressee::operator==( const Addressee &a ) const +{ + if ( uid() != a.uid() ) { + kdDebug(5700) << "uid differs" << endl; + return false; + } + --EQUALSTEST-- + if ( ( mData->url.isValid() || a.mData->url.isValid() ) && + ( mData->url != a.mData->url ) ) { + kdDebug(5700) << "url differs" << endl; + return false; + } + if ( !listEquals( mData->phoneNumbers, a.mData->phoneNumbers ) ) { + kdDebug(5700) << "phoneNumbers differs" << endl; + return false; + } + if ( !listEquals( mData->addresses, a.mData->addresses ) ) { + kdDebug(5700) << "addresses differs" << endl; + return false; + } + if ( !listEquals( mData->keys, a.mData->keys ) ) { + kdDebug(5700) << "keys differs" << endl; + return false; + } + if ( !emailsEquals( mData->emails, a.mData->emails ) ) { + kdDebug(5700) << "emails differs" << endl; + return false; + } + if ( !listEquals( mData->categories, a.mData->categories ) ) { + kdDebug(5700) << "categories differs" << endl; + return false; + } + if ( !listEquals( mData->custom, a.mData->custom ) ) { + kdDebug(5700) << "custom differs" << endl; + return false; + } + + return true; +} + +bool Addressee::operator!=( const Addressee &a ) const +{ + return !( a == *this ); +} + +bool Addressee::isEmpty() const +{ + return mData->empty; +} + +void Addressee::setUid( const TQString &id ) +{ + if ( id == mData->uid ) return; + detach(); + mData->empty = false; + mData->uid = id; +} + +TQString Addressee::uid() const +{ + return mData->uid; +} + +TQString Addressee::uidLabel() +{ + return i18n("Unique Identifier"); +} + +void Addressee::setUri( const TQString &id ) +{ + if ( id == mData->uri ) return; + detach(); + mData->empty = false; + mData->uri = id; +} + +TQString Addressee::uri() const +{ + return mData->uri; +} + +TQString Addressee::uriLabel() +{ + return i18n("Unique Resource Identifier"); +} + +--DEFINITIONS-- + +void Addressee::setNameFromString( const TQString &s ) +{ + TQString str = s; + //remove enclosing quotes from string + if ( str.length() > 1 && s[ 0 ] == '"' && s[ s.length() - 1 ] == '"' ) + str = s.mid( 1, s.length() - 2 ); + + setFormattedName( str ); + setName( str ); + + // clear all name parts + setPrefix( TQString() ); + setGivenName( TQString() ); + setAdditionalName( TQString() ); + setFamilyName( TQString() ); + setSuffix( TQString() ); + + if ( str.isEmpty() ) + return; + + TQString spaceStr = " "; + TQString emptyStr = ""; + AddresseeHelper *helper = AddresseeHelper::self(); + + int i = str.find( ',' ); + if( i < 0 ) { + TQStringList parts = TQStringList::split( spaceStr, str ); + int leftOffset = 0; + int rightOffset = parts.count() - 1; + + TQString suffix; + while ( rightOffset >= 0 ) { + if ( helper->containsSuffix( parts[ rightOffset ] ) ) { + suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? emptyStr : spaceStr)); + rightOffset--; + } else + break; + } + setSuffix( suffix ); + + if ( rightOffset < 0 ) + return; + + TQStringList inclusionList; + for ( int n = 1; (rightOffset - n >= 0) && (n < 4); ++n ) { + if ( helper->containsPrefix( parts[ rightOffset - n ].lower() ) ) { + inclusionList.prepend( parts[ rightOffset - n ] ); + } else + break; + } + + if ( !inclusionList.isEmpty() ) { + setFamilyName( inclusionList.join( " " ) + spaceStr + parts[ rightOffset ] ); + rightOffset -= inclusionList.count(); + } else { + if ( helper->tradeAsFamilyName() ) + setFamilyName( parts[ rightOffset ] ); + else + setGivenName( parts[ rightOffset ] ); + } + + TQString prefix; + while ( leftOffset < rightOffset ) { + if ( helper->containsTitle( parts[ leftOffset ] ) ) { + prefix.append( ( prefix.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); + leftOffset++; + } else + break; + } + setPrefix( prefix ); + + if ( leftOffset < rightOffset ) { + setGivenName( parts[ leftOffset ] ); + leftOffset++; + } + + TQString additionalName; + while ( leftOffset < rightOffset ) { + additionalName.append( ( additionalName.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); + leftOffset++; + } + setAdditionalName( additionalName ); + } else { + TQString part1 = str.left( i ); + TQString part2 = str.mid( i + 1 ); + + TQStringList parts = TQStringList::split( spaceStr, part1 ); + int leftOffset = 0; + int rightOffset = parts.count() - 1; + + if ( parts.count() > 0 ) { + + TQString suffix; + while ( rightOffset >= 0 ) { + if ( helper->containsSuffix( parts[ rightOffset ] ) ) { + suffix.prepend(parts[ rightOffset ] + (suffix.isEmpty() ? emptyStr : spaceStr)); + rightOffset--; + } else + break; + } + setSuffix( suffix ); + + if ( rightOffset - 1 >= 0 && helper->containsPrefix( parts[ rightOffset - 1 ].lower() ) ) { + setFamilyName( parts[ rightOffset - 1 ] + spaceStr + parts[ rightOffset ] ); + rightOffset--; + } else + setFamilyName( parts[ rightOffset ] ); + + TQString prefix; + while ( leftOffset < rightOffset ) { + if ( helper->containsTitle( parts[ leftOffset ] ) ) { + prefix.append( ( prefix.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); + leftOffset++; + } else + break; + } + } else { + setPrefix( "" ); + setFamilyName( "" ); + setSuffix( "" ); + } + + parts = TQStringList::split( spaceStr, part2 ); + + leftOffset = 0; + rightOffset = parts.count(); + + if ( parts.count() > 0 ) { + + TQString prefix; + while ( leftOffset < rightOffset ) { + if ( helper->containsTitle( parts[ leftOffset ] ) ) { + prefix.append( ( prefix.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); + leftOffset++; + } else + break; + } + setPrefix( prefix ); + + if ( leftOffset < rightOffset ) { + setGivenName( parts[ leftOffset ] ); + leftOffset++; + } + + TQString additionalName; + while ( leftOffset < rightOffset ) { + additionalName.append( ( additionalName.isEmpty() ? emptyStr : spaceStr) + parts[ leftOffset ] ); + leftOffset++; + } + setAdditionalName( additionalName ); + } else { + setGivenName( "" ); + setAdditionalName( "" ); + } + } +} + +TQString Addressee::realName() const +{ + TQString n( formattedName() ); + if ( !n.isEmpty() ) + return n; + + n = assembledName(); + if ( !n.isEmpty() ) + return n; + + n = name(); + if ( !n.isEmpty() ) + return n; + + return organization(); +} + +TQString Addressee::assembledName() const +{ + TQString name = prefix() + " " + givenName() + " " + additionalName() + " " + + familyName() + " " + suffix(); + + return name.simplifyWhiteSpace(); +} + +TQString Addressee::fullEmail( const TQString &email ) const +{ + TQString e; + if ( email.isNull() ) { + e = preferredEmail(); + } else { + e = email; + } + if ( e.isEmpty() ) return TQString(); + + TQString text; + if ( realName().isEmpty() ) + text = e; + else { + TQRegExp needQuotes( "[^ 0-9A-Za-z\\x0080-\\xFFFF]" ); + if ( realName().find( needQuotes ) != -1 ) { + TQString name = realName(); + name.replace( "\"", "\\\"" ); + text = "\"" + name + "\" <" + e + ">"; + } else + text = realName() + " <" + e + ">"; + } + + return text; +} + +void Addressee::insertEmail( const TQString &email, bool preferred ) +{ + if ( email.simplifyWhiteSpace().isEmpty() ) + return; + + detach(); + mData->empty = false; + + TQStringList::Iterator it = mData->emails.find( email ); + + if ( it != mData->emails.end() ) { + if ( !preferred || it == mData->emails.begin() ) return; + mData->emails.remove( it ); + mData->emails.prepend( email ); + } else { + if ( preferred ) { + mData->emails.prepend( email ); + } else { + mData->emails.append( email ); + } + } +} + +void Addressee::removeEmail( const TQString &email ) +{ + detach(); + + TQStringList::Iterator it = mData->emails.find( email ); + if ( it == mData->emails.end() ) return; + + mData->emails.remove( it ); +} + +TQString Addressee::preferredEmail() const +{ + if ( mData->emails.count() == 0 ) return TQString(); + else return mData->emails.first(); +} + +TQStringList Addressee::emails() const +{ + return mData->emails; +} +void Addressee::setEmails( const TQStringList& emails ) { + detach(); + + mData->emails = emails; +} +void Addressee::insertPhoneNumber( const PhoneNumber &phoneNumber ) +{ + detach(); + mData->empty = false; + + PhoneNumber::List::Iterator it; + for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { + if ( (*it).id() == phoneNumber.id() ) { + *it = phoneNumber; + return; + } + } + if ( !phoneNumber.number().simplifyWhiteSpace().isEmpty() ) + mData->phoneNumbers.append( phoneNumber ); +} + +void Addressee::removePhoneNumber( const PhoneNumber &phoneNumber ) +{ + detach(); + + PhoneNumber::List::Iterator it; + for( it = mData->phoneNumbers.begin(); it != mData->phoneNumbers.end(); ++it ) { + if ( (*it).id() == phoneNumber.id() ) { + mData->phoneNumbers.remove( it ); + return; + } + } +} + +PhoneNumber Addressee::phoneNumber( int type ) const +{ + PhoneNumber phoneNumber( "", type ); + PhoneNumber::List::ConstIterator it; + for( it = mData->phoneNumbers.constBegin(); it != mData->phoneNumbers.constEnd(); ++it ) { + if ( matchBinaryPattern( (*it).type(), type ) ) { + if ( (*it).type() & PhoneNumber::Pref ) + return (*it); + else if ( phoneNumber.number().isEmpty() ) + phoneNumber = (*it); + } + } + + return phoneNumber; +} + +PhoneNumber::List Addressee::phoneNumbers() const +{ + return mData->phoneNumbers; +} + +PhoneNumber::List Addressee::phoneNumbers( int type ) const +{ + PhoneNumber::List list; + + PhoneNumber::List::ConstIterator it; + for( it = mData->phoneNumbers.constBegin(); it != mData->phoneNumbers.constEnd(); ++it ) { + if ( matchBinaryPattern( (*it).type(), type ) ) { + list.append( *it ); + } + } + return list; +} + +PhoneNumber Addressee::findPhoneNumber( const TQString &id ) const +{ + PhoneNumber::List::ConstIterator it; + for( it = mData->phoneNumbers.constBegin(); it != mData->phoneNumbers.constEnd(); ++it ) { + if ( (*it).id() == id ) { + return *it; + } + } + return PhoneNumber(); +} + +void Addressee::insertKey( const Key &key ) +{ + detach(); + mData->empty = false; + + Key::List::Iterator it; + for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { + if ( (*it).id() == key.id() ) { + *it = key; + return; + } + } + mData->keys.append( key ); +} + +void Addressee::removeKey( const Key &key ) +{ + detach(); + + Key::List::Iterator it; + for( it = mData->keys.begin(); it != mData->keys.end(); ++it ) { + if ( (*it).id() == key.id() ) { + mData->keys.remove( key ); + return; + } + } +} + +Key Addressee::key( int type, TQString customTypeString ) const +{ + Key::List::ConstIterator it; + for( it = mData->keys.constBegin(); it != mData->keys.constEnd(); ++it ) { + if ( (*it).type() == type ) { + if ( type == Key::Custom ) { + if ( customTypeString.isEmpty() ) { + return *it; + } else { + if ( (*it).customTypeString() == customTypeString ) + return (*it); + } + } else { + return *it; + } + } + } + return Key( TQString(), type ); +} + +void Addressee::setKeys( const Key::List& list ) +{ + detach(); + mData->keys = list; +} + +Key::List Addressee::keys() const +{ + return mData->keys; +} + +Key::List Addressee::keys( int type, TQString customTypeString ) const +{ + Key::List list; + + Key::List::ConstIterator it; + for( it = mData->keys.constBegin(); it != mData->keys.constEnd(); ++it ) { + if ( (*it).type() == type ) { + if ( type == Key::Custom ) { + if ( customTypeString.isEmpty() ) { + list.append( *it ); + } else { + if ( (*it).customTypeString() == customTypeString ) + list.append( *it ); + } + } else { + list.append( *it ); + } + } + } + return list; +} + +Key Addressee::findKey( const TQString &id ) const +{ + Key::List::ConstIterator it; + for( it = mData->keys.constBegin(); it != mData->keys.constEnd(); ++it ) { + if ( (*it).id() == id ) { + return *it; + } + } + return Key(); +} + +TQString Addressee::asString() const +{ + return "Smith, agent Smith..."; +} + +void Addressee::dump() const +{ + kdDebug(5700) << "Addressee {" << endl; + + kdDebug(5700) << " Uid: '" << uid() << "'" << endl; + + --DEBUG-- + + kdDebug(5700) << " Emails {" << endl; + const TQStringList e = emails(); + TQStringList::ConstIterator it; + for( it = e.begin(); it != e.end(); ++it ) { + kdDebug(5700) << " " << (*it) << endl; + } + kdDebug(5700) << " }" << endl; + + kdDebug(5700) << " PhoneNumbers {" << endl; + const PhoneNumber::List p = phoneNumbers(); + PhoneNumber::List::ConstIterator it2; + for( it2 = p.begin(); it2 != p.end(); ++it2 ) { + kdDebug(5700) << " Type: " << int((*it2).type()) << " Number: " << (*it2).number() << endl; + } + kdDebug(5700) << " }" << endl; + + const Address::List a = addresses(); + Address::List::ConstIterator it3; + for( it3 = a.begin(); it3 != a.end(); ++it3 ) { + (*it3).dump(); + } + + kdDebug(5700) << " Keys {" << endl; + const Key::List k = keys(); + Key::List::ConstIterator it4; + for( it4 = k.begin(); it4 != k.end(); ++it4 ) { + kdDebug(5700) << " Type: " << int((*it4).type()) << + " Key: " << (*it4).textData() << + " CustomString: " << (*it4).customTypeString() << endl; + } + kdDebug(5700) << " }" << endl; + + kdDebug(5700) << "}" << endl; +} + + +void Addressee::insertAddress( const Address &address ) +{ + if ( address.isEmpty() ) + return; + + detach(); + mData->empty = false; + + Address::List::Iterator it; + for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { + if ( (*it).id() == address.id() ) { + *it = address; + return; + } + } + + mData->addresses.append( address ); +} + +void Addressee::removeAddress( const Address &address ) +{ + detach(); + + Address::List::Iterator it; + for( it = mData->addresses.begin(); it != mData->addresses.end(); ++it ) { + if ( (*it).id() == address.id() ) { + mData->addresses.remove( it ); + return; + } + } +} + +Address Addressee::address( int type ) const +{ + Address address( type ); + Address::List::ConstIterator it; + for( it = mData->addresses.constBegin(); it != mData->addresses.constEnd(); ++it ) { + if ( matchBinaryPattern( (*it).type(), type ) ) { + if ( (*it).type() & Address::Pref ) + return (*it); + else if ( address.isEmpty() ) + address = (*it); + } + } + + return address; +} + +Address::List Addressee::addresses() const +{ + return mData->addresses; +} + +Address::List Addressee::addresses( int type ) const +{ + Address::List list; + + Address::List::ConstIterator it; + for( it = mData->addresses.constBegin(); it != mData->addresses.constEnd(); ++it ) { + if ( matchBinaryPattern( (*it).type(), type ) ) { + list.append( *it ); + } + } + + return list; +} + +Address Addressee::findAddress( const TQString &id ) const +{ + Address::List::ConstIterator it; + for( it = mData->addresses.constBegin(); it != mData->addresses.constEnd(); ++it ) { + if ( (*it).id() == id ) { + return *it; + } + } + return Address(); +} + +void Addressee::insertCategory( const TQString &c ) +{ + detach(); + mData->empty = false; + + if ( mData->categories.findIndex( c ) != -1 ) return; + + mData->categories.append( c ); +} + +void Addressee::removeCategory( const TQString &c ) +{ + detach(); + + TQStringList::Iterator it = mData->categories.find( c ); + if ( it == mData->categories.end() ) return; + + mData->categories.remove( it ); +} + +bool Addressee::hasCategory( const TQString &c ) const +{ + return ( mData->categories.findIndex( c ) != -1 ); +} + +void Addressee::setCategories( const TQStringList &c ) +{ + detach(); + mData->empty = false; + + mData->categories = c; +} + +TQStringList Addressee::categories() const +{ + return mData->categories; +} + +void Addressee::insertCustom( const TQString &app, const TQString &name, + const TQString &value ) +{ + if ( value.isEmpty() || name.isEmpty() || app.isEmpty() ) return; + + detach(); + mData->empty = false; + + TQString qualifiedName = app + "-" + name + ":"; + + TQStringList::Iterator it; + for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { + if ( (*it).startsWith( qualifiedName ) ) { + (*it) = qualifiedName + value; + return; + } + } + + mData->custom.append( qualifiedName + value ); +} + +void Addressee::removeCustom( const TQString &app, const TQString &name) +{ + detach(); + + TQString qualifiedName = app + "-" + name + ":"; + + TQStringList::Iterator it; + for( it = mData->custom.begin(); it != mData->custom.end(); ++it ) { + if ( (*it).startsWith( qualifiedName ) ) { + mData->custom.remove( it ); + return; + } + } +} + +TQString Addressee::custom( const TQString &app, const TQString &name ) const +{ + TQString qualifiedName = app + "-" + name + ":"; + TQString value; + + TQStringList::ConstIterator it; + for( it = mData->custom.constBegin(); it != mData->custom.constEnd(); ++it ) { + if ( (*it).startsWith( qualifiedName ) ) { + value = (*it).mid( (*it).find( ":" ) + 1 ); + break; + } + } + + return value; +} + +void Addressee::setCustoms( const TQStringList &l ) +{ + detach(); + mData->empty = false; + + mData->custom = l; +} + +TQStringList Addressee::customs() const +{ + return mData->custom; +} + +void Addressee::parseEmailAddress( const TQString &rawEmail, TQString &fullName, + TQString &email) +{ + // This is a simplified version of KPIM::splitAddress(). + + fullName = ""; + email = ""; + if ( rawEmail.isEmpty() ) + return; // KPIM::AddressEmpty; + + // The code works on 8-bit strings, so convert the input to UTF-8. + TQCString address = rawEmail.utf8(); + + TQCString displayName; + TQCString addrSpec; + TQCString comment; + + // The following is a primitive parser for a mailbox-list (cf. RFC 2822). + // The purpose is to extract a displayable string from the mailboxes. + // Comments in the addr-spec are not handled. No error checking is done. + + enum { TopLevel, InComment, InAngleAddress } context = TopLevel; + bool inQuotedString = false; + int commentLevel = 0; + bool stop = false; + + for ( char* p = address.data(); *p && !stop; ++p ) { + switch ( context ) { + case TopLevel : { + switch ( *p ) { + case '"' : inQuotedString = !inQuotedString; + displayName += *p; + break; + case '(' : if ( !inQuotedString ) { + context = InComment; + commentLevel = 1; + } + else + displayName += *p; + break; + case '<' : if ( !inQuotedString ) { + context = InAngleAddress; + } + else + displayName += *p; + break; + case '\\' : // quoted character + displayName += *p; + ++p; // skip the '\' + if ( *p ) + displayName += *p; + else + //return KPIM::UnexpectedEnd; + goto ABORT_PARSING; + break; + case ',' : if ( !inQuotedString ) { + //if ( allowMultipleAddresses ) + // stop = true; + //else + // return KPIM::UnexpectedComma; + goto ABORT_PARSING; + } + else + displayName += *p; + break; + default : displayName += *p; + } + break; + } + case InComment : { + switch ( *p ) { + case '(' : ++commentLevel; + comment += *p; + break; + case ')' : --commentLevel; + if ( commentLevel == 0 ) { + context = TopLevel; + comment += ' '; // separate the text of several comments + } + else + comment += *p; + break; + case '\\' : // quoted character + comment += *p; + ++p; // skip the '\' + if ( *p ) + comment += *p; + else + //return KPIM::UnexpectedEnd; + goto ABORT_PARSING; + break; + default : comment += *p; + } + break; + } + case InAngleAddress : { + switch ( *p ) { + case '"' : inQuotedString = !inQuotedString; + addrSpec += *p; + break; + case '>' : if ( !inQuotedString ) { + context = TopLevel; + } + else + addrSpec += *p; + break; + case '\\' : // quoted character + addrSpec += *p; + ++p; // skip the '\' + if ( *p ) + addrSpec += *p; + else + //return KPIM::UnexpectedEnd; + goto ABORT_PARSING; + break; + default : addrSpec += *p; + } + break; + } + } // switch ( context ) + } + +ABORT_PARSING: + displayName = displayName.stripWhiteSpace(); + comment = comment.stripWhiteSpace(); + addrSpec = addrSpec.stripWhiteSpace(); + + fullName = TQString::fromUtf8( displayName ); + email = TQString::fromUtf8( addrSpec ); + + // check for errors + if ( inQuotedString ) + return; // KPIM::UnbalancedQuote; + if ( context == InComment ) + return; // KPIM::UnbalancedParens; + if ( context == InAngleAddress ) + return; // KPIM::UnclosedAngleAddr; + + if ( addrSpec.isEmpty() ) { + if ( displayName.isEmpty() ) + return; // KPIM::NoAddressSpec; + else { + //addrSpec = displayName; + //displayName.truncate( 0 ); + // Address of the form "foo@bar" or "foo@bar (Name)". + email = fullName; + fullName = TQString::fromUtf8( comment ); + } + } + + // Check that we do not have any extra characters on the end of the + // strings + unsigned int len = fullName.length(); + if ( fullName[ 0 ] == '"' && fullName[ len - 1 ] == '"' ) + fullName = fullName.mid( 1, len - 2 ); +} + +void Addressee::setResource( Resource *resource ) +{ + detach(); + mData->resource = resource; +} + +Resource *Addressee::resource() const +{ + return mData->resource; +} + +void Addressee::setChanged( bool value ) +{ + detach(); + mData->changed = value; +} + +bool Addressee::changed() const +{ + return mData->changed; +} + +void Addressee::setSortMode( KABC::SortMode *mode ) +{ + mSortMode = mode; +} + +bool Addressee::operator< ( const Addressee &addr ) +{ + if ( !mSortMode ) + return false; + else + return mSortMode->lesser( *this, addr ); +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Addressee &a ) +{ + if (!a.mData) return s; + + s << a.uid(); + + --STREAMOUT-- + s << a.mData->phoneNumbers; + s << a.mData->addresses; + s << a.mData->emails; + s << a.mData->categories; + s << a.mData->custom; + s << a.mData->keys; + return s; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Addressee &a ) +{ + if (!a.mData) + return s; + + a.detach(); + + s >> a.mData->uid; + + --STREAMIN-- + s >> a.mData->phoneNumbers; + s >> a.mData->addresses; + s >> a.mData->emails; + s >> a.mData->categories; + s >> a.mData->custom; + s >> a.mData->keys; + + a.mData->empty = false; + + return s; +} + +bool matchBinaryPattern( int value, int pattern ) +{ + /** + We want to match all telephonnumbers/addresses which have the bits in the + pattern set. More are allowed. + if pattern == 0 we have a special handling, then we want only those with + exactly no bit set. + */ + if ( pattern == 0 ) + return ( value == 0 ); + else + return ( pattern == ( pattern & value ) ); +} + +template +bool listEquals( const TQValueList &list, const TQValueList &pattern ) +{ + if ( list.count() != pattern.count() ) + return false; + + for ( uint i = 0; i < list.count(); ++i ) + if ( pattern.find( list[ i ] ) == pattern.end() ) + return false; + + return true; +} + +bool emailsEquals( const TQStringList &list, const TQStringList &pattern ) +{ + if ( list.count() != pattern.count() ) + return false; + + if ( list.first() != pattern.first() ) + return false; + + TQStringList::ConstIterator it; + for ( it = list.begin(); it != list.end(); ++it ) + if ( pattern.find( *it ) == pattern.end() ) + return false; + + return true; +} diff --git a/tdeabc/scripts/addressee.src.h b/tdeabc/scripts/addressee.src.h new file mode 100644 index 000000000..9cadfd41e --- /dev/null +++ b/tdeabc/scripts/addressee.src.h @@ -0,0 +1,407 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_ADDRESSEE_H +#define KABC_ADDRESSEE_H + +#include +#include +#include +#include + +#include +#include + +#include "address.h" +#include "agent.h" +#include "geo.h" +#include "key.h" +#include "phonenumber.h" +#include "picture.h" +#include "secrecy.h" +#include "sound.h" +#include "timezone.h" + +namespace KABC { + +class Resource; +class Field; +class SortMode; + +/** + @short address book entry + + This class represents an entry in the address book. + + The data of this class is implicitly shared. You can pass this class by value. + + If you need the name of a field for presenting it to the user you should use + the functions ending in Label(). They return a translated string which can be + used as label for the corresponding field. + + About the name fields: + + givenName() is the first name and familyName() the last name. In some + countries the family name comes first, that's the reason for the + naming. formattedName() is the full name with the correct formatting. + It is used as an override, when the correct formatting can't be generated + from the other name fields automatically. + + realName() returns a fully formatted name(). It uses formattedName, if set, + otherwise it constucts the name from the name fields. As fallback, if + nothing else is set it uses name(). + + name() is the NAME type of RFC2426. It can be used as internal name for the + data enty, but shouldn't be used for displaying the data to the user. + */ +class KABC_EXPORT Addressee +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Addressee & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Addressee & ); + + public: + typedef TQValueList List; + typedef TQMap Map; + + /** + Construct an empty address book entry. + */ + Addressee(); + ~Addressee(); + + Addressee( const Addressee & ); + Addressee &operator=( const Addressee & ); + + bool operator==( const Addressee & ) const; + bool operator!=( const Addressee & ) const; + + /** + Return, if the address book entry is empty. + */ + bool isEmpty() const; + + /** + Set unique identifier. + */ + void setUid( const TQString &uid ); + /** + Return unique identifier. + */ + TQString uid() const; + /** + Return translated label for uid field. + */ + static TQString uidLabel(); + + /** + Set unique resource identifier. + */ + void setUri( const TQString &uid ); + /** + Return unique resource identifier. + */ + TQString uri() const; + /** + Return translated label for uri field. + */ + static TQString uriLabel(); + + --DECLARATIONS-- + /** + Set name fields by parsing the given string and trying to associate the + parts of the string with according fields. This function should probably + be a bit more clever. + */ + void setNameFromString( const TQString & ); + + /** + Return the name of the addressee. This is calculated from all the name + fields. + */ + TQString realName() const; + + /** + Return the name that consists of all name parts. + */ + TQString assembledName() const; + + /** + Return email address including real name. + + @param email Email address to be used to construct the full email string. + If this is TQString::null the preferred email address is used. + */ + TQString fullEmail( const TQString &email=TQString::null ) const; + + /** + Insert an email address. If the email address already exists in this + addressee it is not duplicated. + + @param email Email address + @param preferred Set to true, if this is the preferred email address of + the addressee. + */ + void insertEmail( const TQString &email, bool preferred=false ); + + /** + Remove email address. If the email address doesn't exist, nothing happens. + */ + void removeEmail( const TQString &email ); + + /** + Return preferred email address. This is the first email address or the + last one added with insertEmail() with a set preferred parameter. + */ + TQString preferredEmail() const; + + /** + Return list of all email addresses. + */ + TQStringList emails() const; + + /** + Set the emails to @p list. + The first email address gets the preferred one! + @param list The list of email addresses. + */ + void setEmails( const TQStringList& list); + + /** + Insert a phone number. If a phone number with the same id already exists + in this addressee it is not duplicated. + */ + void insertPhoneNumber( const PhoneNumber &phoneNumber ); + + /** + Remove phone number. If no phone number with the given id exists for this + addresse nothing happens. + */ + void removePhoneNumber( const PhoneNumber &phoneNumber ); + + /** + Return phone number, which matches the given type. + */ + PhoneNumber phoneNumber( int type ) const; + + /** + Return list of all phone numbers. + */ + PhoneNumber::List phoneNumbers() const; + + /** + Return list of phone numbers with a special type. + */ + PhoneNumber::List phoneNumbers( int type ) const; + + /** + Return phone number with the given id. + */ + PhoneNumber findPhoneNumber( const TQString &id ) const; + + /** + Insert a key. If a key with the same id already exists + in this addressee it is not duplicated. + */ + void insertKey( const Key &key ); + + /** + Remove a key. If no key with the given id exists for this + addresse nothing happens. + */ + void removeKey( const Key &key ); + + /** + Return key, which matches the given type. + If @p type == Key::Custom you can specify a string + that should match. If you leave the string empty, the first + key with a custom value is returned. + */ + Key key( int type, TQString customTypeString = TQString::null ) const; + + /** + Return list of all keys. + */ + Key::List keys() const; + + /** + Set the list of keys + @param keys The keys to be set. + */ + void setKeys( const Key::List& keys); + + /** + Return list of keys with a special type. + If @p type == Key::Custom you can specify a string + that should match. If you leave the string empty, all custom + keys will be returned. + */ + Key::List keys( int type, TQString customTypeString = TQString::null ) const; + + /** + Return key with the given id. + */ + Key findKey( const TQString &id ) const; + + /** + Insert an address. If an address with the same id already exists + in this addressee it is not duplicated. + */ + void insertAddress( const Address &address ); + + /** + Remove address. If no address with the given id exists for this + addresse nothing happens. + */ + void removeAddress( const Address &address ); + + /** + Return address, which matches the given type. + */ + Address address( int type ) const; + + /** + Return list of all addresses. + */ + Address::List addresses() const; + + /** + Return list of addresses with a special type. + */ + Address::List addresses( int type ) const; + + /** + Return address with the given id. + */ + Address findAddress( const TQString &id ) const; + + /** + Insert category. If the category already exists it is not duplicated. + */ + void insertCategory( const TQString & ); + + /** + Remove category. + */ + void removeCategory( const TQString & ); + + /** + Return, if addressee has the given category. + */ + bool hasCategory( const TQString & ) const; + + /** + Set categories to given value. + */ + void setCategories( const TQStringList & ); + + /** + Return list of all set categories. + */ + TQStringList categories() const; + + /** + Insert custom entry. The entry is identified by the name of the inserting + application and a unique name. If an entry with the given app and name + already exists its value is replaced with the new given value. + + An empty value isn't allowed (nothing happens if this is called with + any of the three arguments being empty) + */ + void insertCustom( const TQString &app, const TQString &name, + const TQString &value ); + + /** + Remove custom entry. + */ + void removeCustom( const TQString &app, const TQString &name ); + + /** + Return value of custom entry, identified by app and entry name. + */ + TQString custom( const TQString &app, const TQString &name ) const; + + /** + Set all custom entries. + */ + void setCustoms( const TQStringList & ); + + /** + Return list of all custom entries. + */ + TQStringList customs() const; + + /** + Parse full email address. The result is given back in fullName and email. + */ + static void parseEmailAddress( const TQString &rawEmail, TQString &fullName, + TQString &email ); + + /** + Debug output. + */ + void dump() const; + + /** + Returns string representation of the addressee. + */ + TQString asString() const; + + /** + Set resource where the addressee is from. + */ + void setResource( Resource *resource ); + + /** + Return pointer to resource. + */ + Resource *resource() const; + + /** + Mark addressee as changed. + */ + void setChanged( bool value ); + + /** + Return whether the addressee is changed. + */ + bool changed() const; + + static void setSortMode( KABC::SortMode *mode ); + + bool operator< ( const Addressee &addr ); + + private: + void detach(); + + struct AddresseeData; + mutable TDESharedPtr mData; + + private: + static AddresseeData* shared_null; + static AddresseeData* makeSharedNull(); + static KABC::SortMode *mSortMode; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Addressee & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Addressee & ); + +} + +#endif diff --git a/tdeabc/scripts/createisomap.pl b/tdeabc/scripts/createisomap.pl new file mode 100755 index 000000000..897cd4896 --- /dev/null +++ b/tdeabc/scripts/createisomap.pl @@ -0,0 +1,35 @@ +#!/usr/bin/perl +# +# Create a translation table countryname->iso-code from the entry.desktop +# files in tdebase/l10n/*/ +# +# USAGE EXAMPLE: +# ./createisomap.pl $TDEDIR/share/locale/l10n > countrytransl.map +# +# Don't laugh at me. I put this together with an old perl book, perl +# being a language I've never used before. + +@entries = <$ARGV[0]/*/entry.desktop>; +chomp @entries; +foreach $entry (@entries) { + local ( $entryiso, @entryfile, @mappings ); + # print "--> $entry\n"; + $entryiso = $entry; + $entryiso =~ s/$ARGV[0]\///; + $entryiso =~ s/\/entry\.desktop//; + # print " $entryiso\n"; + open (IN, $entry); + @entryfile = ; + close IN; + chomp @entryfile; + foreach $entryfileline (@entryfile) { + if ( $entryfileline =~ /^Name.*=(.*)$/ ) { + # push (@mappings, $1 . "\t" . $entryiso ); + print "$1\t$entryiso\n"; + } + } +} + +# add some convenience entries which aren't part of the entry.desktop files + +print "Czech Republic\tcz\n"; diff --git a/tdeabc/scripts/entrylist b/tdeabc/scripts/entrylist new file mode 100644 index 000000000..87c342a06 --- /dev/null +++ b/tdeabc/scripts/entrylist @@ -0,0 +1,82 @@ +# This file describes the fields of an address book entry. +# +# The following comma-separated fields are used: +# +# Control: A generates accessor functions. +# L generates a static function for returning a tranlsated label +# F generates a Field id and object for generic field handling +# E generate an equality test in Addressee::operator==(). +# Field Name : A descriptive name which is shown to the user. +# Comment : A comment helping translators to understand the field name +# Type : C++ type of field. +# Identifier : A string used in code as variable name etc. +# Field Category : Categories the field belongs to (see Field::FieldCategory). +# Output function: Function used to convert type to string for debug output (optional) + +ALE,name,,TQString,name + +ALFE,formatted name,,TQString,formattedName,Frequent + +ALFE,family name,,TQString,familyName,Frequent +ALFE,given name,,TQString,givenName,Frequent +ALFE,additional names,,TQString,additionalName +ALFE,honorific prefixes,,TQString,prefix +ALFE,honorific suffixes,,TQString,suffix + +ALFE,nick name,,TQString,nickName,Personal + +ALFE,birthday,,TQDateTime,birthday,Personal,.toString() + +#Address address +LF,home address street,,TQString,homeAddressStreet,Address|Personal +LF,home address city,,TQString,homeAddressLocality,Address|Personal +LF,home address state,,TQString,homeAddressRegion,Address|Personal +LF,home address zip code,,TQString,homeAddressPostalCode,Address|Personal +LF,home address country,,TQString,homeAddressCountry,Address|Personal +LF,home address label,,TQString,homeAddressLabel,Address|Personal + +LF,business address street,,TQString,businessAddressStreet,Address|Organization +LF,business address city,,TQString,businessAddressLocality,Address|Organization +LF,business address state,,TQString,businessAddressRegion,Address|Organization +LF,business address zip code,,TQString,businessAddressPostalCode,Address|Organization +LF,business address country,,TQString,businessAddressCountry,Address|Organization +LF,business address label,,TQString,businessAddressLabel,Address|Organization + +#phoneNumbers +LF,home phone,,TQString,homePhone,Personal|Frequent +LF,business phone,,TQString,businessPhone,Organization|Frequent +LF,mobile phone,,TQString,mobilePhone,Frequent +LF,home fax,,TQString,homeFax +LF,business fax,,TQString,businessFax +LF,car phone,,TQString,carPhone +LF,ISDN,,TQString,isdn +LF,pager,,TQString,pager + +#emails +LF,email address,,TQString,email,Email|Frequent + +ALFE,mail client,,TQString,mailer,Email + +ALE,time zone,,TimeZone,timeZone,,.asString() +ALE,geographic position,,Geo,geo,,.asString() + +ALFE,title,person,TQString,title,Organization +ALFE,role,person in organization,TQString,role,Organization +ALFE,organization,,TQString,organization,Organization +ALFE,department,,TQString,department,Organization + +ALFE,note,,TQString,note + +ALE,product identifier,,TQString,productId +ALE,revision date,,TQDateTime,revision,,.toString() + +ALE,sort string,,TQString,sortString + +ALF,homepage,,KURL,url,,.url() + +ALE,security class,,Secrecy,secrecy,,.asString() + +ALE,logo,,Picture,logo,,.asString() +ALE,photo,,Picture,photo,,.asString() +ALE,sound,,Sound,sound,,.asString() +ALE,agent,,Agent,agent,,.asString() diff --git a/tdeabc/scripts/field.src.cpp b/tdeabc/scripts/field.src.cpp new file mode 100644 index 000000000..bec318880 --- /dev/null +++ b/tdeabc/scripts/field.src.cpp @@ -0,0 +1,512 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "field.h" +#include "address.h" + +using namespace KABC; + +class Field::FieldImpl +{ + public: + FieldImpl( int fieldId, int category = 0, + const TQString &label = TQString::null, + const TQString &key = TQString::null, + const TQString &app = TQString::null ) + : mFieldId( fieldId ), mCategory( category ), mLabel( label ), + mKey( key ), mApp( app ) {} + + enum FieldId + { + CustomField, + --ENUMS-- + }; + + int fieldId() { return mFieldId; } + int category() { return mCategory; } + + TQString label() { return mLabel; } + TQString key() { return mKey; } + TQString app() { return mApp; } + + private: + int mFieldId; + int mCategory; + + TQString mLabel; + TQString mKey; + TQString mApp; +}; + + +Field::List Field::mAllFields; +Field::List Field::mDefaultFields; +Field::List Field::mCustomFields; + + +Field::Field( FieldImpl *impl ) +{ + mImpl = impl; +} + +Field::~Field() +{ + delete mImpl; +} + +TQString Field::label() +{ + switch ( mImpl->fieldId() ) { + --CASELABEL-- + case FieldImpl::CustomField: + return mImpl->label(); + default: + return i18n("Unknown Field"); + } +} + +int Field::category() +{ + return mImpl->category(); +} + +TQString Field::categoryLabel( int category ) +{ + switch ( category ) { + case All: + return i18n("All"); + case Frequent: + return i18n("Frequent"); + case Address: + return i18n("street/postal","Address"); + case Email: + return i18n("Email"); + case Personal: + return i18n("Personal"); + case Organization: + return i18n("Organization"); + case CustomCategory: + return i18n("Custom"); + default: + return i18n("Undefined"); + } +} + +TQString Field::value( const KABC::Addressee &a ) +{ + switch ( mImpl->fieldId() ) { + --CASEVALUE-- + case FieldImpl::Email: + return a.preferredEmail(); + case FieldImpl::Birthday: + if ( a.birthday().isValid() ) + return a.birthday().date().toString( Qt::ISODate ); + else + return TQString::null; + case FieldImpl::Url: + return a.url().prettyURL(); + case FieldImpl::HomePhone: + { + PhoneNumber::List::ConstIterator it; + + { + // check for preferred number + const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Home | PhoneNumber::Pref ); + for ( it = list.begin(); it != list.end(); ++it ) + if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home ) + return (*it).number(); + } + + { + // check for normal home number + const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Home ); + for ( it = list.begin(); it != list.end(); ++it ) + if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Home ) + return (*it).number(); + } + + return TQString::null; + } + case FieldImpl::BusinessPhone: + { + PhoneNumber::List::ConstIterator it; + + { + // check for preferred number + const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Work | PhoneNumber::Pref ); + for ( it = list.begin(); it != list.end(); ++it ) + if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work ) + return (*it).number(); + } + + { + // check for normal work number + const PhoneNumber::List list = a.phoneNumbers( PhoneNumber::Work ); + for ( it = list.begin(); it != list.end(); ++it ) + if ( ((*it).type() & ~(PhoneNumber::Pref)) == PhoneNumber::Work ) + return (*it).number(); + } + + return TQString::null; + } + case FieldImpl::MobilePhone: + return a.phoneNumber( PhoneNumber::Cell ).number(); + case FieldImpl::HomeFax: + return a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ).number(); + case FieldImpl::BusinessFax: + return a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ).number(); + case FieldImpl::CarPhone: + return a.phoneNumber( PhoneNumber::Car ).number(); + case FieldImpl::Isdn: + return a.phoneNumber( PhoneNumber::Isdn ).number(); + case FieldImpl::Pager: + return a.phoneNumber( PhoneNumber::Pager ).number(); + case FieldImpl::HomeAddressStreet: + return a.address( Address::Home ).street(); + case FieldImpl::HomeAddressLocality: + return a.address( Address::Home ).locality(); + case FieldImpl::HomeAddressRegion: + return a.address( Address::Home ).region(); + case FieldImpl::HomeAddressPostalCode: + return a.address( Address::Home ).postalCode(); + case FieldImpl::HomeAddressCountry: + return a.address( Address::Home ).country(); + case FieldImpl::HomeAddressLabel: + return a.address( Address::Home ).label(); + case FieldImpl::BusinessAddressStreet: + return a.address( Address::Work ).street(); + case FieldImpl::BusinessAddressLocality: + return a.address( Address::Work ).locality(); + case FieldImpl::BusinessAddressRegion: + return a.address( Address::Work ).region(); + case FieldImpl::BusinessAddressPostalCode: + return a.address( Address::Work ).postalCode(); + case FieldImpl::BusinessAddressCountry: + return a.address( Address::Work ).country(); + case FieldImpl::BusinessAddressLabel: + return a.address( Address::Work ).label(); + case FieldImpl::CustomField: + return a.custom( mImpl->app(), mImpl->key() ); + default: + return TQString::null; + } +} + +bool Field::setValue( KABC::Addressee &a, const TQString &value ) +{ + switch ( mImpl->fieldId() ) { + --CASESETVALUE-- + case FieldImpl::MobilePhone: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Cell ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::HomeFax: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Home | PhoneNumber::Fax ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::BusinessFax: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Work | PhoneNumber::Fax ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::CarPhone: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Car ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::Isdn: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Isdn ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::Pager: + { + PhoneNumber number = a.phoneNumber( PhoneNumber::Pager ); + number.setNumber( value ); + a.insertPhoneNumber( number ); + return true; + } + case FieldImpl::HomeAddressStreet: + { + KABC::Address address = a.address( Address::Home ); + address.setStreet( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::HomeAddressLocality: + { + KABC::Address address = a.address( Address::Home ); + address.setLocality( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::HomeAddressRegion: + { + KABC::Address address = a.address( Address::Home ); + address.setRegion( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::HomeAddressPostalCode: + { + KABC::Address address = a.address( Address::Home ); + address.setPostalCode( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::HomeAddressCountry: + { + KABC::Address address = a.address( Address::Home ); + address.setCountry( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::HomeAddressLabel: + { + KABC::Address address = a.address( Address::Home ); + address.setLabel( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressStreet: + { + KABC::Address address = a.address( Address::Work ); + address.setStreet( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressLocality: + { + KABC::Address address = a.address( Address::Work ); + address.setLocality( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressRegion: + { + KABC::Address address = a.address( Address::Work ); + address.setRegion( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressPostalCode: + { + KABC::Address address = a.address( Address::Work ); + address.setPostalCode( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressCountry: + { + KABC::Address address = a.address( Address::Work ); + address.setCountry( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::BusinessAddressLabel: + { + KABC::Address address = a.address( Address::Work ); + address.setLabel( value ); + a.insertAddress( address ); + return true; + } + case FieldImpl::Birthday: + a.setBirthday( TQT_TQDATE_OBJECT(TQDate::fromString( value, Qt::ISODate )) ); + return true; + case FieldImpl::CustomField: + a.insertCustom( mImpl->app(), mImpl->key(), value ); + return true; + default: + return false; + } +} + +TQString Field::sortKey( const KABC::Addressee &a ) +{ + switch ( mImpl->fieldId() ) { + --CASEVALUE-- + case FieldImpl::Birthday: + if ( a.birthday().isValid() ) { + TQDate date = TQT_TQDATE_OBJECT(a.birthday().date()); + TQString key; + key.sprintf( "%02d-%02d", date.month(), date.day() ); + return key; + } else + return TQString( "00-00" ); + default: + return value( a ).lower(); + } +} + +bool Field::isCustom() +{ + return mImpl->fieldId() == FieldImpl::CustomField; +} + +Field::List Field::allFields() +{ + if ( mAllFields.isEmpty() ) { + --CREATEFIELDS-- + } + + return mAllFields; +} + +Field::List Field::defaultFields() +{ + if ( mDefaultFields.isEmpty() ) { + createDefaultField( FieldImpl::FormattedName ); + createDefaultField( FieldImpl::Email ); + } + + return mDefaultFields; +} + +void Field::createField( int id, int category ) +{ + mAllFields.append( new Field( new FieldImpl( id, category ) ) ); +} + +void Field::createDefaultField( int id, int category ) +{ + mDefaultFields.append( new Field( new FieldImpl( id, category ) ) ); +} + +void Field::deleteFields() +{ + Field::List::ConstIterator it; + + for ( it = mAllFields.constBegin(); it != mAllFields.constEnd(); ++it ) { + delete (*it); + } + mAllFields.clear(); + + for ( it = mDefaultFields.constBegin(); it != mDefaultFields.constEnd(); ++it ) { + delete (*it); + } + mDefaultFields.clear(); + + for ( it = mCustomFields.constBegin(); it != mCustomFields.constEnd(); ++it ) { + delete (*it); + } + mCustomFields.clear(); +} + +void Field::saveFields( const TQString &identifier, + const Field::List &fields ) +{ + TDEConfig *cfg = TDEGlobal::config(); + TDEConfigGroupSaver( cfg, "KABCFields" ); + + saveFields( cfg, identifier, fields ); +} + +void Field::saveFields( TDEConfig *cfg, const TQString &identifier, + const Field::List &fields ) +{ + TQValueList fieldIds; + + int custom = 0; + Field::List::ConstIterator it; + for( it = fields.begin(); it != fields.end(); ++it ) { + fieldIds.append( (*it)->mImpl->fieldId() ); + if( (*it)->isCustom() ) { + TQStringList customEntry; + customEntry << (*it)->mImpl->label(); + customEntry << (*it)->mImpl->key(); + customEntry << (*it)->mImpl->app(); + cfg->writeEntry( "KABC_CustomEntry_" + identifier + "_" + + TQString::number( custom++ ), customEntry ); + } + } + + cfg->writeEntry( identifier, fieldIds ); +} + +Field::List Field::restoreFields( const TQString &identifier ) +{ + TDEConfig *cfg = TDEGlobal::config(); + TDEConfigGroupSaver( cfg, "KABCFields" ); + + return restoreFields( cfg, identifier ); +} + +Field::List Field::restoreFields( TDEConfig *cfg, const TQString &identifier ) +{ + const TQValueList fieldIds = cfg->readIntListEntry( identifier ); + + Field::List fields; + + int custom = 0; + TQValueList::ConstIterator it; + for( it = fieldIds.begin(); it != fieldIds.end(); ++it ) { + FieldImpl *f = 0; + if ( (*it) == FieldImpl::CustomField ) { + TQStringList customEntry = cfg->readListEntry( "KABC_CustomEntry_" + + identifier + "_" + + TQString::number( custom++ ) ); + f = new FieldImpl( *it, CustomCategory, customEntry[ 0 ], + customEntry[ 1 ], customEntry[ 2 ] ); + } else { + f = new FieldImpl( *it ); + } + fields.append( new Field( f ) ); + } + + return fields; +} + +bool Field::equals( Field *field ) +{ + bool sameId = ( mImpl->fieldId() == field->mImpl->fieldId() ); + + if ( !sameId ) return false; + + if ( mImpl->fieldId() != FieldImpl::CustomField ) return true; + + return mImpl->key() == field->mImpl->key(); +} + +Field *Field::createCustomField( const TQString &label, int category, + const TQString &key, const TQString &app ) +{ + Field *field = new Field( new FieldImpl( FieldImpl::CustomField, + category | CustomCategory, + label, key, app ) ); + mCustomFields.append( field ); + + return field; +} diff --git a/tdeabc/scripts/makeaddressee b/tdeabc/scripts/makeaddressee new file mode 100755 index 000000000..fa955b0bf --- /dev/null +++ b/tdeabc/scripts/makeaddressee @@ -0,0 +1,215 @@ +#!/usr/bin/perl + +my $srcdir; +$srcdir = `dirname $0` || die "Can't determine \$srcdir."; +chomp $srcdir; + +if (!open( ENTRIES, "$srcdir/entrylist" ) ) { + print "Can't open $srcdir/entrylist\n"; + exit 1; +} + + while() { + if (/^#/) { next; } + chop; + @entries = split /,/; + if (!/^.+,(\w+),(\w+)/) { next; } + push @entryCtrl, @entries[0]; + push @entryRealNames, @entries[1]; + push @entryComments, @entries[2]; + push @entryTypes, @entries[3]; + push @entryNames, @entries[4]; + push @entryCategory, @entries[5]; + push @entryDebug, @entries[6]; + } + +close ENTRIES; + +if (!open( H_IN, "$srcdir/addressee.src.h" ) ) { + print "Can't open $srcdir/addressee.src.h\n"; + exit 1; +} +if (!open( H_OUT, ">../addressee.h" ) ) { + print "Can't open addressee.h\n"; + exit 1; +} + print H_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; + + while( ) { + if (/--DECLARATIONS--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] =~ /A/ ) { + print H_OUT " /**\n"; + print H_OUT " Set $entryRealNames[$i].\n"; + print H_OUT " */\n"; + print H_OUT " void set" . ucfirst($entryNames[$i]); + print H_OUT "( const $entryTypes[$i] &$entryNames[$i] );\n"; + + print H_OUT " /**\n"; + print H_OUT " Return $entryRealNames[$i].\n"; + print H_OUT " */\n"; + print H_OUT " $entryTypes[$i] $entryNames[$i]() const;\n"; + } + + if ( $entryCtrl[$i] !~ /L/ ) { next; } + print H_OUT " /**\n"; + print H_OUT " Return translated label for $entryNames[$i] field.\n"; + print H_OUT " */\n"; + print H_OUT " static TQString $entryNames[$i]Label();\n\n"; + } + } else { + print H_OUT; + } + } + +close H_OUT; +close H_IN; + +if (!open( CPP_IN, "$srcdir/addressee.src.cpp" ) ) { + print "Can't open $srcdir/addressee.src.cpp\n"; + exit 1; +} +if (!open( CPP_OUT, ">../addressee.cpp" ) ) { + print "Can't open addressee.cpp\n"; + exit 1; +} + print CPP_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; + + while( ) { + if (/--VARIABLES--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /A/ ) { next; } + print CPP_OUT " $entryTypes[$i] $entryNames[$i];\n"; + } + } elsif (/--DEFINITIONS--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] =~ /A/ ) { + print CPP_OUT "void Addressee::set" . ucfirst($entryNames[$i]); + print CPP_OUT "( const $entryTypes[$i] &$entryNames[$i] )\n{\n"; + print CPP_OUT " if ( $entryNames[$i] == mData->$entryNames[$i] ) return;\n"; + print CPP_OUT " detach();\n mData->empty = false;\n"; + print CPP_OUT " mData->$entryNames[$i] = $entryNames[$i];\n}\n\n"; + + print CPP_OUT "$entryTypes[$i] Addressee::$entryNames[$i]() const\n{\n"; + print CPP_OUT " return mData->$entryNames[$i];\n}\n\n"; + } + + if ( $entryCtrl[$i] !~ /L/ ) { next; } + @labelwords = split ' ', $entryRealNames[$i]; + for( $j=0; $j < @labelwords; ++$j ) { + $labelwords[$j] = ucfirst $labelwords[$j]; + } + $label = join ' ', @labelwords; + print CPP_OUT "TQString Addressee::$entryNames[$i]Label()\n{\n"; + if ( $entryComments[$i] ) { + print CPP_OUT " return i18n(\"$entryComments[$i]\",\"$label\");\n"; + } else { + print CPP_OUT " return i18n(\"$label\");\n"; + } + print CPP_OUT "}\n\n\n"; + } + } elsif (/--EQUALSTEST--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] =~ /E/ ) { + if ( $entryNames[$i] !~ "revision" ) { + if ( $entryTypes[$i] =~ "TQString" ) { + print CPP_OUT " if ( mData->$entryNames[$i] != a.mData->$entryNames[$i] &&\n"; + print CPP_OUT " !( mData->$entryNames[$i].isEmpty() && a.mData->$entryNames[$i].isEmpty() ) ) {\n"; + print CPP_OUT " kdDebug(5700) << \"$entryNames[$i] differs\" << endl;\n"; + print CPP_OUT " return false;\n"; + print CPP_OUT " }\n"; + } else { + print CPP_OUT " if ( mData->$entryNames[$i] != a.mData->$entryNames[$i] ) {\n"; + print CPP_OUT " kdDebug(5700) << \"$entryNames[$i] differs\" << endl;\n"; + print CPP_OUT " return false;\n"; + print CPP_OUT " }\n"; + } + } + } + } + } elsif (/--STREAMOUT--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] =~ /A/ ) { + print CPP_OUT " s << a.mData->$entryNames[$i];\n"; + } + } + } elsif (/--STREAMIN--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] =~ /A/ ) { + print CPP_OUT " s >> a.mData->$entryNames[$i];\n"; + } + } + } elsif (/--DEBUG--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /A/ ) { next; } + print CPP_OUT " kdDebug(5700) << \" " . ucfirst($entryNames[$i]); + print CPP_OUT ": '\" << $entryNames[$i]()$entryDebug[$i] << \"'\" << endl;\n"; + } + } else { + print CPP_OUT; + } + } + +close CPP_OUT; +close CPP_IN; + +if (!open( CPP_IN, "$srcdir/field.src.cpp" ) ) { + print "Can't open $srcdir/field.src.cpp\n"; + exit 1; +} +if (!open( CPP_OUT, ">../field.cpp" ) ) { + print "Can't open field.cpp\n"; + exit 1; +} + print CPP_OUT "/*** Warning! This file has been generated by the script makeaddressee ***/\n"; + + while( ) { + if (/--ENUMS--/) { + $first = 1; + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /F/ ) { next; } + if ( $first ) { $first = 0; } + else { print CPP_OUT ",\n"; } + print CPP_OUT " " . ucfirst($entryNames[$i]); + } + print CPP_OUT "\n"; + } elsif (/--CASELABEL--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /F/ ) { next; } + if ( $entryCtrl[$i] !~ /L/ ) { next; } + print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; + print CPP_OUT " return Addressee::$entryNames[$i]Label();\n"; + } + } elsif (/--CASEVALUE--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /A/ ) { next; } + if ( $entryCtrl[$i] !~ /F/ ) { next; } + if ( $entryTypes[$i] ne "TQString" ) { next; } + print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; + print CPP_OUT " return a.$entryNames[$i]();\n"; + } + } elsif (/--CASESETVALUE--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /A/ ) { next; } + if ( $entryCtrl[$i] !~ /F/ ) { next; } + if ( $entryTypes[$i] ne "TQString" ) { next; } + print CPP_OUT " case FieldImpl::" . ucfirst($entryNames[$i]) . ":\n"; + print CPP_OUT " a.set" . ucfirst($entryNames[$i]) . "( value );\n"; + print CPP_OUT " return true;\n"; + } + } elsif (/--CREATEFIELDS--/) { + for( $i=0; $i<@entryNames; ++$i ) { + if ( $entryCtrl[$i] !~ /F/ ) { next; } + print CPP_OUT " createField( FieldImpl::" . ucfirst($entryNames[$i]); + if ( $entryCategory[$i] ) { + print CPP_OUT ", $entryCategory[$i]"; + } + print CPP_OUT " );\n"; + } + } else { + print CPP_OUT; + } + } + +close CPP_OUT; +close CPP_IN; diff --git a/tdeabc/secrecy.cpp b/tdeabc/secrecy.cpp new file mode 100644 index 000000000..2725612bc --- /dev/null +++ b/tdeabc/secrecy.cpp @@ -0,0 +1,100 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include "secrecy.h" + +using namespace KABC; + +Secrecy::Secrecy( int type ) + : mType( type ) +{ +} + +bool Secrecy::operator==( const Secrecy &s ) const +{ + return ( mType == s.mType ); +} + +bool Secrecy::operator!=( const Secrecy &s ) const +{ + return !( *this == s ); +} + +bool Secrecy::isValid() const +{ + return mType != Invalid; +} + +void Secrecy::setType( int type ) +{ + mType = type; +} + +int Secrecy::type() const +{ + return mType; +} + +Secrecy::TypeList Secrecy::typeList() +{ + static TypeList list; + + if ( list.isEmpty() ) + list << Public << Private << Confidential; + + return list; +} + +TQString Secrecy::typeLabel( int type ) +{ + switch ( type ) { + case Public: + return i18n( "Public" ); + break; + case Private: + return i18n( "Private" ); + break; + case Confidential: + return i18n( "Confidential" ); + break; + default: + return i18n( "Unknown type" ); + break; + } +} + +TQString Secrecy::asString() const +{ + return typeLabel( mType ); +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Secrecy &secrecy ) +{ + return s << secrecy.mType; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Secrecy &secrecy ) +{ + s >> secrecy.mType; + + return s; +} diff --git a/tdeabc/secrecy.h b/tdeabc/secrecy.h new file mode 100644 index 000000000..5cc60b11d --- /dev/null +++ b/tdeabc/secrecy.h @@ -0,0 +1,100 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_SECRECY_H +#define KABC_SECRECY_H + +#include + +#include + +namespace KABC { + +class KABC_EXPORT Secrecy +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Secrecy & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Secrecy & ); + +public: + typedef TQValueList TypeList; + + /** + * Secrecy types + * + * @li Public - for public access + * @li Private - only private access + * @li Confidential - access for confidential persons + */ + enum Types { + Public, + Private, + Confidential, + Invalid + }; + + /** + * Constructor. + * + * @param type The secrecy type, see Types. + */ + Secrecy( int type = Invalid ); + + bool operator==( const Secrecy & ) const; + bool operator!=( const Secrecy & ) const; + + /** + Returns if the Secrecy object has a valid value. + */ + bool isValid() const; + + /** + * Sets the type, see Types. + */ + void setType( int type ); + + /** + * Returns the type, see Types. + */ + int type() const; + + /** + * Returns a list of all available secrecy types. + */ + static TypeList typeList(); + + /** + * Returns a translated label for a given secrecy type. + */ + static TQString typeLabel( int type ); + + /** + * For debug. + */ + TQString asString() const; + +private: + int mType; +}; + +KABC_EXPORT TQDataStream& operator<<( TQDataStream &s, const Secrecy &secrecy ); +KABC_EXPORT TQDataStream& operator>>( TQDataStream &s, Secrecy &secrecy ); + +} +#endif diff --git a/tdeabc/sortmode.cpp b/tdeabc/sortmode.cpp new file mode 100644 index 000000000..efb4a3919 --- /dev/null +++ b/tdeabc/sortmode.cpp @@ -0,0 +1,79 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include "sortmode.h" + +using namespace KABC; + +NameSortMode::NameSortMode() + : mNameType( FormattedName ), mAscendingOrder( true ), d( 0 ) +{ + mNameType = FormattedName; +} + +NameSortMode::NameSortMode( NameType type, bool ascending ) + : mNameType( type ), mAscendingOrder( ascending ), d( 0 ) +{ +} + +bool NameSortMode::lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const +{ + bool lesser = false; + + switch ( mNameType ) { + case FormattedName: + lesser = TQString::localeAwareCompare( first.formattedName(), second.formattedName() ) < 0; + break; + case FamilyName: + lesser = TQString::localeAwareCompare( first.familyName(), second.familyName() ) < 0; + break; + case GivenName: + lesser = TQString::localeAwareCompare( first.givenName(), second.givenName() ) < 0; + break; + default: + lesser = false; + break; + } + + if ( !mAscendingOrder ) + lesser = !lesser; + + return lesser; +} + +FieldSortMode::FieldSortMode( KABC::Field *field, bool ascending ) + : mField( field ), mAscendingOrder( ascending ), d( 0 ) +{ +} + +bool FieldSortMode::lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const +{ + if ( !mField ) + return false; + else { + bool lesser = TQString::localeAwareCompare( mField->value( first ), mField->value( second ) ) < 0; + if ( !mAscendingOrder ) + lesser = !lesser; + + return lesser; + } +} diff --git a/tdeabc/sortmode.h b/tdeabc/sortmode.h new file mode 100644 index 000000000..f02662b7d --- /dev/null +++ b/tdeabc/sortmode.h @@ -0,0 +1,114 @@ +/* + This file is part of libkabc. + Copyright (c) 2004 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_SORTMODE_H +#define KABC_SORTMODE_H + +#include + +#include + +namespace KABC { + +/** + @short Sort method for sorting an addressee list. + + This interface should be reimplemented by classes which shall act as + SortModes for KABC::AddresseeList. +*/ +class KABC_EXPORT SortMode +{ + public: + /** + Reimplement this method and return whether the first contact is 'smaller' + than the second. + */ + virtual bool lesser( const KABC::Addressee &first, const KABC::Addressee &second ) const = 0; +}; + +class KABC_EXPORT NameSortMode : public SortMode +{ + public: + enum NameType + { + FormattedName, + FamilyName, + GivenName + }; + + /** + Constructor. + + Creates a NameSortMethod with FormattedName as name type set. + */ + NameSortMode(); + + /** + Constructor. + + Creates a NameSortMethod with the specified name type. + + @param type The name type. + @param ascending true for ascending sort, false for descending. + */ + NameSortMode( NameType type, bool ascending = true ); + + /** + Returns whether the first contact is 'smaller' then the second. + */ + virtual bool lesser( const KABC::Addressee&, const KABC::Addressee& ) const; + + private: + NameType mNameType; + bool mAscendingOrder; + + class NameSortModePrivate; + NameSortModePrivate *d; +}; + +class KABC_EXPORT FieldSortMode : public SortMode +{ + public: + /** + Constructor. + + Creates a FieldSortMethod with the specified field. + + @param field The field. + @param ascending true for ascending sort, false for descending. + */ + FieldSortMode( KABC::Field *field, bool ascending = true ); + + /** + Returns whether the first contact is 'smaller' then the second. + */ + virtual bool lesser( const KABC::Addressee&, const KABC::Addressee& ) const; + + private: + KABC::Field *mField; + bool mAscendingOrder; + + class FieldSortModePrivate; + FieldSortModePrivate *d; +}; + +} + +#endif diff --git a/tdeabc/sound.cpp b/tdeabc/sound.cpp new file mode 100644 index 000000000..cf645be83 --- /dev/null +++ b/tdeabc/sound.cpp @@ -0,0 +1,118 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "sound.h" + +#include + +using namespace KABC; + +Sound::Sound() + : mIntern( false ) +{ +} + +Sound::Sound( const TQString &url ) + : mUrl( url ), mIntern( false ) +{ +} + +Sound::Sound( const TQByteArray &data ) + : mData( data ), mIntern( true ) +{ +} + +Sound::~Sound() +{ +} + +bool Sound::operator==( const Sound &s ) const +{ + if ( mIntern != s.mIntern ) return false; + + if ( mIntern ) { + if ( mData != s.mData ) + return false; + } else { + if ( mUrl != s.mUrl ) + return false; + } + + return true; +} + +bool Sound::operator!=( const Sound &s ) const +{ + return !( s == *this ); +} + +void Sound::setUrl( const TQString &url ) +{ + mUrl = url; + mIntern = false; +} + +void Sound::setData( const TQByteArray &data ) +{ + mData = data; + mIntern = true; +} + +bool Sound::isIntern() const +{ + return mIntern; +} + +bool Sound::isEmpty() const +{ + return (!mIntern) && mUrl.isEmpty(); + +} + +TQString Sound::url() const +{ + return mUrl; +} + +TQByteArray Sound::data() const +{ + return mData; +} + +TQString Sound::asString() const +{ + if ( mIntern ) + return "intern sound"; + else + return mUrl; +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const Sound &sound ) +{ + return s << sound.mIntern << sound.mUrl; +// return s << sound.mIntern << sound.mUrl << sound.mData; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, Sound &sound ) +{ + s >> sound.mIntern >> sound.mUrl; +// s >> sound.mIntern >> sound.mUrl >> sound.mData; + return s; +} diff --git a/tdeabc/sound.h b/tdeabc/sound.h new file mode 100644 index 000000000..98dcf320b --- /dev/null +++ b/tdeabc/sound.h @@ -0,0 +1,153 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_SOUND_H +#define KABC_SOUND_H + +#include +#include + +#include + +namespace KABC { + +/** @short Class that holds a Sound clip for a contact. + * + * The sound can be played doing something like this: + * + * \code + * KTempFile tmp; + * if(sound.isIntern()) { + * tmp.file()->tqwriteBlock( sound.data() ); + * tmp.close(); + * KAudioPlayer::play( tmp.name() ); + * } else if(!sound.url().isEmpty()) { + * TQString tmpFile; + * if(!TDEIO::NetAccess::download(KURL(themeURL.url()), tmpFile, NULL)) + * { + * KMessageBox::error(0L, + * TDEIO::NetAccess::lastErrorString(), + * i18n("Failed to download sound file"), + * KMessageBox::Notify + * ); + * return; + * } + * KAudioPlayer::play( tmpFile ); + * } + * \endcode + * + * Unfortunetly KAudioPlayer::play is ASync, so to delete the temporary file, the best you can really do is set a timer. + * + */ +class KABC_EXPORT Sound +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Sound & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Sound & ); + +public: + + /** + * Consturctor. Creates an empty object. + */ + Sound(); + + /** + * Consturctor. + * + * @param url A URL that describes the position of the sound file. + */ + Sound( const TQString &url ); + + /** + * Consturctor. + * + * @param data The raw data of the sound. + */ + Sound( const TQByteArray &data ); + + /** + * Destructor. + */ + ~Sound(); + + + bool operator==( const Sound & ) const; + bool operator!=( const Sound & ) const; + + /** + * Sets a URL for the location of the sound file. When using this + * function, isIntern() will return 'false' until you use + * setData(). + * + * @param url The location URL of the sound file. + */ + void setUrl( const TQString &url ); + + /** + * Test if this sound file has been set. + * Just does: !isIntern() && url.isEmpty() + * @since 3.4 + */ + bool isEmpty() const; + + /** + * Sets the raw data of the sound. When using this function, + * isIntern() will return 'true' until you use setUrl(). + * + * @param data The raw data of the sound. + */ + void setData( const TQByteArray &data ); + + /** + * Returns whether the sound is described by a URL (extern) or + * by the raw data (intern). + * When this method returns 'true' you can use data() to + * get the raw data. Otherwise you can request the URL of this + * sound by url() and load the raw data from that location. + */ + bool isIntern() const; + + /** + * Returns the location URL of this sound. + */ + TQString url() const; + + /** + * Returns the raw data of this sound. + */ + TQByteArray data() const; + + /** + * Returns string representation of the sound. + */ + TQString asString() const; + +private: + TQString mUrl; + TQByteArray mData; + + int mIntern; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const Sound & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, Sound & ); + +} +#endif diff --git a/tdeabc/stdaddressbook.cpp b/tdeabc/stdaddressbook.cpp new file mode 100644 index 000000000..3e64645ea --- /dev/null +++ b/tdeabc/stdaddressbook.cpp @@ -0,0 +1,203 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#include "resource.h" + +#include "stdaddressbook.h" + +using namespace KABC; + +StdAddressBook *StdAddressBook::mSelf = 0; +bool StdAddressBook::mAutomaticSave = true; + +static KStaticDeleter addressBookDeleter; + +TQString StdAddressBook::fileName() +{ + return locateLocal( "data", "tdeabc/std.vcf" ); +} + +TQString StdAddressBook::directoryName() +{ + return locateLocal( "data", "tdeabc/stdvcf" ); +} + +void StdAddressBook::handleCrash() +{ +} + +StdAddressBook *StdAddressBook::self() +{ + if ( !mSelf ) + addressBookDeleter.setObject( mSelf, new StdAddressBook ); + + return mSelf; +} + +StdAddressBook *StdAddressBook::self( bool asynchronous ) +{ + if ( !mSelf ) + addressBookDeleter.setObject( mSelf, new StdAddressBook( asynchronous ) ); + + return mSelf; +} + +StdAddressBook::StdAddressBook() + : AddressBook( "" ) +{ + kdDebug(5700) << "StdAddressBook::StdAddressBook()" << endl; + + init( false ); +} + +StdAddressBook::StdAddressBook( bool asynchronous ) + : AddressBook( "" ) +{ + kdDebug(5700) << "StdAddressBook::StdAddressBook( bool )" << endl; + + init( asynchronous ); +} + +StdAddressBook::~StdAddressBook() +{ + if ( mAutomaticSave ) + saveAll(); +} + +void StdAddressBook::init( bool asynchronous ) +{ + KRES::Manager *manager = resourceManager(); + + KRES::Manager::ActiveIterator it; + for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { + (*it)->setAddressBook( this ); + if ( !(*it)->open() ) { + error( TQString( "Unable to open resource '%1'!" ).arg( (*it)->resourceName() ) ); + continue; + } + connect( *it, TQT_SIGNAL( loadingFinished( Resource* ) ), + this, TQT_SLOT( resourceLoadingFinished( Resource* ) ) ); + connect( *it, TQT_SIGNAL( savingFinished( Resource* ) ), + this, TQT_SLOT( resourceSavingFinished( Resource* ) ) ); + + connect( *it, TQT_SIGNAL( loadingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceLoadingError( Resource*, const TQString& ) ) ); + connect( *it, TQT_SIGNAL( savingError( Resource*, const TQString& ) ), + this, TQT_SLOT( resourceSavingError( Resource*, const TQString& ) ) ); + } + + Resource *res = standardResource(); + if ( !res ) { + res = manager->createResource( "file" ); + if ( res ) + addResource( res ); + else + kdDebug(5700) << "No resource available!!!" << endl; + } + + setStandardResource( res ); + manager->writeConfig(); + + if ( asynchronous ) + asyncLoad(); + else + load(); +} + +bool StdAddressBook::saveAll() +{ + kdDebug(5700) << "StdAddressBook::saveAll()" << endl; + bool ok = true; + + deleteRemovedAddressees(); + + KRES::Manager::ActiveIterator it; + KRES::Manager *manager = resourceManager(); + for ( it = manager->activeBegin(); it != manager->activeEnd(); ++it ) { + if ( !(*it)->readOnly() && (*it)->isOpen() ) { + Ticket *ticket = requestSaveTicket( *it ); + if ( !ticket ) { + error( i18n( "Unable to save to resource '%1'. It is locked." ) + .arg( (*it)->resourceName() ) ); + return false; + } + + if ( !AddressBook::save( ticket ) ) { + ok = false; + releaseSaveTicket( ticket ); + } + } + } + + return ok; +} + +bool StdAddressBook::save() +{ + kdDebug(5700) << "StdAddressBook::save()" << endl; + + if ( mSelf ) + return mSelf->saveAll(); + else + return true; +} + +void StdAddressBook::close() +{ + addressBookDeleter.destructObject(); +} + +void StdAddressBook::setAutomaticSave( bool enable ) +{ + mAutomaticSave = enable; +} + +bool StdAddressBook::automaticSave() +{ + return mAutomaticSave; +} + +// should get const for 4.X +Addressee StdAddressBook::whoAmI() +{ + TDEConfig config( "kabcrc" ); + config.setGroup( "General" ); + + return findByUid( config.readEntry( "WhoAmI" ) ); +} + +void StdAddressBook::setWhoAmI( const Addressee &addr ) +{ + TDEConfig config( "kabcrc" ); + config.setGroup( "General" ); + + config.writeEntry( "WhoAmI", addr.uid() ); +} diff --git a/tdeabc/stdaddressbook.h b/tdeabc/stdaddressbook.h new file mode 100644 index 000000000..935b2bad1 --- /dev/null +++ b/tdeabc/stdaddressbook.h @@ -0,0 +1,153 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_STDADDRESSBOOK_H +#define KABC_STDADDRESSBOOK_H + +#include "addressbook.h" + +namespace KABC { + +/** + Standard KDE address book + + This class provides access to the standard KDE address book shared by all + applications. + + It's implemented as a singleton. Use self() to get the address book + object. On the first self() call the address book also gets loaded. + + Example: + + \code + KABC::AddressBook *ab = KABC::StdAddressBook::self(); + + AddressBook::Ticket *ticket = ab->requestSaveTicket(); + + if ( ticket ) { + KABC::AddressBook::Iterator it; + for ( it = ab->begin(); it != ab->end(); ++it ) { + kdDebug() << "UID=" << (*it).uid() << endl; + + // do some other stuff + } + + KABC::StdAddressBook::save( ticket ); + } + \endcode +*/ +class KABC_EXPORT StdAddressBook : public AddressBook +{ + public: + + /** + Destructor. + */ + ~StdAddressBook(); + + /** + Returns the standard addressbook object. It also loads all resources of + the users standard address book synchronously. + */ + static StdAddressBook *self(); + + /** + This is the same as above, but with specified behaviour of resource loading. + + @param asynchronous When true, the resources are loaded asynchronous, that + means you have the data foremost the addressBookChanged() + signal has been emitted. So connect to this signal when + using this method! + */ + static StdAddressBook *self( bool asynchronous ); + + /** + Saves the standard address book to disk. + + @deprecated Use AddressBook::save( Ticket* ) instead + */ + static bool save() KDE_DEPRECATED; + + /** + @deprecated There is no need to call this function anymore. + */ + static void handleCrash() KDE_DEPRECATED; + + /** + Returns the default file name for vcard-based addressbook + */ + static TQString fileName(); + + /** + Returns the default directory name for vcard-based addressbook + */ + static TQString directoryName(); + + /** + Sets the automatic save property of the address book. + + @param state If true, the address book is saved automatically + at destruction time, otherwise you have to call + AddressBook::save( Ticket* ). + */ + static void setAutomaticSave( bool state ); + + /** + Closes the address book. Depending on automaticSave() it will + save the address book first. + */ + static void close(); + + /** + Returns whether the address book is saved at destruction time. + See also setAutomaticSave(). + */ + static bool automaticSave(); + + /** + Returns the contact, that is associated with the owner of the + address book. This contact should be used by other programs + to access user specific data. + */ + Addressee whoAmI(); + + /** + Sets the users contact. See whoAmI() for more information. + + @param addr The users contact. + */ + void setWhoAmI( const Addressee &addr ); + + protected: + StdAddressBook(); + StdAddressBook( bool asynchronous ); + + void init( bool asynchronous ); + bool saveAll(); + + private: + static StdAddressBook *mSelf; + static bool mAutomaticSave; +}; + +} + +#endif + diff --git a/tdeabc/tdeab2tdeabc.cpp b/tdeabc/tdeab2tdeabc.cpp new file mode 100644 index 000000000..13b433abc --- /dev/null +++ b/tdeabc/tdeab2tdeabc.cpp @@ -0,0 +1,476 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "addressbook.h" +#include "stdaddressbook.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + { "disable-autostart", I18N_NOOP( "Disable automatic startup on login" ), 0 }, + { "quiet", "", 0 }, + { "o", 0, 0 }, + { "override", I18N_NOOP( "Override existing entries" ), "1" }, + TDECmdLineLastOption +}; + +void readKMailEntry( const TQString &kmailEntry, KABC::AddressBook *ab ) +{ + kdDebug() << "KMAILENTRY: " << kmailEntry << endl; + + TQString entry = kmailEntry.simplifyWhiteSpace(); + if ( entry.isEmpty() ) return; + + TQString email; + TQString name; + TQString comment; + + if ( entry.at( entry.length() -1 ) == ')' ) { + int br = entry.findRev( '(' ); + if ( br >= 0 ) { + comment = entry.mid( br + 1, entry.length() - br - 2 ); + entry.truncate( br ); + if ( entry.at( entry.length() - 1 ).isSpace() ) { + entry.truncate( br - 1 ); + } + } + } + + int posSpace = entry.findRev( ' ' ); + if ( posSpace < 0 ) { + email = entry; + if ( !comment.isEmpty() ) { + name = comment; + comment = ""; + } + } else { + email = entry.mid( posSpace + 1 ); + name = entry.left( posSpace ); + } + + if ( email.at( 0 ) == '<' && email.at( email.length() - 1) == '>' ) { + email = email.mid( 1, email.length() - 2 ); + } + if ( name.at( 0 ) == '"' && name.at( name.length() - 1) == '"' ) { + name = name.mid( 1, name.length() - 2 ); + } + if ( name.at( 0 ) == '\'' && name.at( name.length() - 1) == '\'' ) { + name = name.mid( 1, name.length() - 2 ); + } + + if ( name.at( name.length() -1 ) == ')' ) { + int br = name.findRev( '(' ); + if ( br >= 0 ) { + comment = name.mid( br + 1, name.length() - br - 2 ) + " " + comment; + name.truncate( br ); + if ( name.at( name.length() - 1 ).isSpace() ) { + name.truncate( br - 1 ); + } + } + } + + kdDebug() << " EMAIL : " << email << endl; + kdDebug() << " NAME : " << name << endl; + kdDebug() << " COMMENT : " << comment << endl; + + KABC::Addressee::List al = ab->findByEmail( email ); + if ( al.isEmpty() ) { + KABC::Addressee a; + a.setNameFromString( name ); + a.insertEmail( email ); + a.setNote( comment ); + + ab->insertAddressee( a ); + + kdDebug() << "--INSERTED: " << a.realName() << endl; + } +} + +void importKMailAddressBook( KABC::AddressBook *ab ) +{ + TQString fileName = locateLocal( "data", "kmail/addressbook" ); + TQString kmailConfigName = locate( "config", "kmailrc" ); + if ( !kmailConfigName.isEmpty() ) { + TDEConfig cfg( kmailConfigName ); + cfg.setGroup( "Addressbook" ); + fileName = cfg.readPathEntry( "default", fileName ); + } + if ( !TDEStandardDirs::exists( fileName ) ) { + kdDebug(5700) << "Couldn't find KMail addressbook." << endl; + return; + } + + TQFile f( fileName ); + if ( !f.open(IO_ReadOnly) ) { + kdDebug(5700) << "Couldn't open file '" << fileName << "'" << endl; + return; + } + + TQStringList kmailEntries; + + TQTextStream t( &f ); + while ( !t.eof() ) { + kmailEntries.append( t.readLine() ); + } + f.close(); + + TQStringList::ConstIterator it; + for ( it = kmailEntries.begin(); it != kmailEntries.end(); ++it ) { + if ( (*it).at( 0 ) == '#' ) continue; + bool insideQuote = false; + int end = (*it).length() - 1; + for ( int i = end; i; i-- ) { + if ( (*it).at( i ) == '"' ) { + if ( insideQuote ) + insideQuote = false; + else + insideQuote = true; + } else if ( (*it).at( i ) == ',' && !insideQuote ) { + readKMailEntry( (*it).mid( i + 1, end - i ), ab ); + end = i - 1; + } + } + + readKMailEntry( (*it).mid( 0, end + 1 ), ab ); + } +} + +void readKAddressBookEntries( const TQString &dataString, Addressee &a ) +{ + // Strip "KMail:1.0" prefix and "[EOS]" suffix. + TQString str = dataString.mid( 11, dataString.length() - 24 ); + + TQStringList entries = TQStringList::split( "\n[EOR]\n ", str ); + + Address homeAddress( Address::Home ); + Address businessAddress( Address::Work ); + Address otherAddress; + + TQStringList::ConstIterator it; + for ( it = entries.begin(); it != entries.end(); ++it ) { + int pos = (*it).find( "\n" ); + TQString fieldName = (*it).left( pos ); + TQString fieldValue = (*it).mid( pos + 2 ); + + if ( fieldName == "X-HomeFax" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home | + PhoneNumber::Fax ) ); + } else if ( fieldName == "X-OtherPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, 0 ) ); + } else if ( fieldName == "X-PrimaryPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pref ) ); + } else if ( fieldName == "X-BusinessFax" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work | + PhoneNumber::Fax ) ); + } else if ( fieldName == "X-CarPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Car ) ); + } else if ( fieldName == "X-MobilePhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Cell ) ); + } else if ( fieldName == "X-ISDN" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Isdn ) ); + } else if ( fieldName == "X-OtherFax" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Fax ) ); + } else if ( fieldName == "X-Pager" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Pager ) ); + } else if ( fieldName == "X-BusinessPhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Work ) ); + } else if ( fieldName == "X-HomePhone" ) { + a.insertPhoneNumber( PhoneNumber( fieldValue, PhoneNumber::Home ) ); + } else if ( fieldName == "X-HomeAddress" ) { + homeAddress.setLabel( fieldValue ); + } else if ( fieldName == "X-HomeAddressStreet" ) { + homeAddress.setStreet( fieldValue ); + } else if ( fieldName == "X-HomeAddressCity" ) { + homeAddress.setLocality( fieldValue ); + } else if ( fieldName == "X-HomeAddressPostalCode" ) { + homeAddress.setPostalCode( fieldValue ); + } else if ( fieldName == "X-HomeAddressState" ) { + homeAddress.setRegion( fieldValue ); + } else if ( fieldName == "X-HomeAddressCountry" ) { + homeAddress.setCountry( fieldValue ); + } else if ( fieldName == "X-BusinessAddress" ) { + businessAddress.setLabel( fieldValue ); + } else if ( fieldName == "X-BusinessAddressStreet" ) { + businessAddress.setStreet( fieldValue ); + } else if ( fieldName == "X-BusinessAddressCity" ) { + businessAddress.setLocality( fieldValue ); + } else if ( fieldName == "X-BusinessAddressPostalCode" ) { + businessAddress.setPostalCode( fieldValue ); + } else if ( fieldName == "X-BusinessAddressState" ) { + businessAddress.setRegion( fieldValue ); + } else if ( fieldName == "X-BusinessAddressCountry" ) { + businessAddress.setCountry( fieldValue ); + } else if ( fieldName == "X-OtherAddress" ) { + otherAddress.setLabel( fieldValue ); + } else if ( fieldName == "X-OtherAddressStreet" ) { + otherAddress.setStreet( fieldValue ); + } else if ( fieldName == "X-OtherAddressCity" ) { + otherAddress.setLocality( fieldValue ); + } else if ( fieldName == "X-OtherAddressPostalCode" ) { + otherAddress.setPostalCode( fieldValue ); + } else if ( fieldName == "X-OtherAddressState" ) { + otherAddress.setRegion( fieldValue ); + } else if ( fieldName == "X-OtherAddressCountry" ) { + otherAddress.setCountry( fieldValue ); + } else if ( fieldName == "NICKNAME" ) { + a.setNickName( fieldValue ); + } else if ( fieldName == "ORG" ) { + a.setOrganization( fieldValue ); + } else if ( fieldName == "ROLE" ) { + a.setRole( fieldValue ); + } else if ( fieldName == "BDAY" ) { + a.setBirthday( TDEGlobal::locale()->readDate( fieldValue ) ); + } else if ( fieldName == "WEBPAGE" ) { + a.setUrl( KURL( fieldValue ) ); + } else if ( fieldName == "N" ) { + } else if ( fieldName == "X-FirstName" ) { + } else if ( fieldName == "X-MiddleName" ) { + } else if ( fieldName == "X-LastName" ) { + } else if ( fieldName == "X-Title" ) { + } else if ( fieldName == "X-Suffix" ) { + } else if ( fieldName == "X-FileAs" ) { + } else if ( fieldName == "EMAIL" ) { + a.insertEmail( fieldValue, true ); + } else if ( fieldName == "X-E-mail2" ) { + a.insertEmail( fieldValue ); + } else if ( fieldName == "X-E-mail3" ) { + a.insertEmail( fieldValue ); + } else if ( fieldName == "X-Notes" ) { + } else { + a.insertCustom( "KADDRESSBOOK", fieldName, fieldValue ); + } + } + + if ( !homeAddress.isEmpty() ) a.insertAddress( homeAddress ); + if ( !businessAddress.isEmpty() ) a.insertAddress( businessAddress ); + if ( !otherAddress.isEmpty() ) a.insertAddress( otherAddress ); +} + +void importKab( KABC::AddressBook *ab, bool override, bool quiet ) +{ + TQString fileName = TDEGlobal::dirs()->saveLocation( "data", "kab/" ); + fileName += "addressbook.kab"; + if ( !TQFile::exists( fileName ) ) { + if ( !quiet ) { + KMessageBox::error( 0, "" + i18n( "Address book file %1 not found! Make sure the old address book is located there and you have read permission for this file." ) + .arg( fileName ) + "" ); + } + kdDebug(5700) << "No KDE 2 addressbook found." << endl; + return; + } + + kdDebug(5700) << "Converting old-style kab addressbook to " + "new-style kabc addressbook." << endl; + + KabAPI kab( 0 ); + if ( kab.init() != ::AddressBook::NoError ) { + kdDebug(5700) << "Error initing kab" << endl; + exit( 1 ); + } + + KabKey key; + ::AddressBook::Entry entry; + + int num = kab.addressbook()->noOfEntries(); + + kdDebug(5700) << "kab Addressbook has " << num << " entries." << endl; + + for ( int i = 0; i < num; ++i ) { + if ( ::AddressBook::NoError != kab.addressbook()->getKey( i, key ) ) { + kdDebug(5700) << "Error getting key for index " << i << " from kab." << endl; + continue; + } + if ( ::AddressBook::NoError != kab.addressbook()->getEntry( key, entry ) ) { + kdDebug(5700) << "Error getting entry for index " << i << " from kab." << endl; + continue; + } + + Addressee a; + + // Convert custom entries + int count = 0; + bool idFound = false; + TQStringList::ConstIterator customIt; + for ( customIt = entry.custom.begin(); customIt != entry.custom.end(); ++customIt ) { + if ( (*customIt).startsWith( "X-KABC-UID:" ) ) { + a.setUid( (*customIt).mid( (*customIt).find( ":" ) + 1 ) ); + idFound = true; + } else if ( (*customIt).startsWith( "KMail:1.0\n" ) ) { + readKAddressBookEntries( *customIt, a ); + } else { + a.insertCustom( "tdeab2tdeabc", TQString::number( count++ ), *customIt ); + } + } + if ( idFound ) { + if ( !override ) continue; + } else { + entry.custom << "X-KABC-UID:" + a.uid(); + ::AddressBook::ErrorCode error = kab.addressbook()->change( key, entry ); + if ( error != ::AddressBook::NoError ) { + kdDebug(5700) << "kab.change returned with error " << error << endl; + } else { + kdDebug(5700) << "Wrote back to kab uid " << a.uid() << endl; + } + } + + a.setTitle( entry.title ); + a.setFormattedName( entry.fn ); + a.setPrefix( entry.nameprefix ); + a.setGivenName( entry.firstname ); + a.setAdditionalName( entry.middlename ); + a.setFamilyName( entry.lastname ); + a.setBirthday( entry.birthday ); + + TQStringList::ConstIterator emailIt; + for ( emailIt = entry.emails.begin(); emailIt != entry.emails.end(); ++emailIt ) + a.insertEmail( *emailIt ); + + TQStringList::ConstIterator phoneIt; + for ( phoneIt = entry.telephone.begin(); phoneIt != entry.telephone.end(); ++phoneIt ) { + int kabType = (*phoneIt++).toInt(); + if ( phoneIt == entry.telephone.end() ) break; + TQString number = *phoneIt; + int type = 0; + if ( kabType == ::AddressBook::Fixed ) type = PhoneNumber::Voice; + else if ( kabType == ::AddressBook::Mobile ) type = PhoneNumber::Cell | PhoneNumber::Voice; + else if ( kabType == ::AddressBook::Fax ) type = PhoneNumber::Fax; + else if ( kabType == ::AddressBook::Modem ) type = PhoneNumber::Modem; + a.insertPhoneNumber( PhoneNumber( number, type ) ); + } + + if ( entry.URLs.count() > 0 ) { + a.setUrl( KURL( entry.URLs.first() ) ); + if ( entry.URLs.count() > 1 ) { + kdWarning() << "More than one URL. Ignoring all but the first." << endl; + } + } + + int noAdr = entry.noOfAddresses(); + for ( int j = 0; j < noAdr; ++j ) { + ::AddressBook::Entry::Address kabAddress; + entry.getAddress( j, kabAddress ); + + Address adr; + + adr.setStreet( kabAddress.address ); + adr.setPostalCode( kabAddress.zip ); + adr.setLocality( kabAddress.town ); + adr.setCountry( kabAddress.country ); + adr.setRegion( kabAddress.state ); + + TQString label; + if ( !kabAddress.headline.isEmpty() ) label += kabAddress.headline + "\n"; + if ( !kabAddress.position.isEmpty() ) label += kabAddress.position + "\n"; + if ( !kabAddress.org.isEmpty() ) label += kabAddress.org + "\n"; + if ( !kabAddress.orgUnit.isEmpty() ) label += kabAddress.orgUnit + "\n"; + if ( !kabAddress.orgSubUnit.isEmpty() ) label += kabAddress.orgSubUnit + "\n"; + if ( !kabAddress.deliveryLabel.isEmpty() ) label += kabAddress.deliveryLabel + "\n"; + adr.setLabel( label ); + + a.insertAddress( adr ); + } + + TQString note = entry.comment; + + if ( !entry.user1.isEmpty() ) note += "\nUser1: " + entry.user1; + if ( !entry.user2.isEmpty() ) note += "\nUser2: " + entry.user2; + if ( !entry.user3.isEmpty() ) note += "\nUser3: " + entry.user3; + if ( !entry.user4.isEmpty() ) note += "\nUser4: " + entry.user4; + + if ( !entry.keywords.count() == 0 ) note += "\nKeywords: " + entry.keywords.join( ", " ); + + TQStringList::ConstIterator talkIt; + for ( talkIt = entry.talk.begin(); talkIt != entry.talk.end(); ++talkIt ) { + note += "\nTalk: " + (*talkIt); + } + + a.setNote( note ); + + a.setPrefix( entry.rank + a.prefix() ); // Add rank to prefix + + a.setCategories( entry.categories ); + + kdDebug(5700) << "Addressee: " << a.familyName() << endl; + + ab->insertAddressee( a ); + } + + kab.save( true ); +} + +int main( int argc, char **argv ) +{ + TDEAboutData aboutData( "tdeab2tdeabc", I18N_NOOP( "Kab to Kabc Converter" ), "0.1" ); + aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); + + TDECmdLineArgs::init( argc, argv, &aboutData ); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + bool override = false; + + if ( args->isSet( "override" ) ) { + kdDebug() << "Override existing entries." << endl; + + override = true; + } + + bool quiet = false; + + if ( args->isSet( "quiet" ) ) + quiet = true; + + if ( args->isSet( "disable-autostart" ) ) { + kdDebug() << "Disable autostart." << endl; + + TDEConfig *config = app.config(); + config->setGroup( "Startup" ); + config->writeEntry( "EnableAutostart", false ); + } + + KABC::AddressBook *kabcBook = StdAddressBook::self(); + + importKMailAddressBook( kabcBook ); + + importKab( kabcBook, override, quiet ); + + StdAddressBook::save(); + + kdDebug(5700) << "Saved kabc addressbook to '" << kabcBook->identifier() << "'" << endl; +} + diff --git a/tdeabc/tdeab2tdeabc.desktop b/tdeabc/tdeab2tdeabc.desktop new file mode 100644 index 000000000..ef7641b23 --- /dev/null +++ b/tdeabc/tdeab2tdeabc.desktop @@ -0,0 +1,105 @@ +[Desktop Entry] +Name=tdeab2tdeabc +Name[af]=kab-na-kabc +Name[csb]=Kònwersëjô adresowi knéżczi +Name[eo]=Konvertilo de "kab" al "kabc" +Name[fr]=KAB2KABC +Name[fy]=Kab2kabc +Name[hu]=Kab2kabc +Name[it]=Kab2Kabc +Name[nl]=Kab2kabc +Name[pl]=Konwersja książki adresowej +Name[pt_BR]=Conversão de kab para kabc +Name[ro]=Kab2kabc +Name[sv]=Kab2kabc +Name[te]=కెఎబి2కెఎబిసి +Name[zu]=i-tdeab2tdeabc +Exec=tdeab2tdeabc --disable-autostart --quiet +Icon=misc +Type=Application +Comment=libkab to libkabc conversion tool. +Comment[af]=libkab na libkabc omskakeling program. +Comment[ar]=أداة تحويل libkab إلى libkabc. +Comment[az]=libkab - libkabc dönüşdürmə vasitəsi. +Comment[be]=Інструмент пераўтварэння libkab у libkabc. +Comment[bg]=Програма за конвертиране на libkab до libkabc. +Comment[bn]=libkab থেকে libtdeabc-তে পরিবর্তন করার প্রোগ্রাম। +Comment[bs]=alat za pretvaranje libkab u libkabc. +Comment[ca]=Eina de conversió de libkab a libkabc. +Comment[cs]=Převod dat z libkab do libkabc. +Comment[csb]=Nôrzãdze do kònwersëji z libkab do libkabc. +Comment[cy]=erfyn trosi libkab i libkabc +Comment[da]=libkab-til-libtdeabc-konverteringsværktøj. +Comment[de]=Konvertierung von libkab in libkabc +Comment[el]=Εργαλείο μετατροπής από το libkab στο libkabc. +Comment[eo]=Konvertilo de "libkab" al "libkabc" +Comment[es]=Conversor libkab a libkabc. +Comment[et]=libkab -> libkabc teisendamine +Comment[eu]=libkab-etik libtdeabc-era bihurtzeko tresna. +Comment[fa]=ابزار تبدیل libkab به libcabc. +Comment[fi]=libkab-libkabc -muunnin +Comment[fr]=Outil de conversion de libkab vers libkabc. +Comment[fy]=Konversjeprogramma fan libkab nei libkabc. +Comment[ga]=Uirlis tiontaithe ó libkab go libkabc. +Comment[gl]=Ferramenta de conversión de libkab a libkabc. +Comment[he]=כלי המרה מ־libkab ל־libkabc +Comment[hi]=libkab से libkabc बदलने वाला औजार +Comment[hr]=Alat za pretvaranje iz libkab u libkabc +Comment[hsb]=libkab -> libkabc konwerter +Comment[hu]=libkab -> libkabc konvertáló. +Comment[id]=konverter libkab ke libkabc. +Comment[is]=libkab í libkabc breytingatól. +Comment[it]=Strumento di conversione da libkab a libkabc. +Comment[ja]=libkab から libkabc への変換ツール +Comment[ka]=libkab => libkabc გარდაქმნის ხელსაწყო. +Comment[kk]=libkab дегеннен libkabc дегенге айналдыру құралы. +Comment[km]=ឧបករណ៍​បម្លែង​ពី libkab ទៅ libkabc +Comment[ko]=libkab을 libkabc로 바꿔주는 연장. +Comment[lb]=libkab op libkabc Konvertéierungs-Hëllefsmëttel. +Comment[lt]=libkab į libkabc konvertavimo įrankis. +Comment[lv]=libkab uz libkabc kovertēšanas rīks. +Comment[mk]=алатка за претворање од libkab во libkabc. +Comment[mn]=libkab-аас libtdeabc-руу хөрвүүлэгч +Comment[ms]=perkakasan penukaran libkab to libkabc. +Comment[mt]=Għodda għall-konverżjoni libkab għal libkabc +Comment[nb]=libkab til libkabc konverteringsverktøy. +Comment[nds]=Warktüüch för't Ümwanneln vun libkab na libkabc. +Comment[ne]=libkab to libkabc रूपान्तरण उपकरण । +Comment[nl]=Conversieprogramma van libkab naar libkabc. +Comment[nn]=Konverterer libkab til libkabc +Comment[nso]=Sebereka sa phetosetso ya libkab go libkabc +Comment[pa]=libkab ਤੋ libkabc ਤਬਦੀਲੀ ਸੰਦ। +Comment[pl]=Narzędzie do konwersji z libkab do libkabc. +Comment[pt]=Ferramenta de conversão de libkab para libkabc. +Comment[pt_BR]=Ferramenta de conversão de libkab para libkabc. +Comment[ro]=Utilitar de conversie de la "libkab" la "libkabc". +Comment[ru]=утилита преобразования libkab в libkabc. +Comment[rw]=Igikoresho cy'ihindura libkab muri libkabc. +Comment[se]=konverterenreaidu libkab:as libkabc:ai +Comment[sk]=Prevod dát z libkab do libkabc. +Comment[sl]=Orodje za pretvorbo iz libkab v libkabc +Comment[sq]=Vegla për shëndrimin e libkab në libkabc. +Comment[sr]=Алат за конверзију из libkab-а у libkabc. +Comment[sr@Latn]=Alat za konverziju iz libkab-a u libkabc. +Comment[ss]=Lithulusi lekutjintja le-libkab kuya ku-libkabc. +Comment[sv]=Konverteringsverktyg från libkab till libkabc +Comment[ta]=libkab இலிருந்து libkabc க்கு மாற்றும் கருவி. +Comment[te]=libkab నుంచి libkabc కు మార్చు పనిముట్టు +Comment[tg]=асбоби дигаргунсози libkab ба libkabc +Comment[th]=เครื่องมือเปลี่ยน libkab เป็น libkabc +Comment[tr]=libkab' tan libkabc' ye dönüştürme aracı +Comment[tt]=libkab-›libkabc äyländerü qoralı. +Comment[uk]=Засіб перетворення libkab до libkabc. +Comment[uz]=libkab'ni libkabc'ga aylantiradigan vosita. +Comment[uz@cyrillic]=libkab'ни libkabc'га айлантирадиган восита. +Comment[ven]=Tshishumiswa tsha u shandukisa libkab itshi ya kha libkabc +Comment[vi]=Công cụ chuyển đổi libkab sang libkabc. +Comment[xh]=libkab kwi libkabc isixhobo sokuguqulela. +Comment[zh_CN]=libkab 到 libkabc 的转换工具。 +Comment[zh_HK]=libkab 至 libkabc 的轉換工具 +Comment[zh_TW]=libkab 至 libkabc 轉換工具 +Comment[zu]=Ithuluzi lokuguqula le-libkab kuyaku-libkabc +Terminal=false +NoDisplay=true +X-TDE-autostart-condition=tdeab2tdeabcrc:Startup:EnableAutostart:true +OnlyShowIn=TDE; diff --git a/tdeabc/tests/Makefile.am b/tdeabc/tests/Makefile.am new file mode 100644 index 000000000..201cf746a --- /dev/null +++ b/tdeabc/tests/Makefile.am @@ -0,0 +1,55 @@ +# Make sure $(all_includes) remains last! +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc -I$(top_srcdir)/kab \ + -I$(srcdir)/../vcardparser/ -I$(srcdir)/../vcard/include \ + -I$(srcdir)/../vcard/include/generated \ + -I$(srcdir)/../vcardparser $(all_includes) +LDADD = ../libkabc.la + +METASOURCES = AUTO + +check_PROGRAMS = testlock testldapclient + +testlock_LDFLAGS = $(all_libraries) +testlock_SOURCES = testlock.cpp + +testldapclient_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testldapclient_SOURCES = testldapclient.cpp + +EXTRA_PROGRAMS = testkabc testkabcdlg testdistlist bigread bigwrite testdb \ + testaddressee testaddresseelist testaddressfmt kabcargl testaddresslineedit + +testkabc_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testkabc_SOURCES = testkabc.cpp + +testaddressee_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testaddressee_SOURCES = testaddressee.cpp + +testaddresseelist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testaddresseelist_SOURCES = testaddresseelist.cpp + +testaddressfmt_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testaddressfmt_SOURCES = testaddressfmt.cpp + +testkabcdlg_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testkabcdlg_SOURCES = testkabcdlg.cpp + +testdistlist_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testdistlist_SOURCES = testdistlist.cpp + +testaddresslineedit_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testaddresslineedit_SOURCES = testaddresslineedit.cpp + +bigread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +bigread_LDADD = ../libkabc.la $(top_builddir)/tdeabc/plugins/file/libkabc_file.la +bigread_SOURCES = bigread.cpp + +bigwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +bigwrite_LDADD = ../libkabc.la $(top_builddir)/tdeabc/plugins/file/libkabc_file.la +bigwrite_SOURCES = bigwrite.cpp + +testdb_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testdb_SOURCES = testdb.cpp + +kabcargl_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +kabcargl_SOURCES = kabcargl.cpp + diff --git a/tdeabc/tests/bigread.cpp b/tdeabc/tests/bigread.cpp new file mode 100644 index 000000000..a5022367c --- /dev/null +++ b/tdeabc/tests/bigread.cpp @@ -0,0 +1,65 @@ +#include + +#include +#include +#include +#include +#include + +#include "addressbook.h" +#include "vcardformat.h" +#include "plugins/file/resourcefile.h" +#if 0 +#include "resourcesql.h" +#endif + +using namespace KABC; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("bigread","BigReadKabc","0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + + TDEApplication app( false, false ); + + AddressBook ab; + + ResourceFile r( "my.kabc", "vcard2" ); + ab.addResource( &r ); + +#if 0 + ResourceSql rsql( &ab, "root", "kde4ever", "localhost" ); + ab.addResource( &rsql ); +#endif + + struct tms start; + + times( &start ); + +#if 0 + kdDebug() << "utime : " << int( start.tms_utime ) << endl; + kdDebug() << "stime : " << int( start.tms_stime ) << endl; + kdDebug() << "cutime: " << int( start.tms_cutime ) << endl; + kdDebug() << "cstime: " << int( start.tms_cstime ) << endl; +#endif + + kdDebug() << "Start load" << endl; + ab.load(); + kdDebug() << "Finished load" << endl; + + struct tms end; + + times( &end ); + +#if 0 + kdDebug() << "utime : " << int( end.tms_utime ) << endl; + kdDebug() << "stime : " << int( end.tms_stime ) << endl; + kdDebug() << "cutime: " << int( end.tms_cutime ) << endl; + kdDebug() << "cstime: " << int( end.tms_cstime ) << endl; +#endif + + kdDebug() << "UTime: " << int( end.tms_utime ) - int( start.tms_utime ) << endl; + kdDebug() << "STime: " << int( end.tms_stime ) - int( start.tms_stime ) << endl; + +// ab.dump(); +} diff --git a/tdeabc/tests/bigwrite.cpp b/tdeabc/tests/bigwrite.cpp new file mode 100644 index 000000000..4b9fa7bc3 --- /dev/null +++ b/tdeabc/tests/bigwrite.cpp @@ -0,0 +1,70 @@ +#include + +#include +#include +#include +#include +#include + +#include "addressbook.h" +#include "vcardformat.h" +#include "plugins/file/resourcefile.h" + +using namespace KABC; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("bigwrite","BigWriteKabc","0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + + TDEApplication app( false, false ); + + AddressBook ab; + ResourceFile r( "my.kabc", "vcard" ); + ab.addResource( &r ); + + for( int i = 0; i < 5000; ++i ) { + Addressee a; + a.setGivenName( "number" + TQString::number( i ) ); + a.setFamilyName( "Name" ); + a.insertEmail( TQString::number( i ) + "@domain" ); + + ab.insertAddressee( a ); + } + printf( "\n" ); + + Ticket *t = ab.requestSaveTicket( &r ); + if ( t ) { + struct tms start; + + times( &start ); + +#if 0 + kdDebug() << "utime : " << int( start.tms_utime ) << endl; + kdDebug() << "stime : " << int( start.tms_stime ) << endl; + kdDebug() << "cutime: " << int( start.tms_cutime ) << endl; + kdDebug() << "cstime: " << int( start.tms_cstime ) << endl; +#endif + + if ( !ab.save( t ) ) { + kdDebug() << "Can't save." << endl; + } + + struct tms end; + + times( &end ); + +#if 0 + kdDebug() << "utime : " << int( end.tms_utime ) << endl; + kdDebug() << "stime : " << int( end.tms_stime ) << endl; + kdDebug() << "cutime: " << int( end.tms_cutime ) << endl; + kdDebug() << "cstime: " << int( end.tms_cstime ) << endl; +#endif + + kdDebug() << "UTime: " << int( end.tms_utime ) - int( start.tms_utime ) << endl; + kdDebug() << "STime: " << int( end.tms_stime ) - int( start.tms_stime ) << endl; + + } else { + kdDebug() << "No ticket for save." << endl; + } +} diff --git a/tdeabc/tests/kabcargl.cpp b/tdeabc/tests/kabcargl.cpp new file mode 100644 index 000000000..e38a8a22e --- /dev/null +++ b/tdeabc/tests/kabcargl.cpp @@ -0,0 +1,70 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "stdaddressbook.h" + +using namespace KABC; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("kabcargl","Fix broken pre3.0rc3 format","0.1"); + aboutData.addAuthor("Cornelius Schumacher", 0, "schumacher@kde.org"); + + TDECmdLineArgs::init(argc,argv,&aboutData); + + TDEApplication app; + + TQString filename = StdAddressBook::fileName(); + + TQFile f( filename ); + if ( !f.open( IO_ReadOnly ) ) { + kdDebug() << "Error opening file '" << filename << "' for reading." << endl; + return 1; + } + + TQTextStream t( &f ); + t.setEncoding(TQTextStream::UnicodeUTF8); + TQString text = t.read(); + f.close(); + + text = TQString::fromUtf8( text.local8Bit() ); + text.replace( "\n", "\r\n" ); + + if ( !f.open( IO_WriteOnly ) ) { + kdDebug() << "Error opening file '" << filename << "' for writing." << endl; + return 1; + } + + TQTextStream t2( &f ); + t2.setEncoding(TQTextStream::UnicodeUTF8); + t2 << text; + f.close(); +} diff --git a/tdeabc/tests/testaddressee.cpp b/tdeabc/tests/testaddressee.cpp new file mode 100644 index 000000000..ef55ae403 --- /dev/null +++ b/tdeabc/tests/testaddressee.cpp @@ -0,0 +1,57 @@ +#include +#include +#include +#include +#include +#include + +#include "addressbook.h" +#include "plugins/file/resourcefile.h" +#include "formats/binaryformat.h" +#include "vcardformat.h" +#include "phonenumber.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + { "save", "", 0 }, + { "number", "", 0 }, + TDECmdLineLastOption +}; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testaddressee","TestAddressee","0.1"); + TDECmdLineArgs::init(argc, argv, &aboutData); + TDECmdLineArgs::addCmdLineOptions(options); + + TDEApplication app; + TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); + + kdDebug() << "Creating a" << endl; + Addressee a; + + kdDebug() << "tick1" << endl; + a.setGivenName("Hans"); + kdDebug() << "tick2" << endl; + a.setPrefix("Dr."); + + kdDebug() << "Creating b" << endl; + Addressee b( a ); + + kdDebug() << "tack1" << endl; + a.setFamilyName("Wurst"); + kdDebug() << "tack2" << endl; + a.setNickName("hansi"); + + kdDebug() << "Creating c" << endl; + Addressee c = a; + + kdDebug() << "tock1" << endl; + c.setGivenName("Eberhard"); + + a.dump(); + b.dump(); + c.dump(); +} diff --git a/tdeabc/tests/testaddresseelist.cpp b/tdeabc/tests/testaddresseelist.cpp new file mode 100644 index 000000000..f247f1744 --- /dev/null +++ b/tdeabc/tests/testaddresseelist.cpp @@ -0,0 +1,196 @@ +#include +#include +#include +#include +#include +#include + +#include "addressbook.h" +#include "addresseelist.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + { "save", "", 0 }, + { "number", "", 0 }, + TDECmdLineLastOption +}; + +int main(int /*argc*/,char /* **argv*/) +{ +/* TDEAboutData aboutData("testaddresseelist","TestAddresseeList","0.1"); + TDECmdLineArgs::init(argc, argv, &aboutData); + TDECmdLineArgs::addCmdLineOptions(options); + + TDEApplication app; + TDECmdLineArgs* args = TDECmdLineArgs::parsedArgs(); */ + + kdDebug() << "Creating addressees" << endl; + Addressee a, b, c, d, e, f; + a.setGivenName ("Peter"); + a.setFamilyName("Pan"); + a.setFormattedName("Pan, Peter"); + a.setUid("Asdf"); + b.setGivenName ("Phileas"); + b.setFamilyName("Fogg"); + b.setFormattedName("Fogg, Phileas"); + b.setUid("Rsdf"); + c.setGivenName ("Jim"); + c.setFamilyName("Hawkins"); + c.setFormattedName("Hawkins, Jim"); + c.setUid("Fhwn"); + d.setGivenName ("John"); + d.setFamilyName("Silver"); + d.setPrefix ("Long"); + d.setFormattedName("Long John Silver"); + d.setUid("Z2hk"); + e.setGivenName ("Alice"); + e.setFamilyName("Liddel"); + e.setFormattedName("Liddel, Alice"); + e.setUid("kk45"); + f.setGivenName ("Edmond"); + f.setFamilyName("Dantes"); + f.setFormattedName("Dantes, Edmond"); + f.setUid("78ze"); + + kdDebug() << "Adding to list" << endl; + AddresseeList list; + list.append(a); + list.append(b); + list.append(c); + list.append(d); + list.append(e); + list.append(f); + + list.sortBy(FamilyName); + if ( !( (*list.at(0)).uid()=="78ze" + && (*list.at(1)).uid()=="Rsdf" + && (*list.at(2)).uid()=="Fhwn" + && (*list.at(3)).uid()=="kk45" + && (*list.at(4)).uid()=="Asdf" + && (*list.at(5)).uid()=="Z2hk" + ) ) { + kdError() << "SORTING BY FAMILY NAME NOT CORRECT!" << endl; + kdDebug() << "list sorted by family name:" << endl; + list.dump(); + } else { + kdDebug() << "Sorting by family name correct." << endl; + } + list.setReverseSorting(true); + list.sort(); + if ( !( (*list.at(5)).uid()=="78ze" + && (*list.at(4)).uid()=="Rsdf" + && (*list.at(3)).uid()=="Fhwn" + && (*list.at(2)).uid()=="kk45" + && (*list.at(1)).uid()=="Asdf" + && (*list.at(0)).uid()=="Z2hk" + ) ) { + kdError() << "REVERSE SORTING BY FAMILY NAME NOT CORRECT!" << endl; + kdDebug() << "list reverse sorted by family name:" << endl; + list.dump(); + } else { + kdDebug() << "Reverse sorting by family name correct." << endl; + } + + list.setReverseSorting(false); + list.sortBy(FormattedName); + if ( !( (*list.at(0)).uid()=="78ze" + && (*list.at(1)).uid()=="Rsdf" + && (*list.at(2)).uid()=="Fhwn" + && (*list.at(3)).uid()=="kk45" + && (*list.at(4)).uid()=="Z2hk" + && (*list.at(5)).uid()=="Asdf" + ) ) { + kdError() << "SORTING BY FORMATTED NAME NOT CORRECT!" << endl; + kdDebug() << "list sorted by formatted name:" << endl; + list.dump(); + } else { + kdDebug() << "Sorting by formatted name correct." << endl; + } + list.setReverseSorting(true); + list.sort(); + if ( !( (*list.at(5)).uid()=="78ze" + && (*list.at(4)).uid()=="Rsdf" + && (*list.at(3)).uid()=="Fhwn" + && (*list.at(2)).uid()=="kk45" + && (*list.at(1)).uid()=="Z2hk" + && (*list.at(0)).uid()=="Asdf" + ) ) { + kdError() << "REVERSE SORTING BY FORMATTED NAME NOT CORRECT!" << endl; + kdDebug() << "list reverse sorted by formatted name:" << endl; + list.dump(); + } else { + kdDebug() << "Reverse sorting by formatted name correct." << endl; + } + + + list.setReverseSorting(false); + list.sortBy(Uid); + if ( !( (*list.at(0)).uid()=="78ze" + && (*list.at(1)).uid()=="Asdf" + && (*list.at(2)).uid()=="Fhwn" + && (*list.at(3)).uid()=="Rsdf" + && (*list.at(4)).uid()=="Z2hk" + && (*list.at(5)).uid()=="kk45" + ) ) { + kdError() << "SORTING BY UID NOT CORRECT!" << endl; + kdDebug() << "list sorted by Uid:" << endl; + list.dump(); + } else { + kdDebug() << "Sorting by Uid correct." << endl; + } + list.setReverseSorting(true); + list.sortBy(Uid); + if ( !( (*list.at(5)).uid()=="78ze" + && (*list.at(4)).uid()=="Asdf" + && (*list.at(3)).uid()=="Fhwn" + && (*list.at(2)).uid()=="Rsdf" + && (*list.at(1)).uid()=="Z2hk" + && (*list.at(0)).uid()=="kk45" + ) ) { + kdError() << "REVERSE SORTING BY UID NOT CORRECT!" << endl; + kdDebug() << "list sorted by Uid:" << endl; + list.dump(); + } else { + kdDebug() << "Reverse sorting by Uid correct." << endl; + } + + // zero, one or two entries might give errors in a poor sorting + // implementation + kdDebug() << "sorting empty list" << endl; + AddresseeList list2; + list2.sort(); + + kdDebug() << "sorting one entry list" << endl; + list2.append(a); + list2.sort(); + + kdDebug() << "sorting two entry list" << endl; + list2.append(f); + list2.setReverseSorting(false); + list2.sort(); + if ( !( (*list2.at(0)).uid()=="78ze" + && (*list2.at(1)).uid()=="Asdf" + ) ) { + kdError() << "SORTING BY FORMATTED NAME IN A TWO ENTRY LIST NOT CORRECT!" << endl; + kdDebug() << "list sorted by formatted name, two entries:" << endl; + list2.dump(); + } else { + kdDebug() << "Sorting by FormattedName in a two entry list correct." << endl; + } + list2.setReverseSorting(true); + list2.sort(); + if ( !( (*list2.at(1)).uid()=="78ze" + && (*list2.at(0)).uid()=="Asdf" + ) ) { + kdError() << "REVERSE SORTING BY FORMATTED NAME IN A TWO ENTRY LIST NOT CORRECT!" << endl; + kdDebug() << "list reverse sorted by formatted name, two entries:" << endl; + list2.dump(); + } else { + kdDebug() << "Reverse sorting by FormattedName in a two entry list correct." << endl; + } + +} + + diff --git a/tdeabc/tests/testaddressfmt.cpp b/tdeabc/tests/testaddressfmt.cpp new file mode 100644 index 000000000..2eb438335 --- /dev/null +++ b/tdeabc/tests/testaddressfmt.cpp @@ -0,0 +1,63 @@ +#include +#include +#include +#include +#include +#include + +#include "addressbook.h" +#include "address.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + { "save", "", 0 }, + { "number", "", 0 }, + TDECmdLineLastOption +}; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testaddressfmt","TestAddressFormat","0.1"); + TDECmdLineArgs::init(argc, argv, &aboutData); + TDECmdLineArgs::addCmdLineOptions(options); + + TDEApplication app; + + Address a; + a.setStreet("Lummerlandstr. 1"); + a.setPostalCode("12345"); + a.setLocality("Lummerstadt"); + a.setCountry ("Germany"); + + Address b; + b.setStreet("457 Foobar Ave"); + b.setPostalCode("1A2B3C"); + b.setLocality("Nervousbreaktown"); + b.setRegion("DC"); + b.setCountry("United States of America"); + + Address c; + c.setStreet("Lummerlandstr. 1"); + c.setPostalCode("12345"); + c.setLocality("Lummerstadt"); + c.setCountry ("Deutschland"); + + Address d; + d.setStreet("Lummerlandstr. 1"); + d.setPostalCode("12345"); + d.setLocality("Lummerstadt"); + d.setCountry (""); + + tqDebug( "-------------------------------------\nShould have german address formatting, local country formatting\n" ); + tqDebug( a.formattedAddress("Jim Knopf").latin1() ); + tqDebug( "-------------------------------------\nShould have US address formatting, local country formatting\n" ); + tqDebug( b.formattedAddress("Huck Finn").latin1() ); + tqDebug( "-------------------------------------\nShould have german address formatting, local country formatting\n" ); + tqDebug( c.formattedAddress("Jim Knopf").latin1() ); + tqDebug( "-------------------------------------\nShould have local address formatting, local country formatting\n" ); + tqDebug( d.formattedAddress("Jim Knopf").latin1() ); +} + + diff --git a/tdeabc/tests/testaddresslineedit.cpp b/tdeabc/tests/testaddresslineedit.cpp new file mode 100644 index 000000000..74446f482 --- /dev/null +++ b/tdeabc/tests/testaddresslineedit.cpp @@ -0,0 +1,29 @@ +#include +#include +#include +#include +#include + +#include "addresslineedit.h" + +using namespace KABC; + +int main( int argc,char **argv ) +{ + TDEAboutData aboutData( "testaddresslineedit", + I18N_NOOP( "Test Address LineEdit" ), "0.1" ); + TDECmdLineArgs::init( argc, argv, &aboutData ); + + TDEApplication app; + + AddressLineEdit *lineEdit = new AddressLineEdit( 0 ); + + lineEdit->show(); + app.setMainWidget( lineEdit ); + + TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) ); + + app.exec(); + + delete lineEdit; +} diff --git a/tdeabc/tests/testdb.cpp b/tdeabc/tests/testdb.cpp new file mode 100644 index 000000000..f7ec1d17c --- /dev/null +++ b/tdeabc/tests/testdb.cpp @@ -0,0 +1,33 @@ +#include +#include +#include +#include +#include + +#include "addressbook.h" +#include "vcardformat.h" +#include "resourcesql.h" + +using namespace KABC; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testdb","TestKabcDB","0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + +// TDEApplication app( false, false ); + TDEApplication app; + + AddressBook ab; + + ResourceSql r( &ab, "root", "kde4ever", "localhost" ); + if ( ! r.open() ) { + kdDebug() << "Failed to open resource." << endl; + } + + r.load( &ab ); + + r.close(); + + ab.dump(); +} diff --git a/tdeabc/tests/testdistlist.cpp b/tdeabc/tests/testdistlist.cpp new file mode 100644 index 000000000..69a309ff9 --- /dev/null +++ b/tdeabc/tests/testdistlist.cpp @@ -0,0 +1,59 @@ +#include + +#include +#include +#include +#include +#include + +#include "stdaddressbook.h" + +#include "distributionlisteditor.h" +#include "distributionlist.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + {"list ", I18N_NOOP("Show distribution list with name "), 0}, + TDECmdLineLastOption +}; + + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testdistlist",I18N_NOOP("Test Distribution Lists"),"0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + if (args->isSet("list")) { + TQString name = args->getOption("list"); + + DistributionListManager *manager = + new DistributionListManager( StdAddressBook::self() ); + manager->load(); + DistributionList *list = manager->list( name ); + if ( !list ) { + kdDebug() << "No list with name '" << name << "'" << endl; + return 1; + } else { + kdDebug() << "RESULT: " << list->emails().join(", ") << endl; + return 0; + } + } + + DistributionListEditor *editor = + new DistributionListEditor( StdAddressBook::self(), 0 ); + + editor->show(); + app.setMainWidget(editor); + + TQObject::connect( &app, TQT_SIGNAL( lastWindowClosed() ), &app, TQT_SLOT( quit() ) ); + + app.exec(); + + delete editor; +} diff --git a/tdeabc/tests/testkabc.cpp b/tdeabc/tests/testkabc.cpp new file mode 100644 index 000000000..427262cab --- /dev/null +++ b/tdeabc/tests/testkabc.cpp @@ -0,0 +1,62 @@ +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "geo.h" +#include "secrecy.h" +#include "stdaddressbook.h" +#include "timezone.h" +#include "key.h" +#include "agent.h" +#include "vcardconverter.h" + +using namespace KABC; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testkabc",I18N_NOOP("TestKabc"),"0.1"); + TDECmdLineArgs::init(argc, argv, &aboutData); + + TDEApplication app( false, false ); + AddressBook *ab = StdAddressBook::self(); + +#define READ + +#ifdef READ + AddressBook::Iterator it; + for ( it = ab->begin(); it != ab->end(); ++it ) { + TQString vcard; + VCardConverter converter; + converter.addresseeToVCard( *it, vcard ); + kdDebug() << "card=" << vcard << endl; + } +#else + Addressee addr; + + addr.setGivenName("Tobias"); + addr.setFamilyName("Koenig"); + + + Picture pic; + TQImage img; + img.load("/home/tobias/test.png"); +/* + pic.setData(img); + pic.setType(TQImage::imageFormat("/home/tobias/test.png")); +*/ + pic.setUrl("http://www.mypict.de"); + addr.setLogo( pic ); + + ab->insertAddressee( addr ); + + StdAddressBook::save(); +#endif + + return 0; +} diff --git a/tdeabc/tests/testkabcdlg.cpp b/tdeabc/tests/testkabcdlg.cpp new file mode 100644 index 000000000..aef203d28 --- /dev/null +++ b/tdeabc/tests/testkabcdlg.cpp @@ -0,0 +1,45 @@ +#include + +#include +#include +#include +#include +#include + +#include "addresseedialog.h" + +using namespace KABC; + +static const TDECmdLineOptions options[] = +{ + {"multiple", I18N_NOOP("Allow selection of multiple addressees"), 0}, + TDECmdLineLastOption +}; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testkabcdlg",I18N_NOOP("TestKabc"),"0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + if (args->isSet("multiple")) { + Addressee::List al = AddresseeDialog::getAddressees( 0 ); + Addressee::List::ConstIterator it; + kdDebug() << "Selected Addressees:" << endl; + for( it = al.begin(); it != al.end(); ++it ) { + kdDebug() << " " << (*it).fullEmail() << endl; + } + } else { + Addressee a = AddresseeDialog::getAddressee( 0 ); + + if ( !a.isEmpty() ) { + kdDebug() << "Selected Addressee:" << endl; + a.dump(); + } else { + kdDebug() << "No Addressee selected." << endl; + } + } +} diff --git a/tdeabc/tests/testldapclient.cpp b/tdeabc/tests/testldapclient.cpp new file mode 100644 index 000000000..df9fd6226 --- /dev/null +++ b/tdeabc/tests/testldapclient.cpp @@ -0,0 +1,161 @@ +/* This file is part of the KDE project + Copyright (C) 2005 David Faure + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "testldapclient.h" + +#include +#include +#include + +#include + +#include +#include + +int main(int argc, char *argv[]) +{ + TDEApplication::disableAutoDcopRegistration(); + TDECmdLineArgs::init(argc,argv,"testldapclient", 0, 0, 0, 0); + TDEApplication app; + + TestLDAPClient test; + test.setup(); + test.runAll(); + test.cleanup(); + kdDebug() << "All tests OK." << endl; + return 0; +} + +void TestLDAPClient::setup() +{ +} + +void TestLDAPClient::runAll() +{ + testIntevation(); +} + +bool TestLDAPClient::check(const TQString& txt, TQString a, TQString b) +{ + if (a.isEmpty()) + a = TQString::null; + if (b.isEmpty()) + b = TQString::null; + if (a == b) { + kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "ok" << endl; + } + else { + kdDebug() << txt << " : checking '" << a << "' against expected value '" << b << "'... " << "KO !" << endl; + cleanup(); + exit(1); + } + return true; +} + +void TestLDAPClient::cleanup() +{ + mClient = 0; +} + +void TestLDAPClient::testIntevation() +{ + kdDebug() << k_funcinfo << endl; + mClient = new LdapClient( this ); + + mClient->setHost( "ca.intevation.de" ); + mClient->setPort( "389" ); + mClient->setBase( "o=Intevation GmbH,c=de" ); + + // Same list as in kaddressbook's ldapsearchdialog + TQStringList attrs; + attrs << "l" << "Company" << "co" << "department" << "description" << "mail" << "facsimileTelephoneNumber" << "cn" << "homePhone" << "mobile" << "o" << "pager" << "postalAddress" << "st" << "street" << "title" << "uid" << "telephoneNumber" << "postalCode" << "objectClass"; + // the list from ldapclient.cpp + //attrs << "cn" << "mail" << "givenname" << "sn" << "objectClass"; + mClient->setAttrs( attrs ); + + // Taken from LdapSearch + //TQString mSearchText = TQString::fromUtf8( "Till" ); + //TQString filter = TQString( "&(|(objectclass=person)(objectclass=groupOfNames)(mail=*))(|(cn=%1*)(mail=%2*)(givenName=%3*)(sn=%4*))" ) + // .arg( mSearchText ).arg( mSearchText ).arg( mSearchText ).arg( mSearchText ); + + // For some reason a fromUtf8 broke the search for me (no results). + // But this certainly looks fishy, it might break on non-utf8 systems. + TQString filter = "&(|(objectclass=person)(objectclass=groupofnames)(mail=*))(|(cn=*gypten MDK*)(sn=*gypten MDK*))"; + + connect( mClient, TQT_SIGNAL( result( const KABC::LdapObject& ) ), + this, TQT_SLOT( slotLDAPResult( const KABC::LdapObject& ) ) ); + connect( mClient, TQT_SIGNAL( done() ), + this, TQT_SLOT( slotLDAPDone() ) ); + connect( mClient, TQT_SIGNAL( error( const TQString& ) ), + this, TQT_SLOT( slotLDAPError( const TQString& ) ) ); + mClient->startQuery( filter ); + kapp->eventLoop()->enterLoop(); + delete mClient; mClient = 0; +} + +// from kaddressbook... ugly though... +static TQString asUtf8( const TQByteArray &val ) +{ + if ( val.isEmpty() ) + return TQString::null; + + const char *data = val.data(); + + //TQString::fromUtf8() bug workaround + if ( data[ val.size() - 1 ] == '\0' ) + return TQString::fromUtf8( data, val.size() - 1 ); + else + return TQString::fromUtf8( data, val.size() ); +} + +static TQString join( const KABC::LdapAttrValue& lst, const TQString& sep ) +{ + TQString res; + bool already = false; + for ( KABC::LdapAttrValue::ConstIterator it = lst.begin(); it != lst.end(); ++it ) { + if ( already ) + res += sep; + already = TRUE; + res += asUtf8( *it ); + } + return res; +} + +void TestLDAPClient::slotLDAPResult( const KABC::LdapObject& obj ) +{ + TQString cn = join( obj.attrs[ "cn" ], ", " ); + kdDebug() << " cn:" << cn << endl; + assert( !obj.attrs[ "mail" ].isEmpty() ); + TQString mail = join( obj.attrs[ "mail" ], ", " ); + kdDebug() << " mail:" << mail << endl; + assert( mail.contains( '@' ) ); +} + +void TestLDAPClient::slotLDAPError( const TQString& err ) +{ + kdDebug() << k_funcinfo << err << endl; + ::exit( 1 ); +} + +void TestLDAPClient::slotLDAPDone() +{ + kdDebug() << k_funcinfo << endl; + kapp->eventLoop()->exitLoop(); +} + +#include "testldapclient.moc" diff --git a/tdeabc/tests/testldapclient.h b/tdeabc/tests/testldapclient.h new file mode 100644 index 000000000..1995914c3 --- /dev/null +++ b/tdeabc/tests/testldapclient.h @@ -0,0 +1,51 @@ +/* This file is part of the KDE project + Copyright (C) 2005 David Faure + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License version 2 as published by the Free Software Foundation. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef TESTLDAPCLIENT_H +#define TESTLDAPCLIENT_H + +#include + +#include "../ldapclient.h" +typedef KABC::LdapClient LdapClient; + +class TestLDAPClient : public TQObject +{ + Q_OBJECT + +public: + TestLDAPClient() {} + void setup(); + void runAll(); + void cleanup(); + + // tests + void testIntevation(); + +private slots: + void slotLDAPResult( const KABC::LdapObject& ); + void slotLDAPError( const TQString& ); + void slotLDAPDone(); + +private: + bool check(const TQString& txt, TQString a, TQString b); + + LdapClient* mClient; +}; + +#endif diff --git a/tdeabc/tests/testlock.cpp b/tdeabc/tests/testlock.cpp new file mode 100644 index 000000000..3ebd724bb --- /dev/null +++ b/tdeabc/tests/testlock.cpp @@ -0,0 +1,206 @@ +/* + This file is part of libkabc. + + Copyright (c) 2003 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "testlock.h" + +#include "stdaddressbook.h" + +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include + +#include +#include + +using namespace KABC; + +LockWidget::LockWidget( const TQString &identifier ) +{ + TQVBoxLayout *topLayout = new TQVBoxLayout( this ); + topLayout->setMargin( KDialog::marginHint() ); + topLayout->setSpacing( KDialog::spacingHint() ); + + if ( identifier.isEmpty() ) { + mLock = 0; + } else { + mLock = new Lock( identifier ); + + int pid = getpid(); + + TQLabel *pidLabel = new TQLabel( "Process ID: " + TQString::number( pid ), + this ); + topLayout->addWidget( pidLabel ); + + TQHBoxLayout *identifierLayout = new TQHBoxLayout( topLayout ); + + TQLabel *resourceLabel = new TQLabel( "Identifier:", this ); + identifierLayout->addWidget( resourceLabel ); + + TQLabel *resourceIdentifier = new TQLabel( identifier, this ); + identifierLayout->addWidget( resourceIdentifier ); + + mStatus = new TQLabel( "Status: Unlocked", this ); + topLayout->addWidget( mStatus ); + + TQPushButton *button = new TQPushButton( "Lock", this ); + topLayout->addWidget( button ); + connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( lock() ) ); + + button = new TQPushButton( "Unlock", this ); + topLayout->addWidget( button ); + connect( button, TQT_SIGNAL( clicked() ), TQT_SLOT( unlock() ) ); + } + + mLockView = new TQListView( this ); + topLayout->addWidget( mLockView ); + mLockView->addColumn( "Lock File" ); + mLockView->addColumn( "PID" ); + mLockView->addColumn( "Locking App" ); + + updateLockView(); + + TQPushButton *quitButton = new TQPushButton( "Quit", this ); + topLayout->addWidget( quitButton ); + connect( quitButton, TQT_SIGNAL( clicked() ), TQT_SLOT( close() ) ); + + KDirWatch *watch = KDirWatch::self(); + connect( watch, TQT_SIGNAL( dirty( const TQString & ) ), + TQT_SLOT( updateLockView() ) ); + connect( watch, TQT_SIGNAL( created( const TQString & ) ), + TQT_SLOT( updateLockView() ) ); + connect( watch, TQT_SIGNAL( deleted( const TQString & ) ), + TQT_SLOT( updateLockView() ) ); + watch->addDir( Lock::locksDir() ); + watch->startScan(); +} + +LockWidget::~LockWidget() +{ + delete mLock; +} + +void LockWidget::updateLockView() +{ + mLockView->clear(); + + TQDir dir( Lock::locksDir() ); + + TQStringList files = dir.entryList( "*.lock" ); + + TQStringList::ConstIterator it; + for( it = files.begin(); it != files.end(); ++it ) { + if ( *it == "." || *it == ".." ) continue; + + TQString app; + int pid; + if ( !Lock::readLockFile( dir.filePath( *it ), pid, app ) ) { + kdWarning() << "Unable to open lock file '" << *it << "'" << endl; + } else { + new TQListViewItem( mLockView, *it, TQString::number( pid ), app ); + } + } +} + +void LockWidget::lock() +{ + if ( !mLock->lock() ) { + KMessageBox::sorry( this, mLock->error() ); + } else { + mStatus->setText( "Status: Locked" ); + } +} + +void LockWidget::unlock() +{ + if ( !mLock->unlock() ) { + KMessageBox::sorry( this, mLock->error() ); + } else { + mStatus->setText( "Status: Unlocked" ); + } +} + + +static const TDECmdLineOptions options[] = +{ + { "a", 0, 0 }, + { "addressbook", "Standard address book", 0 }, + { "d", 0, 0 }, + { "diraddressbook", "Standard address book directory resource", 0 }, + { "+identifier", "Identifier of resource to be locked, e.g. filename", 0 }, + TDECmdLineLastOption +}; + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testlock",I18N_NOOP("Test libkabc Lock"),"0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app; + + TQString identifier; + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + if ( args->count() == 1 ) { + identifier = args->arg( 0 ); + } else if ( args->count() != 0 ) { + std::cerr << "Usage: testlock " << std::endl; + return 1; + } + + if ( args->isSet( "addressbook" ) ) { + if ( args->count() == 1 ) { + std::cerr << "Ignoring resource identifier" << std::endl; + } + identifier = StdAddressBook::fileName(); + } + + if ( args->isSet( "diraddressbook" ) ) { + if ( args->count() == 1 ) { + std::cerr << "Ignoring resource identifier" << std::endl; + } + identifier = StdAddressBook::directoryName(); + } + + LockWidget mainWidget( identifier ); + + kapp->setMainWidget( &mainWidget ); + mainWidget.show(); + + return app.exec(); +} + +#include "testlock.moc" diff --git a/tdeabc/tests/testlock.h b/tdeabc/tests/testlock.h new file mode 100644 index 000000000..a94d4e8c6 --- /dev/null +++ b/tdeabc/tests/testlock.h @@ -0,0 +1,51 @@ +/* + This file is part of libkabc. + + Copyright (c) 2003 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef KABC_TESTLOCK_H +#define KABC_TESTLOCK_H + +#include "lock.h" + +#include + +class TQLabel; +class TQListView; + +class KABC_EXPORT LockWidget : public TQWidget +{ + Q_OBJECT + public: + LockWidget( const TQString &identifier ); + ~LockWidget(); + + protected slots: + void lock(); + void unlock(); + + void updateLockView(); + + private: + KABC::Lock *mLock; + + TQLabel *mStatus; + TQListView *mLockView; +}; + +#endif diff --git a/tdeabc/timezone.cpp b/tdeabc/timezone.cpp new file mode 100644 index 000000000..59a184c6d --- /dev/null +++ b/tdeabc/timezone.cpp @@ -0,0 +1,85 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include "timezone.h" + +using namespace KABC; + +TimeZone::TimeZone() : + mOffset( 0 ), mValid( false ) +{ +} + +TimeZone::TimeZone( int offset ) : + mOffset( offset ), mValid( true ) +{ +} + +void TimeZone::setOffset( int offset ) +{ + mOffset = offset; + mValid = true; +} + +int TimeZone::offset() const +{ + return mOffset; +} + +bool TimeZone::isValid() const +{ + return mValid; +} + +bool TimeZone::operator==( const TimeZone &t ) const +{ + if ( !t.isValid() && !isValid() ) return true; + if ( !t.isValid() || !isValid() ) return false; + if ( t.mOffset == mOffset ) return true; + return false; +} + +bool TimeZone::operator!=( const TimeZone &t ) const +{ + if ( !t.isValid() && !isValid() ) return false; + if ( !t.isValid() || !isValid() ) return true; + if ( t.mOffset != mOffset ) return true; + return false; +} + +TQString TimeZone::asString() const +{ + return TQString::number( mOffset ); +} + +TQDataStream &KABC::operator<<( TQDataStream &s, const TimeZone &zone ) +{ + return s << zone.mOffset; +} + +TQDataStream &KABC::operator>>( TQDataStream &s, TimeZone &zone ) +{ + s >> zone.mOffset; + zone.mValid = true; + + return s; +} diff --git a/tdeabc/timezone.h b/tdeabc/timezone.h new file mode 100644 index 000000000..8705797fb --- /dev/null +++ b/tdeabc/timezone.h @@ -0,0 +1,89 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_TIMEZONE_H +#define KABC_TIMEZONE_H + +#include + +#include + +namespace KABC { + +/** + * @short Time zone information. + * + * This class stores information about a time zone. + */ +class KABC_EXPORT TimeZone +{ + friend KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const TimeZone & ); + friend KABC_EXPORT TQDataStream &operator>>( TQDataStream &, TimeZone & ); + +public: + + /** + * Construct invalid time zone. + */ + TimeZone(); + + /** + * Construct time zone. + * + * @param offset Offset in minutes relative to UTC. + */ + TimeZone( int offset ); + + /** + * Set time zone offset relative to UTC. + * + * @param offset Offset in minutes. + */ + void setOffset( int offset ); + + /** + * Return offset in minutes relative to UTC. + */ + int offset() const; + + /** + * Return, if this time zone object is valid. + */ + bool isValid() const; + + bool operator==( const TimeZone & ) const; + bool operator!=( const TimeZone & ) const; + + /** + * Return string representation of time zone offset. + */ + TQString asString() const; + +private: + int mOffset; // Offset in minutes + + bool mValid; +}; + +KABC_EXPORT TQDataStream &operator<<( TQDataStream &, const TimeZone & ); +KABC_EXPORT TQDataStream &operator>>( TQDataStream &, TimeZone & ); + +} +#endif diff --git a/tdeabc/vcard/AdrParam.cpp b/tdeabc/vcard/AdrParam.cpp new file mode 100644 index 000000000..5ad56f4fb --- /dev/null +++ b/tdeabc/vcard/AdrParam.cpp @@ -0,0 +1,126 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include +#include + +using namespace VCARD; + +AdrParam::AdrParam() + : Param() +{ +} + +AdrParam::AdrParam(const AdrParam & x) + : Param(x), + adrTypeList_ (x.adrTypeList_) +{ +} + +AdrParam::AdrParam(const TQCString & s) + : Param(s) +{ +} + + AdrParam & +AdrParam::operator = (AdrParam & x) +{ + if (*this == x) return *this; + + adrTypeList_ = x.adrTypeList(); + textParam_ = x.textParam(); + + Param::operator = (x); + return *this; +} + + AdrParam & +AdrParam::operator = (const TQCString & s) +{ + Param::operator = (s); + + adrTypeList_.clear(); + textParam_.truncate(0); + + return *this; +} + + bool +AdrParam::operator == (AdrParam & x) +{ + parse(); + + if (!x.textParam().isEmpty()) + return (x.textParam_ == textParam_); + + if (x.adrTypeList().count() != adrTypeList_.count()) + return false; + + TQStrListIterator it(x.adrTypeList_); + + for (; it.current(); ++it) + if (!adrTypeList_.find(it.current())) + return false; + + return true; +} + +AdrParam::~AdrParam() +{ +} + + void +AdrParam::_parse() +{ + adrTypeList_.clear(); + + if (strRep_.left(4) != "TYPE") { + textParam_ = strRep_; + return; + } + + if (!strRep_.contains('=')) + return; + + RTokenise(strRep_, ",", adrTypeList_); +} + + void +AdrParam::_assemble() +{ + if (!textParam_.isEmpty()) { + strRep_ = textParam_; + return; + } + + TQStrListIterator it(adrTypeList_); + + for (; it.current(); ++it) { + + strRep_ += it.current(); + + if (it.current() != adrTypeList_.last()) + strRep_ += ','; + } +} diff --git a/tdeabc/vcard/AdrValue.cpp b/tdeabc/vcard/AdrValue.cpp new file mode 100644 index 000000000..535ba6980 --- /dev/null +++ b/tdeabc/vcard/AdrValue.cpp @@ -0,0 +1,140 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include +#include +#include + +using namespace VCARD; + +AdrValue::AdrValue() + : Value() +{ +} + +AdrValue::AdrValue(const AdrValue & x) + : Value(x), + poBox_ (x.poBox_), + extAddress_ (x.extAddress_), + street_ (x.street_), + locality_ (x.locality_), + region_ (x.region_), + postCode_ (x.postCode_), + countryName_ (x.countryName_) +{ +} + +AdrValue::AdrValue(const TQCString & s) + : Value(s) +{ +} + + AdrValue & +AdrValue::operator = (AdrValue & x) +{ + if (*this == x) return *this; + + poBox_ = x.poBox_; + extAddress_ = x.extAddress_; + street_ = x.street_; + locality_ = x.locality_; + region_ = x.region_; + postCode_ = x.postCode_; + countryName_ = x.countryName_; + + Value::operator = (x); + return *this; +} + + AdrValue & +AdrValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +AdrValue::operator == (AdrValue & x) +{ + parse(); + x.parse(); + + return ( + poBox_ == x.poBox_ && + extAddress_ == x.extAddress_ && + street_ == x.street_ && + locality_ == x.locality_ && + region_ == x.region_ && + postCode_ == x.postCode_ && + countryName_ == x.countryName_); +} + +AdrValue::~AdrValue() +{ +} + + AdrValue * +AdrValue::clone() +{ + return new AdrValue( *this ); +} + + void +AdrValue::_parse() +{ + vDebug("AdrValue::_parse()"); + + TQStrList l; + RTokenise(strRep_, ";", l); + + for (unsigned int i = 0; i < l.count(); i++) { + + switch (i) { + + case 0: poBox_ = l.at(0); break; + case 1: extAddress_ = l.at(1); break; + case 2: street_ = l.at(2); break; + case 3: locality_ = l.at(3); break; + case 4: region_ = l.at(4); break; + case 5: postCode_ = l.at(5); break; + case 6: countryName_ = l.at(6); break; + default: break; + } + } +} + + void +AdrValue::_assemble() +{ + vDebug("AdrValue::_assemble"); + + strRep_ = poBox_; + strRep_ += ";" + extAddress_; + strRep_ += ";" + street_; + strRep_ += ";" + locality_; + strRep_ += ";" + region_; + strRep_ += ";" + postCode_; + strRep_ += ";" + countryName_; +} + diff --git a/tdeabc/vcard/AgentParam.cpp b/tdeabc/vcard/AgentParam.cpp new file mode 100644 index 000000000..9e4531b02 --- /dev/null +++ b/tdeabc/vcard/AgentParam.cpp @@ -0,0 +1,103 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +AgentParam::AgentParam() + : Param() +{ +} + +AgentParam::AgentParam(const AgentParam & x) + : Param(x), + refer_ (x.refer_), + uri_ (x.uri_) +{ +} + +AgentParam::AgentParam(const TQCString & s) + : Param(s) +{ +} + + AgentParam & +AgentParam::operator = (AgentParam & x) +{ + if (*this == x) return *this; + + refer_ = x.refer_; + uri_ = x.uri_; + + Param::operator = (x); + return *this; +} + + AgentParam & +AgentParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +AgentParam::operator == (AgentParam & x) +{ + parse(); + + if (refer_) + return (x.refer() && uri_ == x.uri_); + + return !x.refer(); +} + +AgentParam::~AgentParam() +{ +} + + void +AgentParam::_parse() +{ + if (strRep_.isEmpty()) { + refer_ = false; + return; + } + + refer_ = true; + uri_ = strRep_; +} + + void +AgentParam::_assemble() +{ + if (!refer_) { + strRep_.truncate(0); + return; + } + + strRep_ = uri_.asString(); + return; +} diff --git a/tdeabc/vcard/AgentValue.cpp b/tdeabc/vcard/AgentValue.cpp new file mode 100644 index 000000000..7d356f8d7 --- /dev/null +++ b/tdeabc/vcard/AgentValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +AgentValue::AgentValue() + : Value() +{ +} + +AgentValue::AgentValue(const AgentValue & x) + : Value(x) +{ +} + +AgentValue::AgentValue(const TQCString & s) + : Value(s) +{ +} + + AgentValue & +AgentValue::operator = (AgentValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + AgentValue & +AgentValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +AgentValue::operator == (AgentValue & x) +{ + x.parse(); + return false; +} + +AgentValue::~AgentValue() +{ +} + + void +AgentValue::_parse() +{ +} + + void +AgentValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/CMakeLists.txt b/tdeabc/vcard/CMakeLists.txt new file mode 100644 index 000000000..8ad988434 --- /dev/null +++ b/tdeabc/vcard/CMakeLists.txt @@ -0,0 +1,40 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/include/generated + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdecore +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### vcard ##################################### + +set( target vcard ) + +set( ${target}_SRCS + vCard-all.cpp +) + +tde_add_library( ${target} SHARED + SOURCES ${${target}_SRCS} + VERSION 0.0.0 + LINK tdecore-shared + DESTINATION ${LIB_INSTALL_DIR} +) diff --git a/tdeabc/vcard/ClassValue.cpp b/tdeabc/vcard/ClassValue.cpp new file mode 100644 index 000000000..21417f87b --- /dev/null +++ b/tdeabc/vcard/ClassValue.cpp @@ -0,0 +1,120 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +#include + +using namespace VCARD; + +ClassValue::ClassValue() + : Value() +{ +} + +ClassValue::ClassValue(const ClassValue & x) + : Value(x), + classType_(x.classType_) +{ +} + +ClassValue::ClassValue(const TQCString & s) + : Value(s) +{ +} + + ClassValue & +ClassValue::operator = (ClassValue & x) +{ + if (*this == x) return *this; + x.parse(); + + classType_ = x.classType_; + + Value::operator = (x); + return *this; +} + + ClassValue & +ClassValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +ClassValue::operator == (ClassValue & x) +{ + x.parse(); + return ( classType_ == x.classType_ ); +} + +ClassValue::~ClassValue() +{ +} + + ClassValue * +ClassValue::clone() +{ + return new ClassValue( *this ); +} + + void +ClassValue::_parse() +{ + if (tqstricmp(strRep_, "PUBLIC") == 0) + classType_ = Public; + + else if (tqstricmp(strRep_, "PRIVATE") == 0) + classType_ = Private; + + else if (tqstricmp(strRep_, "CONFIDENTIAL") == 0) + classType_ = Confidential; + + else classType_ = Other; +} + + void +ClassValue::_assemble() +{ + switch (classType_) { + + case Public: + strRep_ = "PUBLIC"; + break; + + case Private: + strRep_ = "PRIVATE"; + break; + + case Confidential: + strRep_ = "CONFIDENTIAL"; + break; + + default: + break; + } +} + diff --git a/tdeabc/vcard/ContentLine.cpp b/tdeabc/vcard/ContentLine.cpp new file mode 100644 index 000000000..52bcdf4f5 --- /dev/null +++ b/tdeabc/vcard/ContentLine.cpp @@ -0,0 +1,302 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include + +using namespace VCARD; + +ContentLine::ContentLine() + : Entity(), + value_(0), + paramType_( ParamUnknown ), + valueType_( ValueUnknown ), + entityType_( EntityUnknown ) +{ +} + +ContentLine::ContentLine(const ContentLine & x) + : Entity(x), + group_ (x.group_), + name_ (x.name_), + paramList_(x.paramList_), + value_(x.value_->clone()), + paramType_( x.paramType_ ), + valueType_( x.valueType_ ), + entityType_( x.entityType_ ) +{ +} + +ContentLine::ContentLine(const TQCString & s) + : Entity(s), + value_(0), + paramType_( ParamUnknown ), + valueType_( ValueUnknown ), + entityType_( EntityUnknown ) +{ +} + + ContentLine & +ContentLine::operator = (ContentLine & x) +{ + if (*this == x) return *this; + + paramList_ = x.paramList(); + value_ = x.value_->clone(); + + Entity::operator = (x); + return *this; +} + + ContentLine & +ContentLine::operator = (const TQCString & s) +{ + Entity::operator = (s); + delete value_; + value_ = 0; + return *this; +} + + bool +ContentLine::operator == (ContentLine & x) +{ + x.parse(); + + TQPtrListIterator it(x.paramList()); + + if (!paramList_.find(it.current())) + return false; + + return true; +} + +ContentLine::~ContentLine() +{ + delete value_; + value_ = 0; +} + + void +ContentLine::_parse() +{ + vDebug("parse"); + + // Unqote newlines + strRep_ = strRep_.replace( TQRegExp( "\\\\n" ), "\n" ); + + int split = strRep_.find(':'); + + if (split == -1) { // invalid content line + vDebug("No ':'"); + return; + } + + TQCString firstPart(strRep_.left(split)); + TQCString valuePart(strRep_.mid(split + 1)); + + split = firstPart.find('.'); + + if (split != -1) { + group_ = firstPart.left(split); + firstPart = firstPart.mid(split + 1); + } + + vDebug("Group == " + group_); + vDebug("firstPart == " + firstPart); + vDebug("valuePart == " + valuePart); + + // Now we have the group, the name and param list together and the value. + + TQStrList l; + + RTokenise(firstPart, ";", l); + + if (l.count() == 0) {// invalid - no name ! + vDebug("No name for this content line !"); + return; + } + + name_ = l.at(0); + + // Now we have the name, so the rest of 'l' is the params. + // Remove the name part. + l.remove(0u); + + entityType_ = EntityNameToEntityType(name_); + paramType_ = EntityTypeToParamType(entityType_); + + unsigned int i = 0; + + // For each parameter, create a new parameter of the correct type. + + TQStrListIterator it(l); + + for (; it.current(); ++it, i++) { + + TQCString str = *it; + + split = str.find("="); + if (split < 0 ) { + vDebug("No '=' in parameter."); + continue; + } + + TQCString paraName = str.left(split); + TQCString paraValue = str.mid(split + 1); + + TQStrList paraValues; + RTokenise(paraValue, ",", paraValues); + + TQStrListIterator it2( paraValues ); + + for(; it2.current(); ++it2) { + + Param *p = new Param; + p->setName( paraName ); + p->setValue( *it2 ); + + paramList_.append(p); + } + } + + // Create a new value of the correct type. + + valueType_ = EntityTypeToValueType(entityType_); + +// kdDebug(5710) << "valueType: " << valueType_ << endl; + + switch (valueType_) { + + case ValueSound: value_ = new SoundValue; break; + case ValueAgent: value_ = new AgentValue; break; + case ValueAddress: value_ = new AdrValue; break; + case ValueTel: value_ = new TelValue; break; + case ValueTextBin: value_ = new TextBinValue; break; + case ValueOrg: value_ = new OrgValue; break; + case ValueN: value_ = new NValue; break; + case ValueUTC: value_ = new UTCValue; break; + case ValueURI: value_ = new URIValue; break; + case ValueClass: value_ = new ClassValue; break; + case ValueFloat: value_ = new FloatValue; break; + case ValueImage: value_ = new ImageValue; break; + case ValueDate: value_ = new DateValue; break; + case ValueTextList: value_ = new TextListValue; break; + case ValueGeo: value_ = new GeoValue; break; + case ValueText: + case ValueUnknown: + default: value_ = new TextValue; break; + } + + *value_ = valuePart; +} + + void +ContentLine::_assemble() +{ + vDebug("Assemble (argl) - my name is \"" + name_ + "\""); + strRep_.truncate(0); + + TQCString line; + + if (!group_.isEmpty()) + line += group_ + '.'; + + line += name_; + + vDebug("Adding parameters"); + ParamListIterator it(paramList_); + + for (; it.current(); ++it) + line += ";" + it.current()->asString(); + + vDebug("Adding value"); + if (value_ != 0) + line += ":" + value_->asString(); + else { + vDebug("No value"); + } + + // Quote newlines + line = line.replace( TQRegExp( "\n" ), "\\n" ); + + // Fold lines longer than 72 chars + const int maxLen = 72; + uint cursor = 0; + while( line.length() > ( cursor + 1 ) * maxLen ) { + strRep_ += line.mid( cursor * maxLen, maxLen ); + strRep_ += "\r\n "; + ++cursor; + } + strRep_ += line.mid( cursor * maxLen ); +} + + void +ContentLine::clear() +{ + group_.truncate(0); + name_.truncate(0); + paramList_.clear(); + delete value_; + value_ = 0; + paramType_ = ParamUnknown; + valueType_ = ValueUnknown; + entityType_ = EntityUnknown; +} diff --git a/tdeabc/vcard/DateParam.cpp b/tdeabc/vcard/DateParam.cpp new file mode 100644 index 000000000..ffaf4b3f6 --- /dev/null +++ b/tdeabc/vcard/DateParam.cpp @@ -0,0 +1,82 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +DateParam::DateParam() + : Param() +{ +} + +DateParam::DateParam(const DateParam & x) + : Param(x) +{ +} + +DateParam::DateParam(const TQCString & s) + : Param(s) +{ +} + + DateParam & +DateParam::operator = (DateParam & x) +{ + if (*this == x) return *this; + + Param::operator = (x); + return *this; +} + + DateParam & +DateParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +DateParam::operator == (DateParam & x) +{ + x.parse(); + + return false; +} + +DateParam::~DateParam() +{ +} + + void +DateParam::_parse() +{ +} + + void +DateParam::_assemble() +{ +} + diff --git a/tdeabc/vcard/DateValue.cpp b/tdeabc/vcard/DateValue.cpp new file mode 100644 index 000000000..9f578a158 --- /dev/null +++ b/tdeabc/vcard/DateValue.cpp @@ -0,0 +1,434 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +#include +#include +#include + +using namespace VCARD; + +DateValue::DateValue() + : Value() +{ + vDebug("DateValue::DateValue()"); +} + +DateValue::DateValue( + unsigned int year, + unsigned int month, + unsigned int day, + unsigned int hour, + unsigned int minute, + unsigned int second, + double secFrac, + bool zonePositive, + unsigned int zoneHour, + unsigned int zoneMinute) + : Value (), + year_ (year), + month_ (month), + day_ (day), + hour_ (hour), + minute_ (minute), + second_ (second), + zoneHour_ (zoneHour), + zoneMinute_ (zoneMinute), + secFrac_ (secFrac), + zonePositive_ (zonePositive), + hasTime_(true) +{ + parsed_ = true; + assembled_ = false; +} + +DateValue::DateValue(const TQDate & d) + : Value (), + year_ (d.year()), + month_ (d.month()), + day_ (d.day()), + hasTime_(false) +{ + parsed_ = true; + assembled_ = false; +} + +DateValue::DateValue(const TQDateTime & d) + : Value (), + year_ (d.date().year()), + month_ (d.date().month()), + day_ (d.date().day()), + hour_ (d.time().hour()), + minute_ (d.time().minute()), + second_ (d.time().second()), + hasTime_(true) +{ + parsed_ = true; + assembled_ = false; +} + +DateValue::DateValue(const DateValue & x) + : Value(x) +{ + year_ = x.year_; + month_ = x.month_; + day_ = x.day_; + hour_ = x.hour_; + minute_ = x.minute_; + second_ = x.second_; + zoneHour_ = x.zoneHour_; + zoneMinute_ = x.zoneMinute_; + secFrac_ = x.secFrac_; + hasTime_ = x.hasTime_; +} + +DateValue::DateValue(const TQCString & s) + : Value(s) +{ +} + + DateValue & +DateValue::operator = (DateValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + DateValue & +DateValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +DateValue::operator == (DateValue & x) +{ + x.parse(); + return false; +} + +DateValue::~DateValue() +{ +} + + DateValue * +DateValue::clone() +{ + return new DateValue( *this ); +} + + void +DateValue::_parse() +{ + vDebug("DateValue::_parse()"); + + // date = date-full-year ["-"] date-month ["-"] date-mday + // time = time-hour [":"] time-minute [":"] time-second [":"] + // [time-secfrac] [time-zone] + + int timeSep = strRep_.find('T'); + + TQCString dateStr; + TQCString timeStr; + + if (timeSep == -1) { + + dateStr = strRep_; + vDebug("Has date string \"" + dateStr + "\""); + + } else { + + dateStr = strRep_.left(timeSep); + vDebug("Has date string \"" + dateStr + "\""); + + timeStr = strRep_.mid(timeSep + 1); + vDebug("Has time string \"" + timeStr + "\""); + } + + /////////////////////////////////////////////////////////////// DATE + + dateStr.replace(TQRegExp("-"), ""); + + kdDebug(5710) << "dateStr: " << dateStr << endl; + + year_ = dateStr.left(4).toInt(); + month_ = dateStr.mid(4, 2).toInt(); + day_ = dateStr.right(2).toInt(); + + if (timeSep == -1) { + hasTime_ = false; + return; // No time, done. + } + else + hasTime_ = true; + + /////////////////////////////////////////////////////////////// TIME + + /////////////////////////////////////////////////////////////// ZONE + + int zoneSep = timeStr.find('Z'); + + if (zoneSep != -1 && timeStr.length() - zoneSep > 3) { + + TQCString zoneStr(timeStr.mid(zoneSep + 1)); + vDebug("zoneStr == " + zoneStr); + + zonePositive_ = (zoneStr[0] == '+'); + zoneHour_ = zoneStr.mid(1, 2).toInt(); + zoneMinute_ = zoneStr.right(2).toInt(); + + timeStr.remove(zoneSep, timeStr.length() - zoneSep); + } + + //////////////////////////////////////////////////// SECOND FRACTION + + int secFracSep = timeStr.findRev(','); + + if (secFracSep != -1 && zoneSep != -1) { // zoneSep checked to avoid errors. + TQCString quirkafleeg = "0." + timeStr.mid(secFracSep + 1, zoneSep); + secFrac_ = quirkafleeg.toDouble(); + } + + /////////////////////////////////////////////////////////////// HMS + + timeStr.replace(TQRegExp(":"), ""); + + hour_ = timeStr.left(2).toInt(); + minute_ = timeStr.mid(2, 2).toInt(); + second_ = timeStr.mid(4, 2).toInt(); +} + + void +DateValue::_assemble() +{ + vDebug("DateValue::_assemble"); + + TQCString year; + TQCString month; + TQCString day; + + year.setNum( year_ ); + month.setNum( month_ ); + day.setNum( day_ ); + + if ( month.length() < 2 ) month.prepend( "0" ); + if ( day.length() < 2 ) day.prepend( "0" ); + + strRep_ = year + '-' + month + '-' + day; + + if ( hasTime_ ) { + TQCString hour; + TQCString minute; + TQCString second; + + hour.setNum( hour_ ); + minute.setNum( minute_ ); + second.setNum( second_ ); + + if ( hour.length() < 2 ) hour.prepend( "0" ); + if ( minute.length() < 2 ) minute.prepend( "0" ); + if ( second.length() < 2 ) second.prepend( "0" ); + + strRep_ += 'T' + hour + ':' + minute + ':' + second + 'Z'; + } +} + + unsigned int +DateValue::year() +{ + parse(); + return year_; +} + + unsigned int +DateValue::month() +{ + parse(); + return month_; +} + + unsigned int +DateValue::day() +{ + parse(); + return day_; +} + unsigned int +DateValue::hour() +{ + parse(); + return hour_; +} + + unsigned int +DateValue::minute() +{ + parse(); + return minute_; +} + + unsigned int +DateValue::second() +{ + parse(); + return second_; +} + + double +DateValue::secondFraction() +{ + parse(); + return secFrac_; +} + + bool +DateValue::zonePositive() +{ + parse(); + return zonePositive_; +} + + unsigned int +DateValue::zoneHour() +{ + parse(); + return zoneHour_; +} + + unsigned int +DateValue::zoneMinute() +{ + parse(); + return zoneMinute_; +} + + void +DateValue::setYear(unsigned int i) +{ + year_ = i; + assembled_ = false; +} + + void +DateValue::setMonth(unsigned int i) +{ + month_ = i; + assembled_ = false; +} + + void +DateValue::setDay(unsigned int i) +{ + day_ = i; + assembled_ = false; +} + + void +DateValue::setHour(unsigned int i) +{ + hour_ = i; + assembled_ = false; +} + + void +DateValue::setMinute(unsigned int i) +{ + minute_ = i; + assembled_ = false; +} + + void +DateValue::setSecond(unsigned int i) +{ + second_ = i; + assembled_ = false; +} + + void +DateValue::setSecondFraction(double d) +{ + secFrac_ = d; + assembled_ = false; +} + + void +DateValue::setZonePositive(bool b) +{ + zonePositive_ = b; + assembled_ = false; +} + + void +DateValue::setZoneHour(unsigned int i) +{ + zoneHour_ = i; + assembled_ = false; +} + + void +DateValue::setZoneMinute(unsigned int i) +{ + zoneMinute_ = i; + assembled_ = false; +} + + TQDate +DateValue::qdate() +{ + parse(); + TQDate d(year_, month_, day_); + return d; +} + + TQTime +DateValue::qtime() +{ + parse(); + TQTime t(hour_, minute_, second_); +// t.setMs(1 / secFrac_); + return t; +} + + TQDateTime +DateValue::qdt() +{ + parse(); + TQDateTime dt; + dt.setDate(qdate()); + dt.setTime(qtime()); + return dt; +} + + bool +DateValue::hasTime() +{ + parse(); + return hasTime_; +} + diff --git a/tdeabc/vcard/EmailParam.cpp b/tdeabc/vcard/EmailParam.cpp new file mode 100644 index 000000000..7daf19ccc --- /dev/null +++ b/tdeabc/vcard/EmailParam.cpp @@ -0,0 +1,116 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include +#include + +using namespace VCARD; + +EmailParam::EmailParam() + : Param() +{ + vDebug("ctor"); +} + +EmailParam::EmailParam(const EmailParam & x) + : Param(x), + emailType_ (x.emailType_), + pref_ (x.pref_) +{ +} + +EmailParam::EmailParam(const TQCString & s) + : Param(s) +{ +} + + EmailParam & +EmailParam::operator = (EmailParam & x) +{ + if (*this == x) return *this; + + emailType_ = x.emailType(); + pref_ = x.pref_; + + Param::operator = (x); + return *this; +} + + EmailParam & +EmailParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +EmailParam::operator == (EmailParam & x) +{ + parse(); + + if (pref_) + return (x.pref_ && x.emailType() == emailType_); + + return !x.pref(); +} + +EmailParam::~EmailParam() +{ +} + + void +EmailParam::_parse() +{ +#if 0 + Param::parseToList(); + + SubParamListIterator it(subParamList_); + + pref_ = true; + emailType_ = ""; + + for (; it.current(); ++it) { + + if (tqstricmp(it.current()->name(), "TYPE") == 0) { + emailType_ = it.current()->value(); + continue; + } + + if (tqstricmp(it.current()->name(), "PREF") == 0) { + pref_ = true; + } + } +#endif +} + + void +EmailParam::_assemble() +{ + strRep_ = "TYPE="; + strRep_ += emailType_; + + if (pref_) + strRep_ += ",PREF"; +} + diff --git a/tdeabc/vcard/Entity.cpp b/tdeabc/vcard/Entity.cpp new file mode 100644 index 000000000..5eaf6a1d0 --- /dev/null +++ b/tdeabc/vcard/Entity.cpp @@ -0,0 +1,134 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +using namespace VCARD; + +Entity::Entity() + : parsed_ (false), + assembled_ (true) +{ + // empty +} + +Entity::Entity(const Entity & e) + : strRep_ (e.strRep_), + parsed_ (e.parsed_), + assembled_ (e.assembled_) +{ + // empty +} + +Entity::Entity(const TQCString & s) + : strRep_ (s), + parsed_ (false), + assembled_ (true) +{ + // empty +} + + Entity & +Entity::operator = (const Entity & e) +{ + if (this == &e) return *this; + + strRep_ = e.strRep_; + parsed_ = e.parsed_; + assembled_ = e.assembled_; + + return *this; +} + + Entity & +Entity::operator = (const TQCString & s) +{ + strRep_ = s; + parsed_ = false; + assembled_ = true; + + return *this; +} + + bool +Entity::operator == (Entity & e) +{ + return asString() == e.asString(); +} + + bool +Entity::operator != (Entity & e) +{ + return !(*this == e); +} + + bool +Entity::operator == (const TQCString & s) +{ + return asString() == s; +} + + bool +Entity::operator != (const TQCString & s) +{ + return !(*this == s); +} + +Entity::~Entity() +{ + // empty +} + + TQCString +Entity::asString() +{ +// vDebug("Entity::asString()"); + assemble(); + + return strRep_; +} + + void +Entity::parse() +{ +// vDebug( "Entity::parse()" ); + + if (!parsed_) _parse(); + + parsed_ = true; + assembled_ = false; +} + + void +Entity::assemble() +{ +// vDebug( "Entity::assemble()" ); + + if (assembled_) return; + + parse(); + _assemble(); + + assembled_ = true; +} + diff --git a/tdeabc/vcard/Enum.cpp b/tdeabc/vcard/Enum.cpp new file mode 100644 index 000000000..bcb48f98a --- /dev/null +++ b/tdeabc/vcard/Enum.cpp @@ -0,0 +1,490 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include + +#include + +using namespace VCARD; + +// There are 31 possible types, not including extensions. +// URI is a custom field designed to store the upstream URI for each contact +// in order to handle certain limited CardDAV systems such as Zimbra + const TQCString +VCARD::paramNames [] = +{ + "NAME", + "PROFILE", + "SOURCE", + "FN", + "N", + "NICKNAME", + "PHOTO", + "BDAY", + "ADR", + "LABEL", + "TEL", + "EMAIL", + "MAILER", + "TZ", + "GEO", + "TITLE", + "ROLE", + "LOGO", + "AGENT", + "ORG", + "CATEGORIES", + "NOTE", + "PRODID", + "REV", + "SORT-STRING", + "SOUND", + "UID", + "URL", + "VERSION", + "CLASS", + "KEY", + "URI" +}; + + const ParamType +VCARD::paramTypesTable[] = { + ParamNone, // NAME + ParamNone, // PROFILE + ParamSource, // SOURCE + ParamText, // FN + ParamText, // N + ParamText, // NICKNAME + ParamImage, // PHOTO (inline/refer) + ParamDate, // BDAY ("VALUE = "date-time/date) + ParamAddrText, // ADR (adr-param/text-param) + ParamAddrText, // LABEL (adr-param/text-param) + ParamTel, // TEL + ParamEmail, // EMAIL + ParamText, // MAILER + ParamNone, // TZ + ParamNone, // GEO + ParamText, // TITLE + ParamText, // ROLE + ParamImage, // LOGO + ParamAgent, // AGENT + ParamText, // ORG + ParamText, // CATEGORIES + ParamText, // NOTE + ParamNone, // PRODID + ParamDate, // REV + ParamText, // SORT-STRING + ParamSound, // SOUND + ParamNone, // UID + ParamNone, // URL + ParamNone, // VERSION + ParamNone, // CLASS + ParamTextBin, // KEY + ParamTextNS, // X + ParamNone // URI +}; + + ParamType +VCARD::EntityTypeToParamType(EntityType e) +{ + ParamType t(ParamUnknown); + + switch (e) { + + //---------------------------------------------------------------// + case EntityAgent: t = ParamAgent; break; + //---------------------------------------------------------------// + case EntitySound: t = ParamSound; break; + //---------------------------------------------------------------// + case EntitySource: t = ParamSource; break; + //---------------------------------------------------------------// + case EntityTelephone: t = ParamTel; break; + //---------------------------------------------------------------// + case EntityEmail: t = ParamEmail; break; + //---------------------------------------------------------------// + case EntityKey: t = ParamTextBin; break; + //---------------------------------------------------------------// + case EntityExtension: t = ParamTextNS; break; + //---------------------------------------------------------------// + case EntityAddress: + case EntityLabel: t = ParamAddrText; break; + //---------------------------------------------------------------// + case EntityBirthday: + case EntityRevision: t = ParamDate; break; + //---------------------------------------------------------------// + case EntityPhoto: + case EntityLogo: t = ParamImage; break; + //---------------------------------------------------------------// + case EntityOrganisation: + case EntityTitle: + case EntityRole: + case EntityFullName: + case EntityMailer: + case EntityN: + case EntitySortString: + case EntityNickname: + case EntityCategories: + case EntityNote: t = ParamText; break; + //---------------------------------------------------------------// + case EntityProductID: + case EntityTimeZone: + case EntityUID: + case EntityURL: + case EntityClass: + case EntityGeo: + case EntityName: + case EntityVersion: + case EntityProfile: + case EntityURI: + default: t = ParamNone; break; + //---------------------------------------------------------------// + + } + + return t; +} + + ValueType +VCARD::EntityTypeToValueType(EntityType e) +{ + ValueType t(ValueUnknown); + + switch (e) { + + //---------------------------------------------------------------// + case EntitySound: t = ValueSound; break; + //---------------------------------------------------------------// + case EntityAgent: t = ValueAgent; break; + //---------------------------------------------------------------// + case EntityAddress: t = ValueAddress; break; + //---------------------------------------------------------------// + case EntityTelephone: t = ValueTel; break; + //---------------------------------------------------------------// + case EntityKey: t = ValueTextBin; break; + //---------------------------------------------------------------// + case EntityOrganisation: t = ValueOrg; break; + //---------------------------------------------------------------// + case EntityN: t = ValueN; break; + //---------------------------------------------------------------// + case EntityTimeZone: t = ValueUTC; break; + //---------------------------------------------------------------// + case EntityClass: t = ValueClass; break; + //---------------------------------------------------------------// + case EntityGeo: t = ValueGeo; break; + //---------------------------------------------------------------// + case EntitySource: + case EntityURL: t = ValueURI; break; + //---------------------------------------------------------------// + case EntityPhoto: + case EntityLogo: t = ValueImage; break; + //---------------------------------------------------------------// + case EntityBirthday: + case EntityRevision: t = ValueDate; break; + //---------------------------------------------------------------// + case EntityCategories: + case EntityNickname: t = ValueTextList; break; + //---------------------------------------------------------------// + case EntityLabel: + case EntityExtension: + case EntityEmail: + case EntityTitle: + case EntityRole: + case EntityFullName: + case EntityMailer: + case EntityProductID: + case EntityName: + case EntitySortString: + case EntityVersion: + case EntityProfile: + case EntityUID: + case EntityNote: + case EntityURI: + default: t = ValueText; break; + //---------------------------------------------------------------// + + } + + return t; +} + + TQCString +VCARD::EntityTypeToParamName(EntityType e) +{ + if ( e > EntityUnknown ) e = EntityUnknown; + return paramNames[ int( e ) ]; +} + + EntityType +VCARD::EntityNameToEntityType(const TQCString & s) +{ + if (s.isEmpty()) return EntityUnknown; + + EntityType t(EntityUnknown); + + switch (s[0]) { + + case 'A': + if (s == "ADR") + t = EntityAddress; + else if (s == "AGENT") + t = EntityAgent; + break; + + case 'B': + if (s == "BDAY") + t = EntityBirthday; + break; + + case 'C': + if (s == "CATEGORIES") + t = EntityCategories; + else if (s == "CLASS") + t = EntityClass; + break; + + case 'E': + if (s == "EMAIL") + t = EntityEmail; + break; + + case 'F': + if (s == "FN") + t = EntityFullName; + break; + + case 'G': + if (s == "GEO") + t = EntityGeo; + break; + + case 'K': + if (s == "KEY") + t = EntityKey; + break; + + case 'L': + if (s == "LABEL") + t = EntityLabel; + else if (s == "LOGO") + t = EntityLogo; + break; + + case 'M': + if (s == "MAILER") + t = EntityMailer; + break; + + case 'N': + if (s == "N") + t = EntityN; + else if (s == "NAME") + t = EntityName; + else if (s == "NICKNAME") + t = EntityNickname; + else if (s == "NOTE") + t = EntityNote; + break; + + case 'O': + if (s == "ORG") + t = EntityOrganisation; + break; + + case 'P': + if (s == "PHOTO") + t = EntityPhoto; + else if (s == "PRODID") + t = EntityProductID; + else if (s == "PROFILE") + t = EntityProfile; + break; + + case 'R': + if (s == "REV") + t = EntityRevision; + else if (s == "ROLE") + t = EntityRole; + break; + + case 'S': + if (s == "SORT-STRING") + t = EntitySortString; + else if (s == "SOUND") + t = EntitySound; + else if (s == "SOURCE") + t = EntitySource; + break; + + case 'T': + if (s == "TEL") + t = EntityTelephone; + else if (s == "TITLE") + t = EntityTitle; + else if (s == "TZ") + t = EntityTimeZone; + break; + + case 'U': + if (s == "UID") + t = EntityUID; + else if (s == "URL") + t = EntityURL; + else if (s == "URI") + t = EntityURI; + case 'V': + if (s == "VERSION") + t = EntityVersion; + break; + + case 'X': + if (s.left(2) == "X-") + t = EntityExtension; + break; + + default: + + t = EntityUnknown; + } + + return t; +} + +// The copyright notice below refers to the base64 codec functions used below, +// which are modified from the original sources. + +/* + * Original version Copyright 1988 by The Leland Stanford Junior University + * Copyright 1998 by the University of Washington + * + * Permission to use, copy, modify, and distribute this software and its + * documentation for any purpose and without fee is hereby granted, provided + * that the above copyright notices appear in all copies and that both the + * above copyright notices and this permission notice appear in supporting + * documentation, and that the name of the University of Washington or The + * Leland Stanford Junior University not be used in advertising or publicity + * pertaining to distribution of the software without specific, written prior + * permission. This software is made available "as is", and + * THE UNIVERSITY OF WASHINGTON AND THE LELAND STANFORD JUNIOR UNIVERSITY + * DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, WITH REGARD TO THIS SOFTWARE, + * INCLUDING WITHOUT LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS FOR A PARTICULAR PURPOSE, AND IN NO EVENT SHALL THE UNIVERSITY OF + * WASHINGTON OR THE LELAND STANFORD JUNIOR UNIVERSITY BE LIABLE FOR ANY + * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER + * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF + * CONTRACT, TORT (INCLUDING NEGLIGENCE) OR STRICT LIABILITY, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +static char B64[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; + +// the mime base64 disctionary used for decoding +static signed char b64dec[] = { + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 0 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 10 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 20 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 30 + -1, -1, -1,-19, -1, -1, -1,-16, -4, -4, // 40 -19 == '+' -16 == '/' + -4, -4, -4, -4, -4, -4, -4, -4, -1, -1, // 50 -4 == '0' + -1, 0, -1, -1, -1, 65, 65, 65, 65, 65, // 60 0 == '=' 65 == 'A' + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, // 70 + 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, // 80 + 65, -1, -1, -1, -1, -1, -1, 71, 71, 71, // 90 71 == 'a' + 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, // 100 + 71, 71, 71, 71, 71, 71, 71, 71, 71, 71, // 110 + 71, 71, 71, -1, -1, -1, -1, -1, -1, -1, // 120 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 130 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 140 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 150 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 160 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 170 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 180 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 190 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 200 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 210 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 220 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 230 + -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, // 240 + -1, -1, -1, -1, -1, -1, -1 // 250 +}; + + char * +VCARD::decodeBase64(const char * s, unsigned long srcl, unsigned long & len) +{ + register unsigned char c; + register unsigned long e(0); + len = 0; + unsigned const char * src = (unsigned const char *)s; + char * ret = new char[srcl + (srcl / 4 + 1)]; + register char *d = ret; + while (srcl--) { // Critical loop + c = *src++; + int dec = b64dec[c]; + if (dec == -1) continue; + if (c == '=') { + switch (e++) { + case 3: e = 0; break; + case 2: if (*src == '=') break; + default: delete [] ret; ret = 0; return 0; break; + } + continue; + } + c -= dec; + if (e == 0) { *d = c << 2; ++e; continue; } + switch (e) { + case 1: *d |= c >> 4; *++d = c << 4; break; + case 2: *d |= c >> 2; *++d = c << 6; break; + case 3: *d++ |= c; e = 0; continue; break; + } + ++e; + } + len = d - (char *)ret; + return ret; +} + + + char * +VCARD::encodeBase64(const char * src, unsigned long srcl, unsigned long & destl) +{ + register const unsigned char *s = (unsigned char *)src; + register unsigned long i = ((srcl + 2) / 3) * 4; + destl = i += 2 * ((i / 60) + 1); + i = 0; + char * ret = new char[destl]; + register unsigned char *d((unsigned char *)ret); + while (srcl != 0) { // Critical loop + *d++ = B64[s[0] >> 2]; + *d++ = B64[((s[0] << 4) + (--srcl == 0 ? 0 : s[1] >> 4)) & 0x3f]; + *d++ = srcl == 0 ? '=' : + B64[((s[1] << 2) + (--srcl == 0 ? 0 : s[2] >> 6)) & 0x3f]; + *d++ = srcl == 0 ? '=' : B64[s[2] & 0x3f]; + if (srcl != 0) srcl--; + if (++i == 15) { i = 0; *d++ = '\r'; *d++ = '\n'; } + s += 3; + } + *d = '\r'; *++d = '\n'; *++d = '\0'; + return ret; +} + diff --git a/tdeabc/vcard/FloatValue.cpp b/tdeabc/vcard/FloatValue.cpp new file mode 100644 index 000000000..ac1f2c6b5 --- /dev/null +++ b/tdeabc/vcard/FloatValue.cpp @@ -0,0 +1,120 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +FloatValue::FloatValue() + : Value() +{ +} + +FloatValue::FloatValue(float f) + : Value (), + value_ (f) +{ + parsed_ = true; +} + +FloatValue::FloatValue(const FloatValue & x) + : Value(x) +{ + value_ = x.value_; +} + +FloatValue::FloatValue(const TQCString & s) + : Value(s) +{ +} + + FloatValue & +FloatValue::operator = (FloatValue & x) +{ + if (*this == x) return *this; + + x.parse(); + value_ = x.value_; + + Value::operator = (x); + return *this; +} + + FloatValue & +FloatValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +FloatValue::operator == (FloatValue & x) +{ + x.parse(); + return (value_ == x.value_); +} + +FloatValue::~FloatValue() +{ +} + + void +FloatValue::_parse() +{ + bool negative(false); + + if (strRep_[0] == '-' || strRep_[1] == '+') { + + if (strRep_[0] == '-') + negative = true; + + strRep_.remove(0, 1); + } + + value_ = strRep_.toFloat(); + if (negative) + value_ = -value_; +} + + void +FloatValue::_assemble() +{ + strRep_ = TQCString().setNum(value_); +} + + float +FloatValue::value() +{ + parse(); + return value_; +} + + void +FloatValue::setValue(float f) +{ + parsed_ = true; + value_ = f; +} + diff --git a/tdeabc/vcard/GeoValue.cpp b/tdeabc/vcard/GeoValue.cpp new file mode 100644 index 000000000..2bac28c1e --- /dev/null +++ b/tdeabc/vcard/GeoValue.cpp @@ -0,0 +1,100 @@ +/* + This file is part of libvcard. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include + +#include + +using namespace VCARD; + +GeoValue::GeoValue() + : Value() +{ +} + +GeoValue::GeoValue(const GeoValue & x) + : Value(x), latitude_(x.latitude_), longitude_(x.longitude_) +{ +} + +GeoValue::GeoValue(const TQCString & s) + : Value(s) +{ +} + + GeoValue & +GeoValue::operator = (GeoValue & x) +{ + if (*this == x) return *this; + + latitude_ = x.latitude_; + longitude_ = x.longitude_; + + Value::operator = (x); + return *this; +} + + GeoValue & +GeoValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +GeoValue::operator == (GeoValue & x) +{ + x.parse(); + + if ( latitude_ != x.latitude_ ) return false; + if ( longitude_ != x.longitude_ ) return false; + + return true; +} + +GeoValue::~GeoValue() +{ +} + + GeoValue * +GeoValue::clone() +{ + return new GeoValue( *this ); +} + + void +GeoValue::_parse() +{ + int semiColon = strRep_.find( ";" ); + + if ( semiColon == -1 ) // invalid + return; + + latitude_ = strRep_.left( semiColon ).toFloat(); + longitude_ = strRep_.mid( semiColon + 1, strRep_.length() - semiColon ).toFloat(); +} + + void +GeoValue::_assemble() +{ + strRep_.sprintf( "%.6f;%.6f", latitude_, longitude_ ); +} diff --git a/tdeabc/vcard/ImageParam.cpp b/tdeabc/vcard/ImageParam.cpp new file mode 100644 index 000000000..69611eeab --- /dev/null +++ b/tdeabc/vcard/ImageParam.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +ImageParam::ImageParam() + : Param() +{ +} + +ImageParam::ImageParam(const ImageParam & x) + : Param(x) +{ +} + +ImageParam::ImageParam(const TQCString & s) + : Param(s) +{ +} + + ImageParam & +ImageParam::operator = (ImageParam & x) +{ + if (*this == x) return *this; + + Param::operator = (x); + return *this; +} + + ImageParam & +ImageParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +ImageParam::operator == (ImageParam & x) +{ + x.parse(); + return false; +} + +ImageParam::~ImageParam() +{ +} + + void +ImageParam::_parse() +{ +} + + void +ImageParam::_assemble() +{ +} + diff --git a/tdeabc/vcard/ImageValue.cpp b/tdeabc/vcard/ImageValue.cpp new file mode 100644 index 000000000..5d8d29bb7 --- /dev/null +++ b/tdeabc/vcard/ImageValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +ImageValue::ImageValue() + : Value() +{ +} + +ImageValue::ImageValue(const ImageValue & x) + : Value(x) +{ +} + +ImageValue::ImageValue(const TQCString & s) + : Value(s) +{ +} + + ImageValue & +ImageValue::operator = (ImageValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + ImageValue & +ImageValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +ImageValue::operator == (ImageValue & x) +{ + x.parse(); + return false; +} + +ImageValue::~ImageValue() +{ +} + + void +ImageValue::_parse() +{ +} + + void +ImageValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/ImgValue.cpp b/tdeabc/vcard/ImgValue.cpp new file mode 100644 index 000000000..42889acd8 --- /dev/null +++ b/tdeabc/vcard/ImgValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +ImgValue::ImgValue() + : Value() +{ +} + +ImgValue::ImgValue(const ImgValue & x) + : Value(x) +{ +} + +ImgValue::ImgValue(const TQCString & s) + : Value(s) +{ +} + + ImgValue & +ImgValue::operator = (ImgValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + ImgValue & +ImgValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +ImgValue::operator == (ImgValue & x) +{ + x.parse(); + return false; +} + +ImgValue::~ImgValue() +{ +} + + void +ImgValue::_parse() +{ +} + + void +ImgValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/LangValue.cpp b/tdeabc/vcard/LangValue.cpp new file mode 100644 index 000000000..f7e5a759e --- /dev/null +++ b/tdeabc/vcard/LangValue.cpp @@ -0,0 +1,127 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +#include + +using namespace VCARD; + +LangValue::LangValue() + : Value() +{ +} + +LangValue::LangValue(const LangValue & x) + : Value(x) +{ +} + +LangValue::LangValue(const TQCString & s) + : Value(s) +{ +} + + LangValue & +LangValue::operator = (LangValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + LangValue & +LangValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +LangValue::operator == (LangValue & x) +{ + x.parse(); + return false; +} + +LangValue::~LangValue() +{ +} + + void +LangValue::_parse() +{ + TQStrList l; + RTokenise(strRep_, "-", l); + + if (l.count() == 0) return; + + primary_ = l.at(0); + + l.remove(0u); + + subtags_ = l; +} + + void +LangValue::_assemble() +{ + strRep_ = primary_; + + TQStrListIterator it(subtags_); + + for (; it.current(); ++it) + strRep_ += TQCString('-') + it.current(); +} + + TQCString +LangValue::primary() +{ + parse(); + return primary_; +} + + TQStrList +LangValue::subtags() +{ + parse(); + return subtags_; +} + + void +LangValue::setPrimary(const TQCString & s) +{ + parse(); + primary_ = s; +} + + void +LangValue::setSubTags(const TQStrList & l) +{ + parse(); + subtags_ = l; +} + diff --git a/tdeabc/vcard/Makefile.am b/tdeabc/vcard/Makefile.am new file mode 100644 index 000000000..e8a33c3a9 --- /dev/null +++ b/tdeabc/vcard/Makefile.am @@ -0,0 +1,21 @@ +INCLUDES = \ + -I$(srcdir)/include \ + -I$(srcdir)/include/generated \ + $(all_includes) + +### KDE 4.0: either make noinst or rename to something like libkvcard +lib_LTLIBRARIES = libvcard.la + +libvcard_la_SOURCES = vCard-all.cpp +libvcard_la_LDFLAGS = $(all_libraries) +libvcard_la_LIBADD = $(LIB_TDECORE) $(LIB_QT) + +check_PROGRAMS = testwrite testread + +testwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testwrite_LDADD = libvcard.la +testwrite_SOURCES = testwrite.cpp + +testread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testread_LDADD = libvcard.la +testread_SOURCES = testread.cpp diff --git a/tdeabc/vcard/NValue.cpp b/tdeabc/vcard/NValue.cpp new file mode 100644 index 000000000..e63268134 --- /dev/null +++ b/tdeabc/vcard/NValue.cpp @@ -0,0 +1,128 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include +#include +#include +#include + +using namespace VCARD; + +NValue::NValue() + : Value() +{ + vDebug("ctor"); +} + +NValue::NValue(const NValue & x) + : Value(x), + family_ (x.family_), + given_ (x.given_), + middle_ (x.middle_), + prefix_ (x.prefix_), + suffix_ (x.suffix_) +{ +} + +NValue::NValue(const TQCString & s) + : Value(s) +{ + vDebug("ctor"); +} + + NValue & +NValue::operator = (NValue & x) +{ + if (*this == x) return *this; + + family_ = x.family_; + given_ = x.given_; + middle_ = x.middle_; + prefix_ = x.prefix_; + suffix_ = x.suffix_; + + Value::operator = (x); + return *this; +} + + NValue & +NValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +NValue::operator == (NValue & x) +{ + x.parse(); + + return ( + family_ == x.family_ && + given_ == x.given_ && + middle_ == x.middle_ && + prefix_ == x.prefix_ && + suffix_ == x.suffix_); +} + +NValue::~NValue() +{ +} + + NValue * +NValue::clone() +{ + return new NValue( *this ); +} + + void +NValue::_parse() +{ + TQStrList l; + RTokenise(strRep_, ";", l); + + for (unsigned int i = 0; i < l.count(); i++) { + + switch (i) { + case 0: family_ = l.at(0); break; + case 1: given_ = l.at(1); break; + case 2: middle_ = l.at(2); break; + case 3: prefix_ = l.at(3); break; + case 4: suffix_ = l.at(4); break; + default: break; + } + } +} + + void +NValue::_assemble() +{ + strRep_ = family_; + strRep_ += ";" + given_; + strRep_ += ";" + middle_; + strRep_ += ";" + prefix_; + strRep_ += ";" + suffix_; +} + diff --git a/tdeabc/vcard/OrgValue.cpp b/tdeabc/vcard/OrgValue.cpp new file mode 100644 index 000000000..94ca18243 --- /dev/null +++ b/tdeabc/vcard/OrgValue.cpp @@ -0,0 +1,107 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +#include + +using namespace VCARD; + +OrgValue::OrgValue() + : Value() +{ +} + +OrgValue::OrgValue(const OrgValue & x) + : Value(x) +{ +} + +OrgValue::OrgValue(const TQCString & s) + : Value(s) +{ +} + + OrgValue & +OrgValue::operator = (OrgValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + OrgValue & +OrgValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +OrgValue::operator == (OrgValue & x) +{ + x.parse(); + return false; +} + +OrgValue::~OrgValue() +{ +} + + void +OrgValue::_parse() +{ + RTokenise(strRep_, ";", valueList_); +} + + void +OrgValue::_assemble() +{ + bool first(true); + + TQStrListIterator it(valueList_); + + for (; it.current(); ++it) { + if (!first) strRep_ += ';'; + strRep_ += it.current(); + first = false; + } +} + + unsigned int +OrgValue::numValues() +{ + parse(); + return valueList_.count(); +} + + TQCString +OrgValue::value(unsigned int i) +{ + parse(); + return valueList_.at(i); +} + diff --git a/tdeabc/vcard/Param.cpp b/tdeabc/vcard/Param.cpp new file mode 100644 index 000000000..8c5ad9e2c --- /dev/null +++ b/tdeabc/vcard/Param.cpp @@ -0,0 +1,129 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +#include + +using namespace VCARD; + +Param::Param() + : Entity(), + name_(""), + value_("") +{ +} + +Param::Param(const Param & x) + : Entity(x), + name_(x.name_), + value_(x.value_) +{ +} + +Param::Param(const TQCString & s) + : Entity(s), + name_(""), + value_("") +{ +} + + Param & +Param::operator = (Param & x) +{ + if (*this == x) return *this; + + Entity::operator = (x); + name_ = x.name_; + value_ = x.value_; + + return *this; +} + + Param & +Param::operator = (const TQCString & s) +{ + Entity::operator = (s); + return *this; +} + + bool +Param::operator == (Param & x) +{ + x.parse(); + return false; +} + +Param::~Param() +{ +} + + void +Param::_parse() +{ +} + + void +Param::_assemble() +{ + strRep_ = name_ + "=" + value_; +} + +Param::Param(const TQCString &name, const TQCString &value) + : Entity(), + name_(name), + value_(value) +{ + parsed_ = true; + assembled_ = false; +} + + void +Param::setName(const TQCString & name) +{ + name_ = name; + + assembled_ = false; +} + + void +Param::setValue(const TQCString & value) +{ + value_ = value; + + assembled_ = false; +} + + TQCString +Param::name() +{ + return name_; +} + + TQCString +Param::value() +{ + return value_; +} diff --git a/tdeabc/vcard/PhoneNumberValue.cpp b/tdeabc/vcard/PhoneNumberValue.cpp new file mode 100644 index 000000000..02a1266fe --- /dev/null +++ b/tdeabc/vcard/PhoneNumberValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +PhoneNumberValue::PhoneNumberValue() + : Value() +{ +} + +PhoneNumberValue::PhoneNumberValue(const PhoneNumberValue & x) + : Value(x) +{ +} + +PhoneNumberValue::PhoneNumberValue(const TQCString & s) + : Value(s) +{ +} + + PhoneNumberValue & +PhoneNumberValue::operator = (PhoneNumberValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + PhoneNumberValue & +PhoneNumberValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +PhoneNumberValue::operator == (PhoneNumberValue & x) +{ + x.parse(); + return false; +} + +PhoneNumberValue::~PhoneNumberValue() +{ +} + + void +PhoneNumberValue::_parse() +{ +} + + void +PhoneNumberValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/README b/tdeabc/vcard/README new file mode 100644 index 000000000..18a9daf4a --- /dev/null +++ b/tdeabc/vcard/README @@ -0,0 +1,15 @@ +libvcard (C) 1999 Rik Hemsley +Written for the KDE project. + +This software is licensed under the MIT license. + +A vCard 3.0 parser based on the same principles that librmm (from Empath) uses. + +It's small and very fast due to parsing and assembly of object being lazy. + +There is a base64 codec declared in Enum.h + +Feedback welcome. + +Rik + diff --git a/tdeabc/vcard/RToken.cpp b/tdeabc/vcard/RToken.cpp new file mode 100644 index 000000000..582a9e1c7 --- /dev/null +++ b/tdeabc/vcard/RToken.cpp @@ -0,0 +1,88 @@ +/* + + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include +#include +#include + +namespace VCARD +{ + + TQ_UINT32 +RTokenise(const char * str, const char * delim, TQStrList & l) +{ + // FIXME no stderr ! + l.clear(); + + if (!delim || !str || strlen(delim) == 0 || strlen(str) == 0) return 0; + + char * len = (char *)(str + strlen(str)); // End of string. + + register char * rstart = new char[strlen(str) + 1]; + register char * r = rstart; + + + register const char * i = str; // Cursor. + + while (i <= len) { + + if (*i == '\\') { // Escaped chars go straight through. + *r++ = *i++; + if (i <= len) + *r++ = *i++; + continue; + } + + if (strchr(delim, *i) != 0) { + // We hit a delimiter. If we have some text, make a new token. + // This has the effect that multiple delimiters are collapsed. + // cs: We mustn't collapse multiple delimiters, otherwise we + // lose empty fields. + *r = '\0'; +// if (r != rstart) { + l.append(rstart); +// } + r = rstart; + ++i; + continue; + } + + *r++ = *i++; + } + + // Catch last token +// if (r != rstart) { + *r = '\0'; + l.append(rstart); +// } + + r = 0; + + delete [] rstart; + + return l.count(); +} + +} diff --git a/tdeabc/vcard/SoundValue.cpp b/tdeabc/vcard/SoundValue.cpp new file mode 100644 index 000000000..5be75d358 --- /dev/null +++ b/tdeabc/vcard/SoundValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +SoundValue::SoundValue() + : Value() +{ +} + +SoundValue::SoundValue(const SoundValue & x) + : Value(x) +{ +} + +SoundValue::SoundValue(const TQCString & s) + : Value(s) +{ +} + + SoundValue & +SoundValue::operator = (SoundValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + SoundValue & +SoundValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +SoundValue::operator == (SoundValue & x) +{ + x.parse(); + return false; +} + +SoundValue::~SoundValue() +{ +} + + void +SoundValue::_parse() +{ +} + + void +SoundValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/SourceParam.cpp b/tdeabc/vcard/SourceParam.cpp new file mode 100644 index 000000000..6a0e772ac --- /dev/null +++ b/tdeabc/vcard/SourceParam.cpp @@ -0,0 +1,112 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +SourceParam::SourceParam() + : Param(), + type_(SourceParam::TypeUnknown) +{ +} + +SourceParam::SourceParam(const SourceParam & x) + : Param(x), + type_ (x.type_), + par_ (x.par_), + val_ (x.val_) +{ +} + +SourceParam::SourceParam(const TQCString & s) + : Param(s), + type_(SourceParam::TypeUnknown) +{ +} + + SourceParam & +SourceParam::operator = (SourceParam & x) +{ + if (*this == x) return *this; + type_ = x.type(); + par_ = x.par(); + val_ = x.val(); + + Param::operator = (x); + return *this; +} + + SourceParam & +SourceParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +SourceParam::operator == (SourceParam & x) +{ + x.parse(); + return false; +} + +SourceParam::~SourceParam() +{ +} + + void +SourceParam::_parse() +{ + int i = strRep_.find('='); + if (i == -1) // Invalid + return; + + par_ = strRep_.left(i); + val_ = strRep_.right(strRep_.length() - i - 1); + + if (tqstricmp(par_, "VALUE") == 0 && tqstricmp(val_, "uri") == 0) + type_ = TypeValue; + else if (tqstricmp(par_, "CONTEXT") == 0 && tqstricmp(val_, "word") == 0) + type_ = TypeContext; + else if (tqstrnicmp(par_, "X-", 2) == 0) { + type_ = TypeX; + } + else type_ = TypeUnknown; + +} + + void +SourceParam::_assemble() +{ + if (type_ == TypeValue) + strRep_ = "VALUE=uri"; + else if (type_ == TypeContext) + strRep_ = "CONTEXT=word"; + else if (type_ == TypeX) + strRep_ = par_ + "=" + val_; + else strRep_ = ""; +} + diff --git a/tdeabc/vcard/TelParam.cpp b/tdeabc/vcard/TelParam.cpp new file mode 100644 index 000000000..072b1dc81 --- /dev/null +++ b/tdeabc/vcard/TelParam.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +TelParam::TelParam() + : Param() +{ +} + +TelParam::TelParam(const TelParam & x) + : Param(x) +{ +} + +TelParam::TelParam(const TQCString & s) + : Param(s) +{ +} + + TelParam & +TelParam::operator = (TelParam & x) +{ + if (*this == x) return *this; + + Param::operator = (x); + return *this; +} + + TelParam & +TelParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +TelParam::operator == (TelParam & x) +{ + x.parse(); + return false; +} + +TelParam::~TelParam() +{ +} + + void +TelParam::_parse() +{ +} + + void +TelParam::_assemble() +{ +} + diff --git a/tdeabc/vcard/TelValue.cpp b/tdeabc/vcard/TelValue.cpp new file mode 100644 index 000000000..c9c1b85aa --- /dev/null +++ b/tdeabc/vcard/TelValue.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +TelValue::TelValue() + : Value() +{ +} + +TelValue::TelValue(const TelValue & x) + : Value(x) +{ +} + +TelValue::TelValue(const TQCString & s) + : Value(s) +{ +} + + TelValue & +TelValue::operator = (TelValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + TelValue & +TelValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +TelValue::operator == (TelValue & x) +{ + x.parse(); + return false; +} + +TelValue::~TelValue() +{ +} + + void +TelValue::_parse() +{ +} + + void +TelValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/TextBinParam.cpp b/tdeabc/vcard/TextBinParam.cpp new file mode 100644 index 000000000..4e0ebadff --- /dev/null +++ b/tdeabc/vcard/TextBinParam.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +TextBinParam::TextBinParam() + : Param() +{ +} + +TextBinParam::TextBinParam(const TextBinParam & x) + : Param(x) +{ +} + +TextBinParam::TextBinParam(const TQCString & s) + : Param(s) +{ +} + + TextBinParam & +TextBinParam::operator = (TextBinParam & x) +{ + if (*this == x) return *this; + + Param::operator = (x); + return *this; +} + + TextBinParam & +TextBinParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +TextBinParam::operator == (TextBinParam & x) +{ + x.parse(); + return false; +} + +TextBinParam::~TextBinParam() +{ +} + + void +TextBinParam::_parse() +{ +} + + void +TextBinParam::_assemble() +{ +} + diff --git a/tdeabc/vcard/TextBinValue.cpp b/tdeabc/vcard/TextBinValue.cpp new file mode 100644 index 000000000..e7da0b7c6 --- /dev/null +++ b/tdeabc/vcard/TextBinValue.cpp @@ -0,0 +1,104 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include +#include + +using namespace VCARD; + +TextBinValue::TextBinValue() + : Value() +{ +} + +TextBinValue::TextBinValue(const TextBinValue & x) + : Value(x) +{ + mIsBinary_ = x.mIsBinary_; + mData_ = x.mData_; + mUrl_ = x.mUrl_; +} + +TextBinValue::TextBinValue(const TQCString & s) + : Value(s) +{ +} + + TextBinValue & +TextBinValue::operator = (TextBinValue & x) +{ + if (*this == x) return *this; + + mIsBinary_ = x.mIsBinary_; + mData_ = x.mData_; + mUrl_ = x.mUrl_; + + Value::operator = (x); + return *this; +} + + TextBinValue & +TextBinValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +TextBinValue::operator == (TextBinValue & x) +{ + x.parse(); + + if ( mIsBinary_ != x.mIsBinary_ ) return false; + if ( mData_ != x.mData_ ) return false; + if ( mUrl_ != x.mUrl_ ) return false; + + return true; +} + +TextBinValue::~TextBinValue() +{ +} + + TextBinValue * +TextBinValue::clone() +{ + return new TextBinValue( *this ); +} + + void +TextBinValue::_parse() +{ +} + + void +TextBinValue::_assemble() +{ + if ( mIsBinary_ ) { + strRep_ = KCodecs::base64Encode( mData_ ); + } else + strRep_ = mUrl_.utf8(); +} + diff --git a/tdeabc/vcard/TextListValue.cpp b/tdeabc/vcard/TextListValue.cpp new file mode 100644 index 000000000..2bec2e181 --- /dev/null +++ b/tdeabc/vcard/TextListValue.cpp @@ -0,0 +1,107 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +#include + +using namespace VCARD; + +TextListValue::TextListValue() + : Value() +{ +} + +TextListValue::TextListValue(const TextListValue & x) + : Value(x) +{ +} + +TextListValue::TextListValue(const TQCString & s) + : Value(s) +{ +} + + TextListValue & +TextListValue::operator = (TextListValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + TextListValue & +TextListValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +TextListValue::operator == (TextListValue & x) +{ + x.parse(); + return false; +} + +TextListValue::~TextListValue() +{ +} + + void +TextListValue::_parse() +{ + RTokenise(strRep_, ";", valueList_); +} + + void +TextListValue::_assemble() +{ + bool first(true); + + TQStrListIterator it(valueList_); + + for (; it.current(); ++it) { + if (!first) strRep_ += ';'; + strRep_ += it.current(); + first = false; + } +} + + unsigned int +TextListValue::numValues() +{ + parse(); + return valueList_.count(); +} + + TQCString +TextListValue::value(unsigned int i) +{ + parse(); + return valueList_.at(i); +} + diff --git a/tdeabc/vcard/TextParam.cpp b/tdeabc/vcard/TextParam.cpp new file mode 100644 index 000000000..b353483ec --- /dev/null +++ b/tdeabc/vcard/TextParam.cpp @@ -0,0 +1,82 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +TextParam::TextParam() + : Param() +{ +} + +TextParam::TextParam(const TextParam & x) + : Param(x) +{ +} + +TextParam::TextParam(const TQCString & s) + : Param(s) +{ +} + + TextParam & +TextParam::operator = (TextParam & x) +{ + if (*this == x) return *this; + + Param::operator = (x); + return *this; +} + + TextParam & +TextParam::operator = (const TQCString & s) +{ + Param::operator = (s); + return *this; +} + + bool +TextParam::operator == (TextParam & x) +{ + x.parse(); + + return false; +} + +TextParam::~TextParam() +{ +} + + void +TextParam::_parse() +{ +} + + void +TextParam::_assemble() +{ +} + diff --git a/tdeabc/vcard/TextValue.cpp b/tdeabc/vcard/TextValue.cpp new file mode 100644 index 000000000..cf8e0673f --- /dev/null +++ b/tdeabc/vcard/TextValue.cpp @@ -0,0 +1,86 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +TextValue::TextValue() + : Value() +{ +} + +TextValue::TextValue(const TextValue & x) + : Value(x) +{ +} + +TextValue::TextValue(const TQCString & s) + : Value(s) +{ +} + + TextValue & +TextValue::operator = (TextValue & x) +{ + if (*this == x) return *this; + + Value::operator = (x); + return *this; +} + + TextValue & +TextValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +TextValue::operator == (TextValue & x) +{ + return strRep_ == x.strRep_; +} + +TextValue::~TextValue() +{ +} + + TextValue * +TextValue::clone() +{ + return new TextValue( *this ); +} + + void +TextValue::_parse() +{ +} + + void +TextValue::_assemble() +{ +} + diff --git a/tdeabc/vcard/URIValue.cpp b/tdeabc/vcard/URIValue.cpp new file mode 100644 index 000000000..bba8db0fa --- /dev/null +++ b/tdeabc/vcard/URIValue.cpp @@ -0,0 +1,133 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +URIValue::URIValue() + : Value() +{ +} + +URIValue::URIValue(const TQCString & scheme, const TQCString & schemeSpecificPart) + : Value(), + scheme_ (scheme), + schemeSpecificPart_ (schemeSpecificPart) +{ + parsed_ = true; +} + +URIValue::URIValue(const URIValue & x) + : Value (x), + scheme_ (x.scheme_), + schemeSpecificPart_ (x.schemeSpecificPart_) +{ +} + +URIValue::URIValue(const TQCString & s) + : Value(s) +{ +} + + URIValue & +URIValue::operator = (URIValue & x) +{ + if (*this == x) return *this; + + scheme_ = x.scheme_; + schemeSpecificPart_ = x.schemeSpecificPart_; + + Value::operator = (x); + return *this; +} + + URIValue & +URIValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +URIValue::operator == (URIValue & x) +{ + x.parse(); + return ( + (scheme_ == x.scheme_) && + (schemeSpecificPart_ == x.schemeSpecificPart_)); + + return false; +} + +URIValue::~URIValue() +{ +} + + void +URIValue::_parse() +{ + int split = strRep_.find(':'); + if (split == -1) + return; + + scheme_ = strRep_.left(split); + schemeSpecificPart_ = strRep_.mid(split + 1); +} + + void +URIValue::_assemble() +{ + strRep_ = scheme_ + ':' + schemeSpecificPart_; +} + + TQCString +URIValue::scheme() +{ + parse(); + return scheme_; +} + + TQCString +URIValue::schemeSpecificPart() +{ + parse(); + return schemeSpecificPart_; +} + + void +URIValue::setScheme(const TQCString & s) +{ + parse(); + scheme_ = s; +} + + void +URIValue::setSchemeSpecificPart(const TQCString & s) +{ + parse(); + schemeSpecificPart_ = s; +} + diff --git a/tdeabc/vcard/UTCValue.cpp b/tdeabc/vcard/UTCValue.cpp new file mode 100644 index 000000000..30473661f --- /dev/null +++ b/tdeabc/vcard/UTCValue.cpp @@ -0,0 +1,110 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include + +using namespace VCARD; + +UTCValue::UTCValue() + : Value() +{ +} + +UTCValue::UTCValue(const UTCValue & x) + : Value(x), positive_(x.positive_), hour_(x.hour_), minute_(x.minute_) + +{ +} + +UTCValue::UTCValue(const TQCString & s) + : Value(s) +{ +} + + UTCValue & +UTCValue::operator = (UTCValue & x) +{ + if (*this == x) return *this; + + positive_ = x.positive_; + hour_ = x.hour_; + minute_ = x.minute_; + + Value::operator = (x); + return *this; +} + + UTCValue & +UTCValue::operator = (const TQCString & s) +{ + Value::operator = (s); + return *this; +} + + bool +UTCValue::operator == (UTCValue & x) +{ + x.parse(); + + if (positive_ != x.positive_) return false; + if (hour_ != x.hour_) return false; + if (minute_ != x.minute_) return false; + + return true; +} + +UTCValue::~UTCValue() +{ +} + + UTCValue * +UTCValue::clone() +{ + return new UTCValue( *this ); +} + + void +UTCValue::_parse() +{ + if ( strRep_.isEmpty() ) + return; + + positive_ = ( strRep_[0] == '+' ); + + int colon = strRep_.find( ':' ); + + if ( colon == -1 ) // Not valid. + return; + + hour_ = strRep_.mid( 1, 2 ).toInt(); + minute_ = strRep_.right( 2 ).toInt(); +} + + void +UTCValue::_assemble() +{ + strRep_.sprintf( "%c%.2i:%.2i", (positive_ ? '+' : '-'), hour_, minute_ ); +} + diff --git a/tdeabc/vcard/VCard.cpp b/tdeabc/vcard/VCard.cpp new file mode 100644 index 000000000..eb3f57f6e --- /dev/null +++ b/tdeabc/vcard/VCard.cpp @@ -0,0 +1,283 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include + +#include +#include +#include +#include + +#include + +using namespace VCARD; + +VCard::VCard() + : Entity() +{ + contentLineList_.setAutoDelete( true ); +} + +VCard::VCard(const VCard & x) + : Entity(x), + group_(x.group_), + contentLineList_(x.contentLineList_) +{ +} + +VCard::VCard(const TQCString & s) + : Entity(s) +{ +} + + VCard & +VCard::operator = (VCard & x) +{ + if (*this == x) return *this; + + group_ = x.group(); + contentLineList_ = x.contentLineList_; + + Entity::operator = (x); + return *this; +} + + VCard & +VCard::operator = (const TQCString & s) +{ + Entity::operator = (s); + return *this; +} + + bool +VCard::operator == (VCard & x) +{ + x.parse(); + return false; +} + +VCard::~VCard() +{ +} + + void +VCard::_parse() +{ + vDebug("parse() called"); + TQStrList l; + + RTokenise(strRep_, "\r\n", l); + + if (l.count() < 3) { // Invalid VCARD ! + vDebug("Invalid vcard"); + return; + } + + // Get the first line + TQCString beginLine = TQCString(l.at(0)).stripWhiteSpace(); + + vDebug("Begin line == \"" + beginLine + "\""); + + // Remove extra blank lines + while (TQCString(l.last()).isEmpty()) + l.remove(l.last()); + + // Now we know this is the last line + TQCString endLine = l.last(); + + // Trash the first and last lines as we have seen them. + l.remove(0u); + l.remove(l.last()); + + /////////////////////////////////////////////////////////////// + // FIRST LINE + + int split = beginLine.find(':'); + + if (split == -1) { // invalid, no BEGIN + vDebug("No split"); + return; + } + + TQCString firstPart(beginLine.left(split)); + TQCString valuePart(beginLine.mid(split + 1)); + + split = firstPart.find('.'); + + if (split != -1) { + group_ = firstPart.left(split); + firstPart = firstPart.right(firstPart.length() - split - 1); + } + + if (tqstrnicmp(firstPart, "BEGIN", 5) != 0) { // No BEGIN ! + vDebug("No BEGIN"); + return; + } + + if (tqstrnicmp(valuePart, "VCARD", 5) != 0) { // Not a vcard ! + vDebug("No VCARD"); + return; + } + + /////////////////////////////////////////////////////////////// + // CONTENT LINES + // + vDebug("Content lines"); + + // Handle folded lines. + + TQStrList refolded; + + TQStrListIterator it(l); + + TQCString cur; + + for (; it.current(); ++it) { + + cur = it.current(); + + ++it; + + while ( + it.current() && + it.current()[0] == ' ' && + strlen(it.current()) != 1) + { + cur += it.current() + 1; + ++it; + } + + --it; + + refolded.append(cur); + } + + TQStrListIterator it2(refolded); + + for (; it2.current(); ++it2) { + + vDebug("New contentline using \"" + TQCString(it2.current()) + "\""); + ContentLine * cl = new ContentLine(it2.current()); + + cl->parse(); + + contentLineList_.append(cl); + } + + /////////////////////////////////////////////////////////////// + // LAST LINE + + split = endLine.find(':'); + + if (split == -1) // invalid, no END + return; + + firstPart = endLine.left(split); + valuePart = endLine.right(firstPart.length() - split - 1); + + split = firstPart.find('.'); + + if (split != -1) { + group_ = firstPart.left(split); + firstPart = firstPart.right(firstPart.length() - split - 1); + } + + if (tqstricmp(firstPart, "END") != 0) // No END ! + return; + + if (tqstricmp(valuePart, "VCARD") != 0) // Not a vcard ! + return; +} + + void +VCard::_assemble() +{ + vDebug("Assembling vcard"); + strRep_ = "BEGIN:VCARD\r\n"; + strRep_ += "VERSION:3.0\r\n"; + + TQPtrListIterator it(contentLineList_); + + for (; it.current(); ++it) + strRep_ += it.current()->asString() + "\r\n"; + + strRep_ += "END:VCARD\r\n"; +} + + bool +VCard::has(EntityType t) +{ + parse(); + return contentLine(t) == 0 ? false : true; +} + + bool +VCard::has(const TQCString & s) +{ + parse(); + return contentLine(s) == 0 ? false : true; +} + + void +VCard::add(const ContentLine & cl) +{ + parse(); + ContentLine * c = new ContentLine(cl); + contentLineList_.append(c); +} + + void +VCard::add(const TQCString & s) +{ + parse(); + ContentLine * c = new ContentLine(s); + contentLineList_.append(c); +} + + ContentLine * +VCard::contentLine(EntityType t) +{ + parse(); + TQPtrListIterator it(contentLineList_); + + for (; it.current(); ++it) + if (it.current()->entityType() == t) + return it.current(); + + return 0; +} + + ContentLine * +VCard::contentLine(const TQCString & s) +{ + parse(); + TQPtrListIterator it(contentLineList_); + + for (; it.current(); ++it) + if (it.current()->entityType() == EntityNameToEntityType(s)) + return it.current(); + + return 0; +} + diff --git a/tdeabc/vcard/VCardEntity.cpp b/tdeabc/vcard/VCardEntity.cpp new file mode 100644 index 000000000..1f8cea5b1 --- /dev/null +++ b/tdeabc/vcard/VCardEntity.cpp @@ -0,0 +1,119 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include + +#include +#include + +using namespace VCARD; + +VCardEntity::VCardEntity() + : Entity() +{ +} + +VCardEntity::VCardEntity(const VCardEntity & x) + : Entity(x) +{ +} + +VCardEntity::VCardEntity(const TQCString & s) + : Entity(s) +{ +} + + VCardEntity & +VCardEntity::operator = (VCardEntity & x) +{ + if (*this == x) return *this; + + Entity::operator = (x); + return *this; +} + + VCardEntity & +VCardEntity::operator = (const TQCString & s) +{ + Entity::operator = (s); + return *this; +} + + bool +VCardEntity::operator == (VCardEntity & x) +{ + x.parse(); + return false; +} + +VCardEntity::~VCardEntity() +{ +} + + void +VCardEntity::_parse() +{ + vDebug("parse"); + TQCString s(strRep_); + + int i = s.find(TQRegExp("BEGIN:VCARD", false)); + + while (i != -1) { + + i = s.find(TQRegExp("BEGIN:VCARD", false), 11); + + TQCString cardStr(s.left(i)); + + VCard * v = new VCard(cardStr); + + cardList_.append(v); + + v->parse(); + + s.remove(0, i); + } +} + + void +VCardEntity::_assemble() +{ + VCardListIterator it(cardList_); + + for (; it.current(); ++it) + strRep_ += it.current()->asString() + "\r\n"; // One CRLF for luck. +} + + VCardList & +VCardEntity::cardList() +{ + parse(); + return cardList_; +} + + void +VCardEntity::setCardList(const VCardList & l) +{ + parse(); + cardList_ = l; +} + diff --git a/tdeabc/vcard/Value.cpp b/tdeabc/vcard/Value.cpp new file mode 100644 index 000000000..c95c0712b --- /dev/null +++ b/tdeabc/vcard/Value.cpp @@ -0,0 +1,81 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#include +#include + +using namespace VCARD; + +Value::Value() + : Entity() +{ +} + +Value::Value(const Value & x) + : Entity(x) +{ +} + +Value::Value(const TQCString & s) + : Entity(s) +{ +} + + Value & +Value::operator = (Value & x) +{ + if (*this == x) return *this; + + Entity::operator = (x); + return *this; +} + + Value & +Value::operator = (const TQCString & s) +{ + Entity::operator = (s); + return *this; +} + + bool +Value::operator == (Value & x) +{ + x.parse(); + return false; +} + +Value::~Value() +{ +} + + void +Value::_parse() +{ +} + + void +Value::_assemble() +{ + vDebug("Value::_assemble()"); +} + diff --git a/tdeabc/vcard/include/VCard.h b/tdeabc/vcard/include/VCard.h new file mode 100644 index 000000000..17b50e8f2 --- /dev/null +++ b/tdeabc/vcard/include/VCard.h @@ -0,0 +1,43 @@ +#ifndef VCARD_H +#define VCARD_H + +#include "VCardAdrParam.h" +#include "VCardAdrValue.h" +#include "VCardAgentParam.h" +#include "VCardAgentValue.h" +#include "VCardClassValue.h" +#include "VCardContentLine.h" +#include "VCardDateParam.h" +#include "VCardDateValue.h" +#include "VCardDefines.h" +#include "VCardEmailParam.h" +#include "VCardEntity.h" +#include "VCardEnum.h" +#include "VCardFloatValue.h" +#include "VCardGeoValue.h" +#include "VCardGroup.h" +#include "VCardImageParam.h" +#include "VCardImageValue.h" +#include "VCardImgValue.h" +#include "VCardLangValue.h" +#include "VCardNValue.h" +#include "VCardOrgValue.h" +#include "VCardParam.h" +#include "VCardPhoneNumberValue.h" +#include "VCardRToken.h" +#include "VCardSoundValue.h" +#include "VCardSourceParam.h" +#include "VCardTelParam.h" +#include "VCardTelValue.h" +#include "VCardTextBinParam.h" +#include "VCardTextBinValue.h" +#include "VCardTextListValue.h" +#include "VCardTextParam.h" +#include "VCardTextValue.h" +#include "VCardURIValue.h" +#include "VCardUTCValue.h" +#include "VCardVCard.h" +#include "VCardVCardEntity.h" +#include "VCardValue.h" + +#endif diff --git a/tdeabc/vcard/include/VCardAdrParam.h b/tdeabc/vcard/include/VCardAdrParam.h new file mode 100644 index 000000000..d40165f4a --- /dev/null +++ b/tdeabc/vcard/include/VCardAdrParam.h @@ -0,0 +1,64 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef ADRPARAM_H +#define ADRPARAM_H + +#include +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT AdrParam : public Param +{ + +#include "AdrParam-generated.h" + + TQStrList adrTypeList() + { parse(); return adrTypeList_; } + + TQCString textParam() + { parse(); return textParam_; } + + void setAdrTypeList(const TQStrList & l) + { adrTypeList_ = l; assembled_ = false; } + + void setTextParam(const TQCString & s) + { textParam_ = s; assembled_ = false; } + + enum AdrType { + AdrDom, AdrIntl, AdrPostal, AdrParcel, AdrHome, AdrWork, AdrPref, + AdrIANA, AdrX + }; + + private: + + TQStrList adrTypeList_; + TQCString textParam_; +}; +} + +#endif diff --git a/tdeabc/vcard/include/VCardAdrValue.h b/tdeabc/vcard/include/VCardAdrValue.h new file mode 100644 index 000000000..94ed93aee --- /dev/null +++ b/tdeabc/vcard/include/VCardAdrValue.h @@ -0,0 +1,83 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef ADRVALUE_H +#define ADRVALUE_H + +#include +#include + +namespace VCARD +{ + +class KVCARD_EXPORT AdrValue : public Value +{ + +#include "AdrValue-generated.h" + + AdrValue *clone(); + + void setPOBox(const TQCString & s) + { poBox_ = s; assembled_ = false; } + + void setExtAddress(const TQCString & s) + { extAddress_ = s; assembled_ = false; } + + void setStreet(const TQCString & s) + { street_ = s; assembled_ = false; } + + void setLocality(const TQCString & s) + { locality_ = s; assembled_ = false; } + + void setRegion(const TQCString & s) + { region_ = s; assembled_ = false; } + + void setPostCode(const TQCString & s) + { postCode_ = s; assembled_ = false; } + + void setCountryName(const TQCString & s) + { countryName_ = s; assembled_ = false; } + + TQCString poBox() { parse(); return poBox_; } + TQCString extAddress() { parse(); return extAddress_; } + TQCString street() { parse(); return street_; } + TQCString locality() { parse(); return locality_; } + TQCString region() { parse(); return region_; } + TQCString postCode() { parse(); return postCode_; } + TQCString countryName() { parse(); return countryName_; } + + private: + + TQCString poBox_; + TQCString extAddress_; + TQCString street_; + TQCString locality_; + TQCString region_; + TQCString postCode_; + TQCString countryName_; +}; + +} + +#endif + diff --git a/tdeabc/vcard/include/VCardAgentParam.h b/tdeabc/vcard/include/VCardAgentParam.h new file mode 100644 index 000000000..90c3bd528 --- /dev/null +++ b/tdeabc/vcard/include/VCardAgentParam.h @@ -0,0 +1,60 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef AGENTPARAM_H +#define AGENTPARAM_H + +#include + +#include +#include + +namespace VCARD +{ + +class KVCARD_EXPORT AgentParam : public Param +{ + +#include "AgentParam-generated.h" + + bool refer() + { parse(); return refer_; } + + URIValue uri() + { parse(); return uri_; } + + void setRefer(bool b) + { refer_ = b; assembled_ = false; } + + void setURI(const TQCString & s) + { uri_ = s; assembled_ = false; } + + private: + + bool refer_; + URIValue uri_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardAgentValue.h b/tdeabc/vcard/include/VCardAgentValue.h new file mode 100644 index 000000000..dd68145c9 --- /dev/null +++ b/tdeabc/vcard/include/VCardAgentValue.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef AGENTVALUE_H +#define AGENTVALUE_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT AgentValue : public Value +{ + +#include "AgentValue-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardClassValue.h b/tdeabc/vcard/include/VCardClassValue.h new file mode 100644 index 000000000..5de79167b --- /dev/null +++ b/tdeabc/vcard/include/VCardClassValue.h @@ -0,0 +1,56 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef CLASSVALUE_H +#define CLASSVALUE_H + +#include + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT ClassValue : public Value +{ + +#include "ClassValue-generated.h" + + enum ClassType { + Public, Private, Confidential, Other + }; + + ClassValue *clone(); + + void setType( int type ) { classType_ = type; assembled_ = false; parsed_ = true; } + int type() { parse(); return classType_; } + + private: + int classType_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardContentLine.h b/tdeabc/vcard/include/VCardContentLine.h new file mode 100644 index 000000000..ea59444a0 --- /dev/null +++ b/tdeabc/vcard/include/VCardContentLine.h @@ -0,0 +1,77 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef CONTENTLINE_H +#define CONTENTLINE_H + +#include + +#include "VCardEnum.h" +#include "VCardEntity.h" +#include "VCardParam.h" +#include "VCardValue.h" + +namespace VCARD +{ + +class KVCARD_EXPORT ContentLine : public Entity +{ + +#include "ContentLine-generated.h" + + TQCString group() { parse(); return group_; } + TQCString name() { parse(); return name_; } + Value * value() { parse(); return value_; } + ParamList paramList() { parse(); return paramList_; } + ParamType paramType() { parse(); return paramType_; } + ValueType valueType() { parse(); return valueType_; } + EntityType entityType() { parse(); return entityType_; } + + void setGroup (const TQCString & s) + { group_ = s; assembled_ = false; } + + void setName (const TQCString & s) + { name_ = s; assembled_ = false; } + + void setValue (Value *s) + { value_ = s; assembled_ = false; } + + void setParamList (const ParamList & l) + { paramList_ = l; assembled_ = false; } + + void clear (); + + private: + + TQCString group_; + TQCString name_; + TQPtrList paramList_; + Value * value_; + + ParamType paramType_; + ValueType valueType_; + EntityType entityType_; +}; +} + +#endif diff --git a/tdeabc/vcard/include/VCardDateParam.h b/tdeabc/vcard/include/VCardDateParam.h new file mode 100644 index 000000000..410eae6b7 --- /dev/null +++ b/tdeabc/vcard/include/VCardDateParam.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef DATEPARAM_H +#define DATEPARAM_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT DateParam : public Param +{ + +#include "DateParam-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardDateValue.h b/tdeabc/vcard/include/VCardDateValue.h new file mode 100644 index 000000000..4f2e2fe7f --- /dev/null +++ b/tdeabc/vcard/include/VCardDateValue.h @@ -0,0 +1,99 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef DATEVALUE_H +#define DATEVALUE_H + +#include +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT DateValue : public Value +{ +#include "DateValue-generated.h" + + DateValue( + unsigned int year, + unsigned int month, + unsigned int day, + unsigned int hour = 0, + unsigned int minute = 0, + unsigned int second = 0, + double secFrac = 0, + bool zonePositive = true, + unsigned int zoneHour = 0, + unsigned int zoneMinute = 0); + + DateValue(const TQDate &); + DateValue(const TQDateTime &); + + DateValue *clone(); + + bool hasTime(); + + unsigned int year(); + unsigned int month(); + unsigned int day(); + unsigned int hour(); + unsigned int minute(); + unsigned int second(); + double secondFraction(); + bool zonePositive(); + unsigned int zoneHour(); + unsigned int zoneMinute(); + + void setYear (unsigned int); + void setMonth (unsigned int); + void setDay (unsigned int); + void setHour (unsigned int); + void setMinute (unsigned int); + void setSecond (unsigned int); + void setSecondFraction (double); + void setZonePositive (bool); + void setZoneHour (unsigned int); + void setZoneMinute (unsigned int); + + TQDate qdate(); + TQTime qtime(); + TQDateTime qdt(); + + private: + + unsigned int year_, month_, day_, + hour_, minute_, second_, + zoneHour_, zoneMinute_; + + double secFrac_; + + bool zonePositive_; + + bool hasTime_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardDefines.h b/tdeabc/vcard/include/VCardDefines.h new file mode 100644 index 000000000..e778bc24f --- /dev/null +++ b/tdeabc/vcard/include/VCardDefines.h @@ -0,0 +1,52 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1998 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef VCARD_DEFINES_H +#define VCARD_DEFINES_H + +#include + +#ifdef VCARD_DEBUG +#define vDebug(a) kdDebug(5710) << a << endl; +#else +#define vDebug(a) +#endif + +#if 0 +#ifndef NDEBUG +# include +# include +# ifdef __GNUG__ +# define vDebug(a) cerr << className() << ":" << __FUNCTION__ << " (" \ + << __LINE__ << "): " << TQCString((a)).data() << endl; +# else +# define vDebug(a) cerr << className() << ": " \ + << TQCString((a)).data() << endl; +# endif +#else +# define vDebug(a) +#endif +#endif + +#endif // Included this file + diff --git a/tdeabc/vcard/include/VCardEmailParam.h b/tdeabc/vcard/include/VCardEmailParam.h new file mode 100644 index 000000000..1fe558afd --- /dev/null +++ b/tdeabc/vcard/include/VCardEmailParam.h @@ -0,0 +1,56 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef EMAILPARAM_H +#define EMAILPARAM_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT EmailParam : public Param +{ + +#include "EmailParam-generated.h" + + TQCString emailType() { parse(); return emailType_; } + bool pref() { parse(); return pref_; } + + void setEmailType(const TQCString & s) + { emailType_ = s; assembled_ = false; } + + void setPref(bool b) + { pref_ = b; assembled_ = false; } + + private: + + TQCString emailType_; + bool pref_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardEntity.h b/tdeabc/vcard/include/VCardEntity.h new file mode 100644 index 000000000..e87c5f1a6 --- /dev/null +++ b/tdeabc/vcard/include/VCardEntity.h @@ -0,0 +1,68 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef ENTITY_H +#define ENTITY_H + +#include +#include + +namespace VCARD +{ + +class KVCARD_EXPORT Entity +{ + public: + + Entity(); + Entity(const Entity & e); + Entity(const TQCString & s); + + virtual Entity & operator = (const Entity & e); + virtual Entity & operator = (const TQCString & s); + + virtual bool operator == (Entity & e); + virtual bool operator != (Entity & e); + virtual bool operator == (const TQCString & s); + virtual bool operator != (const TQCString & s); + + virtual ~Entity(); + + TQCString asString(); + + virtual void parse(); + virtual void assemble(); + + virtual void _parse() = 0; + virtual void _assemble() = 0; + + protected: + + TQCString strRep_; + bool parsed_; + bool assembled_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardEnum.h b/tdeabc/vcard/include/VCardEnum.h new file mode 100644 index 000000000..4552ccdbc --- /dev/null +++ b/tdeabc/vcard/include/VCardEnum.h @@ -0,0 +1,123 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef ENUM_H +#define ENUM_H + +#include + +#include + +namespace VCARD +{ + +extern const TQCString paramNames []; + +enum EntityType { + EntityName, + EntityProfile, + EntitySource, + EntityFullName, + EntityN, + EntityNickname, + EntityPhoto, + EntityBirthday, + EntityAddress, + EntityLabel, + EntityTelephone, + EntityEmail, + EntityMailer, + EntityTimeZone, + EntityGeo, + EntityTitle, + EntityRole, + EntityLogo, + EntityAgent, + EntityOrganisation, + EntityCategories, + EntityNote, + EntityProductID, + EntityRevision, + EntitySortString, + EntitySound, + EntityUID, + EntityURI, + EntityURL, + EntityVersion, + EntityClass, + EntityKey, + EntityExtension, + EntityUnknown +}; + +enum ValueType { + ValueSound, + ValueAgent, + ValueAddress, + ValueTel, + ValueTextBin, + ValueOrg, + ValueN, + ValueUTC, + ValueURI, + ValueClass, + ValueFloat, + ValueImage, + ValueDate, + ValueTextList, + ValueText, + ValueGeo, + ValueUnknown +}; + +enum ParamType { + ParamUnknown, + ParamNone, + ParamSource, + ParamText, + ParamImage, + ParamDate, + ParamAddrText, + ParamTel, + ParamEmail, + ParamMailer, + ParamAgent, + ParamTextBin, + ParamTextNS, + ParamSound +}; + +extern const ParamType paramTypesTable[]; + +KVCARD_EXPORT ParamType EntityTypeToParamType(EntityType); +KVCARD_EXPORT ValueType EntityTypeToValueType(EntityType); +KVCARD_EXPORT TQCString EntityTypeToParamName(EntityType); +KVCARD_EXPORT EntityType EntityNameToEntityType(const TQCString &); + +KVCARD_EXPORT char * encodeBase64(const char *, unsigned long, unsigned long &); +KVCARD_EXPORT char * decodeBase64(const char *, unsigned long, unsigned long &); + +} + +#endif + diff --git a/tdeabc/vcard/include/VCardFloatValue.h b/tdeabc/vcard/include/VCardFloatValue.h new file mode 100644 index 000000000..45a6823be --- /dev/null +++ b/tdeabc/vcard/include/VCardFloatValue.h @@ -0,0 +1,51 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef FLOATVALUE_H +#define FLOATVALUE_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT FloatValue : public Value +{ + +#include "FloatValue-generated.h" + + FloatValue(float); + + float value(); + void setValue(float); + + private: + + float value_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardGeoValue.h b/tdeabc/vcard/include/VCardGeoValue.h new file mode 100644 index 000000000..4228587a4 --- /dev/null +++ b/tdeabc/vcard/include/VCardGeoValue.h @@ -0,0 +1,49 @@ +/* + This file is part of libvcard. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef GEOVALUE_H +#define GEOVALUE_H + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT GeoValue : public Value +{ + +#include "GeoValue-generated.h" + + GeoValue *clone(); + + void setLatitude( float lat ) { latitude_ = lat; assembled_ = false; } + void setLongitude( float lon ) { longitude_ = lon; assembled_ = false; } + + float latitude() { parse(); return latitude_; } + float longitude() { parse(); return longitude_; } + + private: + float latitude_; + float longitude_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardGroup.h b/tdeabc/vcard/include/VCardGroup.h new file mode 100644 index 000000000..ce884f100 --- /dev/null +++ b/tdeabc/vcard/include/VCardGroup.h @@ -0,0 +1,39 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef GROUP_H +#define GROUP_H + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT Group : public Entity +{ +#include "Group-generated.h" +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardImageParam.h b/tdeabc/vcard/include/VCardImageParam.h new file mode 100644 index 000000000..10ab8a3f5 --- /dev/null +++ b/tdeabc/vcard/include/VCardImageParam.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef IMGPARAM_H +#define IMGPARAM_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT ImageParam : public Param +{ + +#include "ImageParam-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardImageValue.h b/tdeabc/vcard/include/VCardImageValue.h new file mode 100644 index 000000000..45fbcad9c --- /dev/null +++ b/tdeabc/vcard/include/VCardImageValue.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef IMAGEVALUE_H +#define IMAGEVALUE_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT ImageValue : public Value +{ + +#include "ImageValue-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardImgValue.h b/tdeabc/vcard/include/VCardImgValue.h new file mode 100644 index 000000000..7d4bbfa2d --- /dev/null +++ b/tdeabc/vcard/include/VCardImgValue.h @@ -0,0 +1,39 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef IMGVALUE_H +#define IMGVALUE_H + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT ImgValue : public Value +{ +#include "ImgValue-generated.h" +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardLangValue.h b/tdeabc/vcard/include/VCardLangValue.h new file mode 100644 index 000000000..7767d52fa --- /dev/null +++ b/tdeabc/vcard/include/VCardLangValue.h @@ -0,0 +1,51 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef LANGVALUE_H +#define LANGVALUE_H + +#include +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT LangValue : public Value +{ +#include "LangValue-generated.h" + + TQCString primary(); + TQStrList subtags(); + + void setPrimary(const TQCString &); + void setSubTags(const TQStrList &); + + TQCString primary_; + TQStrList subtags_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardNValue.h b/tdeabc/vcard/include/VCardNValue.h new file mode 100644 index 000000000..9db37fbbc --- /dev/null +++ b/tdeabc/vcard/include/VCardNValue.h @@ -0,0 +1,56 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef NVALUE_H +#define NVALUE_H + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT NValue : public Value +{ +#include "NValue-generated.h" + NValue *clone(); + + TQCString family() { parse(); return family_; } + TQCString given() { parse(); return given_; } + TQCString middle() { parse(); return middle_; } + TQCString prefix() { parse(); return prefix_; } + TQCString suffix() { parse(); return suffix_; } + + void setFamily (const TQCString & s) { family_ = s; assembled_ = false; } + void setGiven (const TQCString & s) { given_ = s; assembled_ = false; } + void setMiddle (const TQCString & s) { middle_ = s; assembled_ = false; } + void setPrefix (const TQCString & s) { prefix_ = s; assembled_ = false; } + void setSuffix (const TQCString & s) { suffix_ = s; assembled_ = false; } + + private: + + TQCString family_, given_, middle_, prefix_, suffix_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardOrgValue.h b/tdeabc/vcard/include/VCardOrgValue.h new file mode 100644 index 000000000..a2bd803e5 --- /dev/null +++ b/tdeabc/vcard/include/VCardOrgValue.h @@ -0,0 +1,50 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef ORGVALUE_H +#define ORGVALUE_H + +#include +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT OrgValue : public Value +{ + +#include "OrgValue-generated.h" + + unsigned int numValues(); + TQCString value(unsigned int); + + private: + + TQStrList valueList_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardParam.h b/tdeabc/vcard/include/VCardParam.h new file mode 100644 index 000000000..93d70f06b --- /dev/null +++ b/tdeabc/vcard/include/VCardParam.h @@ -0,0 +1,59 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef PARAM_H +#define PARAM_H + +#include +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT Param : public Entity +{ + +#include "Param-generated.h" + + Param(const TQCString &name, const TQCString &value); + + void setName(const TQCString &); + void setValue(const TQCString &); + + TQCString name(); + TQCString value(); + + private: + + TQCString name_; + TQCString value_; +}; + +typedef TQPtrList ParamList; +typedef TQPtrListIterator ParamListIterator; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardPhoneNumberValue.h b/tdeabc/vcard/include/VCardPhoneNumberValue.h new file mode 100644 index 000000000..3f9e106ca --- /dev/null +++ b/tdeabc/vcard/include/VCardPhoneNumberValue.h @@ -0,0 +1,39 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef PHONENUMBERVALUE_H +#define PHONENUMBERVALUE_H + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT PhoneNumberValue : public Value +{ +#include "PhoneNumberValue-generated.h" +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardRToken.h b/tdeabc/vcard/include/VCardRToken.h new file mode 100644 index 000000000..17a3943d3 --- /dev/null +++ b/tdeabc/vcard/include/VCardRToken.h @@ -0,0 +1,40 @@ +/* + + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef RTOKEN_H +#define RTOKEN_H + +#include + +#include + +namespace VCARD +{ + +KVCARD_EXPORT TQ_UINT32 RTokenise(const char * str, const char * delim, TQStrList & l); + +} + +#endif + diff --git a/tdeabc/vcard/include/VCardSndValue.h b/tdeabc/vcard/include/VCardSndValue.h new file mode 100644 index 000000000..09a3a8238 --- /dev/null +++ b/tdeabc/vcard/include/VCardSndValue.h @@ -0,0 +1,39 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef SNDVALUE_H +#define SNDVALUE_H + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT SndValue : public Value +{ +#include "SndValue-generated.h" +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardSoundValue.h b/tdeabc/vcard/include/VCardSoundValue.h new file mode 100644 index 000000000..61858f058 --- /dev/null +++ b/tdeabc/vcard/include/VCardSoundValue.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef SOUNDVALUE_H +#define SOUNDVALUE_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT SoundValue : public Value +{ + +#include "SoundValue-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardSourceParam.h b/tdeabc/vcard/include/VCardSourceParam.h new file mode 100644 index 000000000..1d9d03d47 --- /dev/null +++ b/tdeabc/vcard/include/VCardSourceParam.h @@ -0,0 +1,58 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef SOURCEPARAM_H +#define SOURCEPARAM_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT SourceParam : public Param +{ + +#include "SourceParam-generated.h" + + enum SourceParamType { TypeUnknown, TypeValue, TypeContext, TypeX }; + + SourceParamType type() { parse(); return type_;} + TQCString par() { parse(); return par_; } + TQCString val() { parse(); return val_; } + + void setType(SourceParamType t) { type_ = t; assembled_ = false; } + void setPar(const TQCString & s) { par_ = s; assembled_ = false; } + void setVal(const TQCString & s) { val_ = s; assembled_ = false; } + + private: + + SourceParamType type_; + // May be "VALUE = uri" or "CONTEXT = word" or "x-name = *SAFE-CHAR" + TQCString par_, val_; // Sub-parameter, value +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTelParam.h b/tdeabc/vcard/include/VCardTelParam.h new file mode 100644 index 000000000..9eea5da2f --- /dev/null +++ b/tdeabc/vcard/include/VCardTelParam.h @@ -0,0 +1,51 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TELPARAM_H +#define TELPARAM_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT TelParam : public Param +{ +#include "TelParam-generated.h" + + enum TelType { + TelHome, TelWork, TelPref, TelVoice, TelFex, TelMsg, TelCell, + TelPager, TelBBS, TelModem, TelCar, TelISDN, TelVideo, TelPCS, + TelIANA, TelX + }; + + private: + + TQPtrList types_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTelValue.h b/tdeabc/vcard/include/VCardTelValue.h new file mode 100644 index 000000000..043a45aa9 --- /dev/null +++ b/tdeabc/vcard/include/VCardTelValue.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TELVALUE_H +#define TELVALUE_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT TelValue : public Value +{ + +#include "TelValue-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTextBinParam.h b/tdeabc/vcard/include/VCardTextBinParam.h new file mode 100644 index 000000000..5a681ad48 --- /dev/null +++ b/tdeabc/vcard/include/VCardTextBinParam.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TEXTBINPARAM_H +#define TEXTBINPARAM_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT TextBinParam : public Param +{ + +#include "TextBinParam-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTextBinValue.h b/tdeabc/vcard/include/VCardTextBinValue.h new file mode 100644 index 000000000..316fa7832 --- /dev/null +++ b/tdeabc/vcard/include/VCardTextBinValue.h @@ -0,0 +1,67 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TEXTBINVALUE_H +#define TEXTBINVALUE_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT TextBinValue : public Value +{ + +#include "TextBinValue-generated.h" + + TextBinValue *clone(); + + bool isBinary() { parse(); return mIsBinary_; } + TQByteArray data() { parse(); return mData_; } + TQString url() { parse(); return mUrl_; } + + void setData( const TQByteArray &data ) + { + mData_ = data; + mIsBinary_ = true; + assembled_ = false; + } + + void setUrl( const TQString &url ) + { + mUrl_ = url; + mIsBinary_ = false; + assembled_ = false; + } + + private: + int mIsBinary_; + TQByteArray mData_; + TQString mUrl_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTextListValue.h b/tdeabc/vcard/include/VCardTextListValue.h new file mode 100644 index 000000000..53760c75a --- /dev/null +++ b/tdeabc/vcard/include/VCardTextListValue.h @@ -0,0 +1,51 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TEXTLISTVALUE_H +#define TEXTLISTVALUE_H + +#include + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT TextListValue : public Value +{ + +#include "TextListValue-generated.h" + + unsigned int numValues(); + TQCString value(unsigned int); + + private: + + TQStrList valueList_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTextParam.h b/tdeabc/vcard/include/VCardTextParam.h new file mode 100644 index 000000000..d593c0578 --- /dev/null +++ b/tdeabc/vcard/include/VCardTextParam.h @@ -0,0 +1,44 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TEXTPARAM_H +#define TEXTPARAM_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT TextParam : public Param +{ + +#include "TextParam-generated.h" + + private: +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardTextValue.h b/tdeabc/vcard/include/VCardTextValue.h new file mode 100644 index 000000000..66eed32a8 --- /dev/null +++ b/tdeabc/vcard/include/VCardTextValue.h @@ -0,0 +1,41 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef TEXTVALUE_H +#define TEXTVALUE_H + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT TextValue : public Value +{ +#include "TextValue-generated.h" + + TextValue *clone(); +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardURIValue.h b/tdeabc/vcard/include/VCardURIValue.h new file mode 100644 index 000000000..696887774 --- /dev/null +++ b/tdeabc/vcard/include/VCardURIValue.h @@ -0,0 +1,52 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef URIVALUE_H +#define URIVALUE_H + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT URIValue : public Value +{ +#include "URIValue-generated.h" + + URIValue(const TQCString & scheme, const TQCString & schemeSpecificPart); + + TQCString scheme(); + TQCString schemeSpecificPart(); + + void setScheme (const TQCString &); + void setSchemeSpecificPart (const TQCString &); + + private: + + TQCString scheme_; + TQCString schemeSpecificPart_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardUTCValue.h b/tdeabc/vcard/include/VCardUTCValue.h new file mode 100644 index 000000000..cb09ccf00 --- /dev/null +++ b/tdeabc/vcard/include/VCardUTCValue.h @@ -0,0 +1,58 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef UTCVALUE_H +#define UTCVALUE_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT UTCValue : public Value +{ + +#include "UTCValue-generated.h" + + UTCValue *clone(); + + void setPositive( int p ) { positive_ = p; assembled_ = false; } + void setHour( int h ) { hour_ = h; assembled_ = false; } + void setMinute( int m ) { minute_ = m; assembled_ = false; } + + bool positive() { parse(); return positive_; } + unsigned int hour() { parse(); return hour_; } + unsigned int minute() { parse(); return minute_; } + + private: + + bool positive_; + unsigned int hour_; + unsigned int minute_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardVCard.h b/tdeabc/vcard/include/VCardVCard.h new file mode 100644 index 000000000..53563e8c0 --- /dev/null +++ b/tdeabc/vcard/include/VCardVCard.h @@ -0,0 +1,63 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef VCARD_VCARD_H +#define VCARD_VCARD_H + +#include +#include + +#include +#include +#include + +namespace VCARD +{ + +class KVCARD_EXPORT VCard : public Entity +{ + +#include "VCard-generated.h" + + bool has(EntityType); + bool has(const TQCString &); + + void add(const ContentLine &); + void add(const TQCString &); + + ContentLine * contentLine(EntityType); + ContentLine * contentLine(const TQCString &); + + TQCString group() { parse(); return group_; } + + TQPtrList contentLineList() { parse(); return contentLineList_; } + + private: + + TQCString group_; + TQPtrList contentLineList_; +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardVCardEntity.h b/tdeabc/vcard/include/VCardVCardEntity.h new file mode 100644 index 000000000..422790c22 --- /dev/null +++ b/tdeabc/vcard/include/VCardVCardEntity.h @@ -0,0 +1,56 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef VCARD_ENTITY_H +#define VCARD_ENTITY_H + +#include +#include + +#include +#include +#include + +namespace VCARD +{ + +typedef TQPtrList VCardList; +typedef TQPtrListIterator VCardListIterator; + +class KVCARD_EXPORT VCardEntity : public Entity +{ + +#include "VCardEntity-generated.h" + + void setCardList(const VCardList & l); + VCardList & cardList(); + + private: + + VCardList cardList_; + +}; + +} + +#endif diff --git a/tdeabc/vcard/include/VCardValue.h b/tdeabc/vcard/include/VCardValue.h new file mode 100644 index 000000000..3c167d70a --- /dev/null +++ b/tdeabc/vcard/include/VCardValue.h @@ -0,0 +1,46 @@ +/* + libvcard - vCard parsing library for vCard version 3.0 + + Copyright (C) 1999 Rik Hemsley rik@kde.org + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to + deal in the Software without restriction, including without limitation the + rights to use, copy, modify, merge, publish, distribute, sublicense, and/or + sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in + all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +*/ + +#ifndef VALUE_H +#define VALUE_H + +#include + +#include + +namespace VCARD +{ + +class KVCARD_EXPORT Value : public Entity +{ +#include "Value-generated.h" + + virtual Value *clone() { return new Value( *this ); } +}; + +typedef TQPtrList ValueList; +typedef TQPtrListIterator ValueListIterator; + +} + +#endif diff --git a/tdeabc/vcard/include/generated/AdrParam-generated.h b/tdeabc/vcard/include/generated/AdrParam-generated.h new file mode 100644 index 000000000..1afdcd36a --- /dev/null +++ b/tdeabc/vcard/include/generated/AdrParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +AdrParam(); +AdrParam(const AdrParam&); +AdrParam(const TQCString&); +AdrParam & operator = (AdrParam&); +AdrParam & operator = (const TQCString&); +bool operator ==(AdrParam&); +bool operator !=(AdrParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {AdrParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~AdrParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "AdrParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/AdrValue-generated.h b/tdeabc/vcard/include/generated/AdrValue-generated.h new file mode 100644 index 000000000..9882d1186 --- /dev/null +++ b/tdeabc/vcard/include/generated/AdrValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +AdrValue(); +AdrValue(const AdrValue&); +AdrValue(const TQCString&); +AdrValue & operator = (AdrValue&); +AdrValue & operator = (const TQCString&); +bool operator ==(AdrValue&); +bool operator !=(AdrValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {AdrValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~AdrValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "AdrValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/AgentParam-generated.h b/tdeabc/vcard/include/generated/AgentParam-generated.h new file mode 100644 index 000000000..07b87d106 --- /dev/null +++ b/tdeabc/vcard/include/generated/AgentParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +AgentParam(); +AgentParam(const AgentParam&); +AgentParam(const TQCString&); +AgentParam & operator = (AgentParam&); +AgentParam & operator = (const TQCString&); +bool operator ==(AgentParam&); +bool operator !=(AgentParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {AgentParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~AgentParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "AgentParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/AgentValue-generated.h b/tdeabc/vcard/include/generated/AgentValue-generated.h new file mode 100644 index 000000000..e2866bb8f --- /dev/null +++ b/tdeabc/vcard/include/generated/AgentValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +AgentValue(); +AgentValue(const AgentValue&); +AgentValue(const TQCString&); +AgentValue & operator = (AgentValue&); +AgentValue & operator = (const TQCString&); +bool operator ==(AgentValue&); +bool operator !=(AgentValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {AgentValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~AgentValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "AgentValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ClassValue-generated.h b/tdeabc/vcard/include/generated/ClassValue-generated.h new file mode 100644 index 000000000..e10c65568 --- /dev/null +++ b/tdeabc/vcard/include/generated/ClassValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ClassValue(); +ClassValue(const ClassValue&); +ClassValue(const TQCString&); +ClassValue & operator = (ClassValue&); +ClassValue & operator = (const TQCString&); +bool operator ==(ClassValue&); +bool operator !=(ClassValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ClassValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ClassValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "ClassValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ContentLine-generated.h b/tdeabc/vcard/include/generated/ContentLine-generated.h new file mode 100644 index 000000000..ad2ac7649 --- /dev/null +++ b/tdeabc/vcard/include/generated/ContentLine-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ContentLine(); +ContentLine(const ContentLine&); +ContentLine(const TQCString&); +ContentLine & operator = (ContentLine&); +ContentLine & operator = (const TQCString&); +bool operator ==(ContentLine&); +bool operator !=(ContentLine& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ContentLine a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ContentLine(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "ContentLine"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/DateParam-generated.h b/tdeabc/vcard/include/generated/DateParam-generated.h new file mode 100644 index 000000000..75e7ad72d --- /dev/null +++ b/tdeabc/vcard/include/generated/DateParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +DateParam(); +DateParam(const DateParam&); +DateParam(const TQCString&); +DateParam & operator = (DateParam&); +DateParam & operator = (const TQCString&); +bool operator ==(DateParam&); +bool operator !=(DateParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {DateParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~DateParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "DateParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/DateValue-generated.h b/tdeabc/vcard/include/generated/DateValue-generated.h new file mode 100644 index 000000000..cf0eb40d8 --- /dev/null +++ b/tdeabc/vcard/include/generated/DateValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +DateValue(); +DateValue(const DateValue&); +DateValue(const TQCString&); +DateValue & operator = (DateValue&); +DateValue & operator = (const TQCString&); +bool operator ==(DateValue&); +bool operator !=(DateValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {DateValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~DateValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "DateValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/EmailParam-generated.h b/tdeabc/vcard/include/generated/EmailParam-generated.h new file mode 100644 index 000000000..46ae1f80f --- /dev/null +++ b/tdeabc/vcard/include/generated/EmailParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +EmailParam(); +EmailParam(const EmailParam&); +EmailParam(const TQCString&); +EmailParam & operator = (EmailParam&); +EmailParam & operator = (const TQCString&); +bool operator ==(EmailParam&); +bool operator !=(EmailParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {EmailParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~EmailParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "EmailParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/FloatValue-generated.h b/tdeabc/vcard/include/generated/FloatValue-generated.h new file mode 100644 index 000000000..155f52ae1 --- /dev/null +++ b/tdeabc/vcard/include/generated/FloatValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +FloatValue(); +FloatValue(const FloatValue&); +FloatValue(const TQCString&); +FloatValue & operator = (FloatValue&); +FloatValue & operator = (const TQCString&); +bool operator ==(FloatValue&); +bool operator !=(FloatValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {FloatValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~FloatValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "FloatValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/GeoValue-generated.h b/tdeabc/vcard/include/generated/GeoValue-generated.h new file mode 100644 index 000000000..b525e8c21 --- /dev/null +++ b/tdeabc/vcard/include/generated/GeoValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +GeoValue(); +GeoValue(const GeoValue&); +GeoValue(const TQCString&); +GeoValue & operator = (GeoValue&); +GeoValue & operator = (const TQCString&); +bool operator ==(GeoValue&); +bool operator !=(GeoValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {GeoValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~GeoValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "GeoValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/Group-generated.h b/tdeabc/vcard/include/generated/Group-generated.h new file mode 100644 index 000000000..38e1c2a3a --- /dev/null +++ b/tdeabc/vcard/include/generated/Group-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +Group(); +Group(const Group&); +Group(const TQCString&); +Group & operator = (Group&); +Group & operator = (const TQCString&); +bool operator ==(Group&); +bool operator !=(Group& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {Group a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~Group(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "Group"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ImageParam-generated.h b/tdeabc/vcard/include/generated/ImageParam-generated.h new file mode 100644 index 000000000..78a5a97cf --- /dev/null +++ b/tdeabc/vcard/include/generated/ImageParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ImageParam(); +ImageParam(const ImageParam&); +ImageParam(const TQCString&); +ImageParam & operator = (ImageParam&); +ImageParam & operator = (const TQCString&); +bool operator ==(ImageParam&); +bool operator !=(ImageParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ImageParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ImageParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "ImageParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ImageValue-generated.h b/tdeabc/vcard/include/generated/ImageValue-generated.h new file mode 100644 index 000000000..882081fbc --- /dev/null +++ b/tdeabc/vcard/include/generated/ImageValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ImageValue(); +ImageValue(const ImageValue&); +ImageValue(const TQCString&); +ImageValue & operator = (ImageValue&); +ImageValue & operator = (const TQCString&); +bool operator ==(ImageValue&); +bool operator !=(ImageValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ImageValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ImageValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "ImageValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ImgParam-generated.h b/tdeabc/vcard/include/generated/ImgParam-generated.h new file mode 100644 index 000000000..04132c857 --- /dev/null +++ b/tdeabc/vcard/include/generated/ImgParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ImgParam(); +ImgParam(const ImgParam&); +ImgParam(const TQCString&); +ImgParam & operator = (ImgParam&); +ImgParam & operator = (const TQCString&); +bool operator ==(ImgParam&); +bool operator !=(ImgParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ImgParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ImgParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +virtual const char * className() const { return "ImgParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ImgValue-generated.h b/tdeabc/vcard/include/generated/ImgValue-generated.h new file mode 100644 index 000000000..0774de9bf --- /dev/null +++ b/tdeabc/vcard/include/generated/ImgValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +ImgValue(); +ImgValue(const ImgValue&); +ImgValue(const TQCString&); +ImgValue & operator = (ImgValue&); +ImgValue & operator = (const TQCString&); +bool operator ==(ImgValue&); +bool operator !=(ImgValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {ImgValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~ImgValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +virtual const char * className() const { return "ImgValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/LangValue-generated.h b/tdeabc/vcard/include/generated/LangValue-generated.h new file mode 100644 index 000000000..c4930c59e --- /dev/null +++ b/tdeabc/vcard/include/generated/LangValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +LangValue(); +LangValue(const LangValue&); +LangValue(const TQCString&); +LangValue & operator = (LangValue&); +LangValue & operator = (const TQCString&); +bool operator ==(LangValue&); +bool operator !=(LangValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {LangValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~LangValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "LangValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/NValue-generated.h b/tdeabc/vcard/include/generated/NValue-generated.h new file mode 100644 index 000000000..d78715ec0 --- /dev/null +++ b/tdeabc/vcard/include/generated/NValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +NValue(); +NValue(const NValue&); +NValue(const TQCString&); +NValue & operator = (NValue&); +NValue & operator = (const TQCString&); +bool operator ==(NValue&); +bool operator !=(NValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {NValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~NValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "NValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/Name-generated.h b/tdeabc/vcard/include/generated/Name-generated.h new file mode 100644 index 000000000..17d56e680 --- /dev/null +++ b/tdeabc/vcard/include/generated/Name-generated.h @@ -0,0 +1,22 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +V_Name(); +V_Name(const V_Name&); +V_Name(const TQCString&); +V_Name & operator = (V_Name&); +V_Name & operator = (const TQCString&); +bool operator ==(V_Name&); +bool operator !=(V_Name& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {V_Name a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~V_Name(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/OrgValue-generated.h b/tdeabc/vcard/include/generated/OrgValue-generated.h new file mode 100644 index 000000000..661ecf5a3 --- /dev/null +++ b/tdeabc/vcard/include/generated/OrgValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +OrgValue(); +OrgValue(const OrgValue&); +OrgValue(const TQCString&); +OrgValue & operator = (OrgValue&); +OrgValue & operator = (const TQCString&); +bool operator ==(OrgValue&); +bool operator !=(OrgValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {OrgValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~OrgValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "OrgValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/Param-generated.h b/tdeabc/vcard/include/generated/Param-generated.h new file mode 100644 index 000000000..bf63e7166 --- /dev/null +++ b/tdeabc/vcard/include/generated/Param-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +Param(); +Param(const Param&); +Param(const TQCString&); +Param & operator = (Param&); +Param & operator = (const TQCString&); +bool operator ==(Param&); +bool operator !=(Param& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {Param a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~Param(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "Param"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ParamName-generated.h b/tdeabc/vcard/include/generated/ParamName-generated.h new file mode 100644 index 000000000..60b1e12d5 --- /dev/null +++ b/tdeabc/vcard/include/generated/ParamName-generated.h @@ -0,0 +1,22 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +V_ParamName(); +V_ParamName(const V_ParamName&); +V_ParamName(const TQCString&); +V_ParamName & operator = (V_ParamName&); +V_ParamName & operator = (const TQCString&); +bool operator ==(V_ParamName&); +bool operator !=(V_ParamName& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {V_ParamName a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~V_ParamName(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/ParamValue-generated.h b/tdeabc/vcard/include/generated/ParamValue-generated.h new file mode 100644 index 000000000..f31a166c6 --- /dev/null +++ b/tdeabc/vcard/include/generated/ParamValue-generated.h @@ -0,0 +1,22 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +V_ParamValue(); +V_ParamValue(const V_ParamValue&); +V_ParamValue(const TQCString&); +V_ParamValue & operator = (V_ParamValue&); +V_ParamValue & operator = (const TQCString&); +bool operator ==(V_ParamValue&); +bool operator !=(V_ParamValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {V_ParamValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~V_ParamValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/PhoneNumberValue-generated.h b/tdeabc/vcard/include/generated/PhoneNumberValue-generated.h new file mode 100644 index 000000000..f0eb6b4f4 --- /dev/null +++ b/tdeabc/vcard/include/generated/PhoneNumberValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +PhoneNumberValue(); +PhoneNumberValue(const PhoneNumberValue&); +PhoneNumberValue(const TQCString&); +PhoneNumberValue & operator = (PhoneNumberValue&); +PhoneNumberValue & operator = (const TQCString&); +bool operator ==(PhoneNumberValue&); +bool operator !=(PhoneNumberValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {PhoneNumberValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~PhoneNumberValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "PhoneNumberValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/SoundValue-generated.h b/tdeabc/vcard/include/generated/SoundValue-generated.h new file mode 100644 index 000000000..64081be0b --- /dev/null +++ b/tdeabc/vcard/include/generated/SoundValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +SoundValue(); +SoundValue(const SoundValue&); +SoundValue(const TQCString&); +SoundValue & operator = (SoundValue&); +SoundValue & operator = (const TQCString&); +bool operator ==(SoundValue&); +bool operator !=(SoundValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {SoundValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~SoundValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "SoundValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/SourceParam-generated.h b/tdeabc/vcard/include/generated/SourceParam-generated.h new file mode 100644 index 000000000..e3b13bca1 --- /dev/null +++ b/tdeabc/vcard/include/generated/SourceParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +SourceParam(); +SourceParam(const SourceParam&); +SourceParam(const TQCString&); +SourceParam & operator = (SourceParam&); +SourceParam & operator = (const TQCString&); +bool operator ==(SourceParam&); +bool operator !=(SourceParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {SourceParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~SourceParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "SourceParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TelParam-generated.h b/tdeabc/vcard/include/generated/TelParam-generated.h new file mode 100644 index 000000000..9f8f24270 --- /dev/null +++ b/tdeabc/vcard/include/generated/TelParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TelParam(); +TelParam(const TelParam&); +TelParam(const TQCString&); +TelParam & operator = (TelParam&); +TelParam & operator = (const TQCString&); +bool operator ==(TelParam&); +bool operator !=(TelParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TelParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TelParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TelParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TelValue-generated.h b/tdeabc/vcard/include/generated/TelValue-generated.h new file mode 100644 index 000000000..600da7727 --- /dev/null +++ b/tdeabc/vcard/include/generated/TelValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TelValue(); +TelValue(const TelValue&); +TelValue(const TQCString&); +TelValue & operator = (TelValue&); +TelValue & operator = (const TQCString&); +bool operator ==(TelValue&); +bool operator !=(TelValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TelValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TelValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TelValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextBinParam-generated.h b/tdeabc/vcard/include/generated/TextBinParam-generated.h new file mode 100644 index 000000000..37dc56e55 --- /dev/null +++ b/tdeabc/vcard/include/generated/TextBinParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextBinParam(); +TextBinParam(const TextBinParam&); +TextBinParam(const TQCString&); +TextBinParam & operator = (TextBinParam&); +TextBinParam & operator = (const TQCString&); +bool operator ==(TextBinParam&); +bool operator !=(TextBinParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextBinParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextBinParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextBinParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextBinValue-generated.h b/tdeabc/vcard/include/generated/TextBinValue-generated.h new file mode 100644 index 000000000..4c9580421 --- /dev/null +++ b/tdeabc/vcard/include/generated/TextBinValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextBinValue(); +TextBinValue(const TextBinValue&); +TextBinValue(const TQCString&); +TextBinValue & operator = (TextBinValue&); +TextBinValue & operator = (const TQCString&); +bool operator ==(TextBinValue&); +bool operator !=(TextBinValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextBinValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextBinValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextBinValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextListValue-generated.h b/tdeabc/vcard/include/generated/TextListValue-generated.h new file mode 100644 index 000000000..8babb0d9f --- /dev/null +++ b/tdeabc/vcard/include/generated/TextListValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextListValue(); +TextListValue(const TextListValue&); +TextListValue(const TQCString&); +TextListValue & operator = (TextListValue&); +TextListValue & operator = (const TQCString&); +bool operator ==(TextListValue&); +bool operator !=(TextListValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextListValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextListValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextListValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextNSParam-generated.h b/tdeabc/vcard/include/generated/TextNSParam-generated.h new file mode 100644 index 000000000..bd8e74b07 --- /dev/null +++ b/tdeabc/vcard/include/generated/TextNSParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextNSParam(); +TextNSParam(const TextNSParam&); +TextNSParam(const TQCString&); +TextNSParam & operator = (TextNSParam&); +TextNSParam & operator = (const TQCString&); +bool operator ==(TextNSParam&); +bool operator !=(TextNSParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextNSParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextNSParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextNSParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextParam-generated.h b/tdeabc/vcard/include/generated/TextParam-generated.h new file mode 100644 index 000000000..54ae611a5 --- /dev/null +++ b/tdeabc/vcard/include/generated/TextParam-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextParam(); +TextParam(const TextParam&); +TextParam(const TQCString&); +TextParam & operator = (TextParam&); +TextParam & operator = (const TQCString&); +bool operator ==(TextParam&); +bool operator !=(TextParam& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextParam a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextParam(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextParam"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/TextValue-generated.h b/tdeabc/vcard/include/generated/TextValue-generated.h new file mode 100644 index 000000000..5b56b54a7 --- /dev/null +++ b/tdeabc/vcard/include/generated/TextValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +TextValue(); +TextValue(const TextValue&); +TextValue(const TQCString&); +TextValue & operator = (TextValue&); +TextValue & operator = (const TQCString&); +bool operator ==(TextValue&); +bool operator !=(TextValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {TextValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~TextValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "TextValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/URIValue-generated.h b/tdeabc/vcard/include/generated/URIValue-generated.h new file mode 100644 index 000000000..5a691e6d6 --- /dev/null +++ b/tdeabc/vcard/include/generated/URIValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +URIValue(); +URIValue(const URIValue&); +URIValue(const TQCString&); +URIValue & operator = (URIValue&); +URIValue & operator = (const TQCString&); +bool operator ==(URIValue&); +bool operator !=(URIValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {URIValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~URIValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "URIValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/UTCValue-generated.h b/tdeabc/vcard/include/generated/UTCValue-generated.h new file mode 100644 index 000000000..0c6edfb46 --- /dev/null +++ b/tdeabc/vcard/include/generated/UTCValue-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +UTCValue(); +UTCValue(const UTCValue&); +UTCValue(const TQCString&); +UTCValue & operator = (UTCValue&); +UTCValue & operator = (const TQCString&); +bool operator ==(UTCValue&); +bool operator !=(UTCValue& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {UTCValue a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~UTCValue(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "UTCValue"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/VCard-generated.h b/tdeabc/vcard/include/generated/VCard-generated.h new file mode 100644 index 000000000..4f36d11da --- /dev/null +++ b/tdeabc/vcard/include/generated/VCard-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +VCard(); +VCard(const VCard&); +VCard(const TQCString&); +VCard & operator = (VCard&); +VCard & operator = (const TQCString&); +bool operator ==(VCard&); +bool operator !=(VCard& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {VCard a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~VCard(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "VCard"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/VCardEntity-generated.h b/tdeabc/vcard/include/generated/VCardEntity-generated.h new file mode 100644 index 000000000..4e973e62a --- /dev/null +++ b/tdeabc/vcard/include/generated/VCardEntity-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +VCardEntity(); +VCardEntity(const VCardEntity&); +VCardEntity(const TQCString&); +VCardEntity & operator = (VCardEntity&); +VCardEntity & operator = (const TQCString&); +bool operator ==(VCardEntity&); +bool operator !=(VCardEntity& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {VCardEntity a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~VCardEntity(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "VCardEntity"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/Value-generated.h b/tdeabc/vcard/include/generated/Value-generated.h new file mode 100644 index 000000000..935d137b6 --- /dev/null +++ b/tdeabc/vcard/include/generated/Value-generated.h @@ -0,0 +1,23 @@ +// XXX Automatically generated. DO NOT EDIT! XXX // + +public: +Value(); +Value(const Value&); +Value(const TQCString&); +Value & operator = (Value&); +Value & operator = (const TQCString&); +bool operator ==(Value&); +bool operator !=(Value& x) {return !(*this==x);} +bool operator ==(const TQCString& s) {Value a(s);return(*this==a);} +bool operator != (const TQCString& s) {return !(*this == s);} + +virtual ~Value(); +void parse() {if(!parsed_) _parse();parsed_=true;assembled_=false;} + +void assemble() {if(assembled_) return;parse();_assemble();assembled_=true;} + +void _parse(); +void _assemble(); +const char * className() const { return "Value"; } + +// End of automatically generated code // diff --git a/tdeabc/vcard/include/generated/generate b/tdeabc/vcard/include/generated/generate new file mode 100755 index 000000000..926dbf136 --- /dev/null +++ b/tdeabc/vcard/include/generated/generate @@ -0,0 +1,2 @@ +#!/bin/sh +cat headerBodies | awk -f generateHeaders.awk diff --git a/tdeabc/vcard/include/generated/generateHeaders.awk b/tdeabc/vcard/include/generated/generateHeaders.awk new file mode 100755 index 000000000..471db11b4 --- /dev/null +++ b/tdeabc/vcard/include/generated/generateHeaders.awk @@ -0,0 +1,41 @@ +#!/bin/awk -f + +{ + outfile = $1 "-generated.h" + name = $1 + + OFS="" + + print "// XXX Automatically generated. DO NOT EDIT! XXX //\n" > outfile + print "// WARNING! All changes made in this file will be lost!\n" > outfile + + if ($2 == "v") { pre = "virtual " } else { pre = "" } + + print "public:" >> outfile + print name "();" >> outfile + print name "(const " name "&);" >> outfile + print name "(const QCString&);" >> outfile + print pre name " & operator = (" name "&);" >> outfile + print pre name " & operator = (const QCString&);" >> outfile + print pre "bool operator ==(" name "&);" >> outfile + print pre "bool operator !=(" name "& x) {return !(*this==x);}" \ + >> outfile + print pre "bool operator ==(const QCString& s) {" name " a(s);" \ + "return(*this==a);} " >> outfile + print pre "bool operator != (const QCString& s) {return !(*this == s);}\n" \ + >> outfile + print "virtual ~" name "();" >> outfile + print pre "void parse() " \ + "{if(!parsed_) _parse();parsed_=true;assembled_=false;}\n" \ + >> outfile + print pre "void assemble() " \ + "{if(assembled_) return;parse();_assemble();assembled_=true;}\n" \ + >> outfile + print pre "void _parse();" >> outfile + print pre "void _assemble();" >> outfile + print pre "const char * className() const { return \"" name "\"; }" \ + >> outfile + + print "\n// End of automatically generated code //" >> outfile +} + diff --git a/tdeabc/vcard/include/generated/headerBodies b/tdeabc/vcard/include/generated/headerBodies new file mode 100644 index 000000000..5e77b2b5e --- /dev/null +++ b/tdeabc/vcard/include/generated/headerBodies @@ -0,0 +1,34 @@ +AdrParam Param +AdrValue Value +AgentParam Param +ContentLine Entity +DateParam Param +DateValue Value +EmailParam Param +GeoValue Value +Group Entity +ImageParam Param +ImageValue Value +LangValue Value +NValue Value +Param Entity +PhoneNumberValue Value +SourceParam Param +TelParam Param +TextParam Param +TextNSParam Param +TextValue Value +TextBinParam Param +URIValue Value +VCard Entity +VCardEntity Entity +Value Entity +SoundValue Value +AgentValue Value +TelValue Value +TextBinValue Value +OrgValue Value +UTCValue Value +ClassValue Value +FloatValue Value +TextListValue Value diff --git a/tdeabc/vcard/testread.cpp b/tdeabc/vcard/testread.cpp new file mode 100644 index 000000000..3a33c7d54 --- /dev/null +++ b/tdeabc/vcard/testread.cpp @@ -0,0 +1,129 @@ +#include +#include +#include + +#include +#include + +#include + +using namespace std; + +int main(int argc, char * argv[]) +{ + if (argc != 2) { + cerr << "Usage: " << argv[0] << " " << endl; + exit(1); + } + + TQFile f(argv[1]); + + TQCString str; + + if (!f.open(IO_ReadOnly)) { + cerr << "Couldn't open file \"" << argv[1] << endl; + exit(1); + } + + TQTextStream t(&f); + + while (!t.eof()) + str += t.readLine().utf8() + '\n'; + + using namespace VCARD; + + // Iterate through all vCards in the file. + + cout << "--------- begin ----------" << endl; + cout << str.data(); + cout << "--------- end ----------" << endl; + + VCardEntity e(str); + + VCardListIterator it(e.cardList()); + + for (; it.current(); ++it) { + + cerr << "****************** VCARD ********************" << endl; + + // Create a vcard using the string representation. + VCard & v (*it.current()); + + if (v.has(EntityEmail)) { + cerr << "Email parameter found" << endl; + + TQCString s = v.contentLine(EntityEmail)->value()->asString(); + + cerr << "Email value == " << s << endl; + } + + if (v.has(EntityNickname)) { + cerr << "Nickname parameter found" << endl; + + cerr << "Nickname value == " << + v.contentLine(EntityNickname)->value()->asString() << + endl; + } + + if (v.has(EntityRevision)) { + + cerr << "Revision parameter found" << endl; + + DateValue * d = + (DateValue *) + v.contentLine(EntityRevision)->value(); + + assert(d != 0); + + cerr << "Revision date: " << endl; + cerr << "Day : " << d->day() << endl; + cerr << "Month : " << d->month() << endl; + cerr << "Year : " << d->year() << endl; + + if (d->hasTime()) { + cerr << "Revision date has a time component" << endl; + cerr << "Revision time: " << endl; + cerr << "Hour : " << d->hour() << endl; + cerr << "Minute : " << d->minute() << endl; + cerr << "Second : " << d->second() << endl; + + } + else cerr << "Revision date does NOT have a time component" << endl; + } + + if (v.has(EntityURL)) { + cerr << "URL Parameter found" << endl; + + cerr << "URL Value == " << + v.contentLine(EntityURL)->value()->asString() << + endl; + + URIValue * urlVal = + (URIValue *)v.contentLine(EntityURL)->value(); + + assert(urlVal != 0); + + cerr << "URL scheme == " << + urlVal->scheme() << endl; + + cerr << "URL scheme specific part == " << + urlVal->schemeSpecificPart() << endl; + } + + if (v.has(EntityN)) { + cerr << "N Parameter found" << endl; + + NValue * n = + (NValue *)(v.contentLine(EntityN)->value()); + + cerr << "Family name == " << n->family() << endl; + cerr << "Given name == " << n->given() << endl; + cerr << "Middle name == " << n->middle() << endl; + cerr << "Prefix == " << n->prefix() << endl; + cerr << "Suffix == " << n->suffix() << endl; + } + + cerr << "***************** END VCARD ******************" << endl; + } +} + diff --git a/tdeabc/vcard/testwrite.cpp b/tdeabc/vcard/testwrite.cpp new file mode 100644 index 000000000..42b76c80f --- /dev/null +++ b/tdeabc/vcard/testwrite.cpp @@ -0,0 +1,41 @@ +#include +#include +#include +#include +#include + +#include + +int main(int argc,char **argv) +{ + TDEAboutData aboutData("testwrite",I18N_NOOP("TestWritevCard"),"0.1"); + TDECmdLineArgs::init(argc,argv,&aboutData); + + TDEApplication app; + + kdDebug() << "Test Write VCard" << endl; + + using namespace VCARD; + + VCard v; + + ContentLine cl1; + cl1.setName(EntityTypeToParamName(EntityName)); + cl1.setValue(new TextValue("Hans Wurst")); + v.add(cl1); + + ContentLine cl2; + cl2.setName(EntityTypeToParamName(EntityTelephone)); + cl2.setValue(new TelValue("12345")); + ParamList p; + p.append( new TelParam("home") ); + p.append( new TelParam("fax") ); + cl2.setParamList( p ); + v.add(cl2); + + TQCString str = v.asString(); + + kdDebug() << "--- VCard begin ---" << endl + << str + << "--- VCard end ---" << endl; +} diff --git a/tdeabc/vcard/vCard-all.cpp b/tdeabc/vcard/vCard-all.cpp new file mode 100644 index 000000000..07bbcd2bb --- /dev/null +++ b/tdeabc/vcard/vCard-all.cpp @@ -0,0 +1,37 @@ +#include "AdrParam.cpp" +#include "AdrValue.cpp" +#include "AgentParam.cpp" +#include "AgentValue.cpp" +#include "ClassValue.cpp" +#include "ContentLine.cpp" +#include "DateParam.cpp" +#include "DateValue.cpp" +#include "EmailParam.cpp" +#include "Entity.cpp" +#include "Enum.cpp" +#include "FloatValue.cpp" +#include "GeoValue.cpp" +#include "ImageParam.cpp" +#include "ImageValue.cpp" +#include "ImgValue.cpp" +#include "LangValue.cpp" +#include "NValue.cpp" +#include "OrgValue.cpp" +#include "Param.cpp" +#include "PhoneNumberValue.cpp" +#include "RToken.cpp" +#include "SoundValue.cpp" +#include "SourceParam.cpp" +#include "TelParam.cpp" +#include "TelValue.cpp" +#include "TextBinParam.cpp" +#include "TextBinValue.cpp" +#include "TextListValue.cpp" +#include "TextParam.cpp" +#include "TextValue.cpp" +#include "URIValue.cpp" +#include "UTCValue.cpp" +#include "VCard.cpp" +#include "VCardEntity.cpp" +#include "Value.cpp" + diff --git a/tdeabc/vcard21parser.cpp b/tdeabc/vcard21parser.cpp new file mode 100644 index 000000000..8a3bfcaea --- /dev/null +++ b/tdeabc/vcard21parser.cpp @@ -0,0 +1,608 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Mark Westcott + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "vcard21parser.h" +#include "vcardconverter.h" + +using namespace KABC; + +bool VCardLineX::isValid() const +{ + // Invalid: if it is "begin:vcard" or "end:vcard" + if ( name == VCARD_BEGIN_N || name == VCARD_END_N ) + return false; + + if ( name[0] == 'x' && name[1] == '-' ) // A custom x- line + return true; + + // This is long but it makes it a bit faster (and saves me from using + // a tree which is probably the ideal situation, but a bit memory heavy) + switch( name[0] ) { + case 'a': + if ( name == VCARD_ADR && qualified && + (qualifiers.contains(VCARD_ADR_DOM) || + qualifiers.contains(VCARD_ADR_INTL) || + qualifiers.contains(VCARD_ADR_POSTAL) || + qualifiers.contains(VCARD_ADR_HOME) || + qualifiers.contains(VCARD_ADR_WORK) || + qualifiers.contains(VCARD_ADR_PREF) + ) ) + return true; + + if ( name == VCARD_AGENT ) + return true; + break; + + case 'b': + if ( name == VCARD_BDAY ) + return true; + break; + + case 'c': + if ( name == VCARD_CATEGORIES ) + return true; + if ( name == VCARD_CLASS && qualified && + (qualifiers.contains(VCARD_CLASS_PUBLIC) || + qualifiers.contains(VCARD_CLASS_PRIVATE) || + qualifiers.contains(VCARD_CLASS_CONFIDENTIAL) + ) ) + return true; + break; + + case 'e': + if ( name == VCARD_EMAIL && qualified && + (qualifiers.contains(VCARD_EMAIL_INTERNET) || + qualifiers.contains(VCARD_EMAIL_PREF) || + qualifiers.contains(VCARD_EMAIL_X400) + ) ) + return true; + break; + + case 'f': + if ( name == VCARD_FN ) + return true; + break; + + case 'g': + if ( name == VCARD_GEO ) + return true; + break; + + case 'k': + if ( name == VCARD_KEY && qualified && + (qualifiers.contains(VCARD_KEY_X509) || + qualifiers.contains(VCARD_KEY_PGP) + ) ) + return true; + break; + + case 'l': + if ( name == VCARD_LABEL ) + return true; + if ( name == VCARD_LOGO ) + return true; + break; + + case 'm': + if ( name == VCARD_MAILER ) + return true; + break; + + case 'n': + if ( name == VCARD_N ) + return true; + if ( name == VCARD_NAME ) + return true; + if ( name == VCARD_NICKNAME ) + return true; + if ( name == VCARD_NOTE ) + return true; + break; + + case 'o': + if ( name == VCARD_ORG ) + return true; + break; + + case 'p': + if ( name == VCARD_PHOTO ) + return true; + if ( name == VCARD_PROFILE ) + return true; + if ( name == VCARD_PRODID ) + return true; + break; + + case 'r': + if ( name == VCARD_ROLE ) + return true; + if ( name == VCARD_REV ) + return true; + break; + + case 's': + if ( name == VCARD_SOURCE ) + return true; + if ( name == VCARD_SOUND ) + return true; + break; + + case 't': + if ( name == VCARD_TEL && qualified && + (qualifiers.contains(VCARD_TEL_HOME) || + qualifiers.contains(VCARD_TEL_WORK) || + qualifiers.contains(VCARD_TEL_PREF) || + qualifiers.contains(VCARD_TEL_VOICE) || + qualifiers.contains(VCARD_TEL_FAX) || + qualifiers.contains(VCARD_TEL_MSG) || + qualifiers.contains(VCARD_TEL_CELL) || + qualifiers.contains(VCARD_TEL_PAGER) || + qualifiers.contains(VCARD_TEL_BBS) || + qualifiers.contains(VCARD_TEL_MODEM) || + qualifiers.contains(VCARD_TEL_CAR) || + qualifiers.contains(VCARD_TEL_ISDN) || + qualifiers.contains(VCARD_TEL_VIDEO) || + qualifiers.contains(VCARD_TEL_PCS) + ) ) + return true; + if ( name == VCARD_TZ ) + return true; + if ( name == VCARD_TITLE ) + return true; + break; + + case 'u': + if ( name == VCARD_URL ) + return true; + if ( name == VCARD_UID ) + return true; + break; + + case 'v': + if ( name == VCARD_VERSION ) + return true; + break; + default: + break; + } + + return false; +} + + +VCard21Parser::VCard21Parser() +{ +} + +VCard21Parser::~VCard21Parser() +{ +} + +void VCard21Parser::readFromString(KABC::AddressBook *addressbook, const TQString &data) +{ + KABC::Addressee mAddressee = readFromString(data); + addressbook->insertAddressee(mAddressee); +} + +KABC::Addressee VCard21Parser::readFromString( const TQString &data) +{ + KABC::Addressee addressee; + VCard21ParserImpl *vCard = VCard21ParserImpl::parseVCard(data); + TQString tmpStr; + + // Check if parsing failed + if (vCard == 0) + { + kdDebug() << "Parsing failed" << endl; + return addressee; + } + //set the addressees name and formated name + TQStringList tmpList = vCard->getValues(VCARD_N); + TQString formattedName = ""; + if (tmpList.count() > 0) + addressee.setFamilyName(tmpList[0]); + if (tmpList.count() > 1) + addressee.setGivenName(tmpList[1]); + if (tmpList.count() > 2) + addressee.setAdditionalName(tmpList[2]); + if (tmpList.count() > 3) + addressee.setPrefix(tmpList[3]); + if (tmpList.count() > 4) + addressee.setSuffix(tmpList[4]); + + tmpStr = (vCard->getValue(VCARD_FN)); + if (!tmpStr.isEmpty()) + addressee.setFormattedName(tmpStr); + + //set the addressee's nick name + tmpStr = vCard->getValue(VCARD_NICKNAME); + addressee.setNickName(tmpStr); + //set the addressee's organization + tmpStr = vCard->getValue(VCARD_ORG); + addressee.setOrganization(tmpStr); + //set the addressee's title + tmpStr = vCard->getValue(VCARD_TITLE); + addressee.setTitle(tmpStr); + //set the addressee's email - we can only deal with two. The preferenced one and one other. + tmpStr = vCard->getValue(VCARD_EMAIL, VCARD_EMAIL_INTERNET); + addressee.insertEmail(tmpStr, false); + tmpStr = vCard->getValue(VCARD_EMAIL,VCARD_EMAIL_PREF); + addressee.insertEmail(tmpStr, true); + //set the addressee's url + tmpStr = vCard->getValue(VCARD_URL); + if (tmpStr.isEmpty()) tmpStr = vCard->getValue(VCARD_URL, VCARD_ADR_WORK); + if (tmpStr.isEmpty()) tmpStr = vCard->getValue(VCARD_URL, VCARD_ADR_HOME); + if (!tmpStr.isEmpty()) { + addressee.setUrl(KURL(tmpStr)); + } + + //set the addressee's birthday + tmpStr = vCard->getValue(VCARD_BDAY); + addressee.setBirthday(VCardStringToDate(tmpStr)); + + //set the addressee's phone numbers + for ( TQValueListIterator i = vCard->_vcdata->begin();i != vCard->_vcdata->end(); ++i ) { + if ( (*i).name == VCARD_TEL ) { + int type = 0; + if ( (*i).qualified ) { + if ( (*i).qualifiers.contains( VCARD_TEL_HOME ) ) + type |= PhoneNumber::Home; + if ( (*i).qualifiers.contains( VCARD_TEL_WORK ) ) + type |= PhoneNumber::Work; + if ( (*i).qualifiers.contains( VCARD_TEL_PREF ) ) + type |= PhoneNumber::Pref; + // if ( (*i).qualifiers.contains( VCARD_TEL_VOICE ) ) + // type |= PhoneNumber::Voice; + if ( (*i).qualifiers.contains( VCARD_TEL_FAX ) ) + type |= PhoneNumber::Fax; + if ( (*i).qualifiers.contains( VCARD_TEL_MSG ) ) + type |= PhoneNumber::Msg; + if ( (*i).qualifiers.contains( VCARD_TEL_CELL ) ) + type |= PhoneNumber::Cell; + if ( (*i).qualifiers.contains( VCARD_TEL_PAGER ) ) + type |= PhoneNumber::Pager; + if ( (*i).qualifiers.contains( VCARD_TEL_BBS ) ) + type |= PhoneNumber::Bbs; + if ( (*i).qualifiers.contains( VCARD_TEL_MODEM ) ) + type |= PhoneNumber::Modem; + if ( (*i).qualifiers.contains( VCARD_TEL_CAR ) ) + type |= PhoneNumber::Car; + if ( (*i).qualifiers.contains( VCARD_TEL_ISDN ) ) + type |= PhoneNumber::Isdn; + if ( (*i).qualifiers.contains( VCARD_TEL_VIDEO ) ) + type |= PhoneNumber::Video; + if ( (*i).qualifiers.contains( VCARD_TEL_PCS ) ) + type |= PhoneNumber::Pcs; + } + addressee.insertPhoneNumber( PhoneNumber( (*i).parameters[ 0 ], type ) ); + } + } + + //set the addressee's addresses + for ( TQValueListIterator i = vCard->_vcdata->begin();i != vCard->_vcdata->end(); ++i ) { + if ( (*i).name == VCARD_ADR ) { + int type = 0; + if ( (*i).qualified ) { + if ( (*i).qualifiers.contains( VCARD_ADR_DOM ) ) + type |= Address::Dom; + if ( (*i).qualifiers.contains( VCARD_ADR_INTL ) ) + type |= Address::Intl; + if ( (*i).qualifiers.contains( VCARD_ADR_POSTAL ) ) + type |= Address::Postal; + if ( (*i).qualifiers.contains( VCARD_ADR_PARCEL ) ) + type |= Address::Parcel; + if ( (*i).qualifiers.contains( VCARD_ADR_HOME ) ) + type |= Address::Home; + if ( (*i).qualifiers.contains( VCARD_ADR_WORK ) ) + type |= Address::Work; + if ( (*i).qualifiers.contains( VCARD_ADR_PREF ) ) + type |= Address::Pref; + } + addressee.insertAddress( readAddressFromQStringList( (*i).parameters, type ) ); + } + } + + //set the addressee's delivery label + tmpStr = vCard->getValue(VCARD_LABEL); + if (!tmpStr.isEmpty()) { + tmpStr.replace("\r\n","\n"); + Address tmpAddress; + tmpAddress.setLabel(tmpStr); + addressee.insertAddress(tmpAddress); + } + + //set the addressee's notes + tmpStr = vCard->getValue(VCARD_NOTE); + tmpStr.replace("\r\n","\n"); + addressee.setNote(tmpStr); + + //set the addressee's timezone + tmpStr = vCard->getValue(VCARD_TZ); + TimeZone tmpZone(tmpStr.toInt()); + addressee.setTimeZone(tmpZone); + + //set the addressee's geographical position + tmpList = vCard->getValues(VCARD_GEO); + if (tmpList.count()==2) + { + tmpStr = tmpList[0]; + float glat = tmpStr.toFloat(); + tmpStr = tmpList[1]; + float glong = tmpStr.toFloat(); + Geo tmpGeo(glat,glong); + addressee.setGeo(tmpGeo); + } + + //set the last revision date + tmpStr = vCard->getValue(VCARD_REV); + addressee.setRevision(VCardStringToDate(tmpStr)); + + //set the role of the addressee + tmpStr = vCard->getValue(VCARD_ROLE); + addressee.setRole(tmpStr); + + delete vCard; + + return addressee; +} + + + +KABC::Address VCard21Parser::readAddressFromQStringList ( const TQStringList &data, const int type ) +{ + KABC::Address mAddress; + mAddress.setType( type ); + + if ( data.count() > 0 ) + mAddress.setPostOfficeBox( data[0] ); + if ( data.count() > 1 ) + mAddress.setExtended( data[1] ); + if ( data.count() > 2 ) + mAddress.setStreet( data[2] ); + if ( data.count() > 3 ) + mAddress.setLocality( data[3] ); + if ( data.count() > 4 ) + mAddress.setRegion( data[4] ); + if ( data.count() > 5 ) + mAddress.setPostalCode( data[5] ); + if ( data.count() > 6 ) + mAddress.setCountry( data[6] ); + + return mAddress; +} + + +VCard21ParserImpl *VCard21ParserImpl::parseVCard( const TQString& vc, int *err ) +{ + int _err = 0; + int _state = VC_STATE_BEGIN; + + TQValueList *vcdata; + TQValueList lines; + + vcdata = new TQValueList; + + lines = TQStringList::split( TQRegExp( "[\x0d\x0a]" ), vc ); + + // for each line in the vCard + for ( TQStringList::Iterator j = lines.begin(); j != lines.end(); ++j ) { + VCardLineX _vcl; + + // take spaces off the end - ugly but necessary hack + for ( int g = (*j).length()-1; g > 0 && (*j)[g].isSpace(); --g ) + (*j)[g] = 0; + + // first token: + // verify state, update if necessary + if ( _state & VC_STATE_BEGIN) { + if ( !tqstricmp( (*j).latin1(), VCARD_BEGIN ) ) { + _state = VC_STATE_BODY; + continue; + } else { + _err = VC_ERR_NO_BEGIN; + break; + } + } else if ( _state & VC_STATE_BODY ) { + if ( !tqstricmp( (*j).latin1(), VCARD_END ) ) { + _state |= VC_STATE_END; + break; + } + + // split into two tokens + int colon = (*j).find( ':' ); + if ( colon < 0 ) { + _err = VC_ERR_INVALID_LINE; + break; + } + + TQString key = (*j).left( colon ); + TQString value = (*j).mid( colon + 1 ); + + // check for qualifiers and + // set name, qualified, qualifier(s) + TQStringList keyTokens = TQStringList::split( ';', key ); + bool qp = false, first_pass = true; + bool b64 = false; + + if ( keyTokens.count() > 0 ) { + _vcl.qualified = false; + _vcl.name = keyTokens[ 0 ].lower(); + + for ( TQStringList::Iterator z = keyTokens.begin(); z != keyTokens.end(); ++z ) { + TQString zz = (*z).lower(); + if ( zz == VCARD_QUOTED_PRINTABLE || zz == VCARD_ENCODING_QUOTED_PRINTABLE ) { + qp = true; + } else if ( zz == VCARD_BASE64 ) { + b64 = true; + } else if ( !first_pass ) { + _vcl.qualified = true; + _vcl.qualifiers.append( zz ); + } + first_pass = false; + } + } else { + _err = VC_ERR_INVALID_LINE; + } + + if ( _err != 0 ) + break; + + if ( _vcl.name == VCARD_VERSION ) + _state |= VC_STATE_HAVE_VERSION; + + if ( _vcl.name == VCARD_N || _vcl.name == VCARD_FN ) + _state |= VC_STATE_HAVE_N; + + // second token: + // split into tokens by ; + // add to parameters vector + if ( b64 ) { + if ( value[ value.length() - 1 ] != '=' ) + do { + value += *( ++j ); + } while ( (*j)[ (*j).length() - 1 ] != '=' ); + } else { + if ( qp ) { // join any split lines + while ( value[ value.length() - 1 ] == '=' ) { + value.remove( value.length() - 1, 1 ); + value.append(*( ++j )); + } + } + _vcl.parameters = TQStringList::split( ';', value, true ); + if ( qp ) { // decode the quoted printable + for ( TQStringList::Iterator z = _vcl.parameters.begin(); z != _vcl.parameters.end(); ++z ) + *z = KCodecs::quotedPrintableDecode( TQCString((*z).latin1()) ); + } + } + } else { + _err = VC_ERR_INTERNAL; + break; + } + + // validate VCardLineX + if ( !_vcl.isValid() ) { + _err = VC_ERR_INVALID_LINE; + break; + } + + // add to vector + vcdata->append( _vcl ); + } + + // errors to check at the last minute (exit state related) + if ( _err == 0 ) { + if ( !( _state & VC_STATE_END ) ) // we have to have an end!! + _err = VC_ERR_NO_END; + + if ( !( _state & VC_STATE_HAVE_N ) || // we have to have the mandatories! + !( _state & VC_STATE_HAVE_VERSION ) ) + _err = VC_ERR_MISSING_MANDATORY; + } + + // set the error message if we can, and only return an object + // if the vCard was valid. + if ( err ) + *err = _err; + + if ( _err != 0 ) { + delete vcdata; + return 0; + } + + return new VCard21ParserImpl( vcdata ); +} + +VCard21ParserImpl::VCard21ParserImpl() + : _vcdata( 0 ) +{ +} + +VCard21ParserImpl::VCard21ParserImpl(TQValueList *_vcd) + : _vcdata(_vcd) +{ +} + +VCard21ParserImpl::~VCard21ParserImpl() +{ + delete _vcdata; + _vcdata = 0; +} + +TQString VCard21ParserImpl::getValue(const TQString& name, const TQString& qualifier) +{ + TQString failed; + const TQString lowname = name.lower(); + const TQString lowqualifier = qualifier.lower(); + + for (TQValueListIterator i = _vcdata->begin();i != _vcdata->end();++i) { + if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) { + if ((*i).parameters.count() > 0) + return (*i).parameters[0]; + else return failed; + } + } + return failed; +} + + +TQString VCard21ParserImpl::getValue(const TQString& name) +{ + TQString failed; + const TQString lowname = name.lower(); + + for (TQValueListIterator i = _vcdata->begin();i != _vcdata->end();++i) { + if ((*i).name == lowname && !(*i).qualified) { + if ((*i).parameters.count() > 0) + return (*i).parameters[0]; + else return failed; + } + } + return failed; +} + + +TQStringList VCard21ParserImpl::getValues(const TQString& name) +{ + const TQString lowname = name.lower(); + for (TQValueListIterator i = _vcdata->begin();i != _vcdata->end();++i) { + if ((*i).name == lowname && !(*i).qualified) + return (*i).parameters; + } + // failed. + return TQStringList(); +} + +TQStringList VCard21ParserImpl::getValues(const TQString& name, const TQString& qualifier) +{ + const TQString lowname = name.lower(); + const TQString lowqualifier = qualifier.lower(); + for (TQValueListIterator i = _vcdata->begin();i != _vcdata->end();++i) { + if ((*i).name == lowname && (*i).qualified && (*i).qualifiers.contains(lowqualifier)) + return (*i).parameters; + } + // failed. + return TQStringList(); +} + + diff --git a/tdeabc/vcard21parser.h b/tdeabc/vcard21parser.h new file mode 100644 index 000000000..0eb66fa93 --- /dev/null +++ b/tdeabc/vcard21parser.h @@ -0,0 +1,221 @@ +/* + This file is part of libkabc. + + Copyright (c) 2002 Mark Westcott + Copyright (c) 2000 George Staikos + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_VCARD21FORMAT_H +#define KABC_VCARD21FORMAT_H + +#include +#include +#include +#include +#include +#include + +#include "addressee.h" +#include "addressbook.h" +#include "phonenumber.h" + + +#define VCARD_BEGIN "begin:vcard" +#define VCARD_END "end:vcard" +#define VCARD_BEGIN_N "begin" +#define VCARD_END_N "end" +#define VCARD_VERSION "version" + +#define VCARD_FN "fn" +#define VCARD_N "n" + +// optional +#define VCARD_NAME "name" +#define VCARD_NICKNAME "nickname" +#define VCARD_PHOTO "photo" +#define VCARD_BDAY "bday" +#define VCARD_ADR "adr" + +// types +#define VCARD_ADR_DOM "dom" +#define VCARD_ADR_INTL "intl" +#define VCARD_ADR_POSTAL "postal" +#define VCARD_ADR_PARCEL "parcel" +#define VCARD_ADR_HOME "home" +#define VCARD_ADR_WORK "work" +#define VCARD_ADR_PREF "pref" +// values +#define VCARD_ADR_POBOX "PO Box" +#define VCARD_ADR_EXTADR "Extended Address" +#define VCARD_ADR_STREET "Street" +#define VCARD_ADR_LOCALITY "Locality" +#define VCARD_ADR_REGION "Region" +#define VCARD_ADR_POSTCODE "Postal Code" +#define VCARD_ADR_COUNTRY "Country Name" +#define VCARD_LABEL "label" +#define VCARD_PROFILE "profile" +#define VCARD_SOURCE "source" +#define VCARD_TEL "tel" +// types +#define VCARD_TEL_HOME "home" +#define VCARD_TEL_WORK "work" +#define VCARD_TEL_PREF "pref" +#define VCARD_TEL_VOICE "voice" +#define VCARD_TEL_FAX "fax" +#define VCARD_TEL_MSG "msg" +#define VCARD_TEL_CELL "cell" +#define VCARD_TEL_PAGER "pager" +#define VCARD_TEL_BBS "bbs" +#define VCARD_TEL_MODEM "modem" +#define VCARD_TEL_CAR "car" +#define VCARD_TEL_ISDN "isdn" +#define VCARD_TEL_VIDEO "video" +#define VCARD_TEL_PCS "pcs" +#define VCARD_EMAIL "email" +// types +#define VCARD_EMAIL_PREF "pref" +#define VCARD_EMAIL_INTERNET "internet" +#define VCARD_EMAIL_X400 "x400" +#define VCARD_TZ "tz" +#define VCARD_GEO "geo" +#define VCARD_MAILER "mailer" +#define VCARD_TITLE "title" +#define VCARD_ROLE "role" +#define VCARD_LOGO "logo" +#define VCARD_AGENT "agent" +#define VCARD_ORG "org" +#define VCARD_CATEGORIES "categories" +#define VCARD_NOTE "note" +#define VCARD_PRODID "prodid" +#define VCARD_REV "rev" +#define VCARD_SOUND "sound" +#define VCARD_UID "uid" +#define VCARD_URL "url" +#define VCARD_CLASS "class" +#define VCARD_CLASS_PUBLIC "public" +#define VCARD_CLASS_PRIVATE "private" +#define VCARD_CLASS_CONFIDENTIAL "confidential" +#define VCARD_KEY "key" +// types +#define VCARD_KEY_X509 "x509" +#define VCARD_KEY_PGP "pgp" + +#define VCARD_QUOTED_PRINTABLE "quoted-printable" +// this one is a temporary hack until we support TYPE=VALUE +#define VCARD_ENCODING_QUOTED_PRINTABLE "encoding=quoted-printable" +#define VCARD_BASE64 "base64" + +#define VC_STATE_BEGIN 1 +#define VC_STATE_BODY 2 +#define VC_STATE_END 4 +#define VC_STATE_HAVE_N 8 +#define VC_STATE_HAVE_VERSION 16 + +#define VC_ERR_NO_BEGIN 1 +#define VC_ERR_NO_END 2 +#define VC_ERR_INVALID_LINE 3 +#define VC_ERR_INTERNAL 4 +#define VC_ERR_INVALID_NAME 5 +#define VC_ERR_MISSING_MANDATORY 6 + +namespace KABC { + +class AddressBook; + +/** + @deprecated use VCardConverter instead. + */ +class KABC_EXPORT_DEPRECATED VCard21Parser +{ +public: + + /** + * Constructor. + */ + VCard21Parser(); + + /** + * Destructor. + */ + virtual ~VCard21Parser(); + + /** + * Parses a string in vcard2.1 format and saves the single addressees + * to the address book. + * + * @param ab The address book. + * @param str The vcard string. + */ + void readFromString( KABC::AddressBook *ab, const TQString &str ); + + /** + * FIXME: we need a writeToString method + * TQString writeToString (KABC::AddressBook *); + */ + + /** + * Parses a string in vcard2.1 format and returns the inherent addressee. + */ + KABC::Addressee readFromString( const TQString &data); + + /** + * Helper method to store a address. + * + * @param data A string list, that is filled with 'street', 'house number' ... + * @param type The type of the returned address. + */ + static KABC::Address readAddressFromQStringList (const TQStringList &data, const int type); +}; + +} + +/** + * @short Helper class + */ +class KABC_EXPORT VCardLineX +{ +public: + TQString name; + bool qualified; + TQValueList qualifiers; + TQValueList parameters; + bool isValid() const; +}; + +/** + * @short Helper class + */ +class KABC_EXPORT VCard21ParserImpl +{ + friend class VCardLineX; + +public: + VCard21ParserImpl(); + virtual ~VCard21ParserImpl(); + static VCard21ParserImpl *parseVCard(const TQString& vc, int *err = NULL); + TQString getValue(const TQString& name, const TQString& qualifier); + TQString getValue(const TQString& name); + TQStringList getValues(const TQString& name, const TQString& qualifier); + TQStringList getValues(const TQString& name); + + TQValueList *_vcdata; + +private: + VCard21ParserImpl (TQValueList *_vcd); +}; + +#endif diff --git a/tdeabc/vcardconverter.cpp b/tdeabc/vcardconverter.cpp new file mode 100644 index 000000000..d575b019c --- /dev/null +++ b/tdeabc/vcardconverter.cpp @@ -0,0 +1,129 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "vcard21parser.h" +#include "vcardformatimpl.h" +#include "vcardtool.h" + +#include "vcardconverter.h" + +using namespace KABC; + +struct VCardConverter::VCardConverterData +{ + VCard21Parser vcard21parser; + VCardFormatImpl vcard30parser; +}; + +VCardConverter::VCardConverter() + : d( new VCardConverterData ) +{ +} + +VCardConverter::~VCardConverter() +{ + delete d; + d = 0; +} + +TQString VCardConverter::createVCard( const Addressee &addr, Version version ) +{ + Addressee::List list; + list.append( addr ); + + return createVCards( list, version ); +} + +TQString VCardConverter::createVCards( Addressee::List list, Version version ) +{ + VCardTool tool; + + return tool.createVCards( list, ( version == v3_0 ? VCard::v3_0 : VCard::v2_1 ) ); +} + +Addressee VCardConverter::parseVCard( const TQString& vcard ) +{ + Addressee::List list = parseVCards( vcard ); + + return list[ 0 ]; +} + +Addressee::List VCardConverter::parseVCards( const TQString& vcard ) +{ + VCardTool tool; + + return tool.parseVCards( vcard ); +} + +// ---------------------------- deprecated stuff ---------------------------- // + +bool VCardConverter::vCardToAddressee( const TQString &str, Addressee &addr, Version version ) +{ + if ( version == v2_1 ) { + addr = d->vcard21parser.readFromString( str ); + return true; + } + + if ( version == v3_0 ) + return d->vcard30parser.readFromString( str, addr ); + + return false; +} + +bool VCardConverter::addresseeToVCard( const Addressee &addr, TQString &str, Version version ) +{ + if ( version == v2_1 ) + return false; + + if ( version == v3_0 ) + return d->vcard30parser.writeToString( addr, str ); + + return false; +} + + +/* Helper functions */ + +TQString KABC::dateToVCardString( const TQDateTime &dateTime ) +{ + return dateTime.toString("yyyyMMddThhmmssZ"); +} + +TQString KABC::dateToVCardString( const TQDate &date ) +{ + return date.toString("yyyyMMdd"); +} + +TQDateTime KABC::VCardStringToDate( const TQString &dateString ) +{ + TQDate date; + TQTime time; + TQString d( dateString ); + + d = d.remove('-').remove(':'); + + if (d.length()>=8) + date = TQDate( d.mid(0,4).toUInt(), d.mid(4,2).toUInt(), d.mid(6,2).toUInt() ); + if (d.length()>9 && d[8].upper()=='T') + time = TQTime( d.mid(9,2).toUInt(), d.mid(11,2).toUInt(), d.mid(13,2).toUInt() ); + + return TQDateTime( date, time ); +} + diff --git a/tdeabc/vcardconverter.h b/tdeabc/vcardconverter.h new file mode 100644 index 000000000..ab09279f2 --- /dev/null +++ b/tdeabc/vcardconverter.h @@ -0,0 +1,163 @@ +/* + This file is part of libkabc. + Copyright (c) 2002 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_VCARDCONVERTER_H +#define KABC_VCARDCONVERTER_H + +#include + +#include "addressee.h" + +namespace KABC { + +/** + @short Class to converting contact objects into vCard format and vice versa. + + This class implements reading and writing of contact using from/to the + vCard format. Currently vCard version 2.1 and 3.0 is supported. + + Example: + + \code + + TQFile file( "myfile.vcf" ); + file.open( IO_ReadOnly ); + + TQString data = file.readAll(); + + VCardConverter converter; + Addressee::List list = converter.parseVCards( data ); + + // print formatted name of first contact + tqDebug( "name=%s", list[ 0 ].formattedName().latin1() ); + + \endcode +*/ +class KABC_EXPORT VCardConverter +{ + public: + + /** + @li v2_1 - VCard format version 2.1 + @li v3_0 - VCard format version 3.0 + */ + enum Version + { + v2_1, + v3_0 + }; + + /** + Constructor. + */ + VCardConverter(); + + /** + Destructor. + */ + ~VCardConverter(); + + /** + Creates a string in vCard format which contains the given + contact. + + @param addr The contact object + @param version The version of the generated vCard format + */ + TQString createVCard( const Addressee &addr, Version version = v3_0 ); + + /** + Creates a string in vCard format which contains the given + list of contact. + + @param list The list of contact objects + @param version The version of the generated vCard format + */ + // FIXME: Add error handling + TQString createVCards( Addressee::List list, Version version = v3_0 ); + + // FIXME: Add "createVCards( AddressBook * )" + + /** + Parses a string in vCard format and returns the first contact. + */ + Addressee parseVCard( const TQString& vcard ); + + /** + Parses a string in vCard format and returns a list of contact objects. + */ + // FIXME: Add error handling + Addressee::List parseVCards( const TQString& vcard ); + + // FIXME: Add "bool parseVCards( AddressBook *, const TQString &vcard )" + + /** + @deprecated + */ + bool vCardToAddressee( const TQString&, Addressee &, Version version = v3_0 ) KDE_DEPRECATED; + + /** + @deprecated + */ + bool addresseeToVCard( const Addressee&, TQString&, Version version = v3_0 ) KDE_DEPRECATED; + + private: + /** + Split a string and replaces escaped separators on the fly with + unescaped ones. + */ + TQStringList splitString( const TQChar &sep, const TQString &value ); + + struct VCardConverterData; + VCardConverterData *d; +}; + + +/** + Helper functions + */ + +/** + * Converts a TQDateTime to a date string as it is used in VCard and LDIF files. + * The return value is in the form "yyyyMMddThhmmssZ" (e.g. "20031201T120000Z") + * @param dateTime date and time to be converted + * @since 3.2 + */ +KABC_EXPORT TQString dateToVCardString( const TQDateTime &dateTime ); + +/** + * Converts a TQDate to a short date string as it is used in VCard and LDIF files. + * The return value is in the form "yyyyMMdd" (e.g. "20031201") + * @param date date to be converted + * @since 3.2 + */ +KABC_EXPORT TQString dateToVCardString( const TQDate &date ); + +/** + * Converts a date string as it is used in VCard and LDIF files to a TQDateTime value. + * If the date string does not contain a time value, it will be returned as 00:00:00. + * (e.g. "20031201T120000" will return a TQDateTime for 2003-12-01 at 12:00) + * @param dateString string representing the date and time. + * @since 3.2 + */ +KABC_EXPORT TQDateTime VCardStringToDate( const TQString &dateString ); + +} +#endif diff --git a/tdeabc/vcardformat.cpp b/tdeabc/vcardformat.cpp new file mode 100644 index 000000000..147aa4259 --- /dev/null +++ b/tdeabc/vcardformat.cpp @@ -0,0 +1,59 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "vcardformatimpl.h" + +#include "vcardformat.h" + +using namespace KABC; + +VCardFormat::VCardFormat() +{ + mImpl = new VCardFormatImpl; +} + +VCardFormat::~VCardFormat() +{ + delete mImpl; +} + +bool VCardFormat::load( AddressBook *addressBook, const TQString &fileName ) +{ + TQFile f( fileName ); + if ( !f.open( IO_ReadOnly ) ) return false; + + bool result = mImpl->loadAll( addressBook, 0, &f ); + + f.close(); + + return result; +} + +bool VCardFormat::save( AddressBook *addressBook, const TQString &fileName ) +{ + TQFile f( fileName ); + if ( !f.open( IO_WriteOnly ) ) return false; + + mImpl->saveAll( addressBook, 0, &f ); + + f.close(); + + return true; +} diff --git a/tdeabc/vcardformat.h b/tdeabc/vcardformat.h new file mode 100644 index 000000000..8194056cb --- /dev/null +++ b/tdeabc/vcardformat.h @@ -0,0 +1,49 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#ifndef KABC_VCARDFORMAT_H +#define KABC_VCARDFORMAT_H + +#include + +#include "format.h" + +namespace KABC { + +class AddressBook; +class VCardFormatImpl; + +/** + @deprecated use VCardFormatPlugin instead. + */ +class KABC_EXPORT_DEPRECATED VCardFormat : public Format { + public: + VCardFormat(); + virtual ~VCardFormat(); + + bool load( AddressBook *, const TQString &fileName ); + bool save( AddressBook *, const TQString &fileName ); + + private: + VCardFormatImpl *mImpl; +}; + +} + +#endif diff --git a/tdeabc/vcardformatimpl.cpp b/tdeabc/vcardformatimpl.cpp new file mode 100644 index 000000000..c0d39bb95 --- /dev/null +++ b/tdeabc/vcardformatimpl.cpp @@ -0,0 +1,1001 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ +#include +#include + +#include +#include +#include +#include + +#include + +#include "addressbook.h" +#include "vcardformatimpl.h" + +using namespace KABC; +using namespace VCARD; + +bool VCardFormatImpl::load( Addressee &addressee, TQFile *file ) +{ + kdDebug(5700) << "VCardFormat::load()" << endl; + + TQByteArray fdata = file->readAll(); + TQCString data(fdata.data(), fdata.size()+1); + + VCardEntity e( data ); + + VCardListIterator it( e.cardList() ); + + if ( it.current() ) { + VCARD::VCard v(*it.current()); + loadAddressee( addressee, v ); + return true; + } + + return false; +} + +bool VCardFormatImpl::loadAll( AddressBook *addressBook, Resource *resource, TQFile *file ) +{ + kdDebug(5700) << "VCardFormat::loadAll()" << endl; + + TQByteArray fdata = file->readAll(); + TQCString data(fdata.data(), fdata.size()+1); + + VCardEntity e( data ); + + VCardListIterator it( e.cardList() ); + + for (; it.current(); ++it) { + VCARD::VCard v(*it.current()); + Addressee addressee; + loadAddressee( addressee, v ); + addressee.setResource( resource ); + addressBook->insertAddressee( addressee ); + } + + return true; +} + +void VCardFormatImpl::save( const Addressee &addressee, TQFile *file ) +{ + VCardEntity vcards; + VCardList vcardlist; + vcardlist.setAutoDelete( true ); + + VCARD::VCard *v = new VCARD::VCard; + + saveAddressee( addressee, v, false ); + + vcardlist.append( v ); + vcards.setCardList( vcardlist ); + + TQCString vcardData = vcards.asString(); + file->writeBlock( (const char*)vcardData, vcardData.length() ); +} + +void VCardFormatImpl::saveAll( AddressBook *ab, Resource *resource, TQFile *file ) +{ + VCardEntity vcards; + VCardList vcardlist; + vcardlist.setAutoDelete( true ); + + AddressBook::Iterator it; + for ( it = ab->begin(); it != ab->end(); ++it ) { + if ( (*it).resource() == resource ) { + VCARD::VCard *v = new VCARD::VCard; + saveAddressee( (*it), v, false ); + (*it).setChanged( false ); + vcardlist.append( v ); + } + } + + vcards.setCardList( vcardlist ); + + TQCString vcardData = vcards.asString(); + file->writeBlock( (const char*)vcardData, vcardData.length() ); +} + +bool VCardFormatImpl::loadAddressee( Addressee& addressee, VCARD::VCard &v ) +{ + TQPtrList contentLines = v.contentLineList(); + ContentLine *cl; + + for( cl = contentLines.first(); cl; cl = contentLines.next() ) { + TQCString n = cl->name(); + if ( n.left( 2 ) == "X-" ) { + n = n.mid( 2 ); + int posDash = n.find( "-" ); + addressee.insertCustom( TQString::fromUtf8( n.left( posDash ) ), + TQString::fromUtf8( n.mid( posDash + 1 ) ), + TQString::fromUtf8( cl->value()->asString() ) ); + continue; + } + + EntityType type = cl->entityType(); + switch( type ) { + + case EntityUID: + addressee.setUid( readTextValue( cl ) ); + break; + + case EntityURI: + addressee.setUri( readTextValue( cl ) ); + break; + + case EntityEmail: + addressee.insertEmail( readTextValue( cl ) ); + break; + + case EntityName: + addressee.setName( readTextValue( cl ) ); + break; + + case EntityFullName: + addressee.setFormattedName( readTextValue( cl ) ); + break; + + case EntityURL: + addressee.setUrl( KURL( readTextValue( cl ) ) ); + break; + + case EntityNickname: + addressee.setNickName( readTextValue( cl ) ); + break; + + case EntityLabel: + // not yet supported by kabc + break; + + case EntityMailer: + addressee.setMailer( readTextValue( cl ) ); + break; + + case EntityTitle: + addressee.setTitle( readTextValue( cl ) ); + break; + + case EntityRole: + addressee.setRole( readTextValue( cl ) ); + break; + + case EntityOrganisation: + addressee.setOrganization( readTextValue( cl ) ); + break; + + case EntityNote: + addressee.setNote( readTextValue( cl ) ); + break; + + case EntityProductID: + addressee.setProductId( readTextValue( cl ) ); + break; + + case EntitySortString: + addressee.setSortString( readTextValue( cl ) ); + break; + + case EntityN: + readNValue( cl, addressee ); + break; + + case EntityAddress: + addressee.insertAddress( readAddressValue( cl ) ); + break; + + case EntityTelephone: + addressee.insertPhoneNumber( readTelephoneValue( cl ) ); + break; + + case EntityCategories: + addressee.setCategories( TQStringList::split( ",", readTextValue( cl ) ) ); + break; + + case EntityBirthday: + addressee.setBirthday( readDateValue( cl ) ); + break; + + case EntityRevision: + addressee.setRevision( readDateTimeValue( cl ) ); + break; + + case EntityGeo: + addressee.setGeo( readGeoValue( cl ) ); + break; + + case EntityTimeZone: + addressee.setTimeZone( readUTCValue( cl ) ); + break; + + case EntityVersion: + break; + + case EntityClass: + addressee.setSecrecy( readClassValue( cl ) ); + break; + + case EntityKey: + addressee.insertKey( readKeyValue( cl ) ); + break; + + case EntityPhoto: + addressee.setPhoto( readPictureValue( cl, EntityPhoto, addressee ) ); + break; + + case EntityLogo: + addressee.setLogo( readPictureValue( cl, EntityLogo, addressee ) ); + break; + + case EntityAgent: + addressee.setAgent( readAgentValue( cl ) ); + break; + + case EntitySound: + addressee.setSound( readSoundValue( cl, addressee ) ); + break; + + default: + kdDebug(5700) << "VCardFormat::load(): Unsupported entity: " + << int( type ) << ": " << cl->asString() << endl; + break; + } + } + + for( cl = contentLines.first(); cl; cl = contentLines.next() ) { + EntityType type = cl->entityType(); + if ( type == EntityLabel ) { + int type = readAddressParam( cl ); + Address address = addressee.address( type ); + if ( address.isEmpty() ) + address.setType( type ); + + address.setLabel( TQString::fromUtf8( cl->value()->asString() ) ); + addressee.insertAddress( address ); + } + } + + return true; +} + +void VCardFormatImpl::saveAddressee( const Addressee &addressee, VCARD::VCard *v, bool intern ) +{ + ContentLine cl; + TQString value; + + addTextValue( v, EntityName, addressee.name() ); + addTextValue( v, EntityUID, addressee.uid() ); + addTextValue( v, EntityURI, addressee.uri() ); + addTextValue( v, EntityFullName, addressee.formattedName() ); + + TQStringList emails = addressee.emails(); + TQStringList::ConstIterator it4; + for( it4 = emails.begin(); it4 != emails.end(); ++it4 ) { + addTextValue( v, EntityEmail, *it4 ); + } + + TQStringList customs = addressee.customs(); + TQStringList::ConstIterator it5; + for( it5 = customs.begin(); it5 != customs.end(); ++it5 ) { + addCustomValue( v, *it5 ); + } + + addTextValue( v, EntityURL, addressee.url().url() ); + + addNValue( v, addressee ); + + addTextValue( v, EntityNickname, addressee.nickName() ); + addTextValue( v, EntityMailer, addressee.mailer() ); + addTextValue( v, EntityTitle, addressee.title() ); + addTextValue( v, EntityRole, addressee.role() ); + addTextValue( v, EntityOrganisation, addressee.organization() ); + addTextValue( v, EntityNote, addressee.note() ); + addTextValue( v, EntityProductID, addressee.productId() ); + addTextValue( v, EntitySortString, addressee.sortString() ); + + Address::List addresses = addressee.addresses(); + Address::List::ConstIterator it3; + for( it3 = addresses.begin(); it3 != addresses.end(); ++it3 ) { + addAddressValue( v, *it3 ); + addLabelValue( v, *it3 ); + } + + PhoneNumber::List phoneNumbers = addressee.phoneNumbers(); + PhoneNumber::List::ConstIterator it2; + for( it2 = phoneNumbers.begin(); it2 != phoneNumbers.end(); ++it2 ) { + addTelephoneValue( v, *it2 ); + } + + Key::List keys = addressee.keys(); + Key::List::ConstIterator it6; + for( it6 = keys.begin(); it6 != keys.end(); ++it6 ) { + addKeyValue( v, *it6 ); + } + + addTextValue( v, EntityCategories, addressee.categories().join(",") ); + + addDateValue( v, EntityBirthday, TQT_TQDATE_OBJECT(addressee.birthday().date()) ); + addDateTimeValue( v, EntityRevision, TQT_TQDATETIME_OBJECT(addressee.revision()) ); + addGeoValue( v, addressee.geo() ); + addUTCValue( v, addressee.timeZone() ); + + addClassValue( v, addressee.secrecy() ); + + addPictureValue( v, EntityPhoto, addressee.photo(), addressee, intern ); + addPictureValue( v, EntityLogo, addressee.logo(), addressee, intern ); + + addAgentValue( v, addressee.agent() ); + + addSoundValue( v, addressee.sound(), addressee, intern ); +} + +void VCardFormatImpl::addCustomValue( VCARD::VCard *v, const TQString &txt ) +{ + if ( txt.isEmpty() ) return; + + ContentLine cl; + cl.setName( "X-" + txt.left( txt.find( ":" ) ).utf8() ); + TQString value = txt.mid( txt.find( ":" ) + 1 ); + if ( value.isEmpty() ) + return; + cl.setValue( new TextValue( value.utf8() ) ); + v->add(cl); +} + +void VCardFormatImpl::addTextValue( VCARD::VCard *v, EntityType type, const TQString &txt ) +{ + if ( txt.isEmpty() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( type ) ); + cl.setValue( new TextValue( txt.utf8() ) ); + v->add(cl); +} + +void VCardFormatImpl::addDateValue( VCARD::VCard *vcard, EntityType type, + const TQDate &date ) +{ + if ( !date.isValid() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( type ) ); + + DateValue *v = new DateValue( date ); + cl.setValue( v ); + vcard->add(cl); +} + +void VCardFormatImpl::addDateTimeValue( VCARD::VCard *vcard, EntityType type, + const TQDateTime &dateTime ) +{ + if ( !dateTime.isValid() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( type ) ); + + DateValue *v = new DateValue( dateTime ); + cl.setValue( v ); + vcard->add(cl); +} + +void VCardFormatImpl::addAddressValue( VCARD::VCard *vcard, const Address &a ) +{ + if ( a.isEmpty() ) + return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityAddress ) ); + + AdrValue *v = new AdrValue; + v->setPOBox( a.postOfficeBox().utf8() ); + v->setExtAddress( a.extended().utf8() ); + v->setStreet( a.street().utf8() ); + v->setLocality( a.locality().utf8() ); + v->setRegion( a.region().utf8() ); + v->setPostCode( a.postalCode().utf8() ); + v->setCountryName( a.country().utf8() ); + cl.setValue( v ); + + addAddressParam( &cl, a.type() ); + + vcard->add( cl ); +} + +void VCardFormatImpl::addLabelValue( VCARD::VCard *vcard, const Address &a ) +{ + if ( a.label().isEmpty() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityLabel ) ); + cl.setValue( new TextValue( a.label().utf8() ) ); + + addAddressParam( &cl, a.type() ); + + vcard->add( cl ); +} + +void VCardFormatImpl::addAddressParam( ContentLine *cl, int type ) +{ + ParamList params; + if ( type & Address::Dom ) params.append( new Param( "TYPE", "dom" ) ); + if ( type & Address::Intl ) params.append( new Param( "TYPE", "intl" ) ); + if ( type & Address::Parcel ) params.append( new Param( "TYPE", "parcel" ) ); + if ( type & Address::Postal ) params.append( new Param( "TYPE", "postal" ) ); + if ( type & Address::Work ) params.append( new Param( "TYPE", "work" ) ); + if ( type & Address::Home ) params.append( new Param( "TYPE", "home" ) ); + if ( type & Address::Pref ) params.append( new Param( "TYPE", "pref" ) ); + cl->setParamList( params ); +} + +void VCardFormatImpl::addGeoValue( VCARD::VCard *vcard, const Geo &geo ) +{ + if ( !geo.isValid() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityGeo ) ); + + GeoValue *v = new GeoValue; + v->setLatitude( geo.latitude() ); + v->setLongitude( geo.longitude() ); + + cl.setValue( v ); + vcard->add(cl); +} + +void VCardFormatImpl::addUTCValue( VCARD::VCard *vcard, const TimeZone &tz ) +{ + if ( !tz.isValid() ) return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityTimeZone ) ); + + UTCValue *v = new UTCValue; + + v->setPositive( tz.offset() >= 0 ); + v->setHour( (tz.offset() / 60) * ( tz.offset() >= 0 ? 1 : -1 ) ); + v->setMinute( (tz.offset() % 60) * ( tz.offset() >= 0 ? 1 : -1 ) ); + + cl.setValue( v ); + vcard->add(cl); +} + +void VCardFormatImpl::addClassValue( VCARD::VCard *vcard, const Secrecy &secrecy ) +{ + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityClass ) ); + + ClassValue *v = new ClassValue; + switch ( secrecy.type() ) { + case Secrecy::Public: + v->setType( (int)ClassValue::Public ); + break; + case Secrecy::Private: + v->setType( (int)ClassValue::Private ); + break; + case Secrecy::Confidential: + v->setType( (int)ClassValue::Confidential ); + break; + } + + cl.setValue( v ); + vcard->add(cl); +} + + +Address VCardFormatImpl::readAddressValue( ContentLine *cl ) +{ + Address a; + AdrValue *v = (AdrValue *)cl->value(); + a.setPostOfficeBox( TQString::fromUtf8( v->poBox() ) ); + a.setExtended( TQString::fromUtf8( v->extAddress() ) ); + a.setStreet( TQString::fromUtf8( v->street() ) ); + a.setLocality( TQString::fromUtf8( v->locality() ) ); + a.setRegion( TQString::fromUtf8( v->region() ) ); + a.setPostalCode( TQString::fromUtf8( v->postCode() ) ); + a.setCountry( TQString::fromUtf8( v->countryName() ) ); + + a.setType( readAddressParam( cl ) ); + + return a; +} + +int VCardFormatImpl::readAddressParam( ContentLine *cl ) +{ + int type = 0; + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "TYPE" ) { + if ( (*it)->value() == "dom" ) type |= Address::Dom; + else if ( (*it)->value() == "intl" ) type |= Address::Intl; + else if ( (*it)->value() == "parcel" ) type |= Address::Parcel; + else if ( (*it)->value() == "postal" ) type |= Address::Postal; + else if ( (*it)->value() == "work" ) type |= Address::Work; + else if ( (*it)->value() == "home" ) type |= Address::Home; + else if ( (*it)->value() == "pref" ) type |= Address::Pref; + } + } + return type; +} + +void VCardFormatImpl::addNValue( VCARD::VCard *vcard, const Addressee &a ) +{ + ContentLine cl; + cl.setName(EntityTypeToParamName( EntityN ) ); + NValue *v = new NValue; + v->setFamily( TQString(a.familyName()).utf8() ); + v->setGiven( TQString(a.givenName()).utf8() ); + v->setMiddle( TQString(a.additionalName()).utf8() ); + v->setPrefix( TQString(a.prefix()).utf8() ); + v->setSuffix( TQString(a.suffix()).utf8() ); + + cl.setValue( v ); + vcard->add(cl); +} + +void VCardFormatImpl::readNValue( ContentLine *cl, Addressee &a ) +{ + NValue *v = (NValue *)cl->value(); + a.setFamilyName( TQString::fromUtf8( v->family() ) ); + a.setGivenName( TQString::fromUtf8( v->given() ) ); + a.setAdditionalName( TQString::fromUtf8( v->middle() ) ); + a.setPrefix( TQString::fromUtf8( v->prefix() ) ); + a.setSuffix( TQString::fromUtf8( v->suffix() ) ); +} + +void VCardFormatImpl::addTelephoneValue( VCARD::VCard *v, const PhoneNumber &p ) +{ + if ( p.number().isEmpty() ) + return; + + ContentLine cl; + cl.setName(EntityTypeToParamName(EntityTelephone)); + cl.setValue(new TelValue( p.number().utf8() )); + + ParamList params; + if( p.type() & PhoneNumber::Home ) params.append( new Param( "TYPE", "home" ) ); + if( p.type() & PhoneNumber::Work ) params.append( new Param( "TYPE", "work" ) ); + if( p.type() & PhoneNumber::Msg ) params.append( new Param( "TYPE", "msg" ) ); + if( p.type() & PhoneNumber::Pref ) params.append( new Param( "TYPE", "pref" ) ); + if( p.type() & PhoneNumber::Voice ) params.append( new Param( "TYPE", "voice" ) ); + if( p.type() & PhoneNumber::Fax ) params.append( new Param( "TYPE", "fax" ) ); + if( p.type() & PhoneNumber::Cell ) params.append( new Param( "TYPE", "cell" ) ); + if( p.type() & PhoneNumber::Video ) params.append( new Param( "TYPE", "video" ) ); + if( p.type() & PhoneNumber::Bbs ) params.append( new Param( "TYPE", "bbs" ) ); + if( p.type() & PhoneNumber::Modem ) params.append( new Param( "TYPE", "modem" ) ); + if( p.type() & PhoneNumber::Car ) params.append( new Param( "TYPE", "car" ) ); + if( p.type() & PhoneNumber::Isdn ) params.append( new Param( "TYPE", "isdn" ) ); + if( p.type() & PhoneNumber::Pcs ) params.append( new Param( "TYPE", "pcs" ) ); + if( p.type() & PhoneNumber::Pager ) params.append( new Param( "TYPE", "pager" ) ); + cl.setParamList( params ); + + v->add(cl); +} + +PhoneNumber VCardFormatImpl::readTelephoneValue( ContentLine *cl ) +{ + PhoneNumber p; + TelValue *value = (TelValue *)cl->value(); + p.setNumber( TQString::fromUtf8( value->asString() ) ); + + int type = 0; + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "TYPE" ) { + if ( (*it)->value() == "home" ) type |= PhoneNumber::Home; + else if ( (*it)->value() == "work" ) type |= PhoneNumber::Work; + else if ( (*it)->value() == "msg" ) type |= PhoneNumber::Msg; + else if ( (*it)->value() == "pref" ) type |= PhoneNumber::Pref; + else if ( (*it)->value() == "voice" ) type |= PhoneNumber::Voice; + else if ( (*it)->value() == "fax" ) type |= PhoneNumber::Fax; + else if ( (*it)->value() == "cell" ) type |= PhoneNumber::Cell; + else if ( (*it)->value() == "video" ) type |= PhoneNumber::Video; + else if ( (*it)->value() == "bbs" ) type |= PhoneNumber::Bbs; + else if ( (*it)->value() == "modem" ) type |= PhoneNumber::Modem; + else if ( (*it)->value() == "car" ) type |= PhoneNumber::Car; + else if ( (*it)->value() == "isdn" ) type |= PhoneNumber::Isdn; + else if ( (*it)->value() == "pcs" ) type |= PhoneNumber::Pcs; + else if ( (*it)->value() == "pager" ) type |= PhoneNumber::Pager; + } + } + p.setType( type ); + + return p; +} + +TQString VCardFormatImpl::readTextValue( ContentLine *cl ) +{ + VCARD::Value *value = cl->value(); + if ( value ) { + return TQString::fromUtf8( value->asString() ); + } else { + kdDebug(5700) << "No value: " << cl->asString() << endl; + return TQString::null; + } +} + +TQDate VCardFormatImpl::readDateValue( ContentLine *cl ) +{ + DateValue *dateValue = (DateValue *)cl->value(); + if ( dateValue ) + return dateValue->qdate(); + else + return TQDate(); +} + +TQDateTime VCardFormatImpl::readDateTimeValue( ContentLine *cl ) +{ + DateValue *dateValue = (DateValue *)cl->value(); + if ( dateValue ) + return dateValue->qdt(); + else + return TQDateTime(); +} + +Geo VCardFormatImpl::readGeoValue( ContentLine *cl ) +{ + GeoValue *geoValue = (GeoValue *)cl->value(); + if ( geoValue ) { + Geo geo( geoValue->latitude(), geoValue->longitude() ); + return geo; + } else + return Geo(); +} + +TimeZone VCardFormatImpl::readUTCValue( ContentLine *cl ) +{ + UTCValue *utcValue = (UTCValue *)cl->value(); + if ( utcValue ) { + TimeZone tz; + tz.setOffset(((utcValue->hour()*60)+utcValue->minute())*(utcValue->positive() ? 1 : -1)); + return tz; + } else + return TimeZone(); +} + +Secrecy VCardFormatImpl::readClassValue( ContentLine *cl ) +{ + ClassValue *classValue = (ClassValue *)cl->value(); + if ( classValue ) { + Secrecy secrecy; + switch ( classValue->type() ) { + case ClassValue::Public: + secrecy.setType( Secrecy::Public ); + break; + case ClassValue::Private: + secrecy.setType( Secrecy::Private ); + break; + case ClassValue::Confidential: + secrecy.setType( Secrecy::Confidential ); + break; + } + + return secrecy; + } else + return Secrecy(); +} + +void VCardFormatImpl::addKeyValue( VCARD::VCard *vcard, const Key &key ) +{ + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityKey ) ); + + ParamList params; + if ( key.isBinary() ) { + cl.setValue( new TextValue( KCodecs::base64Encode( key.binaryData() ) ) ); + params.append( new Param( "ENCODING", "b" ) ); + } else { + cl.setValue( new TextValue( key.textData().utf8() ) ); + } + + switch ( key.type() ) { + case Key::X509: + params.append( new Param( "TYPE", "X509" ) ); + break; + case Key::PGP: + params.append( new Param( "TYPE", "PGP" ) ); + break; + case Key::Custom: + params.append( new Param( "TYPE", key.customTypeString().utf8() ) ); + break; + } + + cl.setParamList( params ); + vcard->add( cl ); +} + +Key VCardFormatImpl::readKeyValue( VCARD::ContentLine *cl ) +{ + Key key; + bool isBinary = false; + TextValue *v = (TextValue *)cl->value(); + + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) + isBinary = true; + if ( (*it)->name() == "TYPE" ) { + if ( (*it)->value().isEmpty() ) + continue; + if ( (*it)->value() == "X509" ) + key.setType( Key::X509 ); + else if ( (*it)->value() == "PGP" ) + key.setType( Key::PGP ); + else { + key.setType( Key::Custom ); + key.setCustomTypeString( TQString::fromUtf8( (*it)->value() ) ); + } + } + } + + + if ( isBinary ) { + TQByteArray data; + KCodecs::base64Decode( v->asString().stripWhiteSpace(), data ); + key.setBinaryData( data ); + } else { + key.setTextData( TQString::fromUtf8( v->asString() ) ); + } + + return key; +} + + +void VCardFormatImpl::addAgentValue( VCARD::VCard *vcard, const Agent &agent ) +{ + if ( agent.isIntern() && !agent.addressee() ) + return; + + if ( !agent.isIntern() && agent.url().isEmpty() ) + return; + + ContentLine cl; + cl.setName( EntityTypeToParamName( EntityAgent ) ); + + ParamList params; + if ( agent.isIntern() ) { + TQString vstr; + Addressee *addr = agent.addressee(); + if ( addr ) { + writeToString( (*addr), vstr ); + vstr.replace( ":", "\\:" ); + vstr.replace( ",", "\\," ); + vstr.replace( ";", "\\;" ); + vstr.replace( "\r\n", "\\n" ); + cl.setValue( new TextValue( vstr.utf8() ) ); + } else + return; + } else { + cl.setValue( new TextValue( agent.url().utf8() ) ); + params.append( new Param( "VALUE", "uri" ) ); + } + + cl.setParamList( params ); + vcard->add( cl ); +} + +Agent VCardFormatImpl::readAgentValue( VCARD::ContentLine *cl ) +{ + Agent agent; + bool isIntern = true; + TextValue *v = (TextValue *)cl->value(); + + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "VALUE" && (*it)->value() == "uri" ) + isIntern = false; + } + + if ( isIntern ) { + TQString vstr = TQString::fromUtf8( v->asString() ); + vstr.replace( "\\n", "\r\n" ); + vstr.replace( "\\:", ":" ); + vstr.replace( "\\,", "," ); + vstr.replace( "\\;", ";" ); + Addressee *addr = new Addressee; + readFromString( vstr, *addr ); + agent.setAddressee( addr ); + } else { + agent.setUrl( TQString::fromUtf8( v->asString() ) ); + } + + return agent; +} + +void VCardFormatImpl::addPictureValue( VCARD::VCard *vcard, VCARD::EntityType type, const Picture &pic, const Addressee &addr, bool intern ) +{ + ContentLine cl; + cl.setName( EntityTypeToParamName( type ) ); + + if ( pic.isIntern() && pic.data().isNull() ) + return; + + if ( !pic.isIntern() && pic.url().isEmpty() ) + return; + + ParamList params; + if ( pic.isIntern() ) { + TQImage img = pic.data(); + if ( intern ) { // only for vCard export we really write the data inline + TQByteArray data; + TQDataStream s( data, IO_WriteOnly ); + s.setVersion( 4 ); // to produce valid png files + s << img; + cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); + } else { // save picture in cache + TQString dir; + if ( type == EntityPhoto ) + dir = "photos"; + if ( type == EntityLogo ) + dir = "logos"; + + img.save( locateLocal( "data", "tdeabc/" + dir + "/" + addr.uid() ), pic.type().utf8() ); + cl.setValue( new TextValue( "" ) ); + } + params.append( new Param( "ENCODING", "b" ) ); + if ( !pic.type().isEmpty() ) + params.append( new Param( "TYPE", pic.type().utf8() ) ); + } else { + cl.setValue( new TextValue( pic.url().utf8() ) ); + params.append( new Param( "VALUE", "uri" ) ); + } + + cl.setParamList( params ); + vcard->add( cl ); +} + +Picture VCardFormatImpl::readPictureValue( VCARD::ContentLine *cl, VCARD::EntityType type, const Addressee &addr ) +{ + Picture pic; + bool isInline = false; + TQString picType; + TextValue *v = (TextValue *)cl->value(); + + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) + isInline = true; + if ( (*it)->name() == "TYPE" && !(*it)->value().isEmpty() ) + picType = TQString::fromUtf8( (*it)->value() ); + } + + if ( isInline ) { + TQImage img; + if ( v->asString() == "" ) { // no picture inline stored => picture is in cache + TQString dir; + if ( type == EntityPhoto ) + dir = "photos"; + if ( type == EntityLogo ) + dir = "logos"; + + img.load( locateLocal( "data", "tdeabc/" + dir + "/" + addr.uid() ) ); + } else { + TQByteArray data; + KCodecs::base64Decode( v->asString(), data ); + img.loadFromData( data ); + } + pic.setData( img ); + pic.setType( picType ); + } else { + pic.setUrl( TQString::fromUtf8( v->asString() ) ); + } + + return pic; +} + +void VCardFormatImpl::addSoundValue( VCARD::VCard *vcard, const Sound &sound, const Addressee &addr, bool intern ) +{ + ContentLine cl; + cl.setName( EntityTypeToParamName( EntitySound ) ); + + if ( sound.isIntern() && sound.data().isNull() ) + return; + + if ( !sound.isIntern() && sound.url().isEmpty() ) + return; + + ParamList params; + if ( sound.isIntern() ) { + TQByteArray data = sound.data(); + if ( intern ) { // only for vCard export we really write the data inline + cl.setValue( new TextValue( KCodecs::base64Encode( data ) ) ); + } else { // save sound in cache + TQFile file( locateLocal( "data", "tdeabc/sounds/" + addr.uid() ) ); + if ( file.open( IO_WriteOnly ) ) { + file.writeBlock( data ); + } + cl.setValue( new TextValue( "" ) ); + } + params.append( new Param( "ENCODING", "b" ) ); + } else { + cl.setValue( new TextValue( sound.url().utf8() ) ); + params.append( new Param( "VALUE", "uri" ) ); + } + + cl.setParamList( params ); + vcard->add( cl ); +} + +Sound VCardFormatImpl::readSoundValue( VCARD::ContentLine *cl, const Addressee &addr ) +{ + Sound sound; + bool isInline = false; + TextValue *v = (TextValue *)cl->value(); + + ParamList params = cl->paramList(); + ParamListIterator it( params ); + for( ; it.current(); ++it ) { + if ( (*it)->name() == "ENCODING" && (*it)->value() == "b" ) + isInline = true; + } + + if ( isInline ) { + TQByteArray data; + if ( v->asString() == "" ) { // no sound inline stored => sound is in cache + TQFile file( locateLocal( "data", "tdeabc/sounds/" + addr.uid() ) ); + if ( file.open( IO_ReadOnly ) ) { + data = file.readAll(); + file.close(); + } + } else { + KCodecs::base64Decode( v->asString(), data ); + } + sound.setData( data ); + } else { + sound.setUrl( TQString::fromUtf8( v->asString() ) ); + } + + return sound; +} + +bool VCardFormatImpl::readFromString( const TQString &vcard, Addressee &addressee ) +{ + VCardEntity e( vcard.utf8() ); + VCardListIterator it( e.cardList() ); + + if ( it.current() ) { + VCARD::VCard v(*it.current()); + loadAddressee( addressee, v ); + return true; + } + + return false; +} + +bool VCardFormatImpl::writeToString( const Addressee &addressee, TQString &vcard ) +{ + VCardEntity vcards; + VCardList vcardlist; + vcardlist.setAutoDelete( true ); + + VCARD::VCard *v = new VCARD::VCard; + + saveAddressee( addressee, v, true ); + + vcardlist.append( v ); + vcards.setCardList( vcardlist ); + vcard = TQString::fromUtf8( vcards.asString() ); + + return true; +} diff --git a/tdeabc/vcardformatimpl.h b/tdeabc/vcardformatimpl.h new file mode 100644 index 000000000..78c466a86 --- /dev/null +++ b/tdeabc/vcardformatimpl.h @@ -0,0 +1,106 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_VCARDFORMATIMPL_H +#define KABC_VCARDFORMATIMPL_H + +#include +#include + +#include "address.h" +#include "addressee.h" + +#ifdef __CYGWIN__ +#include +#else +#include +#endif + +namespace KABC { + +class AddressBook; + +/** + @deprecated use VCardFormatPlugin instead. + */ +class KABC_EXPORT_DEPRECATED VCardFormatImpl +{ + public: + bool load( Addressee &, TQFile *file ); + bool loadAll( AddressBook *, Resource *, TQFile *file ); + void save( const Addressee &, TQFile *file ); + void saveAll( AddressBook *, Resource *, TQFile *file ); + + bool readFromString( const TQString &vcard, Addressee &addr ); + bool writeToString( const Addressee &addressee, TQString &vcard ); + + protected: + bool loadAddressee( Addressee &, VCARD::VCard & ); + void saveAddressee( const Addressee &, VCARD::VCard *, bool intern ); + + void addTextValue (VCARD::VCard *, VCARD::EntityType, const TQString & ); + TQString readTextValue( VCARD::ContentLine * ); + + void addDateValue( VCARD::VCard *, VCARD::EntityType, const TQDate & ); + TQDate readDateValue( VCARD::ContentLine * ); + + void addDateTimeValue( VCARD::VCard *, VCARD::EntityType, const TQDateTime & ); + TQDateTime readDateTimeValue( VCARD::ContentLine * ); + + void addAddressValue( VCARD::VCard *, const Address & ); + Address readAddressValue( VCARD::ContentLine * ); + + void addLabelValue( VCARD::VCard *, const Address & ); + + void addTelephoneValue( VCARD::VCard *, const PhoneNumber & ); + PhoneNumber readTelephoneValue( VCARD::ContentLine * ); + + void addNValue( VCARD::VCard *, const Addressee & ); + void readNValue( VCARD::ContentLine *, Addressee & ); + + void addCustomValue( VCARD::VCard *, const TQString & ); + + void addAddressParam( VCARD::ContentLine *, int ); + int readAddressParam( VCARD::ContentLine * ); + + void addGeoValue( VCARD::VCard *, const Geo & ); + Geo readGeoValue( VCARD::ContentLine * ); + + void addUTCValue( VCARD::VCard *, const TimeZone & ); + TimeZone readUTCValue( VCARD::ContentLine * ); + + void addClassValue( VCARD::VCard *, const Secrecy & ); + Secrecy readClassValue( VCARD::ContentLine * ); + + void addKeyValue( VCARD::VCard *, const Key & ); + Key readKeyValue( VCARD::ContentLine * ); + + void addPictureValue( VCARD::VCard *, VCARD::EntityType, const Picture &, const Addressee &, bool ); + Picture readPictureValue( VCARD::ContentLine *, VCARD::EntityType, const Addressee &addr ); + + void addSoundValue( VCARD::VCard *, const Sound &, const Addressee &, bool ); + Sound readSoundValue( VCARD::ContentLine *, const Addressee &addr ); + + void addAgentValue( VCARD::VCard *, const Agent & ); + Agent readAgentValue( VCARD::ContentLine * ); +}; + +} +#endif diff --git a/tdeabc/vcardformatplugin.cpp b/tdeabc/vcardformatplugin.cpp new file mode 100644 index 000000000..6194cd0fe --- /dev/null +++ b/tdeabc/vcardformatplugin.cpp @@ -0,0 +1,120 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include + +#include "address.h" +#include "addressee.h" +#include "vcardconverter.h" + +#include "vcardformatplugin.h" + +using namespace KABC; + +VCardFormatPlugin::VCardFormatPlugin() +{ +} + +VCardFormatPlugin::~VCardFormatPlugin() +{ +} + +bool VCardFormatPlugin::load( Addressee &addressee, TQFile *file ) +{ + TQString data; + + TQTextStream t( file ); + t.setEncoding( TQTextStream::Latin1 ); + data = t.read(); + + VCardConverter converter; + Addressee::List l = converter.parseVCards( data ); + + if ( ! l.first().isEmpty() ) { + addressee = l.first(); + return true; + } + + return false; +} + +bool VCardFormatPlugin::loadAll( AddressBook*, Resource *resource, TQFile *file ) +{ + TQString data; + + TQTextStream t( file ); + t.setEncoding( TQTextStream::Latin1 ); + data = t.read(); + + VCardConverter converter; + + Addressee::List l = converter.parseVCards( data ); + + Addressee::List::iterator itr; + for ( itr = l.begin(); itr != l.end(); ++itr) { + Addressee addressee = *itr; + addressee.setResource( resource ); + addressee.setChanged( false ); + resource->insertAddressee( addressee ); + } + + return true; +} + +void VCardFormatPlugin::save( const Addressee &addressee, TQFile *file ) +{ + VCardConverter converter ; + Addressee::List vcardlist; + + + vcardlist.append( addressee ); + + TQTextStream t( file ); + t.setEncoding( TQTextStream::UnicodeUTF8 ); + t << converter.createVCards( vcardlist ); +} + +void VCardFormatPlugin::saveAll( AddressBook*, Resource *resource, TQFile *file ) +{ + VCardConverter converter; + Addressee::List vcardlist; + + Resource::Iterator it; + for ( it = resource->begin(); it != resource->end(); ++it ) { + (*it).setChanged( false ); + vcardlist.append( *it ); + } + + TQTextStream t( file ); + t.setEncoding( TQTextStream::UnicodeUTF8 ); + t << converter.createVCards( vcardlist ); +} + +bool VCardFormatPlugin::checkFormat( TQFile *file ) const +{ + TQString line; + + file->readLine( line, 1024 ); + line = line.stripWhiteSpace(); + if ( line == "BEGIN:VCARD" ) + return true; + else + return false; +} diff --git a/tdeabc/vcardformatplugin.h b/tdeabc/vcardformatplugin.h new file mode 100644 index 000000000..5ac7e49c2 --- /dev/null +++ b/tdeabc/vcardformatplugin.h @@ -0,0 +1,56 @@ +/* + This file is part of libkabc. + Copyright (c) 2001 Cornelius Schumacher + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_VCARDFORMATPLUGIN_H +#define KABC_VCARDFORMATPLUGIN_H + +#include "formatplugin.h" + +namespace KABC { + +class AddressBook; +class Addressee; + +/** + @short Interface of vCard backend for address book. + + This class implements the file format interface of address book entries for + the vCard format. +*/ +class KABC_EXPORT VCardFormatPlugin : public FormatPlugin +{ + public: + VCardFormatPlugin(); + virtual ~VCardFormatPlugin(); + + bool load( Addressee &, TQFile *file ); + bool loadAll( AddressBook *, Resource *, TQFile *file ); + void save( const Addressee &, TQFile *file ); + void saveAll( AddressBook *, Resource *, TQFile *file ); + + bool checkFormat( TQFile *file ) const; + + private: + struct VCardFormatPrivate; + VCardFormatPrivate *d; +}; + +} +#endif diff --git a/tdeabc/vcardparser/CMakeLists.txt b/tdeabc/vcardparser/CMakeLists.txt new file mode 100644 index 000000000..2c6fa112a --- /dev/null +++ b/tdeabc/vcardparser/CMakeLists.txt @@ -0,0 +1,40 @@ +################################################# +# +# (C) 2010 Serghei Amelian +# serghei (DOT) amelian (AT) gmail.com +# +# Improvements and feedback are welcome +# +# This file is released under GPL >= 2 +# +################################################# + +include_directories( + ${TQT_INCLUDE_DIRS} + ${CMAKE_BINARY_DIR}/tdecore + ${CMAKE_SOURCE_DIR}/tdecore +) + +link_directories( + ${TQT_LIBRARY_DIRS} +) + + +##### headers ################################### + +install( FILES + vcard.h vcardline.h vcardparser.h + DESTINATION ${INCLUDE_INSTALL_DIR}/kabc ) + + +##### vcards #################################### + +set( target vcards ) + +set( ${target}_SRCS + vcard.cpp vcardline.cpp vcardparser.cpp +) + +tde_add_library( ${target} STATIC_PIC + SOURCES ${${target}_SRCS} +) diff --git a/tdeabc/vcardparser/Makefile.am b/tdeabc/vcardparser/Makefile.am new file mode 100644 index 000000000..a855c9756 --- /dev/null +++ b/tdeabc/vcardparser/Makefile.am @@ -0,0 +1,31 @@ +INCLUDES = -I$(top_builddir)/kabc -I$(top_srcdir)/kabc $(all_includes) + +noinst_LTLIBRARIES = libvcards.la +libvcards_la_SOURCES = vcard.cpp vcardline.cpp vcardparser.cpp + +vcardsincludedir = $(includedir)/kabc +vcardsinclude_HEADERS = vcard.h vcardline.h vcardparser.h + +check_PROGRAMS = testread testwrite testread2 + +testread_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testread_LDADD = libvcards.la $(top_builddir)/tdeabc/libkabc.la +testread_SOURCES = testread.cpp + +testread2_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testread2_LDADD = libvcards.la $(top_builddir)/tdeabc/libkabc.la +testread2_SOURCES = testread2.cpp testutils.cpp + +testwrite_LDFLAGS = $(all_libraries) $(KDE_RPATH) $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) -ltdefx $(LIB_KIO) -ltdetexteditor +testwrite_LDADD = libvcards.la $(top_builddir)/tdeabc/libkabc.la +testwrite_SOURCES = testwrite.cpp + +TESTFILES = vcard1.vcf vcard2.vcf vcard3.vcf vcard4.vcf vcard6.vcf vcard7.vcf + +check-local: testread + rm -f FAILED; \ + for i in $(TESTFILES); \ + do perl $(top_srcdir)/tdeabc/vcardparser/checkvcard.pl \ + $(top_srcdir)/tdeabc/vcardparser/tests/$$i; \ + done; \ + [ ! -e FAILED ] diff --git a/tdeabc/vcardparser/README.testing b/tdeabc/vcardparser/README.testing new file mode 100644 index 000000000..a7794931d --- /dev/null +++ b/tdeabc/vcardparser/README.testing @@ -0,0 +1,15 @@ +For testing the vcardparser there are some test files and a small testsuite +automatically checking for regressions. The tests directory contains some vCard +files and correpsonding reference output files (with an additional ".ref" +suffix). For running the geression test do "make check". This will compile some +test programs, parse the test files, write them out as vCard again and compare +the output to the reference file. The check fails, if there are unexpected +differences and shows which lines differed. + +For creating a new test put a vCard file to be parsed into the tests directory. +Create a reference file by running "testread" on the test file. It will put out +the parsed data as vCard again on stdout. Carefully check the output, manually +correct any errors and save the result as reference file in the tests directory. +Now add the filename to the TESTFILES variable in Makefile.am and run "make +check". If the check fails adapt the reference file or fix the bugs in the +parser, whatever is appropriate. diff --git a/tdeabc/vcardparser/checkvcard.pl b/tdeabc/vcardparser/checkvcard.pl new file mode 100755 index 000000000..67160ea4a --- /dev/null +++ b/tdeabc/vcardparser/checkvcard.pl @@ -0,0 +1,75 @@ +#!/usr/bin/perl + +if ( @ARGV != 1 ) { + print STDERR "Missing arg: filename\n"; + exit 1; +} + +$file = $ARGV[0]; + +if ( !open( IN, "$file" ) ) { + print STDERR "Unable to open '$file'\n"; + exit 1; +} + +while( ) { + if (/^VERSION:(.*)$/ ) { + $version = $1; + if ( $version eq "2.1" ) { $options = "--vcard21"; } + } +} + +close IN; + +$ref = "$file.ref"; + +if ( !open( REF, "$ref" ) ) { + print STDERR "Unable to open $ref\n"; + exit 1; +} + +while( ) { + push @ref, $_; +} + +close REF; + +if ( !open( READ, "./testread $file $options 2> /dev/null |" ) ) { + print STDERR "Unable to open testread\n"; + exit 1; +} + +print "Checking '$file':\n"; + +$gotsomething = 0; +$error = 0; +$i = 0; +while( ) { + $gotsomething = 1; + $out = $_; + $ref = @ref[$i++]; + + if ( $out ne $ref ) { + if ( $ref =~ /^UID/ && $out =~ /^UID/ ) { next; } + $error++; + print " Expected : $ref"; + print " Parser output : $out"; + } +} + +close READ; + +if ( $gotsomething == 0 ) { + print "\n FAILED: testread didn't output anything\n"; + system "touch FAILED"; + exit 1; +} +if ( $error > 0 ) { + print "\n FAILED: $error errors found.\n"; + system "touch FAILED"; + exit 1; +} else { + print " OK\n"; +} + +exit 0; diff --git a/tdeabc/vcardparser/testread.cpp b/tdeabc/vcardparser/testread.cpp new file mode 100644 index 000000000..fd3524b56 --- /dev/null +++ b/tdeabc/vcardparser/testread.cpp @@ -0,0 +1,89 @@ +/* + This file is part of libkabc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include + +#include "vcardconverter.h" +#include "vcard.h" + +static const TDECmdLineOptions options[] = +{ + {"vcard21", I18N_NOOP("vCard 2.1"), 0}, + {"+inputfile", I18N_NOOP("Input file"), 0}, + TDECmdLineLastOption +}; + +int main( int argc, char **argv ) +{ + TDEApplication::disableAutoDcopRegistration(); + + TDEAboutData aboutData( "testread", "vCard test reader", "0.1" ); + aboutData.addAuthor( "Cornelius Schumacher", 0, "schumacher@kde.org" ); + + TDECmdLineArgs::init( argc, argv, &aboutData ); + TDECmdLineArgs::addCmdLineOptions( options ); + + TDEApplication app( false, false ); + + TDECmdLineArgs *args = TDECmdLineArgs::parsedArgs(); + + if ( args->count() != 1 ) { + std::cerr << "Missing argument" << std::endl; + return 1; + } + + TQString inputFile( args->arg( 0 ) ); + + TQFile file( inputFile ); + if ( !file.open( IO_ReadOnly ) ) { + tqDebug( "Unable to open file '%s' for reading!", file.name().latin1() ); + return 1; + } + + TQString text; + + TQTextStream s( &file ); + s.setEncoding( TQTextStream::Latin1 ); + text = s.read(); + file.close(); + + KABC::VCardConverter converter; + KABC::Addressee::List list = converter.parseVCards( text ); + + if ( args->isSet( "vcard21" ) ) { + text = converter.createVCards( list, KABC::VCardConverter::v2_1 ); // uses version 2.1 + } else { + text = converter.createVCards( list ); // uses version 3.0 + } + + std::cout << text.utf8(); + + return 0; +} diff --git a/tdeabc/vcardparser/testread2.cpp b/tdeabc/vcardparser/testread2.cpp new file mode 100644 index 000000000..ea278602c --- /dev/null +++ b/tdeabc/vcardparser/testread2.cpp @@ -0,0 +1,42 @@ +#include "testutils.h" +#include +#include +#include + +using namespace KABC; + +int +main() +{ + Addressee::List l = vCardsAsAddresseeList(); + TQString vcards = vCardsAsText(); + + VCardConverter vct; + + Addressee::List parsed = vct.parseVCards( vcards ); + + if ( l.size() != parsed.size() ) { + kdDebug()<<"\tSize - FAILED : "< +#include +#include + +using namespace KABC; + +Addressee +vcard1() +{ + Addressee addr; + + addr.setName( "Frank Dawson" ); + addr.setOrganization( "Lotus Development Corporation" ); + addr.setUrl( KURL( "http://home.earthlink.net/~fdawson") ); + addr.insertEmail( "fdawson@earthlink.net" ); + addr.insertEmail( "Frank_Dawson@Lotus.com", true ); + addr.insertPhoneNumber( PhoneNumber("+1-919-676-9515",PhoneNumber::Voice|PhoneNumber::Msg + |PhoneNumber::Work ) ); + addr.insertPhoneNumber( PhoneNumber("+1-919-676-9564",PhoneNumber::Fax |PhoneNumber::Work )); + Address a( Address::Work | Address::Postal | Address::Parcel ); + a.setStreet( "6544 Battleford Drive" ); + a.setLocality( "Raleigh" ); + a.setRegion( "NC" ); + a.setPostalCode( "27613-3502" ); + a.setCountry( "U.S.A." ); + addr.insertAddress( a ); + return addr; +} + +Addressee +vcard2() +{ + Addressee addr; + + addr.setName( "Tim Howes" ); + addr.setOrganization( "Netscape Communications Corp." ); + addr.insertEmail( "howes@netscape.com" ); + addr.insertPhoneNumber( PhoneNumber("+1-415-937-3419",PhoneNumber::Voice|PhoneNumber::Msg + |PhoneNumber::Work) ); + addr.insertPhoneNumber( PhoneNumber("+1-415-528-4164",PhoneNumber::Fax |PhoneNumber::Work) ); + Address a( Address::Work ); + a.setStreet( "501 E. Middlefield Rd." ); + a.setLocality( "Mountain View" ); + a.setRegion( "CA" ); + a.setPostalCode( "94043" ); + a.setCountry( "U.S.A." ); + addr.insertAddress( a ); + return addr; +} + +Addressee +vcard3() +{ + Addressee addr; + + addr.setName( "ian geiser" ); + addr.setOrganization( "Source eXtreme" ); + addr.insertEmail( "geiseri@yahoo.com" ); + addr.setTitle( "VP of Engineering" ); + return addr; +} + + +QString +vcardAsText( const TQString& location ) +{ + TQString line; + TQFile file( location ); + if ( file.open( IO_ReadOnly ) ) { + TQTextStream stream( &file ); + if ( !stream.eof() ) { + line = stream.read(); + } + file.close(); + } + return line; +} + +Addressee::List +vCardsAsAddresseeList() +{ + Addressee::List l; + + l.append( vcard1() ); + l.append( vcard2() ); + l.append( vcard3() ); + + return l; +} + +QString +vCardsAsText() +{ + TQString vcards = vcardAsText( "tests/vcard1.vcf" ); + vcards += vcardAsText( "tests/vcard2.vcf" ); + vcards += vcardAsText( "tests/vcard3.vcf" ); + + return vcards; +} diff --git a/tdeabc/vcardparser/testutils.h b/tdeabc/vcardparser/testutils.h new file mode 100644 index 000000000..c8218b7ba --- /dev/null +++ b/tdeabc/vcardparser/testutils.h @@ -0,0 +1,14 @@ +#ifndef TESTUTILS_H +#define TESTUTILS_H + +#include +#include + +KABC::Addressee vcard1(); +KABC::Addressee vcard2(); +KABC::Addressee vcard3(); +KABC::Addressee::List vCardsAsAddresseeList(); +TQString vCardAsText( const TQString& location ); +TQString vCardsAsText(); + +#endif diff --git a/tdeabc/vcardparser/testwrite.cpp b/tdeabc/vcardparser/testwrite.cpp new file mode 100644 index 000000000..e40ffe4d0 --- /dev/null +++ b/tdeabc/vcardparser/testwrite.cpp @@ -0,0 +1,134 @@ +/* + This file is part of libkabc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include "vcardconverter.h" + +int main( int argc, char **argv ) +{ + TDEAboutData aboutData( "testwrite", "vCard test writer", "0.1" ); + + TDECmdLineArgs::init( argc, argv, &aboutData ); + + TDEApplication app( false, false ); + + + KABC::Addressee addressee; + + addressee.setNameFromString( "Mr. Tobias Koenig Jr." ); + addressee.setNickName( "tokoe" ); + addressee.setBirthday( TQDate( 1982, 7, 19 ) ); + addressee.setMailer( "mutt1.2" ); + addressee.setTimeZone( KABC::TimeZone( +2 ) ); + + KABC::Geo geo; + geo.setLatitude( 30 ); + geo.setLongitude( 51 ); + addressee.setGeo( geo ); + + addressee.setTitle( "nerd" ); + addressee.setRole( "Maintainer" ); + addressee.setOrganization( "KDE" ); + addressee.setNote( "nerver\ntouch a running system" ); + addressee.setProductId( "testId" ); + addressee.setRevision( TQDateTime::currentDateTime() ); + addressee.setSortString( "koenig" ); + addressee.setUrl( KURL( "http://wgess16.dyndns.org") ); + addressee.setSecrecy( KABC::Secrecy( KABC::Secrecy::Confidential ) ); +/* + TQImage img; + img.load( "testimg.png", "PNG" ); + KABC::Picture photo; + photo.setData( img ); + addressee.setPhoto( photo ); + + TQImage img2; + img2.load( "testimg.png", "PNG" ); + KABC::Picture logo; + logo.setData( img2 ); + addressee.setLogo( logo ); + + TQFile soundFile( "testsound.wav" ); + soundFile.open( IO_ReadOnly ); + TQByteArray data = soundFile.readAll(); + soundFile.close(); + KABC::Sound sound; + sound.setData( data ); + addressee.setSound( sound ); +*/ + addressee.insertEmail( "tokoe@kde.org", true ); + addressee.insertEmail( "tokoe82@yahoo.de", true ); + + KABC::PhoneNumber phone1( "3541523475", KABC::PhoneNumber::Pref | KABC::PhoneNumber::Home ); + KABC::PhoneNumber phone2( "+46745673475", KABC::PhoneNumber::Work ); + addressee.insertPhoneNumber( phone1 ); + addressee.insertPhoneNumber( phone2 ); + + KABC::Key key( "secret key", KABC::Key::X509 ); + addressee.insertKey( key ); + + TQStringList categories; + categories << "Friends" << "School" << "KDE"; + addressee.setCategories( categories ); + + KABC::Address a( KABC::Address::Work | KABC::Address::Postal | KABC::Address::Parcel ); + a.setStreet( "6544 Battleford Drive" ); + a.setLocality( "Raleigh" ); + a.setRegion( "NC" ); + a.setPostalCode( "27613-3502" ); + a.setCountry( "U.S.A." ); + addressee.insertAddress( a ); + + addressee.insertCustom( "1hsdf", "ertuer", "iurt" ); + addressee.insertCustom( "2hsdf", "ertuer", "iurt" ); + addressee.insertCustom( "3hsdf", "ertuer", "iurt" ); + + KABC::Addressee::List list; + for ( int i = 0; i < 1000; ++i ) { + KABC::Addressee addr = addressee; + addr.setUid( TQString::number( i ) ); + list.append( addr ); + } + + KABC::VCardConverter converter; + TQString txt = converter.createVCards( list ); + + TQFile file( "out.vcf" ); + file.open( IO_WriteOnly ); + + TQTextStream s( &file ); + s.setEncoding( TQTextStream::UnicodeUTF8 ); + s << txt; + file.close(); + + return 0; +} diff --git a/tdeabc/vcardparser/vcard.cpp b/tdeabc/vcardparser/vcard.cpp new file mode 100644 index 000000000..30a8e1c49 --- /dev/null +++ b/tdeabc/vcardparser/vcard.cpp @@ -0,0 +1,109 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "vcard.h" + +using namespace KABC; + +VCard::VCard() +{ +} + +VCard::VCard( const VCard& vcard ) +{ + mLineMap = vcard.mLineMap; +} + +VCard::~VCard() +{ +} + +VCard& VCard::operator=( const VCard& vcard ) +{ + if ( &vcard == this ) + return *this; + + mLineMap = vcard.mLineMap; + + return *this; +} + +void VCard::clear() +{ + mLineMap.clear(); +} + +TQStringList VCard::identifiers() const +{ + return mLineMap.keys(); +} + +void VCard::addLine( const VCardLine& line ) +{ + mLineMap[ line.identifier() ].append( line ); +} + +VCardLine::List VCard::lines( const TQString& identifier ) const +{ + LineMap::ConstIterator it = mLineMap.find( identifier ); + if ( it == mLineMap.end() ) + return VCardLine::List(); + + return *it; +} + +VCardLine VCard::line( const TQString& identifier ) const +{ + LineMap::ConstIterator it = mLineMap.find( identifier ); + if ( it == mLineMap.end() ) + return VCardLine(); + + if ( (*it).isEmpty() ) + return VCardLine(); + else + return (*it).first(); +} + +void VCard::setVersion( Version version ) +{ + mLineMap.erase( "VERSION" ); + + VCardLine line; + line.setIdentifier( "VERSION" ); + if ( version == v2_1 ) + line.setIdentifier( "2.1" ); + else if ( version == v3_0 ) + line.setIdentifier( "3.0" ); + + mLineMap[ "VERSION" ].append( line ); +} + +VCard::Version VCard::version() const +{ + LineMap::ConstIterator versionEntry = mLineMap.find( "VERSION" ); + if ( versionEntry == mLineMap.end() ) + return v3_0; + + VCardLine line = ( *versionEntry )[ 0 ]; + if ( line.value() == "2.1" ) + return v2_1; + else + return v3_0; +} diff --git a/tdeabc/vcardparser/vcard.h b/tdeabc/vcardparser/vcard.h new file mode 100644 index 000000000..6afeeda26 --- /dev/null +++ b/tdeabc/vcardparser/vcard.h @@ -0,0 +1,91 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef VCARDPARSER_VCARD_H +#define VCARDPARSER_VCARD_H + +#include "vcardline.h" +#include +#include +#include + +namespace KABC { + +class VCard +{ + public: + typedef TQValueList List; + typedef TQMap< TQString, VCardLine::List > LineMap; + + enum Version { v2_1, v3_0 }; + + VCard(); + VCard( const VCard& ); + + ~VCard(); + + VCard& operator=( const VCard& ); + + /** + * Removes all lines from the vCard. + */ + void clear(); + + /** + * Returns a list of all identifiers that exists in the + * vCard. + */ + TQStringList identifiers() const; + + /** + * Adds a VCardLine to the VCard + */ + void addLine( const VCardLine& line ); + + /** + * Returns all lines of the vcard with a special identifier. + */ + VCardLine::List lines( const TQString& identifier ) const; + + /** + * Returns only the first line of the vcard with a special identifier. + */ + VCardLine line( const TQString& identifier ) const; + + /** + * Set the version of the vCard. + */ + void setVersion( Version version ); + + /** + * Returns the version of this vCard. + */ + Version version() const; + + private: + LineMap mLineMap; + + class VCardPrivate; + VCardPrivate *d; +}; + +} + +#endif diff --git a/tdeabc/vcardparser/vcardline.cpp b/tdeabc/vcardparser/vcardline.cpp new file mode 100644 index 000000000..6680cf7d0 --- /dev/null +++ b/tdeabc/vcardparser/vcardline.cpp @@ -0,0 +1,151 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include "vcardline.h" + +using namespace KABC; + +class VCardLine::VCardLinePrivate +{ + public: + TQString mGroup; +}; + +VCardLine::VCardLine() + : d( 0 ) +{ +} + +VCardLine::VCardLine( const TQString &identifier ) + : d( 0 ) +{ + mIdentifier = identifier; +} + +VCardLine::VCardLine( const TQString &identifier, const TQVariant &value ) + : d( 0 ) +{ + mIdentifier = identifier; + mValue = value; +} + +VCardLine::VCardLine( const VCardLine& line ) + : d( 0 ) +{ + mParamMap = line.mParamMap; + mValue = line.mValue; + mIdentifier = line.mIdentifier; +} + +VCardLine::~VCardLine() +{ + delete d; + d = 0; +} + +VCardLine& VCardLine::operator=( const VCardLine& line ) +{ + if ( &line == this ) + return *this; + + mParamMap = line.mParamMap; + mValue = line.mValue; + mIdentifier = line.mIdentifier; + + return *this; +} + +void VCardLine::setIdentifier( const TQString& identifier ) +{ + mIdentifier = identifier; +} + +TQString VCardLine::identifier() const +{ + return mIdentifier; +} + +void VCardLine::setValue( const TQVariant& value ) +{ + mValue = value; +} + +TQVariant VCardLine::value() const +{ + return mValue; +} + +void VCardLine::setGroup( const TQString& group ) +{ + if ( !d ) + d = new VCardLinePrivate(); + + d->mGroup = group; +} + +TQString VCardLine::group() const +{ + if ( d ) + return d->mGroup; + else + return TQString(); +} + +bool VCardLine::hasGroup() const +{ + if ( !d ) + return false; + else + return d->mGroup.isEmpty(); +} + +TQStringList VCardLine::parameterList() const +{ + return mParamMap.keys(); +} + +void VCardLine::addParameter( const TQString& param, const TQString& value ) +{ + TQStringList &list = mParamMap[ param ]; + if ( list.findIndex( value ) == -1 ) // not included yet + list.append( value ); +} + +TQStringList VCardLine::parameters( const TQString& param ) const +{ + ParamMap::ConstIterator it = mParamMap.find( param ); + if ( it == mParamMap.end() ) + return TQStringList(); + else + return *it; +} + +TQString VCardLine::parameter( const TQString& param ) const +{ + ParamMap::ConstIterator it = mParamMap.find( param ); + if ( it == mParamMap.end() ) + return TQString::null; + else { + if ( (*it).isEmpty() ) + return TQString::null; + else + return (*it).first(); + } +} diff --git a/tdeabc/vcardparser/vcardline.h b/tdeabc/vcardparser/vcardline.h new file mode 100644 index 000000000..92fe743f6 --- /dev/null +++ b/tdeabc/vcardparser/vcardline.h @@ -0,0 +1,115 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef VCARDLINE_H +#define VCARDLINE_H + +#include +#include +#include +#include +#include + +namespace KABC { + +class VCardLine +{ + public: + typedef TQValueList List; + typedef TQMap ParamMap; + + VCardLine(); + VCardLine( const TQString &identifier ); + VCardLine( const TQString &identifier, const TQVariant &value ); + VCardLine( const VCardLine& ); + + ~VCardLine(); + + VCardLine& operator=( const VCardLine& ); + + /** + * Sets the identifier of this line e.g. UID, FN, CLASS + */ + void setIdentifier( const TQString& identifier ); + + /** + * Returns the identifier of this line. + */ + TQString identifier() const; + + /** + * Sets the value of of this line. + */ + void setValue( const TQVariant& value ); + + /** + * Returns the value of this line. + */ + TQVariant value() const; + + /** + * Sets the group the line belongs to. + */ + void setGroup( const TQString& group ); + + /** + * Returns the group the line belongs to. + */ + TQString group() const; + + /** + * Returns whether the line belongs to a group. + */ + bool hasGroup() const; + + /** + * Returns all parameters. + */ + TQStringList parameterList() const; + + /** + * Add a new parameter to the line. + */ + void addParameter( const TQString& param, const TQString& value ); + + /** + * Returns the values of a special parameter. + * You can get a list of all parameters with paramList(). + */ + TQStringList parameters( const TQString& param ) const; + + /** + * Returns only the first value of a special parameter. + * You can get a list of all parameters with paramList(). + */ + TQString parameter( const TQString& param ) const; + + private: + ParamMap mParamMap; + TQString mIdentifier; + TQVariant mValue; + + class VCardLinePrivate; + VCardLinePrivate *d; +}; + +} + +#endif diff --git a/tdeabc/vcardparser/vcardparser.cpp b/tdeabc/vcardparser/vcardparser.cpp new file mode 100644 index 000000000..aed9ebd39 --- /dev/null +++ b/tdeabc/vcardparser/vcardparser.cpp @@ -0,0 +1,297 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include + +#include + +#include "vcardparser.h" + +#define FOLD_WIDTH 75 + +using namespace KABC; + +static TQString backslash( "\\\\" ); +static TQString comma( "\\," ); +static TQString newline( "\\n" ); +static TQString cr( "\\r" ); + +static void addEscapes( TQString &str ) +{ + str.replace( '\\', backslash ); + str.replace( ',', comma ); + str.replace( '\r', cr ); + str.replace( '\n', newline ); +} + +static void removeEscapes( TQString &str ) +{ + str.replace( cr, "\\r" ); + str.replace( newline, "\n" ); + str.replace( comma, "," ); + str.replace( backslash, "\\" ); +} + +VCardParser::VCardParser() +{ +} + +VCardParser::~VCardParser() +{ +} + +VCard::List VCardParser::parseVCards( const TQString& text ) +{ + static TQRegExp sep( "[\x0d\x0a]" ); + + VCard currentVCard; + VCard::List vCardList; + TQString currentLine; + + const TQStringList lines = TQStringList::split( sep, text ); + TQStringList::ConstIterator it; + + bool inVCard = false; + TQStringList::ConstIterator linesEnd( lines.end() ); + for ( it = lines.begin(); it != linesEnd; ++it ) { + + if ( (*it).isEmpty() ) // empty line + continue; + + if ( (*it)[ 0 ] == ' ' || (*it)[ 0 ] == '\t' ) { // folded line => append to previous + currentLine += TQString( *it ).remove( 0, 1 ); + continue; + } else { + if ( inVCard && !currentLine.isEmpty() ) { // now parse the line + int colon = currentLine.find( ':' ); + if ( colon == -1 ) { // invalid line + currentLine = (*it); + continue; + } + + VCardLine vCardLine; + const TQString key = currentLine.left( colon ).stripWhiteSpace(); + TQString value = currentLine.mid( colon + 1 ); + + TQStringList params = TQStringList::split( ';', key ); + + // check for group + if ( params[0].find( '.' ) != -1 ) { + const TQStringList groupList = TQStringList::split( '.', params[0] ); + vCardLine.setGroup( groupList[0] ); + vCardLine.setIdentifier( groupList[1] ); + } else + vCardLine.setIdentifier( params[0] ); + + if ( params.count() > 1 ) { // find all parameters + TQStringList::ConstIterator paramIt = params.begin(); + for ( ++paramIt; paramIt != params.end(); ++paramIt ) { + TQStringList pair = TQStringList::split( '=', *paramIt ); + if ( pair.size() == 1 ) { + // correct the 2.1 'standard' + if ( pair[0].lower() == "quoted-printable" ) { + pair[0] = "encoding"; + pair[1] = "quoted-printable"; + } else if ( pair[0].lower() == "base64" ) { + pair[0] = "encoding"; + pair[1] = "base64"; + } else { + pair.prepend( "type" ); + } + } + // This is pretty much a faster pair[1].contains( ',' )... + if ( pair[1].find( ',' ) != -1 ) { // parameter in type=x,y,z format + const TQStringList args = TQStringList::split( ',', pair[ 1 ] ); + TQStringList::ConstIterator argIt; + for ( argIt = args.begin(); argIt != args.end(); ++argIt ) + vCardLine.addParameter( pair[0].lower(), *argIt ); + } else + vCardLine.addParameter( pair[0].lower(), pair[1] ); + } + } + + removeEscapes( value ); + + TQByteArray output; + bool wasBase64Encoded = false; + + params = vCardLine.parameterList(); + if ( params.findIndex( "encoding" ) != -1 ) { // have to decode the data + TQByteArray input; + input = TQCString(value.latin1()); + if ( vCardLine.parameter( "encoding" ).lower() == "b" || + vCardLine.parameter( "encoding" ).lower() == "base64" ) { + KCodecs::base64Decode( input, output ); + wasBase64Encoded = true; + } + else if ( vCardLine.parameter( "encoding" ).lower() == "quoted-printable" ) { + // join any qp-folded lines + while ( value.at( value.length() - 1 ) == '=' && it != linesEnd ) { + value = value.remove( value.length() - 1, 1 ) + (*it); + ++it; + } + input = TQCString(value.latin1()); + KCodecs::quotedPrintableDecode( input, output ); + } + } else { + output = TQCString(value.latin1()); + } + + if ( params.findIndex( "charset" ) != -1 ) { // have to convert the data + TQTextCodec *codec = + TQTextCodec::codecForName( vCardLine.parameter( "charset" ).latin1() ); + if ( codec ) { + vCardLine.setValue( codec->toUnicode( output ) ); + } else { + vCardLine.setValue( TQString(TQString::fromUtf8( output )) ); + } + } else if ( wasBase64Encoded ) { + vCardLine.setValue( output ); + } else { // if charset not given, assume it's in UTF-8 (as used in previous KDE versions) + vCardLine.setValue( TQString(TQString::fromUtf8( output )) ); + } + + currentVCard.addLine( vCardLine ); + } + + // we do not save the start and end tag as vcardline + if ( (*it).lower().startsWith( "begin:vcard" ) ) { + inVCard = true; + currentLine.setLength( 0 ); + currentVCard.clear(); // flush vcard + continue; + } + + if ( (*it).lower().startsWith( "end:vcard" ) ) { + inVCard = false; + vCardList.append( currentVCard ); + currentLine.setLength( 0 ); + currentVCard.clear(); // flush vcard + continue; + } + + currentLine = (*it); + } + } + + return vCardList; +} + +TQString VCardParser::createVCards( const VCard::List& list ) +{ + TQString text; + TQString textLine; + TQString encodingType; + TQStringList idents; + TQStringList params; + TQStringList values; + TQStringList::ConstIterator identIt; + TQStringList::Iterator paramIt; + TQStringList::ConstIterator valueIt; + + VCardLine::List lines; + VCardLine::List::ConstIterator lineIt; + VCard::List::ConstIterator cardIt; + + bool hasEncoding; + + text.reserve( list.size() * 300 ); // reserve memory to be more efficient + + // iterate over the cards + VCard::List::ConstIterator listEnd( list.end() ); + for ( cardIt = list.begin(); cardIt != listEnd; ++cardIt ) { + text.append( "BEGIN:VCARD\r\n" ); + + idents = (*cardIt).identifiers(); + for ( identIt = idents.constBegin(); identIt != idents.constEnd(); ++identIt ) { + lines = (*cardIt).lines( (*identIt) ); + + // iterate over the lines + for ( lineIt = lines.constBegin(); lineIt != lines.constEnd(); ++lineIt ) { + if ( !(*lineIt).value().asString().isEmpty() ) { + if ((*lineIt).identifier() != TQString("URI")) { + if ( (*lineIt).hasGroup() ) + textLine = (*lineIt).group() + "." + (*lineIt).identifier(); + else + textLine = (*lineIt).identifier(); + + params = (*lineIt).parameterList(); + hasEncoding = false; + if ( params.count() > 0 ) { // we have parameters + for ( paramIt = params.begin(); paramIt != params.end(); ++paramIt ) { + if ( (*paramIt) == "encoding" ) { + hasEncoding = true; + encodingType = (*lineIt).parameter( "encoding" ).lower(); + } + + values = (*lineIt).parameters( *paramIt ); + for ( valueIt = values.constBegin(); valueIt != values.constEnd(); ++valueIt ) { + textLine.append( ";" + (*paramIt).upper() ); + if ( !(*valueIt).isEmpty() ) + textLine.append( "=" + (*valueIt) ); + } + } + } + + if ( hasEncoding ) { // have to encode the data + TQByteArray input, output; + if ( encodingType == "b" ) { + input = (*lineIt).value().toByteArray(); + KCodecs::base64Encode( input, output ); + } else if ( encodingType == "quoted-printable" ) { + input = (*lineIt).value().toString().utf8(); + input.resize( input.size() - 1 ); // strip \0 + KCodecs::quotedPrintableEncode( input, output, false ); + } + + TQString value( output ); + addEscapes( value ); + textLine.append( ":" + value ); + } else { + TQString value( (*lineIt).value().asString() ); + addEscapes( value ); + textLine.append( ":" + value ); + } + + if ( textLine.length() > FOLD_WIDTH ) { // we have to fold the line + for ( uint i = 0; i <= ( textLine.length() / FOLD_WIDTH ); ++i ) + text.append( ( i == 0 ? "" : " " ) + textLine.mid( i * FOLD_WIDTH, FOLD_WIDTH ) + "\r\n" ); + } else + text.append( textLine + "\r\n" ); + } + else { + // URIs can be full of weird symbols, etc. so bypass all checks + textLine = (*lineIt).identifier(); + TQString value( (*lineIt).value().asString() ); + addEscapes( value ); + textLine.append( ":" + value ); + text.append( textLine + "\r\n" ); + } + } + } + } + + text.append( "END:VCARD\r\n" ); + text.append( "\r\n" ); + } + + return text; +} diff --git a/tdeabc/vcardparser/vcardparser.h b/tdeabc/vcardparser/vcardparser.h new file mode 100644 index 000000000..da5fdd46e --- /dev/null +++ b/tdeabc/vcardparser/vcardparser.h @@ -0,0 +1,44 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef VCARDPARSER_H +#define VCARDPARSER_H + +#include "vcard.h" + +namespace KABC { + +class VCardParser +{ + public: + VCardParser(); + ~VCardParser(); + + static VCard::List parseVCards( const TQString& text ); + static TQString createVCards( const VCard::List& list ); + + private: + class VCardParserPrivate; + VCardParserPrivate *d; +}; + +} + +#endif diff --git a/tdeabc/vcardtool.cpp b/tdeabc/vcardtool.cpp new file mode 100644 index 000000000..295360a03 --- /dev/null +++ b/tdeabc/vcardtool.cpp @@ -0,0 +1,896 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#include +#include +#include + +#include "agent.h" +#include "key.h" +#include "picture.h" +#include "secrecy.h" +#include "sound.h" + +#include "vcardtool.h" + +using namespace KABC; + +static bool needsEncoding( const TQString &value ) +{ + uint length = value.length(); + for ( uint i = 0; i < length; ++i ) { + char c = value.at( i ).latin1(); + if ( (c < 33 || c > 126) && c != ' ' && c != '=' ) + return true; + } + + return false; +} + +VCardTool::VCardTool() +{ + mAddressTypeMap.insert( "dom", Address::Dom ); + mAddressTypeMap.insert( "intl", Address::Intl ); + mAddressTypeMap.insert( "postal", Address::Postal ); + mAddressTypeMap.insert( "parcel", Address::Parcel ); + mAddressTypeMap.insert( "home", Address::Home ); + mAddressTypeMap.insert( "work", Address::Work ); + mAddressTypeMap.insert( "pref", Address::Pref ); + + mPhoneTypeMap.insert( "HOME", PhoneNumber::Home ); + mPhoneTypeMap.insert( "WORK", PhoneNumber::Work ); + mPhoneTypeMap.insert( "MSG", PhoneNumber::Msg ); + mPhoneTypeMap.insert( "PREF", PhoneNumber::Pref ); + mPhoneTypeMap.insert( "VOICE", PhoneNumber::Voice ); + mPhoneTypeMap.insert( "FAX", PhoneNumber::Fax ); + mPhoneTypeMap.insert( "CELL", PhoneNumber::Cell ); + mPhoneTypeMap.insert( "VIDEO", PhoneNumber::Video ); + mPhoneTypeMap.insert( "BBS", PhoneNumber::Bbs ); + mPhoneTypeMap.insert( "MODEM", PhoneNumber::Modem ); + mPhoneTypeMap.insert( "CAR", PhoneNumber::Car ); + mPhoneTypeMap.insert( "ISDN", PhoneNumber::Isdn ); + mPhoneTypeMap.insert( "PCS", PhoneNumber::Pcs ); + mPhoneTypeMap.insert( "PAGER", PhoneNumber::Pager ); +} + +VCardTool::~VCardTool() +{ +} + +// TODO: make list a const& +TQString VCardTool::createVCards( Addressee::List list, VCard::Version version ) +{ + VCard::List vCardList; + + Addressee::List::ConstIterator addrIt; + Addressee::List::ConstIterator listEnd( list.constEnd() ); + for ( addrIt = list.constBegin(); addrIt != listEnd; ++addrIt ) { + VCard card; + TQStringList::ConstIterator strIt; + + // ADR + LABEL + const Address::List addresses = (*addrIt).addresses(); + for ( Address::List::ConstIterator it = addresses.begin(); it != addresses.end(); ++it ) { + TQStringList address; + + bool isEmpty = ( (*it).postOfficeBox().isEmpty() && + (*it).extended().isEmpty() && + (*it).street().isEmpty() && + (*it).locality().isEmpty() && + (*it).region().isEmpty() && + (*it).postalCode().isEmpty() && + (*it).country().isEmpty() ); + + address.append( (*it).postOfficeBox().replace( ';', "\\;" ) ); + address.append( (*it).extended().replace( ';', "\\;" ) ); + address.append( (*it).street().replace( ';', "\\;" ) ); + address.append( (*it).locality().replace( ';', "\\;" ) ); + address.append( (*it).region().replace( ';', "\\;" ) ); + address.append( (*it).postalCode().replace( ';', "\\;" ) ); + address.append( (*it).country().replace( ';', "\\;" ) ); + + VCardLine adrLine( "ADR", address.join( ";" ) ); + if ( version == VCard::v2_1 && needsEncoding( address.join( ";" ) ) ) { + adrLine.addParameter( "charset", "UTF-8" ); + adrLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + + VCardLine labelLine( "LABEL", (*it).label() ); + if ( version == VCard::v2_1 && needsEncoding( (*it).label() ) ) { + labelLine.addParameter( "charset", "UTF-8" ); + labelLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + + bool hasLabel = !(*it).label().isEmpty(); + TQMap::ConstIterator typeIt; + for ( typeIt = mAddressTypeMap.constBegin(); typeIt != mAddressTypeMap.constEnd(); ++typeIt ) { + if ( typeIt.data() & (*it).type() ) { + adrLine.addParameter( "TYPE", typeIt.key() ); + if ( hasLabel ) + labelLine.addParameter( "TYPE", typeIt.key() ); + } + } + + if ( !isEmpty ) + card.addLine( adrLine ); + if ( hasLabel ) + card.addLine( labelLine ); + } + + // AGENT + card.addLine( createAgent( version, (*addrIt).agent() ) ); + + // BDAY + card.addLine( VCardLine( "BDAY", createDateTime( TQT_TQDATETIME_OBJECT((*addrIt).birthday()) ) ) ); + + // CATEGORIES + if ( version == VCard::v3_0 ) { + TQStringList categories = (*addrIt).categories(); + TQStringList::Iterator catIt; + for ( catIt = categories.begin(); catIt != categories.end(); ++catIt ) + (*catIt).replace( ',', "\\," ); + + VCardLine catLine( "CATEGORIES", categories.join( "," ) ); + if ( version == VCard::v2_1 && needsEncoding( categories.join( "," ) ) ) { + catLine.addParameter( "charset", "UTF-8" ); + catLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + + card.addLine( catLine ); + } + + // CLASS + if ( version == VCard::v3_0 ) { + card.addLine( createSecrecy( (*addrIt).secrecy() ) ); + } + + // EMAIL + const TQStringList emails = (*addrIt).emails(); + bool pref = true; + for ( strIt = emails.begin(); strIt != emails.end(); ++strIt ) { + VCardLine line( "EMAIL", *strIt ); + if ( pref == true && emails.count() > 1 ) { + line.addParameter( "TYPE", "PREF" ); + pref = false; + } + card.addLine( line ); + } + + // FN + VCardLine fnLine( "FN", TQString((*addrIt).formattedName()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).formattedName() ) ) { + fnLine.addParameter( "charset", "UTF-8" ); + fnLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( fnLine ); + + // GEO + Geo geo = (*addrIt).geo(); + if ( geo.isValid() ) { + TQString str; + str.sprintf( "%.6f;%.6f", geo.latitude(), geo.longitude() ); + card.addLine( VCardLine( "GEO", str ) ); + } + + // KEY + const Key::List keys = (*addrIt).keys(); + Key::List::ConstIterator keyIt; + for ( keyIt = keys.begin(); keyIt != keys.end(); ++keyIt ) + card.addLine( createKey( *keyIt ) ); + + // LOGO + card.addLine( createPicture( "LOGO", (*addrIt).logo() ) ); + + // MAILER + VCardLine mailerLine( "MAILER", TQString((*addrIt).mailer()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).mailer() ) ) { + mailerLine.addParameter( "charset", "UTF-8" ); + mailerLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( mailerLine ); + + // N + TQStringList name; + name.append( (*addrIt).familyName().replace( ';', "\\;" ) ); + name.append( (*addrIt).givenName().replace( ';', "\\;" ) ); + name.append( (*addrIt).additionalName().replace( ';', "\\;" ) ); + name.append( (*addrIt).prefix().replace( ';', "\\;" ) ); + name.append( (*addrIt).suffix().replace( ';', "\\;" ) ); + + VCardLine nLine( "N", name.join( ";" ) ); + if ( version == VCard::v2_1 && needsEncoding( name.join( ";" ) ) ) { + nLine.addParameter( "charset", "UTF-8" ); + nLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( nLine ); + + // NAME + VCardLine nameLine( "NAME", TQString((*addrIt).name()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).name() ) ) { + nameLine.addParameter( "charset", "UTF-8" ); + nameLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( nameLine ); + + // NICKNAME + if ( version == VCard::v3_0 ) + card.addLine( VCardLine( "NICKNAME", TQString((*addrIt).nickName()) ) ); + + // NOTE + VCardLine noteLine( "NOTE", TQString((*addrIt).note()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).note() ) ) { + noteLine.addParameter( "charset", "UTF-8" ); + noteLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( noteLine ); + + // ORG + TQStringList organization; + organization.append( ( *addrIt ).organization().replace( ';', "\\;" ) ); + if ( !( *addrIt ).department().isEmpty() ) + organization.append( ( *addrIt ).department().replace( ';', "\\;" ) ); + VCardLine orgLine( "ORG", organization.join( ";" ) ); + if ( version == VCard::v2_1 && needsEncoding( organization.join( ";" ) ) ) { + orgLine.addParameter( "charset", "UTF-8" ); + orgLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( orgLine ); + + // PHOTO + card.addLine( createPicture( "PHOTO", (*addrIt).photo() ) ); + + // PROID + if ( version == VCard::v3_0 ) + card.addLine( VCardLine( "PRODID", TQString((*addrIt).productId()) ) ); + + // REV + card.addLine( VCardLine( "REV", createDateTime( TQT_TQDATETIME_OBJECT((*addrIt).revision()) ) ) ); + + // ROLE + VCardLine roleLine( "ROLE", TQString((*addrIt).role()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).role() ) ) { + roleLine.addParameter( "charset", "UTF-8" ); + roleLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( roleLine ); + + // SORT-STRING + if ( version == VCard::v3_0 ) + card.addLine( VCardLine( "SORT-STRING", TQString((*addrIt).sortString()) ) ); + + // SOUND + card.addLine( createSound( (*addrIt).sound() ) ); + + // TEL + const PhoneNumber::List phoneNumbers = (*addrIt).phoneNumbers(); + PhoneNumber::List::ConstIterator phoneIt; + for ( phoneIt = phoneNumbers.begin(); phoneIt != phoneNumbers.end(); ++phoneIt ) { + VCardLine line( "TEL", (*phoneIt).number() ); + + TQMap::ConstIterator typeIt; + for ( typeIt = mPhoneTypeMap.constBegin(); typeIt != mPhoneTypeMap.constEnd(); ++typeIt ) { + if ( typeIt.data() & (*phoneIt).type() ) + line.addParameter( "TYPE", typeIt.key() ); + } + + card.addLine( line ); + } + + // TITLE + VCardLine titleLine( "TITLE", TQString((*addrIt).title()) ); + if ( version == VCard::v2_1 && needsEncoding( (*addrIt).title() ) ) { + titleLine.addParameter( "charset", "UTF-8" ); + titleLine.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( titleLine ); + + // TZ + TimeZone timeZone = (*addrIt).timeZone(); + if ( timeZone.isValid() ) { + TQString str; + + int neg = 1; + if ( timeZone.offset() < 0 ) + neg = -1; + + str.sprintf( "%c%02d:%02d", ( timeZone.offset() >= 0 ? '+' : '-' ), + ( timeZone.offset() / 60 ) * neg, + ( timeZone.offset() % 60 ) * neg ); + + card.addLine( VCardLine( "TZ", str ) ); + } + + // UID + card.addLine( VCardLine( "UID", (*addrIt).uid() ) ); + + // UID + card.addLine( VCardLine( "URI", (*addrIt).uri() ) ); + + // URL + card.addLine( VCardLine( "URL", (*addrIt).url().url() ) ); + + // VERSION + if ( version == VCard::v2_1 ) + card.addLine( VCardLine( "VERSION", "2.1" ) ); + if ( version == VCard::v3_0 ) + card.addLine( VCardLine( "VERSION", "3.0" ) ); + + // X- + const TQStringList customs = (*addrIt).customs(); + for ( strIt = customs.begin(); strIt != customs.end(); ++strIt ) { + TQString identifier = "X-" + (*strIt).left( (*strIt).find( ":" ) ); + TQString value = (*strIt).mid( (*strIt).find( ":" ) + 1 ); + if ( value.isEmpty() ) + continue; + + VCardLine line( identifier, value ); + if ( version == VCard::v2_1 && needsEncoding( value ) ) { + line.addParameter( "charset", "UTF-8" ); + line.addParameter( "encoding", "QUOTED-PRINTABLE" ); + } + card.addLine( line ); + } + + vCardList.append( card ); + } + + return VCardParser::createVCards( vCardList ); +} + +Addressee::List VCardTool::parseVCards( const TQString& vcard ) +{ + static const TQChar semicolonSep( ';' ); + static const TQChar commaSep( ',' ); + TQString identifier; + + Addressee::List addrList; + const VCard::List vCardList = VCardParser::parseVCards( vcard ); + + VCard::List::ConstIterator cardIt; + VCard::List::ConstIterator listEnd( vCardList.end() ); + for ( cardIt = vCardList.begin(); cardIt != listEnd; ++cardIt ) { + Addressee addr; + + const TQStringList idents = (*cardIt).identifiers(); + TQStringList::ConstIterator identIt; + TQStringList::ConstIterator identEnd( idents.end() ); + for ( identIt = idents.begin(); identIt != identEnd; ++identIt ) { + const VCardLine::List lines = (*cardIt).lines( (*identIt) ); + VCardLine::List::ConstIterator lineIt; + + // iterate over the lines + for ( lineIt = lines.begin(); lineIt != lines.end(); ++lineIt ) { + identifier = (*lineIt).identifier().lower(); + // ADR + if ( identifier == "adr" ) { + Address address; + const TQStringList addrParts = splitString( semicolonSep, (*lineIt).value().asString() ); + if ( addrParts.count() > 0 ) + address.setPostOfficeBox( addrParts[ 0 ] ); + if ( addrParts.count() > 1 ) + address.setExtended( addrParts[ 1 ] ); + if ( addrParts.count() > 2 ) + address.setStreet( addrParts[ 2 ] ); + if ( addrParts.count() > 3 ) + address.setLocality( addrParts[ 3 ] ); + if ( addrParts.count() > 4 ) + address.setRegion( addrParts[ 4 ] ); + if ( addrParts.count() > 5 ) + address.setPostalCode( addrParts[ 5 ] ); + if ( addrParts.count() > 6 ) + address.setCountry( addrParts[ 6 ] ); + + int type = 0; + + const TQStringList types = (*lineIt).parameters( "type" ); + for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) + type += mAddressTypeMap[ (*it).lower() ]; + + address.setType( type ); + addr.insertAddress( address ); + } + + // AGENT + else if ( identifier == "agent" ) + addr.setAgent( parseAgent( *lineIt ) ); + + // BDAY + else if ( identifier == "bday" ) + addr.setBirthday( parseDateTime( (*lineIt).value().asString() ) ); + + // CATEGORIES + else if ( identifier == "categories" ) { + const TQStringList categories = splitString( commaSep, (*lineIt).value().asString() ); + addr.setCategories( categories ); + } + + // CLASS + else if ( identifier == "class" ) + addr.setSecrecy( parseSecrecy( *lineIt ) ); + + // EMAIL + else if ( identifier == "email" ) { + const TQStringList types = (*lineIt).parameters( "type" ); + addr.insertEmail( (*lineIt).value().asString(), types.findIndex( "PREF" ) != -1 ); + } + + // FN + else if ( identifier == "fn" ) + addr.setFormattedName( (*lineIt).value().asString() ); + + // GEO + else if ( identifier == "geo" ) { + Geo geo; + + const TQStringList geoParts = TQStringList::split( ';', (*lineIt).value().asString(), true ); + geo.setLatitude( geoParts[ 0 ].toFloat() ); + geo.setLongitude( geoParts[ 1 ].toFloat() ); + + addr.setGeo( geo ); + } + + // KEY + else if ( identifier == "key" ) + addr.insertKey( parseKey( *lineIt ) ); + + // LABEL + else if ( identifier == "label" ) { + int type = 0; + + const TQStringList types = (*lineIt).parameters( "type" ); + for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) + type += mAddressTypeMap[ (*it).lower() ]; + + bool available = false; + KABC::Address::List addressList = addr.addresses(); + KABC::Address::List::Iterator it; + for ( it = addressList.begin(); it != addressList.end(); ++it ) { + if ( (*it).type() == type ) { + (*it).setLabel( (*lineIt).value().asString() ); + addr.insertAddress( *it ); + available = true; + break; + } + } + + if ( !available ) { // a standalone LABEL tag + KABC::Address address( type ); + address.setLabel( (*lineIt).value().asString() ); + addr.insertAddress( address ); + } + } + + // LOGO + else if ( identifier == "logo" ) + addr.setLogo( parsePicture( *lineIt ) ); + + // MAILER + else if ( identifier == "mailer" ) + addr.setMailer( (*lineIt).value().asString() ); + + // N + else if ( identifier == "n" ) { + const TQStringList nameParts = splitString( semicolonSep, (*lineIt).value().asString() ); + if ( nameParts.count() > 0 ) + addr.setFamilyName( nameParts[ 0 ] ); + if ( nameParts.count() > 1 ) + addr.setGivenName( nameParts[ 1 ] ); + if ( nameParts.count() > 2 ) + addr.setAdditionalName( nameParts[ 2 ] ); + if ( nameParts.count() > 3 ) + addr.setPrefix( nameParts[ 3 ] ); + if ( nameParts.count() > 4 ) + addr.setSuffix( nameParts[ 4 ] ); + } + + // NAME + else if ( identifier == "name" ) + addr.setName( (*lineIt).value().asString() ); + + // NICKNAME + else if ( identifier == "nickname" ) + addr.setNickName( (*lineIt).value().asString() ); + + // NOTE + else if ( identifier == "note" ) + addr.setNote( (*lineIt).value().asString() ); + + // ORGANIZATION + else if ( identifier == "org" ) { + const TQStringList orgParts = splitString( semicolonSep, (*lineIt).value().asString() ); + if ( orgParts.count() > 0 ) + addr.setOrganization( orgParts[ 0 ] ); + if ( orgParts.count() > 1 ) + addr.setDepartment( orgParts[ 1 ] ); + } + + // PHOTO + else if ( identifier == "photo" ) + addr.setPhoto( parsePicture( *lineIt ) ); + + // PROID + else if ( identifier == "prodid" ) + addr.setProductId( (*lineIt).value().asString() ); + + // REV + else if ( identifier == "rev" ) + addr.setRevision( parseDateTime( (*lineIt).value().asString() ) ); + + // ROLE + else if ( identifier == "role" ) + addr.setRole( (*lineIt).value().asString() ); + + // SORT-STRING + else if ( identifier == "sort-string" ) + addr.setSortString( (*lineIt).value().asString() ); + + // SOUND + else if ( identifier == "sound" ) + addr.setSound( parseSound( *lineIt ) ); + + // TEL + else if ( identifier == "tel" ) { + PhoneNumber phone; + phone.setNumber( (*lineIt).value().asString() ); + + int type = 0; + + const TQStringList types = (*lineIt).parameters( "type" ); + for ( TQStringList::ConstIterator it = types.begin(); it != types.end(); ++it ) + type += mPhoneTypeMap[(*it).upper()]; + + phone.setType( type ); + + addr.insertPhoneNumber( phone ); + } + + // TITLE + else if ( identifier == "title" ) + addr.setTitle( (*lineIt).value().asString() ); + + // TZ + else if ( identifier == "tz" ) { + TimeZone tz; + const TQString date = (*lineIt).value().asString(); + + int hours = date.mid( 1, 2).toInt(); + int minutes = date.mid( 4, 2 ).toInt(); + int offset = ( hours * 60 ) + minutes; + offset = offset * ( date[ 0 ] == '+' ? 1 : -1 ); + + tz.setOffset( offset ); + addr.setTimeZone( tz ); + } + + // UID + else if ( identifier == "uid" ) + addr.setUid( (*lineIt).value().asString() ); + + // URI + else if ( identifier == "uri" ) + addr.setUri( (*lineIt).value().asString() ); + + // URL + else if ( identifier == "url" ) + addr.setUrl( KURL( (*lineIt).value().asString() ) ); + + // X- + else if ( identifier.startsWith( "x-" ) ) { + const TQString key = (*lineIt).identifier().mid( 2 ); + int dash = key.find( "-" ); + addr.insertCustom( key.left( dash ), key.mid( dash + 1 ), (*lineIt).value().asString() ); + } + } + } + + addrList.append( addr ); + } + + return addrList; +} + +TQDateTime VCardTool::parseDateTime( const TQString &str ) +{ + TQDateTime dateTime; + + if ( str.find( '-' ) == -1 ) { // is base format (yyyymmdd) + dateTime.setDate( TQDate( str.left( 4 ).toInt(), str.mid( 4, 2 ).toInt(), + str.mid( 6, 2 ).toInt() ) ); + + if ( str.find( 'T' ) ) // has time information yyyymmddThh:mm:ss + dateTime.setTime( TQTime( str.mid( 11, 2 ).toInt(), str.mid( 14, 2 ).toInt(), + str.mid( 17, 2 ).toInt() ) ); + + } else { // is extended format yyyy-mm-dd + dateTime.setDate( TQDate( str.left( 4 ).toInt(), str.mid( 5, 2 ).toInt(), + str.mid( 8, 2 ).toInt() ) ); + + if ( str.find( 'T' ) ) // has time information yyyy-mm-ddThh:mm:ss + dateTime.setTime( TQTime( str.mid( 11, 2 ).toInt(), str.mid( 14, 2 ).toInt(), + str.mid( 17, 2 ).toInt() ) ); + } + + return dateTime; +} + +TQString VCardTool::createDateTime( const TQDateTime &dateTime ) +{ + TQString str; + + if ( dateTime.date().isValid() ) { + str.sprintf( "%4d-%02d-%02d", dateTime.date().year(), dateTime.date().month(), + dateTime.date().day() ); + if ( dateTime.time().isValid() ) { + TQString tmp; + tmp.sprintf( "T%02d:%02d:%02dZ", dateTime.time().hour(), dateTime.time().minute(), + dateTime.time().second() ); + str += tmp; + } + } + + return str; +} + +Picture VCardTool::parsePicture( const VCardLine &line ) +{ + Picture pic; + + const TQStringList params = line.parameterList(); + if ( params.findIndex( "encoding" ) != -1 ) { + TQImage img; + img.loadFromData( line.value().asByteArray() ); + pic.setData( img ); + } else if ( params.findIndex( "value" ) != -1 ) { + if ( line.parameter( "value" ).lower() == "uri" ) + pic.setUrl( line.value().asString() ); + } + + if ( params.findIndex( "type" ) != -1 ) + pic.setType( line.parameter( "type" ) ); + + return pic; +} + +VCardLine VCardTool::createPicture( const TQString &identifier, const Picture &pic ) +{ + VCardLine line( identifier ); + + if ( pic.isIntern() ) { + if ( !pic.data().isNull() ) { + TQByteArray input; + TQBuffer buffer( input ); + buffer.open( IO_WriteOnly ); + + TQImageIO iio( &buffer, "JPEG" ); + iio.setImage( pic.data() ); + iio.setQuality( 100 ); + iio.write(); + + line.setValue( input ); + line.addParameter( "encoding", "b" ); + line.addParameter( "type", "image/jpeg" ); + } + } else if ( !pic.url().isEmpty() ) { + line.setValue( pic.url() ); + line.addParameter( "value", "URI" ); + } + + return line; +} + +Sound VCardTool::parseSound( const VCardLine &line ) +{ + Sound snd; + + const TQStringList params = line.parameterList(); + if ( params.findIndex( "encoding" ) != -1 ) + snd.setData( line.value().asByteArray() ); + else if ( params.findIndex( "value" ) != -1 ) { + if ( line.parameter( "value" ).lower() == "uri" ) + snd.setUrl( line.value().asString() ); + } + +/* TODO: support sound types + if ( params.contains( "type" ) ) + snd.setType( line.parameter( "type" ) ); +*/ + + return snd; +} + +VCardLine VCardTool::createSound( const Sound &snd ) +{ + VCardLine line( "SOUND" ); + + if ( snd.isIntern() ) { + if ( !snd.data().isEmpty() ) { + line.setValue( snd.data() ); + line.addParameter( "encoding", "b" ); + // TODO: need to store sound type!!! + } + } else if ( !snd.url().isEmpty() ) { + line.setValue( snd.url() ); + line.addParameter( "value", "URI" ); + } + + return line; +} + +Key VCardTool::parseKey( const VCardLine &line ) +{ + Key key; + + const TQStringList params = line.parameterList(); + if ( params.findIndex( "encoding" ) != -1 ) + key.setBinaryData( line.value().asByteArray() ); + else + key.setTextData( line.value().asString() ); + + if ( params.findIndex( "type" ) != -1 ) { + if ( line.parameter( "type" ).lower() == "x509" ) + key.setType( Key::X509 ); + else if ( line.parameter( "type" ).lower() == "pgp" ) + key.setType( Key::PGP ); + else { + key.setType( Key::Custom ); + key.setCustomTypeString( line.parameter( "type" ) ); + } + } + + return key; +} + +VCardLine VCardTool::createKey( const Key &key ) +{ + VCardLine line( "KEY" ); + + if ( key.isBinary() ) { + if ( !key.binaryData().isEmpty() ) { + line.setValue( key.binaryData() ); + line.addParameter( "encoding", "b" ); + } + } else if ( !key.textData().isEmpty() ) + line.setValue( key.textData() ); + + if ( key.type() == Key::X509 ) + line.addParameter( "type", "X509" ); + else if ( key.type() == Key::PGP ) + line.addParameter( "type", "PGP" ); + else if ( key.type() == Key::Custom ) + line.addParameter( "type", key.customTypeString() ); + + return line; +} + +Secrecy VCardTool::parseSecrecy( const VCardLine &line ) +{ + Secrecy secrecy; + + if ( line.value().asString().lower() == "public" ) + secrecy.setType( Secrecy::Public ); + if ( line.value().asString().lower() == "private" ) + secrecy.setType( Secrecy::Private ); + if ( line.value().asString().lower() == "confidential" ) + secrecy.setType( Secrecy::Confidential ); + + return secrecy; +} + +VCardLine VCardTool::createSecrecy( const Secrecy &secrecy ) +{ + VCardLine line( "CLASS" ); + + int type = secrecy.type(); + + if ( type == Secrecy::Public ) + line.setValue( "PUBLIC" ); + else if ( type == Secrecy::Private ) + line.setValue( "PRIVATE" ); + else if ( type == Secrecy::Confidential ) + line.setValue( "CONFIDENTIAL" ); + + return line; +} + +Agent VCardTool::parseAgent( const VCardLine &line ) +{ + Agent agent; + + const TQStringList params = line.parameterList(); + if ( params.findIndex( "value" ) != -1 ) { + if ( line.parameter( "value" ).lower() == "uri" ) + agent.setUrl( line.value().asString() ); + } else { + TQString str = line.value().asString(); + str.replace( "\\n", "\r\n" ); + str.replace( "\\N", "\r\n" ); + str.replace( "\\;", ";" ); + str.replace( "\\:", ":" ); + str.replace( "\\,", "," ); + + const Addressee::List list = parseVCards( str ); + if ( list.count() > 0 ) { + Addressee *addr = new Addressee; + *addr = list[ 0 ]; + agent.setAddressee( addr ); + } + } + + return agent; +} + +VCardLine VCardTool::createAgent( VCard::Version version, const Agent &agent ) +{ + VCardLine line( "AGENT" ); + + if ( agent.isIntern() ) { + if ( agent.addressee() != 0 ) { + Addressee::List list; + list.append( *agent.addressee() ); + + TQString str = createVCards( list, version ); + str.replace( "\r\n", "\\n" ); + str.replace( ";", "\\;" ); + str.replace( ":", "\\:" ); + str.replace( ",", "\\," ); + line.setValue( str ); + } + } else if ( !agent.url().isEmpty() ) { + line.setValue( agent.url() ); + line.addParameter( "value", "URI" ); + } + + return line; +} + +TQStringList VCardTool::splitString( const TQChar &sep, const TQString &str ) +{ + TQStringList list; + TQString value( str ); + + int start = 0; + int pos = value.find( sep, start ); + + while ( pos != -1 ) { + if ( value[ pos - 1 ] != '\\' ) { + if ( pos > start && pos <= (int)value.length() ) + list << value.mid( start, pos - start ); + else + list << TQString::null; + + start = pos + 1; + pos = value.find( sep, start ); + } else { + if ( pos != 0 ) { + value.replace( pos - 1, 2, sep ); + pos = value.find( sep, pos ); + } else + pos = value.find( sep, pos + 1 ); + } + } + + int l = value.length() - 1; + if ( value.mid( start, l - start + 1 ).length() > 0 ) + list << value.mid( start, l - start + 1 ); + else + list << TQString::null; + + return list; +} diff --git a/tdeabc/vcardtool.h b/tdeabc/vcardtool.h new file mode 100644 index 000000000..fbf959613 --- /dev/null +++ b/tdeabc/vcardtool.h @@ -0,0 +1,88 @@ +/* + This file is part of libkabc. + Copyright (c) 2003 Tobias Koenig + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef KABC_VCARDTOOL_H +#define KABC_VCARDTOOL_H + +#include "addressee.h" +#include "vcardparser.h" + +class TQDateTime; + +namespace KABC { + +class Agent; +class Key; +class Picture; +class Secrecy; +class Sound; + +class KABC_EXPORT VCardTool +{ + public: + VCardTool(); + ~VCardTool(); + + /** + Creates a string that contains the addressees from the list in + the vCard format. + */ + TQString createVCards( Addressee::List list, VCard::Version version = VCard::v3_0 ); + + /** + Parses the string and returns a list of addressee objects. + */ + Addressee::List parseVCards( const TQString& vcard ); + + private: + /** + Split a string and replaces escaped separators on the fly with + unescaped ones. + */ + TQStringList splitString( const TQChar &sep, const TQString &value ); + + TQDateTime parseDateTime( const TQString &str ); + TQString createDateTime( const TQDateTime &dateTime ); + + Picture parsePicture( const VCardLine &line ); + VCardLine createPicture( const TQString &identifier, const Picture &pic ); + + Sound parseSound( const VCardLine &line ); + VCardLine createSound( const Sound &snd ); + + Key parseKey( const VCardLine &line ); + VCardLine createKey( const Key &key ); + + Secrecy parseSecrecy( const VCardLine &line ); + VCardLine createSecrecy( const Secrecy &secrecy ); + + Agent parseAgent( const VCardLine &line ); + VCardLine createAgent( VCard::Version version, const Agent &agent ); + + TQMap mAddressTypeMap; + TQMap mPhoneTypeMap; + + class VCardToolPrivate; + VCardToolPrivate *d; +}; + +} + +#endif diff --git a/tdecert/tdecertpart.cc b/tdecert/tdecertpart.cc index 7c84f31d1..9a50e6e29 100644 --- a/tdecert/tdecertpart.cc +++ b/tdecert/tdecertpart.cc @@ -24,14 +24,14 @@ #include #include #include -#include +#include #include #include #include #include #include #include -#include +#include #include #include #include diff --git a/tdecmshell/main.cpp b/tdecmshell/main.cpp index 3d54abc45..72f3c66f2 100644 --- a/tdecmshell/main.cpp +++ b/tdecmshell/main.cpp @@ -37,12 +37,12 @@ #include #include #include -#include +#include #include #include -#include +#include #include -#include +#include #include "main.h" #include "main.moc" diff --git a/tdeconf_update/tdeconf_update.cpp b/tdeconf_update/tdeconf_update.cpp index 458b3b523..814e68a16 100644 --- a/tdeconf_update/tdeconf_update.cpp +++ b/tdeconf_update/tdeconf_update.cpp @@ -30,13 +30,13 @@ #include #include -#include +#include #include -#include +#include #include #include #include -#include +#include static TDECmdLineOptions options[] = { diff --git a/tdecore/CMakeLists.txt b/tdecore/CMakeLists.txt index 850bb10f2..b8f512873 100644 --- a/tdecore/CMakeLists.txt +++ b/tdecore/CMakeLists.txt @@ -74,19 +74,19 @@ install( FILES kurl.h ksock.h tdeaboutdata.h tdecmdlineargs.h tdeconfigbackend.h kapp.h tdeapplication.h kuniqueapp.h kuniqueapplication.h kcharsets.h tdeversion.h kpty.h kprocess.h kprocctrl.h - klocale.h kicontheme.h kiconloader.h kdebug.h twinmodule.h + tdelocale.h kicontheme.h kiconloader.h kdebug.h twinmodule.h twin.h krootprop.h tdeshortcut.h kkeynative.h tdeaccel.h kglobalaccel.h tdestdaccel.h tdeshortcutlist.h kcatalogue.h kregexp.h kcompletion.h kstringhandler.h kstddirs.h - kstandarddirs.h kglobal.h kglobalsettings.h ksharedptr.h + kstandarddirs.h tdeglobal.h tdeglobalsettings.h ksharedptr.h kallocator.h kvmallocator.h kcrash.h krfcdate.h kinstance.h - kpalette.h kipc.h klibloader.h ktempfile.h ksavefile.h + kpalette.h kipc.h klibloader.h tdetempfile.h ksavefile.h krandomsequence.h knotifyclient.h kiconeffect.h kaudioplayer.h kdcoppropertyproxy.h netwm.h tdeaccelmanager.h netwm_def.h kpixmapprovider.h kunload.h kstaticdeleter.h kextsock.h kextendedsocket.h ksockaddr.h kprocio.h kasyncio.h kbufferedio.h kurldrag.h kmimesourcefactory.h kmdcodec.h ksocks.h tdesycoca.h - tdesycocaentry.h tdesycocatype.h kxmessages.h kstartupinfo.h + tdesycocaentry.h tdesycocatype.h kxmessages.h tdestartupinfo.h klargefile.h tdemultipledrag.h kgenericfactory.h kgenericfactory.tcc ktypelist.h ksortablevaluelist.h kdebugclasses.h kclipboard.h kcalendarsystem.h kcalendarsystemfactory.h kmacroexpander.h @@ -123,15 +123,15 @@ set( ${target}_SRCS libintl.cpp tdeapplication.cpp kdebug.cpp netwm.cpp tdeconfigbase.cpp tdeconfig.cpp ksimpleconfig.cpp tdeconfigbackend.cpp kmanagerselection.cpp kdesktopfile.cpp kstandarddirs.cpp - ksock.cpp kpty.cpp kprocess.cpp kprocctrl.cpp klocale.cpp + ksock.cpp kpty.cpp kprocess.cpp kprocctrl.cpp tdelocale.cpp krfcdate.cpp kiconeffect.cpp kicontheme.cpp kiconloader.cpp twin.cpp twinmodule.cpp krootprop.cpp kcharsets.cpp kckey.cpp tdeshortcut.cpp kkeynative_x11.cpp kkeyserver_x11.cpp tdeaccelaction.cpp tdeshortcutmenu.cpp tdeaccelbase.cpp tdeaccel.cpp kglobalaccel_x11.cpp kglobalaccel.cpp tdestdaccel.cpp tdeshortcutlist.cpp - kcrash.cpp kurl.cpp kregexp.cpp kglobal.cpp kglobalsettings.cpp + kcrash.cpp kurl.cpp kregexp.cpp tdeglobal.cpp tdeglobalsettings.cpp kallocator.cpp kvmallocator.cpp kmimesourcefactory.cpp - kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp ktempfile.cpp + kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp tdetempfile.cpp kuniqueapplication.cpp tdeaccelmanager.cpp ksavefile.cpp krandomsequence.cpp kstringhandler.cpp kcompletion.cpp tdecmdlineargs.cpp tdeaboutdata.cpp kcompletionbase.cpp knotifyclient.cpp @@ -139,7 +139,7 @@ set( ${target}_SRCS kextsock.cpp netsupp.cpp kprocio.cpp kbufferedio.cpp kpixmapprovider.cpp kurldrag.cpp kmdcodec.cpp ksocks.cpp fakes.c vsnprintf.c tdesycoca.cpp tdesycocadict.cpp tdesycoca.skel - tdesycocafactory.cpp kxmessages.cpp kstartupinfo.cpp + tdesycocafactory.cpp kxmessages.cpp tdestartupinfo.cpp kcatalogue.cpp kasyncio.cpp tdemultipledrag.cpp kstaticdeleter.cpp kappdcopiface.cpp kappdcopiface.skel kclipboard.cpp kcheckaccelerators.cpp tdeversion.cpp kdebugdcopiface.cpp diff --git a/tdecore/MAINTAINERS b/tdecore/MAINTAINERS index e4a9ad80d..ae94ecd7c 100644 --- a/tdecore/MAINTAINERS +++ b/tdecore/MAINTAINERS @@ -27,10 +27,10 @@ kcrash.cpp Waldo Bastian kdcoppropertyproxy.cpp kdebug.cpp Stephan Kulow kdesktopfile.cpp -kglobal.cpp Stephan Kulow +tdeglobal.cpp Stephan Kulow kglobalaccel.cpp Ellis Whitehead kglobalaccel_x11.cpp Ellis Whitehead -kglobalsettings.cpp David Faure +tdeglobalsettings.cpp David Faure kiconeffect.cpp kiconloader.cpp kicontheme.cpp @@ -41,7 +41,7 @@ kkeynative_x11.cpp Ellis Whitehead kkeysequence.cpp Ellis Whitehead kkeysequence_emb.cpp Ellis Whitehead klibloader.cpp -klocale.cpp Hans Petter Bieker +tdelocale.cpp Hans Petter Bieker kmdcodec.cpp kmimesourcefactory.cpp tdemultipledrag.cpp David Faure @@ -60,14 +60,14 @@ tdeshortcut.cpp Ellis Whitehead ksimpleconfig.cpp Waldo Bastian ksocks.cpp kstandarddirs.cpp Waldo Bastian -kstartupinfo.cpp Lubos Lunak +tdestartupinfo.cpp Lubos Lunak kstaticdeleter.cpp Stephan Kulow tdestdaccel.cpp Ellis Whitehead kstringhandler.cpp tdesycoca.cpp Waldo Bastian tdesycocadict.cpp Waldo Bastian tdesycocafactory.cpp Waldo Bastian -ktempfile.cpp Waldo Bastian +tdetempfile.cpp Waldo Bastian kuniqueapplication.cpp Waldo Bastian kurl.cpp Waldo Bastian kurldrag.cpp David Faure diff --git a/tdecore/Makefile.am b/tdecore/Makefile.am index ae5048ed9..c04ee4c6d 100644 --- a/tdecore/Makefile.am +++ b/tdecore/Makefile.am @@ -41,19 +41,19 @@ include_HEADERS = tdeconfig.h tdeconfigskeleton.h \ tdeconfigbase.h kdesktopfile.h kurl.h ksock.h tdeaboutdata.h \ tdecmdlineargs.h tdeconfigbackend.h kapp.h tdeapplication.h kuniqueapp.h \ kuniqueapplication.h kcharsets.h tdeversion.h kpty.h kprocess.h \ - kprocctrl.h klocale.h kicontheme.h kiconloader.h kdebug.h \ + kprocctrl.h tdelocale.h kicontheme.h kiconloader.h kdebug.h \ twinmodule.h twin.h krootprop.h tdeshortcut.h kkeynative.h tdeaccel.h \ kglobalaccel.h tdestdaccel.h tdeshortcutlist.h kcatalogue.h \ kregexp.h kcompletion.h kstringhandler.h \ - kstddirs.h kstandarddirs.h kglobal.h kglobalsettings.h ksharedptr.h \ + kstddirs.h kstandarddirs.h tdeglobal.h tdeglobalsettings.h ksharedptr.h \ kallocator.h kvmallocator.h kcrash.h krfcdate.h \ - kinstance.h kpalette.h kipc.h klibloader.h ktempfile.h ksavefile.h \ + kinstance.h kpalette.h kipc.h klibloader.h tdetempfile.h ksavefile.h \ krandomsequence.h knotifyclient.h kiconeffect.h \ kaudioplayer.h kdcoppropertyproxy.h netwm.h tdeaccelmanager.h \ netwm_def.h kpixmapprovider.h kunload.h kstaticdeleter.h \ kextsock.h kextendedsocket.h ksockaddr.h kprocio.h kasyncio.h \ kbufferedio.h kurldrag.h kmimesourcefactory.h kmdcodec.h ksocks.h \ - tdesycoca.h tdesycocaentry.h tdesycocatype.h kxmessages.h kstartupinfo.h \ + tdesycoca.h tdesycocaentry.h tdesycocatype.h kxmessages.h tdestartupinfo.h \ klargefile.h tdemultipledrag.h kgenericfactory.h kgenericfactory.tcc \ ktypelist.h ksortablevaluelist.h kdebugclasses.h kclipboard.h \ kcalendarsystem.h kcalendarsystemfactory.h kmacroexpander.h \ @@ -93,14 +93,14 @@ libtdecore_la_SOURCES = libintl.cpp tdeapplication.cpp \ kdebug.cpp netwm.cpp tdeconfigbase.cpp tdeconfig.cpp ksimpleconfig.cpp \ tdeconfigbackend.cpp kmanagerselection.cpp kdesktopfile.cpp \ kstandarddirs.cpp ksock.cpp kpty.cpp kprocess.cpp kprocctrl.cpp \ - klocale.cpp krfcdate.cpp kiconeffect.cpp kicontheme.cpp \ + tdelocale.cpp krfcdate.cpp kiconeffect.cpp kicontheme.cpp \ kiconloader.cpp twin.cpp twinmodule.cpp krootprop.cpp kcharsets.cpp \ kckey.cpp tdeshortcut.cpp kkeynative_x11.cpp kkeyserver_x11.cpp \ tdeaccelaction.cpp tdeshortcutmenu.cpp tdeaccelbase.cpp tdeaccel.cpp \ kglobalaccel_x11.cpp kglobalaccel.cpp tdestdaccel.cpp tdeshortcutlist.cpp \ - kcrash.cpp kurl.cpp kregexp.cpp kglobal.cpp kglobalsettings.cpp \ + kcrash.cpp kurl.cpp kregexp.cpp tdeglobal.cpp tdeglobalsettings.cpp \ kallocator.cpp kvmallocator.cpp kmimesourcefactory.cpp \ - kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp ktempfile.cpp \ + kinstance.cpp kpalette.cpp kipc.cpp klibloader.cpp tdetempfile.cpp \ kuniqueapplication.cpp tdeaccelmanager.cpp \ ksavefile.cpp krandomsequence.cpp kstringhandler.cpp kcompletion.cpp \ tdecmdlineargs.cpp tdeaboutdata.cpp kcompletionbase.cpp knotifyclient.cpp \ @@ -109,7 +109,7 @@ libtdecore_la_SOURCES = libintl.cpp tdeapplication.cpp \ kpixmapprovider.cpp kurldrag.cpp \ kmdcodec.cpp ksocks.cpp fakes.c vsnprintf.c \ tdesycoca.cpp tdesycocadict.cpp tdesycocafactory.cpp tdesycoca.skel \ - kxmessages.cpp kstartupinfo.cpp kcatalogue.cpp kasyncio.cpp \ + kxmessages.cpp tdestartupinfo.cpp kcatalogue.cpp kasyncio.cpp \ tdemultipledrag.cpp kstaticdeleter.cpp kappdcopiface.cpp \ kappdcopiface.skel kclipboard.cpp kcheckaccelerators.cpp \ tdeversion.cpp kdebugdcopiface.cpp kdebugdcopiface.skel \ diff --git a/tdecore/kappdcopiface.cpp b/tdecore/kappdcopiface.cpp index 31bc8dd5b..ed6e26163 100644 --- a/tdecore/kappdcopiface.cpp +++ b/tdecore/kappdcopiface.cpp @@ -20,7 +20,7 @@ #include "kappdcopiface.h" #include #include -#include +#include #include diff --git a/tdecore/kapplication_win.cpp b/tdecore/kapplication_win.cpp index 940bc379e..38bafaef8 100644 --- a/tdecore/kapplication_win.cpp +++ b/tdecore/kapplication_win.cpp @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include "kcheckaccelerators.h" diff --git a/tdecore/kcalendarsystem.cpp b/tdecore/kcalendarsystem.cpp index 39331e170..20d00d181 100644 --- a/tdecore/kcalendarsystem.cpp +++ b/tdecore/kcalendarsystem.cpp @@ -22,10 +22,10 @@ // systems. // Also default gregorian and factory classes -#include +#include #include "kcalendarsystem.h" -#include "klocale.h" +#include "tdelocale.h" class KCalendarSystemPrivate { diff --git a/tdecore/kcalendarsystemgregorian.cpp b/tdecore/kcalendarsystemgregorian.cpp index ead1aca66..9d4d14661 100644 --- a/tdecore/kcalendarsystemgregorian.cpp +++ b/tdecore/kcalendarsystemgregorian.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "kcalendarsystemgregorian.h" diff --git a/tdecore/kcalendarsystemhebrew.cpp b/tdecore/kcalendarsystemhebrew.cpp index a0db927f4..2f0aa111a 100644 --- a/tdecore/kcalendarsystemhebrew.cpp +++ b/tdecore/kcalendarsystemhebrew.cpp @@ -21,7 +21,7 @@ // Derived hebrew kde calendar class -#include +#include #include #include "kcalendarsystemhebrew.h" diff --git a/tdecore/kcalendarsystemhijri.cpp b/tdecore/kcalendarsystemhijri.cpp index 8c9fac471..cc66805e0 100644 --- a/tdecore/kcalendarsystemhijri.cpp +++ b/tdecore/kcalendarsystemhijri.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include "kcalendarsystemhijri.h" diff --git a/tdecore/kcalendarsystemjalali.cpp b/tdecore/kcalendarsystemjalali.cpp index 559ebb39c..631693e45 100644 --- a/tdecore/kcalendarsystemjalali.cpp +++ b/tdecore/kcalendarsystemjalali.cpp @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/tdecore/kcharsets.cpp b/tdecore/kcharsets.cpp index fa623b693..23786c53e 100644 --- a/tdecore/kcharsets.cpp +++ b/tdecore/kcharsets.cpp @@ -22,8 +22,8 @@ #include "kentities.c" #include -#include -#include +#include +#include #include #include diff --git a/tdecore/kcheckaccelerators.cpp b/tdecore/kcheckaccelerators.cpp index b7e113f4b..306591e67 100644 --- a/tdecore/kcheckaccelerators.cpp +++ b/tdecore/kcheckaccelerators.cpp @@ -41,9 +41,9 @@ #include #include -#include +#include #include -#include +#include /* diff --git a/tdecore/kclipboard.cpp b/tdecore/kclipboard.cpp index 54d051486..8ab23cccc 100644 --- a/tdecore/kclipboard.cpp +++ b/tdecore/kclipboard.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include "kclipboard.h" diff --git a/tdecore/kcompletion.cpp b/tdecore/kcompletion.cpp index a5349b3ee..4a80d85df 100644 --- a/tdecore/kcompletion.cpp +++ b/tdecore/kcompletion.cpp @@ -20,9 +20,9 @@ #include #include -#include +#include #include -#include +#include #include diff --git a/tdecore/kcompletion.h b/tdecore/kcompletion.h index e6d7f5314..2bce648fb 100644 --- a/tdecore/kcompletion.h +++ b/tdecore/kcompletion.h @@ -28,7 +28,7 @@ #include #include "tdelibs_export.h" -#include +#include #include #include diff --git a/tdecore/kcrash.cpp b/tdecore/kcrash.cpp index 2eed7c282..08abe75c7 100644 --- a/tdecore/kcrash.cpp +++ b/tdecore/kcrash.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdecore/kdebug.areas b/tdecore/kdebug.areas index b6e742489..5653a9a03 100644 --- a/tdecore/kdebug.areas +++ b/tdecore/kdebug.areas @@ -184,7 +184,7 @@ 5602 kontact (plugins) 5650 tderesources 5700 kabc -5710 kabc/vcard +5710 tdeabc/vcard 5720 kaddressbook 5800 libkcal 5850 korganizer diff --git a/tdecore/kdebug.cpp b/tdecore/kdebug.cpp index 062864fca..656edf6f9 100644 --- a/tdecore/kdebug.cpp +++ b/tdecore/kdebug.cpp @@ -28,12 +28,12 @@ #include "kdebugdcopiface.h" #include "tdeapplication.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kinstance.h" #include "kstandarddirs.h" #include -#include +#include #include #include #include diff --git a/tdecore/kdebugrc b/tdecore/kdebugrc index e1317ddfb..dbf3ed53f 100644 --- a/tdecore/kdebugrc +++ b/tdecore/kdebugrc @@ -96,7 +96,7 @@ InfoOutput=4 [5400] InfoOutput=4 -# kabc/vcard +# tdeabc/vcard [5710] InfoOutput=4 diff --git a/tdecore/kdesktopfile.cpp b/tdecore/kdesktopfile.cpp index a5a57cdd8..b385eeb18 100644 --- a/tdecore/kdesktopfile.cpp +++ b/tdecore/kdesktopfile.cpp @@ -35,7 +35,7 @@ #include "kstandarddirs.h" #include "kmountpoint.h" #include "kcatalogue.h" -#include "klocale.h" +#include "tdelocale.h" #include "kdesktopfile.h" #include "kdesktopfile.moc" diff --git a/tdecore/kdetcompmgr.cpp b/tdecore/kdetcompmgr.cpp index d78d76b34..964cd49be 100644 --- a/tdecore/kdetcompmgr.cpp +++ b/tdecore/kdetcompmgr.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdecore/kgenericfactory.h b/tdecore/kgenericfactory.h index 426b29ef1..7f2b7b453 100644 --- a/tdecore/kgenericfactory.h +++ b/tdecore/kgenericfactory.h @@ -23,8 +23,8 @@ #include #include #include -#include -#include +#include +#include #include /* @internal */ diff --git a/tdecore/kglobal.cpp b/tdecore/kglobal.cpp index 965a537a3..f8639d526 100644 --- a/tdecore/kglobal.cpp +++ b/tdecore/kglobal.cpp @@ -16,7 +16,7 @@ Boston, MA 02110-1301, USA. */ /* -* kglobal.cpp -- Implementation of class TDEGlobal. +* tdeglobal.cpp -- Implementation of class TDEGlobal. * Author: Sirtaj Singh Kang * Version: $Id$ * Generated: Sat May 1 02:08:43 EST 1999 @@ -25,13 +25,13 @@ #include #include #include -#include "kglobal.h" +#include "tdeglobal.h" #include #include #include #include -#include +#include #include #include #include diff --git a/tdecore/kglobalaccel.cpp b/tdecore/kglobalaccel.cpp index 6af97065d..746721e40 100644 --- a/tdecore/kglobalaccel.cpp +++ b/tdecore/kglobalaccel.cpp @@ -32,7 +32,7 @@ #include "tdeaccelbase.h" #include #include -#include +#include //---------------------------------------------------- diff --git a/tdecore/kglobalsettings.cpp b/tdecore/kglobalsettings.cpp index a103c4652..c0c6329c7 100644 --- a/tdecore/kglobalsettings.cpp +++ b/tdecore/kglobalsettings.cpp @@ -16,7 +16,7 @@ Boston, MA 02110-1301, USA. */ #include "config.h" -#include "kglobalsettings.h" +#include "tdeglobalsettings.h" #include #include @@ -40,12 +40,12 @@ static QRgb qt_colorref2qrgb(COLORREF col) #endif #include -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/tdecore/kiconeffect.cpp b/tdecore/kiconeffect.cpp index e865a1317..c1a4a8ca5 100644 --- a/tdecore/kiconeffect.cpp +++ b/tdecore/kiconeffect.cpp @@ -29,9 +29,9 @@ #include #include -#include +#include #include -#include +#include #include #include "kiconeffect.h" diff --git a/tdecore/kiconloader.cpp b/tdecore/kiconloader.cpp index be44a921f..e81293986 100644 --- a/tdecore/kiconloader.cpp +++ b/tdecore/kiconloader.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdecore/kiconloader.h b/tdecore/kiconloader.h index 0c7e67a26..434a3d976 100644 --- a/tdecore/kiconloader.h +++ b/tdecore/kiconloader.h @@ -27,7 +27,7 @@ #undef TDEIconLoaderXStatus #endif -#include +#include #include #include diff --git a/tdecore/kicontheme.cpp b/tdecore/kicontheme.cpp index 9d5d2b7d0..544eefe01 100644 --- a/tdecore/kicontheme.cpp +++ b/tdecore/kicontheme.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdecore/kinstance.cpp b/tdecore/kinstance.cpp index cf0b35791..6760c95a0 100644 --- a/tdecore/kinstance.cpp +++ b/tdecore/kinstance.cpp @@ -21,7 +21,7 @@ #include #include "tdeconfig.h" -#include "klocale.h" +#include "tdelocale.h" #include "kcharsets.h" #include "kiconloader.h" #include "tdehardwaredevices.h" @@ -29,7 +29,7 @@ #include "tdeaboutdata.h" #include "kstandarddirs.h" #include "kdebug.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kmimesourcefactory.h" #include diff --git a/tdecore/kkeynative_x11.cpp b/tdecore/kkeynative_x11.cpp index 64635acc3..a44305dad 100644 --- a/tdecore/kkeynative_x11.cpp +++ b/tdecore/kkeynative_x11.cpp @@ -32,7 +32,7 @@ #include #include "kckey.h" #include -#include +#include #ifdef Q_WS_X11 #define XK_MISCELLANY diff --git a/tdecore/kkeyserver_x11.cpp b/tdecore/kkeyserver_x11.cpp index cd4abb6fb..64bfe383d 100644 --- a/tdecore/kkeyserver_x11.cpp +++ b/tdecore/kkeyserver_x11.cpp @@ -33,8 +33,8 @@ #include #include -#include -#include +#include +#include #ifdef Q_WS_X11 # define XK_MISCELLANY diff --git a/tdecore/klibloader.cpp b/tdecore/klibloader.cpp index f7e63c215..aed2c06af 100644 --- a/tdecore/klibloader.cpp +++ b/tdecore/klibloader.cpp @@ -29,7 +29,7 @@ #include "klibloader.h" #include "kstandarddirs.h" #include "kdebug.h" -#include "klocale.h" +#include "tdelocale.h" #include "ltdl.h" diff --git a/tdecore/klibloader.h b/tdecore/klibloader.h index 3e8f9ff45..d9e632184 100644 --- a/tdecore/klibloader.h +++ b/tdecore/klibloader.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include // For backwards compatibility diff --git a/tdecore/klocale.cpp b/tdecore/klocale.cpp index 3e169ba03..4402dd183 100644 --- a/tdecore/klocale.cpp +++ b/tdecore/klocale.cpp @@ -33,7 +33,7 @@ #include #include "kcatalogue.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kstandarddirs.h" #include "ksimpleconfig.h" #include "kinstance.h" @@ -41,7 +41,7 @@ #include "kdebug.h" #include "kcalendarsystem.h" #include "kcalendarsystemfactory.h" -#include "klocale.h" +#include "tdelocale.h" #ifdef Q_WS_WIN #include diff --git a/tdecore/klocale.h b/tdecore/klocale.h index 65a21d13d..94cf704f1 100644 --- a/tdecore/klocale.h +++ b/tdecore/klocale.h @@ -39,7 +39,7 @@ class KCatalogue; class KCalendarSystem; /** - * \file klocale.h + * \file tdelocale.h */ #ifndef I18N_NOOP diff --git a/tdecore/klockfile.cpp b/tdecore/klockfile.cpp index ee09a06c8..1f4f8337e 100644 --- a/tdecore/klockfile.cpp +++ b/tdecore/klockfile.cpp @@ -39,8 +39,8 @@ #include #include #include -#include -#include +#include +#include // TODO: http://www.spinnaker.de/linux/nfs-locking.html // TODO: Make regression test diff --git a/tdecore/kmimesourcefactory.cpp b/tdecore/kmimesourcefactory.cpp index f08cb249a..8ed02941e 100644 --- a/tdecore/kmimesourcefactory.cpp +++ b/tdecore/kmimesourcefactory.cpp @@ -19,7 +19,7 @@ */ #include -#include +#include #include #include diff --git a/tdecore/kmimesourcefactory.h b/tdecore/kmimesourcefactory.h index 16302dfe4..8292cda42 100644 --- a/tdecore/kmimesourcefactory.h +++ b/tdecore/kmimesourcefactory.h @@ -23,7 +23,7 @@ #define KMIMESOURCEFACTORY_H #include -#include +#include class KMimeSourceFactoryPrivate; class TDEInstance; diff --git a/tdecore/kpalette.cpp b/tdecore/kpalette.cpp index c06184221..7335e8e14 100644 --- a/tdecore/kpalette.cpp +++ b/tdecore/kpalette.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdecore/kprotocolinfo_tdecore.cpp b/tdecore/kprotocolinfo_tdecore.cpp index 8cc5091c5..86a9a6fcc 100644 --- a/tdecore/kprotocolinfo_tdecore.cpp +++ b/tdecore/kprotocolinfo_tdecore.cpp @@ -26,7 +26,7 @@ #include "kprotocolinfofactory.h" #include -#include +#include #include #include #include diff --git a/tdecore/kprotocolinfofactory.cpp b/tdecore/kprotocolinfofactory.cpp index 4daab08dd..115a44f25 100644 --- a/tdecore/kprotocolinfofactory.cpp +++ b/tdecore/kprotocolinfofactory.cpp @@ -18,7 +18,7 @@ */ #include -#include +#include #include #include #include diff --git a/tdecore/krootprop.cpp b/tdecore/krootprop.cpp index bb15462dd..c717a1823 100644 --- a/tdecore/krootprop.cpp +++ b/tdecore/krootprop.cpp @@ -23,8 +23,8 @@ #ifdef Q_WS_X11 // not needed anyway :-) #include "krootprop.h" -#include "kglobal.h" -#include "klocale.h" +#include "tdeglobal.h" +#include "tdelocale.h" #include "kcharsets.h" #include "tdeapplication.h" #include diff --git a/tdecore/ksavefile.h b/tdecore/ksavefile.h index e035115a9..282652dea 100644 --- a/tdecore/ksavefile.h +++ b/tdecore/ksavefile.h @@ -23,7 +23,7 @@ #include #include #include -#include +#include class KSaveFilePrivate; diff --git a/tdecore/ksimpleconfig.cpp b/tdecore/ksimpleconfig.cpp index 55cf7485b..dc359f17e 100644 --- a/tdecore/ksimpleconfig.cpp +++ b/tdecore/ksimpleconfig.cpp @@ -31,7 +31,7 @@ #include #include -#include "kglobal.h" +#include "tdeglobal.h" #include "kstandarddirs.h" #include "tdeconfigbackend.h" diff --git a/tdecore/ksimpledirwatch.cpp b/tdecore/ksimpledirwatch.cpp index f39a94221..835566268 100644 --- a/tdecore/ksimpledirwatch.cpp +++ b/tdecore/ksimpledirwatch.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdecore/ksockaddr.cpp b/tdecore/ksockaddr.cpp index cd2f9c93c..a645b3aa9 100644 --- a/tdecore/ksockaddr.cpp +++ b/tdecore/ksockaddr.cpp @@ -38,7 +38,7 @@ #include #include "kdebug.h" -#include "klocale.h" +#include "tdelocale.h" //#include "kextsock.h" #ifndef HAVE_STRUCT_SOCKADDR_IN6 diff --git a/tdecore/ksocks.cpp b/tdecore/ksocks.cpp index 95e36dc15..a6ecc37d2 100644 --- a/tdecore/ksocks.cpp +++ b/tdecore/ksocks.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include "klibloader.h" #include diff --git a/tdecore/kstandarddirs.h b/tdecore/kstandarddirs.h index 7eb654f42..7cdf44e37 100644 --- a/tdecore/kstandarddirs.h +++ b/tdecore/kstandarddirs.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include class TDEConfig; class TDEStandardDirsPrivate; diff --git a/tdecore/kstartupinfo.cpp b/tdecore/kstartupinfo.cpp index a472de5fd..3d798cdc1 100644 --- a/tdecore/kstartupinfo.cpp +++ b/tdecore/kstartupinfo.cpp @@ -45,7 +45,7 @@ DEALINGS IN THE SOFTWARE. #define QT_CLEAN_NAMESPACE #endif -#include "kstartupinfo.h" +#include "tdestartupinfo.h" #include #include @@ -1525,5 +1525,5 @@ static TQString escape_str( const TQString& str_P ) return ret; } -#include "kstartupinfo.moc" +#include "tdestartupinfo.moc" #endif diff --git a/tdecore/kstartupinfo.h b/tdecore/kstartupinfo.h index dcc80f978..3f8310f6b 100644 --- a/tdecore/kstartupinfo.h +++ b/tdecore/kstartupinfo.h @@ -49,7 +49,7 @@ class TDEStartupInfoPrivate; * * This class can be used to send information about started application, * change the information and receive this information. For detailed - * description, see tdelibs/tdecore/README.kstartupinfo. + * description, see tdelibs/tdecore/README.tdestartupinfo. * * You usually don't need to use this class for sending the notification * information, as KDE libraries should do this when an application is diff --git a/tdecore/kstaticdeleter.h b/tdecore/kstaticdeleter.h index dd759adf7..b6967268c 100644 --- a/tdecore/kstaticdeleter.h +++ b/tdecore/kstaticdeleter.h @@ -23,7 +23,7 @@ #ifndef _KSTATIC_DELETER_H_ #define _KSTATIC_DELETER_H_ -#include +#include /** * Static deleters are used to manage static resources. They can register diff --git a/tdecore/kstringhandler.cpp b/tdecore/kstringhandler.cpp index c562c539f..b19c5b875 100644 --- a/tdecore/kstringhandler.cpp +++ b/tdecore/kstringhandler.cpp @@ -18,7 +18,7 @@ */ #include "kstringhandler.h" -#include "kglobal.h" +#include "tdeglobal.h" static void parsePythonRange( const TQCString &range, uint &start, uint &end ) { diff --git a/tdecore/ktempdir.cpp b/tdecore/ktempdir.cpp index 53cc83f99..d16d2e185 100644 --- a/tdecore/ktempdir.cpp +++ b/tdecore/ktempdir.cpp @@ -47,7 +47,7 @@ #include #include -#include "kglobal.h" +#include "tdeglobal.h" #include "tdeapplication.h" #include "kinstance.h" #include "ktempdir.h" diff --git a/tdecore/ktempfile.cpp b/tdecore/ktempfile.cpp index 973e14070..805d315a1 100644 --- a/tdecore/ktempfile.cpp +++ b/tdecore/ktempfile.cpp @@ -48,10 +48,10 @@ #include #include -#include "kglobal.h" +#include "tdeglobal.h" #include "tdeapplication.h" #include "kinstance.h" -#include "ktempfile.h" +#include "tdetempfile.h" #include "kstandarddirs.h" #include "kde_file.h" #include "kdebug.h" diff --git a/tdecore/ktimezones.cpp b/tdecore/ktimezones.cpp index 6b21e0392..3436cdabb 100644 --- a/tdecore/ktimezones.cpp +++ b/tdecore/ktimezones.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdecore/kuniqueapplication.cpp b/tdecore/kuniqueapplication.cpp index 964c7c8c7..0a3a0962a 100644 --- a/tdecore/kuniqueapplication.cpp +++ b/tdecore/kuniqueapplication.cpp @@ -40,7 +40,7 @@ #if defined Q_WS_X11 #include -#include +#include #endif #include diff --git a/tdecore/kurl.cpp b/tdecore/kurl.cpp index 9479029a9..2079c050b 100644 --- a/tdecore/kurl.cpp +++ b/tdecore/kurl.cpp @@ -27,7 +27,7 @@ // KDE_QT_ONLY is first used for dcop/client (e.g. marshalling) #ifndef KDE_QT_ONLY #include -#include +#include #include #include #endif diff --git a/tdecore/kurldrag.cpp b/tdecore/kurldrag.cpp index 20aa6388e..5e64d09b2 100644 --- a/tdecore/kurldrag.cpp +++ b/tdecore/kurldrag.cpp @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include #include class KURLDragPrivate diff --git a/tdecore/kvmallocator.cpp b/tdecore/kvmallocator.cpp index 996d55791..3b887eeee 100644 --- a/tdecore/kvmallocator.cpp +++ b/tdecore/kvmallocator.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include #include "kvmallocator.h" diff --git a/tdecore/netsupp.cpp b/tdecore/netsupp.cpp index c7e968c16..0c072752c 100644 --- a/tdecore/netsupp.cpp +++ b/tdecore/netsupp.cpp @@ -37,7 +37,7 @@ #include "config.h" #include "kdebug.h" -#include "klocale.h" +#include "tdelocale.h" #ifndef IN6_IS_ADDR_V4MAPPED #define NEED_IN6_TESTS diff --git a/tdecore/network/kresolver.cpp b/tdecore/network/kresolver.cpp index 1c32e80ec..b9ac605c0 100644 --- a/tdecore/network/kresolver.cpp +++ b/tdecore/network/kresolver.cpp @@ -54,7 +54,7 @@ #endif // KDE -#include +#include // Us #include "kresolver.h" diff --git a/tdecore/network/kresolverstandardworkers.cpp b/tdecore/network/kresolverstandardworkers.cpp index cde24f752..96519d1aa 100644 --- a/tdecore/network/kresolverstandardworkers.cpp +++ b/tdecore/network/kresolverstandardworkers.cpp @@ -44,7 +44,7 @@ #include #include "kdebug.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kstandarddirs.h" #include "tdeapplication.h" diff --git a/tdecore/network/tdesocketaddress.cpp b/tdecore/network/tdesocketaddress.cpp index ff97699c8..a6da5f7c0 100644 --- a/tdecore/network/tdesocketaddress.cpp +++ b/tdecore/network/tdesocketaddress.cpp @@ -36,7 +36,7 @@ #include #include -#include "klocale.h" +#include "tdelocale.h" #include "tdesocketaddress.h" #include "netsupp.h" diff --git a/tdecore/network/tdesocketbase.cpp b/tdecore/network/tdesocketbase.cpp index 0eb31bbc1..66decb15d 100644 --- a/tdecore/network/tdesocketbase.cpp +++ b/tdecore/network/tdesocketbase.cpp @@ -24,7 +24,7 @@ #include #include -#include "klocale.h" +#include "tdelocale.h" #include "tdesocketbase.h" #include "tdesocketdevice.h" diff --git a/tdecore/networkbackends/network-manager/network-manager_p.h b/tdecore/networkbackends/network-manager/network-manager_p.h index 474f628bb..0e1fe4de8 100644 --- a/tdecore/networkbackends/network-manager/network-manager_p.h +++ b/tdecore/networkbackends/network-manager/network-manager_p.h @@ -27,7 +27,7 @@ /* TDE headers */ #include -#include +#include /* TQDbus headers */ #include diff --git a/tdecore/tde-config.cpp.cmake b/tdecore/tde-config.cpp.cmake index 98481cefe..36e752f33 100644 --- a/tdecore/tde-config.cpp.cmake +++ b/tdecore/tde-config.cpp.cmake @@ -1,11 +1,11 @@ // -*- c++ -*- #include -#include +#include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdecore/tde-config.cpp.in b/tdecore/tde-config.cpp.in index ac49e5c41..f86e5f5db 100644 --- a/tdecore/tde-config.cpp.in +++ b/tdecore/tde-config.cpp.in @@ -1,11 +1,11 @@ // -*- c++ -*- #include -#include +#include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdecore/tdeaboutdata.h b/tdecore/tdeaboutdata.h index d5addac0a..db76287f2 100644 --- a/tdecore/tdeaboutdata.h +++ b/tdecore/tdeaboutdata.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #ifndef _KABOUTDATA_H_ #define _KABOUTDATA_H_ diff --git a/tdecore/tdeaccel.cpp b/tdecore/tdeaccel.cpp index e019baafc..5430c2529 100644 --- a/tdecore/tdeaccel.cpp +++ b/tdecore/tdeaccel.cpp @@ -29,7 +29,7 @@ #include "tdeaccelbase.h" #include #include -#include +#include #include #include "tdeaccelprivate.h" diff --git a/tdecore/tdeaccelaction.cpp b/tdecore/tdeaccelaction.cpp index 93f17ae25..89d8efaa2 100644 --- a/tdecore/tdeaccelaction.cpp +++ b/tdecore/tdeaccelaction.cpp @@ -28,9 +28,9 @@ #include #include "kckey.h" #include -#include +#include #include -#include +#include #include //--------------------------------------------------------------------- diff --git a/tdecore/tdeaccelbase.cpp b/tdecore/tdeaccelbase.cpp index 434801f61..6673cabb4 100644 --- a/tdecore/tdeaccelbase.cpp +++ b/tdecore/tdeaccelbase.cpp @@ -29,10 +29,10 @@ #include #include "kckey.h" #include -#include +#include #include #include "kkeyserver.h" -#include +#include #include "tdeshortcutmenu.h" //--------------------------------------------------------------------- diff --git a/tdecore/tdeapplication.cpp b/tdecore/tdeapplication.cpp index 24c77826b..58b010e4e 100644 --- a/tdecore/tdeapplication.cpp +++ b/tdecore/tdeapplication.cpp @@ -61,10 +61,10 @@ #include #endif -#include +#include #include #include -#include +#include #include #include #include @@ -72,7 +72,7 @@ #include #include #include -#include +#include #include #include #include @@ -89,7 +89,7 @@ #include #if defined Q_WS_X11 -#include +#include #endif #include diff --git a/tdecore/tdecmdlineargs.cpp b/tdecore/tdecmdlineargs.cpp index ad24467e2..46d1b9f4a 100644 --- a/tdecore/tdecmdlineargs.cpp +++ b/tdecore/tdecmdlineargs.cpp @@ -37,9 +37,9 @@ #include "tdecmdlineargs.h" #include -#include +#include #include -#include +#include #include #include diff --git a/tdecore/tdeconfig.cpp b/tdecore/tdeconfig.cpp index 35c5b73bc..68307dc85 100644 --- a/tdecore/tdeconfig.cpp +++ b/tdecore/tdeconfig.cpp @@ -36,7 +36,7 @@ #include "tdeconfigbackend.h" #include "tdeconfig.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kstandarddirs.h" #include "kstaticdeleter.h" #include diff --git a/tdecore/tdeconfig_compiler/example/autoexample.cpp b/tdecore/tdeconfig_compiler/example/autoexample.cpp index e25219787..6085fa6eb 100644 --- a/tdecore/tdeconfig_compiler/example/autoexample.cpp +++ b/tdecore/tdeconfig_compiler/example/autoexample.cpp @@ -27,9 +27,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdecore/tdeconfig_compiler/example/example.cpp b/tdecore/tdeconfig_compiler/example/example.cpp index c08339d4a..157570d98 100644 --- a/tdecore/tdeconfig_compiler/example/example.cpp +++ b/tdecore/tdeconfig_compiler/example/example.cpp @@ -24,9 +24,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include diff --git a/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp b/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp index 753bae532..207a78402 100644 --- a/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp +++ b/tdecore/tdeconfig_compiler/tdeconfig_compiler.cpp @@ -30,9 +30,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -1151,7 +1151,7 @@ int main( int argc, char **argv ) if ( headerIncludes.count() > 0 ) h << endl; if ( !singleton && cfgFileNameArg && parameters.isEmpty() ) - h << "#include " << endl; + h << "#include " << endl; h << "#include " << endl; h << "#include " << endl << endl; @@ -1421,7 +1421,7 @@ int main( int argc, char **argv ) cpp << "#include \"" << headerFileName << "\"" << endl << endl; - if ( setUserTexts ) cpp << "#include " << endl << endl; + if ( setUserTexts ) cpp << "#include " << endl << endl; // Header required by singleton implementation if ( singleton ) diff --git a/tdecore/tdeconfig_compiler/tests/test2.cpp.ref b/tdecore/tdeconfig_compiler/tests/test2.cpp.ref index cc3f67b5e..e66c5b9da 100644 --- a/tdecore/tdeconfig_compiler/tests/test2.cpp.ref +++ b/tdecore/tdeconfig_compiler/tests/test2.cpp.ref @@ -3,7 +3,7 @@ #include "test2.h" -#include +#include Test2::Test2( ) : MyPrefs( TQString::fromLatin1( "korganizerrc" ) ) diff --git a/tdecore/tdeconfig_compiler/tests/test8a.h.ref b/tdecore/tdeconfig_compiler/tests/test8a.h.ref index 88686ca1b..a1e5b7e37 100644 --- a/tdecore/tdeconfig_compiler/tests/test8a.h.ref +++ b/tdecore/tdeconfig_compiler/tests/test8a.h.ref @@ -3,7 +3,7 @@ #ifndef TEST8A_H #define TEST8A_H -#include +#include #include #include diff --git a/tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref b/tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref index 5aad12fe8..b3fde4334 100644 --- a/tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref +++ b/tdecore/tdeconfig_compiler/tests/test_dpointer.cpp.ref @@ -3,7 +3,7 @@ #include "test_dpointer.h" -#include +#include #include diff --git a/tdecore/tdeconfigbackend.cpp b/tdecore/tdeconfigbackend.cpp index d050a2efe..6d5197ff7 100644 --- a/tdecore/tdeconfigbackend.cpp +++ b/tdecore/tdeconfigbackend.cpp @@ -42,9 +42,9 @@ #include "tdeconfigbackend.h" #include "tdeconfigbase.h" #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdecore/tdeconfigbackend.h b/tdecore/tdeconfigbackend.h index 71ba15288..83c8047bc 100644 --- a/tdecore/tdeconfigbackend.h +++ b/tdecore/tdeconfigbackend.h @@ -25,7 +25,7 @@ #include "tdeconfigdata.h" #include #include -#include +#include #include "tdelibs_export.h" class TQFile; diff --git a/tdecore/tdeconfigbase.cpp b/tdecore/tdeconfigbase.cpp index 668a688d8..a3b15185b 100644 --- a/tdecore/tdeconfigbase.cpp +++ b/tdecore/tdeconfigbase.cpp @@ -28,8 +28,8 @@ #include #include -#include -#include +#include +#include #include #include "tdeconfigbase.h" diff --git a/tdecore/tdeconfigdialogmanager.cpp b/tdecore/tdeconfigdialogmanager.cpp index dfabefb59..9578c05c1 100644 --- a/tdecore/tdeconfigdialogmanager.cpp +++ b/tdecore/tdeconfigdialogmanager.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include diff --git a/tdecore/tdeconfigskeleton.cpp b/tdecore/tdeconfigskeleton.cpp index 1abaf388b..45a4b4112 100644 --- a/tdecore/tdeconfigskeleton.cpp +++ b/tdecore/tdeconfigskeleton.cpp @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include #include #include "kstringhandler.h" diff --git a/tdecore/tdeconfigskeleton.h b/tdecore/tdeconfigskeleton.h index ccbf4529b..b260db1e8 100644 --- a/tdecore/tdeconfigskeleton.h +++ b/tdecore/tdeconfigskeleton.h @@ -34,7 +34,7 @@ #include #include #include -#include +#include /** * @short Class for storing a preferences setting diff --git a/tdecore/tdehardwaredevices.cpp b/tdecore/tdehardwaredevices.cpp index 263bc5507..60f3efde9 100644 --- a/tdecore/tdehardwaredevices.cpp +++ b/tdecore/tdehardwaredevices.cpp @@ -23,10 +23,10 @@ #include #include -#include -#include +#include +#include #include -#include +#include #include #include diff --git a/tdecore/tdenetworkconnections.cpp b/tdecore/tdenetworkconnections.cpp index 2705343f7..2682aa991 100644 --- a/tdecore/tdenetworkconnections.cpp +++ b/tdecore/tdenetworkconnections.cpp @@ -23,7 +23,7 @@ #include -#include +#include // #define DEBUG_SIGNAL_QUEUE 1 diff --git a/tdecore/tdeshortcut.cpp b/tdecore/tdeshortcut.cpp index 33797b0bc..bae897e98 100644 --- a/tdecore/tdeshortcut.cpp +++ b/tdecore/tdeshortcut.cpp @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include //---------------------------------------------------- diff --git a/tdecore/tdeshortcutlist.cpp b/tdecore/tdeshortcutlist.cpp index 645e69565..ffacd001c 100644 --- a/tdecore/tdeshortcutlist.cpp +++ b/tdecore/tdeshortcutlist.cpp @@ -5,7 +5,7 @@ #include "tdeaccelaction.h" #include #include -#include +#include #include #include #include diff --git a/tdecore/tdeshortcutmenu.cpp b/tdecore/tdeshortcutmenu.cpp index 91061a734..c035c0df9 100644 --- a/tdecore/tdeshortcutmenu.cpp +++ b/tdecore/tdeshortcutmenu.cpp @@ -23,7 +23,7 @@ #include "tdeaccelaction.h" #include -#include +#include #include "tdeshortcutmenu.h" //#include diff --git a/tdecore/tdestdaccel.cpp b/tdecore/tdestdaccel.cpp index f91d2ee66..ba3e64ca5 100644 --- a/tdecore/tdestdaccel.cpp +++ b/tdecore/tdestdaccel.cpp @@ -25,8 +25,8 @@ #include "tdeaccelbase.h" #include #include -#include -#include +#include +#include #include #include diff --git a/tdecore/tdesycoca.cpp b/tdecore/tdesycoca.cpp index 16914c0bc..8f5ede967 100644 --- a/tdecore/tdesycoca.cpp +++ b/tdecore/tdesycoca.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdecore/tests/Makefile.am b/tdecore/tests/Makefile.am index 2911d3ab8..a831eb65c 100644 --- a/tdecore/tests/Makefile.am +++ b/tdecore/tests/Makefile.am @@ -41,7 +41,7 @@ LDADD = ../libtdecore.la tdeconfigtestgui_SOURCES = tdeconfigtestgui.cpp kdebugtest_SOURCES = kdebugtest.cpp klocaletest_SOURCES = klocaletest.cpp -#klocaletest2_SOURCES = klocaletest2.cpp klocale.cpp libintl.cpp kcatalogue.cpp +#klocaletest2_SOURCES = klocaletest2.cpp tdelocale.cpp libintl.cpp kcatalogue.cpp #kcatalogue_SOURCES = kcatalogue.cpp libintl.cpp ksimpleconfigtest_SOURCES = ksimpleconfigtest.cpp kurltest_SOURCES = kurltest.cpp diff --git a/tdecore/tests/kapptest.cpp b/tdecore/tests/kapptest.cpp index 0952f292c..6a3abace9 100644 --- a/tdecore/tests/kapptest.cpp +++ b/tdecore/tests/kapptest.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include int diff --git a/tdecore/tests/kcalendartest.cpp b/tdecore/tests/kcalendartest.cpp index 12c9010e2..7dc2cc6d7 100644 --- a/tdecore/tests/kcalendartest.cpp +++ b/tdecore/tests/kcalendartest.cpp @@ -10,8 +10,8 @@ #include #include #include -#include -#include +#include +#include #include class TDELocale; diff --git a/tdecore/tests/kcmdlineargstest.cpp b/tdecore/tests/kcmdlineargstest.cpp index 8148e4208..5213e443f 100644 --- a/tdecore/tests/kcmdlineargstest.cpp +++ b/tdecore/tests/kcmdlineargstest.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include diff --git a/tdecore/tests/kglobaltest.cpp b/tdecore/tests/kglobaltest.cpp index eaab091f9..852e2ba34 100644 --- a/tdecore/tests/kglobaltest.cpp +++ b/tdecore/tests/kglobaltest.cpp @@ -1,6 +1,6 @@ #include -#include +#include #include #include #include diff --git a/tdecore/tests/klocaletest.cpp b/tdecore/tests/klocaletest.cpp index 0647a10d3..36f301d6c 100644 --- a/tdecore/tests/klocaletest.cpp +++ b/tdecore/tests/klocaletest.cpp @@ -11,9 +11,9 @@ #include #include -#include -#include -#include "klocale.h" +#include +#include +#include "tdelocale.h" #include #include #include diff --git a/tdecore/tests/kmdcodectest.cpp b/tdecore/tests/kmdcodectest.cpp index bd3162f52..571d3f10b 100644 --- a/tdecore/tests/kmdcodectest.cpp +++ b/tdecore/tests/kmdcodectest.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/tdecore/tests/krfcdatetest.cpp b/tdecore/tests/krfcdatetest.cpp index 6ef0fe5e5..94358a8f1 100644 --- a/tdecore/tests/krfcdatetest.cpp +++ b/tdecore/tests/krfcdatetest.cpp @@ -2,7 +2,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdecore/tests/ksocktest.cpp b/tdecore/tests/ksocktest.cpp index 01a9c4c3a..a1ce8f86b 100644 --- a/tdecore/tests/ksocktest.cpp +++ b/tdecore/tests/ksocktest.cpp @@ -17,7 +17,7 @@ */ #include "kuniqueapplication.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "kdebug.h" #include "ksock.h" #include "ksockaddr.h" diff --git a/tdecore/tests/ktempfiletest.cpp b/tdecore/tests/ktempfiletest.cpp index 20cd6b36d..5c2354fff 100644 --- a/tdecore/tests/ktempfiletest.cpp +++ b/tdecore/tests/ktempfiletest.cpp @@ -16,7 +16,7 @@ Boston, MA 02110-1301, USA. */ -#include "ktempfile.h" +#include "tdetempfile.h" #include "tdeapplication.h" #include "kstandarddirs.h" #include diff --git a/tdecore/tests/kuniqueapptest.cpp b/tdecore/tests/kuniqueapptest.cpp index 60ac98b5a..13b8ca534 100644 --- a/tdecore/tests/kuniqueapptest.cpp +++ b/tdecore/tests/kuniqueapptest.cpp @@ -17,7 +17,7 @@ */ #include "kuniqueapplication.h" -#include "kglobalsettings.h" +#include "tdeglobalsettings.h" #include #include diff --git a/tdecore/tests/kurltest.cpp b/tdecore/tests/kurltest.cpp index 6694d0d80..0f57dd97c 100644 --- a/tdecore/tests/kurltest.cpp +++ b/tdecore/tests/kurltest.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdecore/tests/startserviceby.cpp b/tdecore/tests/startserviceby.cpp index 20fc95f34..67c535cec 100644 --- a/tdecore/tests/startserviceby.cpp +++ b/tdecore/tests/startserviceby.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include int diff --git a/tdecore/tests/testqtargs.cpp b/tdecore/tests/testqtargs.cpp index 8383f930e..d69b3f6f4 100644 --- a/tdecore/tests/testqtargs.cpp +++ b/tdecore/tests/testqtargs.cpp @@ -46,7 +46,7 @@ application palette (light and dark shades are\ncalculated)."), 0}, #include #include #include -#include +#include static const TDECmdLineOptions options[] = { diff --git a/tdecore/twin.cpp b/tdecore/twin.cpp index 93352dacc..e96c25011 100644 --- a/tdecore/twin.cpp +++ b/tdecore/twin.cpp @@ -37,16 +37,16 @@ #include "twin.h" #include "tdeapplication.h" -#include +#include #include #include #include -#include +#include #include #include #ifdef Q_WS_X11 -#include +#include #include #include diff --git a/tdecore/twinmodule.cpp b/tdecore/twinmodule.cpp index 27b8b0cdd..a37370e58 100644 --- a/tdecore/twinmodule.cpp +++ b/tdecore/twinmodule.cpp @@ -30,7 +30,7 @@ #include "kdebug.h" #include #include -#include +#include #include #include "netwm.h" diff --git a/tdefile-plugins/elf/tdefile_elf.cpp b/tdefile-plugins/elf/tdefile_elf.cpp index cad269713..7308a40d1 100644 --- a/tdefile-plugins/elf/tdefile_elf.cpp +++ b/tdefile-plugins/elf/tdefile_elf.cpp @@ -21,7 +21,7 @@ #include "tdefile_elf.h" #include -#include +#include #include #include #include diff --git a/tdehtml/css/csshelper.cpp b/tdehtml/css/csshelper.cpp index 02b5b3d39..a6ea9c38b 100644 --- a/tdehtml/css/csshelper.cpp +++ b/tdehtml/css/csshelper.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include "rendering/render_style.h" diff --git a/tdehtml/css/cssparser.cpp b/tdehtml/css/cssparser.cpp index b33151b59..8b11c78d2 100644 --- a/tdehtml/css/cssparser.cpp +++ b/tdehtml/css/cssparser.cpp @@ -26,7 +26,7 @@ #define YYDEBUG 0 #include -#include +#include #include #include "cssparser.h" diff --git a/tdehtml/css/cssstyleselector.cpp b/tdehtml/css/cssstyleselector.cpp index 2a1fb5477..79f8ba251 100644 --- a/tdehtml/css/cssstyleselector.cpp +++ b/tdehtml/css/cssstyleselector.cpp @@ -57,7 +57,7 @@ using namespace DOM; #include #include -#include +#include #include #include #include diff --git a/tdehtml/ecma/kjs_debugwin.cpp b/tdehtml/ecma/kjs_debugwin.cpp index f1b2b430d..b7bd23de3 100644 --- a/tdehtml/ecma/kjs_debugwin.cpp +++ b/tdehtml/ecma/kjs_debugwin.cpp @@ -41,17 +41,17 @@ #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include -#include +#include #include #include #include diff --git a/tdehtml/ecma/kjs_html.cpp b/tdehtml/ecma/kjs_html.cpp index 8a63ba943..abd059e75 100644 --- a/tdehtml/ecma/kjs_html.cpp +++ b/tdehtml/ecma/kjs_html.cpp @@ -56,9 +56,9 @@ #include "rendering/render_frames.h" #include "rendering/render_layer.h" -#include "kmessagebox.h" +#include "tdemessagebox.h" #include -#include +#include #include diff --git a/tdehtml/ecma/kjs_mozilla.cpp b/tdehtml/ecma/kjs_mozilla.cpp index 6fc7688dd..d26aabb5e 100644 --- a/tdehtml/ecma/kjs_mozilla.cpp +++ b/tdehtml/ecma/kjs_mozilla.cpp @@ -18,7 +18,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include "kjs_mozilla.h" diff --git a/tdehtml/ecma/kjs_navigator.cpp b/tdehtml/ecma/kjs_navigator.cpp index 03bc22987..296290744 100644 --- a/tdehtml/ecma/kjs_navigator.cpp +++ b/tdehtml/ecma/kjs_navigator.cpp @@ -21,13 +21,13 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ -#include +#include #include #include #include -#include +#include #include #include #include diff --git a/tdehtml/ecma/kjs_proxy.cpp b/tdehtml/ecma/kjs_proxy.cpp index 578cd30f0..bdd7183fe 100644 --- a/tdehtml/ecma/kjs_proxy.cpp +++ b/tdehtml/ecma/kjs_proxy.cpp @@ -38,10 +38,10 @@ #include "xml/dom_nodeimpl.h" #include "tdehtmlpart_p.h" #include -#include +#include #include -#include -#include +#include +#include #include #include #include diff --git a/tdehtml/ecma/kjs_window.cpp b/tdehtml/ecma/kjs_window.cpp index 1d38de27e..554781cb9 100644 --- a/tdehtml/ecma/kjs_window.cpp +++ b/tdehtml/ecma/kjs_window.cpp @@ -36,9 +36,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -50,7 +50,7 @@ #ifndef KONQ_EMBEDDED #include #endif -#include +#include #include #include #include diff --git a/tdehtml/html/dtd.cpp b/tdehtml/html/dtd.cpp index accc8b855..d3ea86d51 100644 --- a/tdehtml/html/dtd.cpp +++ b/tdehtml/html/dtd.cpp @@ -26,7 +26,7 @@ using namespace DOM; #include -#include +#include // priority of tags. Closing tags of higher priority close tags of lower // priority. diff --git a/tdehtml/html/html_documentimpl.cpp b/tdehtml/html/html_documentimpl.cpp index e4f090973..52ada7a7b 100644 --- a/tdehtml/html/html_documentimpl.cpp +++ b/tdehtml/html/html_documentimpl.cpp @@ -47,9 +47,9 @@ #include #include #include -#include +#include #include -#include +#include #include "css/cssproperties.h" #include "css/cssstyleselector.h" diff --git a/tdehtml/html/html_elementimpl.cpp b/tdehtml/html/html_elementimpl.cpp index 1153e8b7f..fc116caf3 100644 --- a/tdehtml/html/html_elementimpl.cpp +++ b/tdehtml/html/html_elementimpl.cpp @@ -50,7 +50,7 @@ #include "xml/dom2_eventsimpl.h" #include -#include +#include #include "html_elementimpl.h" using namespace DOM; diff --git a/tdehtml/html/html_formimpl.cpp b/tdehtml/html/html_formimpl.cpp index 372904e0e..6fae233dd 100644 --- a/tdehtml/html/html_formimpl.cpp +++ b/tdehtml/html/html_formimpl.cpp @@ -47,12 +47,12 @@ #include "rendering/render_form.h" #include -#include +#include #include #include -#include +#include #include -#include +#include #ifndef TDEHTML_NO_WALLET #include #endif diff --git a/tdehtml/html/html_imageimpl.cpp b/tdehtml/html/html_imageimpl.cpp index b1972aad4..a006b3bd0 100644 --- a/tdehtml/html/html_imageimpl.cpp +++ b/tdehtml/html/html_imageimpl.cpp @@ -29,7 +29,7 @@ #include "tdehtml_part.h" #include -#include +#include #include #include "rendering/render_image.h" diff --git a/tdehtml/html/html_tableimpl.cpp b/tdehtml/html/html_tableimpl.cpp index 71fe14773..f14ad8583 100644 --- a/tdehtml/html/html_tableimpl.cpp +++ b/tdehtml/html/html_tableimpl.cpp @@ -43,7 +43,7 @@ #include "rendering/render_table.h" #include -#include +#include using namespace tdehtml; using namespace DOM; diff --git a/tdehtml/html/htmlparser.cpp b/tdehtml/html/htmlparser.cpp index f7cc1daaf..31d3d4c17 100644 --- a/tdehtml/html/htmlparser.cpp +++ b/tdehtml/html/htmlparser.cpp @@ -56,7 +56,7 @@ #include "html/htmlparser.h" #include -#include +#include using namespace DOM; using namespace tdehtml; diff --git a/tdehtml/html/htmltokenizer.cpp b/tdehtml/html/htmltokenizer.cpp index 62d3ffab6..292d1773d 100644 --- a/tdehtml/html/htmltokenizer.cpp +++ b/tdehtml/html/htmltokenizer.cpp @@ -50,7 +50,7 @@ #include "css/csshelper.h" #include "ecma/kjs_proxy.h" #include -#include +#include #include #include #include diff --git a/tdehtml/java/kjavaapplet.cpp b/tdehtml/java/kjavaapplet.cpp index 70a39afbc..a28e541e2 100644 --- a/tdehtml/java/kjavaapplet.cpp +++ b/tdehtml/java/kjavaapplet.cpp @@ -22,7 +22,7 @@ #include "kjavaappletwidget.h" #include "kjavaappletcontext.h" -#include +#include #include #include diff --git a/tdehtml/java/kjavaappletcontext.cpp b/tdehtml/java/kjavaappletcontext.cpp index 76914a5dc..b644b67ca 100644 --- a/tdehtml/java/kjavaappletcontext.cpp +++ b/tdehtml/java/kjavaappletcontext.cpp @@ -23,8 +23,8 @@ #include "kjavaappletserver.h" #include "kjavaprocess.h" #include "kjavaapplet.h" -#include -#include +#include +#include #include #include #include diff --git a/tdehtml/java/kjavaappletserver.cpp b/tdehtml/java/kjavaappletserver.cpp index 5d108ffcf..952fe143b 100644 --- a/tdehtml/java/kjavaappletserver.cpp +++ b/tdehtml/java/kjavaappletserver.cpp @@ -27,13 +27,13 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/tdehtml/java/kjavaappletviewer.cpp b/tdehtml/java/kjavaappletviewer.cpp index 5d5b47fbf..f80690aa9 100644 --- a/tdehtml/java/kjavaappletviewer.cpp +++ b/tdehtml/java/kjavaappletviewer.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdehtml/java/kjavaappletwidget.cpp b/tdehtml/java/kjavaappletwidget.cpp index c096261cd..a1f5b8f11 100644 --- a/tdehtml/java/kjavaappletwidget.cpp +++ b/tdehtml/java/kjavaappletwidget.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include diff --git a/tdehtml/java/kjavaprocess.cpp b/tdehtml/java/kjavaprocess.cpp index 1ff68dd74..6b505c343 100644 --- a/tdehtml/java/kjavaprocess.cpp +++ b/tdehtml/java/kjavaprocess.cpp @@ -22,7 +22,7 @@ #include "kjavaprocess.h" #include -#include +#include #include #include diff --git a/tdehtml/misc/arena.cpp b/tdehtml/misc/arena.cpp index cfbce24ab..e2513ba36 100644 --- a/tdehtml/misc/arena.cpp +++ b/tdehtml/misc/arena.cpp @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include "arena.h" #ifdef HAVE_GETPAGESIZE diff --git a/tdehtml/misc/decoder.cpp b/tdehtml/misc/decoder.cpp index 6000aa9cf..28c8a5e9d 100644 --- a/tdehtml/misc/decoder.cpp +++ b/tdehtml/misc/decoder.cpp @@ -39,12 +39,12 @@ using namespace tdehtml; #include #include -#include +#include #include #include #include -#include +#include diff --git a/tdehtml/misc/htmlhashes.cpp b/tdehtml/misc/htmlhashes.cpp index e073f0964..376007819 100644 --- a/tdehtml/misc/htmlhashes.cpp +++ b/tdehtml/misc/htmlhashes.cpp @@ -19,7 +19,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include "htmlhashes.h" #include "htmltags.c" diff --git a/tdehtml/misc/htmltags.h b/tdehtml/misc/htmltags.h index d8fbb3236..bf9a8ded8 100644 --- a/tdehtml/misc/htmltags.h +++ b/tdehtml/misc/htmltags.h @@ -5,7 +5,7 @@ #define TDEHTML_TAGS_H #include "dom/dom_string.h" -#include +#include KDE_NO_EXPORT const char* getTagName(unsigned short id); diff --git a/tdehtml/misc/knsplugininstaller.cpp b/tdehtml/misc/knsplugininstaller.cpp index 0edcc34ea..b8b94cd6b 100644 --- a/tdehtml/misc/knsplugininstaller.cpp +++ b/tdehtml/misc/knsplugininstaller.cpp @@ -24,11 +24,11 @@ #include "knsplugininstaller.moc" #include -#include +#include #include -#include +#include #include -#include +#include #include #include diff --git a/tdehtml/misc/loader.cpp b/tdehtml/misc/loader.cpp index b7f42aa29..7621b5e4f 100644 --- a/tdehtml/misc/loader.cpp +++ b/tdehtml/misc/loader.cpp @@ -59,7 +59,7 @@ #include #include #include -#include +#include #include #include #include @@ -71,7 +71,7 @@ #ifdef IMAGE_TITLES #include #include -#include +#include #endif #include "html/html_documentimpl.h" diff --git a/tdehtml/misc/loader_jpeg.cpp b/tdehtml/misc/loader_jpeg.cpp index 72816817f..9ee5378f9 100644 --- a/tdehtml/misc/loader_jpeg.cpp +++ b/tdehtml/misc/loader_jpeg.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include extern "C" { #define XMD_H diff --git a/tdehtml/misc/maketags b/tdehtml/misc/maketags index b2b472892..8a6abf0ed 100644 --- a/tdehtml/misc/maketags +++ b/tdehtml/misc/maketags @@ -41,7 +41,7 @@ print header < +#include KDE_NO_EXPORT const char* getTagName(unsigned short id); diff --git a/tdehtml/rendering/font.cpp b/tdehtml/rendering/font.cpp index b7632fc8d..c70073940 100644 --- a/tdehtml/rendering/font.cpp +++ b/tdehtml/rendering/font.cpp @@ -33,7 +33,7 @@ #include "tdehtml_settings.h" #include -#include +#include #include #include diff --git a/tdehtml/rendering/render_applet.cpp b/tdehtml/rendering/render_applet.cpp index d14a93553..eb9762897 100644 --- a/tdehtml/rendering/render_applet.cpp +++ b/tdehtml/rendering/render_applet.cpp @@ -20,7 +20,7 @@ * */ #include -#include +#include #include diff --git a/tdehtml/rendering/render_body.cpp b/tdehtml/rendering/render_body.cpp index 80a613000..820b1b872 100644 --- a/tdehtml/rendering/render_body.cpp +++ b/tdehtml/rendering/render_body.cpp @@ -25,7 +25,7 @@ #include "xml/dom_docimpl.h" #include "tdehtmlview.h" -#include +#include #include using namespace tdehtml; diff --git a/tdehtml/rendering/render_box.cpp b/tdehtml/rendering/render_box.cpp index d138d3ee2..85e1f6665 100644 --- a/tdehtml/rendering/render_box.cpp +++ b/tdehtml/rendering/render_box.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include #include diff --git a/tdehtml/rendering/render_canvas.cpp b/tdehtml/rendering/render_canvas.cpp index a3dc548b2..862f374b2 100644 --- a/tdehtml/rendering/render_canvas.cpp +++ b/tdehtml/rendering/render_canvas.cpp @@ -29,7 +29,7 @@ #include "tdehtmlview.h" #include "tdehtml_part.h" #include -#include +#include using namespace tdehtml; diff --git a/tdehtml/rendering/render_flow.cpp b/tdehtml/rendering/render_flow.cpp index 272ceb2db..a535b218e 100644 --- a/tdehtml/rendering/render_flow.cpp +++ b/tdehtml/rendering/render_flow.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include "rendering/render_flow.h" #include "rendering/render_text.h" diff --git a/tdehtml/rendering/render_form.cpp b/tdehtml/rendering/render_form.cpp index 89f38a7b2..9d302bfc8 100644 --- a/tdehtml/rendering/render_form.cpp +++ b/tdehtml/rendering/render_form.cpp @@ -30,8 +30,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdehtml/rendering/render_frames.cpp b/tdehtml/rendering/render_frames.cpp index 12d0d75ec..68c66495a 100644 --- a/tdehtml/rendering/render_frames.cpp +++ b/tdehtml/rendering/render_frames.cpp @@ -39,9 +39,9 @@ #include "misc/knsplugininstaller.h" #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdehtml/rendering/render_image.cpp b/tdehtml/rendering/render_image.cpp index b41911e3a..ad8f18bb3 100644 --- a/tdehtml/rendering/render_image.cpp +++ b/tdehtml/rendering/render_image.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include "css/csshelper.h" #include "misc/helper.h" diff --git a/tdehtml/rendering/render_inline.cpp b/tdehtml/rendering/render_inline.cpp index aee43a817..15bc1b0df 100644 --- a/tdehtml/rendering/render_inline.cpp +++ b/tdehtml/rendering/render_inline.cpp @@ -23,7 +23,7 @@ * */ -#include +#include #include "rendering/render_arena.h" #include "rendering/render_inline.h" diff --git a/tdehtml/rendering/render_line.cpp b/tdehtml/rendering/render_line.cpp index b518d3a43..d8bc8d0e2 100644 --- a/tdehtml/rendering/render_line.cpp +++ b/tdehtml/rendering/render_line.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "rendering/render_flow.h" #include "rendering/render_text.h" diff --git a/tdehtml/rendering/render_list.cpp b/tdehtml/rendering/render_list.cpp index 5af983a72..cc9ba4e5b 100644 --- a/tdehtml/rendering/render_list.cpp +++ b/tdehtml/rendering/render_list.cpp @@ -35,7 +35,7 @@ #include "xml/dom_docimpl.h" #include -#include +#include #include //#define BOX_DEBUG diff --git a/tdehtml/rendering/render_object.cpp b/tdehtml/rendering/render_object.cpp index 1d16057a2..a979e1dc1 100644 --- a/tdehtml/rendering/render_object.cpp +++ b/tdehtml/rendering/render_object.cpp @@ -45,7 +45,7 @@ #include "misc/loader.h" #include -#include +#include #include #include "tdehtmlview.h" #include diff --git a/tdehtml/rendering/render_object.h b/tdehtml/rendering/render_object.h index 8d066201c..bf120ff84 100644 --- a/tdehtml/rendering/render_object.h +++ b/tdehtml/rendering/render_object.h @@ -32,7 +32,7 @@ #include #include -#include +#include #include "xml/dom_docimpl.h" #include "misc/tdehtmllayout.h" diff --git a/tdehtml/rendering/render_replaced.cpp b/tdehtml/rendering/render_replaced.cpp index 5a96d06f0..2d991c3a2 100644 --- a/tdehtml/rendering/render_replaced.cpp +++ b/tdehtml/rendering/render_replaced.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdehtml/rendering/render_table.cpp b/tdehtml/rendering/render_table.cpp index 8a75c73f2..9f2cc3366 100644 --- a/tdehtml/rendering/render_table.cpp +++ b/tdehtml/rendering/render_table.cpp @@ -40,7 +40,7 @@ #include "rendering/render_line.h" #include "xml/dom_docimpl.h" -#include +#include #include #include diff --git a/tdehtml/rendering/render_text.cpp b/tdehtml/rendering/render_text.cpp index d125b04c6..411f3f221 100644 --- a/tdehtml/rendering/render_text.cpp +++ b/tdehtml/rendering/render_text.cpp @@ -43,7 +43,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdehtml/rendering/table_layout.cpp b/tdehtml/rendering/table_layout.cpp index eb8153331..97a6a4c91 100644 --- a/tdehtml/rendering/table_layout.cpp +++ b/tdehtml/rendering/table_layout.cpp @@ -23,7 +23,7 @@ #include "table_layout.h" #include "render_table.h" -#include +#include using namespace tdehtml; diff --git a/tdehtml/tdehtml_ext.cpp b/tdehtml/tdehtml_ext.cpp index 3cc65676d..b7dfb8a42 100644 --- a/tdehtml/tdehtml_ext.cpp +++ b/tdehtml/tdehtml_ext.cpp @@ -44,7 +44,7 @@ #include #include -#include +#include #include #include #include @@ -54,7 +54,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdehtml/tdehtml_factory.cpp b/tdehtml/tdehtml_factory.cpp index b52476ea1..4094030c6 100644 --- a/tdehtml/tdehtml_factory.cpp +++ b/tdehtml/tdehtml_factory.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include #include diff --git a/tdehtml/tdehtml_pagecache.cpp b/tdehtml/tdehtml_pagecache.cpp index c2e0a89e1..319dd8162 100644 --- a/tdehtml/tdehtml_pagecache.cpp +++ b/tdehtml/tdehtml_pagecache.cpp @@ -21,7 +21,7 @@ #include "tdehtml_pagecache.h" #include -#include +#include #include #include diff --git a/tdehtml/tdehtml_part.cpp b/tdehtml/tdehtml_part.cpp index c4bba759c..28b15c7d1 100644 --- a/tdehtml/tdehtml_part.cpp +++ b/tdehtml/tdehtml_part.cpp @@ -78,18 +78,18 @@ using namespace DOM; #include #include #include -#include +#include #include #include -#include +#include #include -#include +#include #include #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdehtml/tdehtml_printsettings.cpp b/tdehtml/tdehtml_printsettings.cpp index 251c3403f..19fe7bdbf 100644 --- a/tdehtml/tdehtml_printsettings.cpp +++ b/tdehtml/tdehtml_printsettings.cpp @@ -19,7 +19,7 @@ #include "tdehtml_printsettings.h" -#include +#include #include #include #include diff --git a/tdehtml/tdehtml_run.cpp b/tdehtml/tdehtml_run.cpp index 2a5fd1861..499616cce 100644 --- a/tdehtml/tdehtml_run.cpp +++ b/tdehtml/tdehtml_run.cpp @@ -24,7 +24,7 @@ #include "tdehtml_run.h" #include #include -#include +#include #include "tdehtml_ext.h" #include diff --git a/tdehtml/tdehtml_settings.cc b/tdehtml/tdehtml_settings.cc index 8e36f5891..7f799e311 100644 --- a/tdehtml/tdehtml_settings.cc +++ b/tdehtml/tdehtml_settings.cc @@ -21,14 +21,14 @@ #include "tdehtml_settings.h" #include "tdehtmldefaults.h" -#include +#include #include -#include -#include +#include +#include #include #include #include -#include +#include /** * @internal diff --git a/tdehtml/tdehtmlimage.cpp b/tdehtml/tdehtmlimage.cpp index bf05d8495..31311cb3d 100644 --- a/tdehtml/tdehtmlimage.cpp +++ b/tdehtml/tdehtmlimage.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include K_EXPORT_COMPONENT_FACTORY( tdehtmlimagefactory /*NOT the part name, see Makefile.am*/, TDEHTMLImageFactory ) diff --git a/tdehtml/tdehtmlview.cpp b/tdehtml/tdehtmlview.cpp index 010075f2a..16b274cbd 100644 --- a/tdehtml/tdehtmlview.cpp +++ b/tdehtml/tdehtmlview.cpp @@ -67,7 +67,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdehtml/tdemultipart/tdemultipart.cpp b/tdehtml/tdemultipart/tdemultipart.cpp index dd864d65b..201f1ef60 100644 --- a/tdehtml/tdemultipart/tdemultipart.cpp +++ b/tdehtml/tdemultipart/tdemultipart.cpp @@ -22,11 +22,11 @@ #include #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdehtml/test_regression.cpp b/tdehtml/test_regression.cpp index 028fadc36..62842e086 100644 --- a/tdehtml/test_regression.cpp +++ b/tdehtml/test_regression.cpp @@ -65,7 +65,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdehtml/xml/dom_docimpl.cpp b/tdehtml/xml/dom_docimpl.cpp index 47836b41e..423a2a51e 100644 --- a/tdehtml/xml/dom_docimpl.cpp +++ b/tdehtml/xml/dom_docimpl.cpp @@ -46,7 +46,7 @@ #include #include #include -#include +#include #include #include "rendering/counter_tree.h" @@ -60,7 +60,7 @@ #include "tdehtmlview.h" #include "tdehtml_part.h" -#include +#include #include #include #include "tdehtml_settings.h" diff --git a/tdehtml/xml/dom_nodeimpl.cpp b/tdehtml/xml/dom_nodeimpl.cpp index ac8ca630e..7e2e1bc5f 100644 --- a/tdehtml/xml/dom_nodeimpl.cpp +++ b/tdehtml/xml/dom_nodeimpl.cpp @@ -33,7 +33,7 @@ #include "xml/dom_nodeimpl.h" #include "xml/dom_restyler.h" -#include +#include #include #include "rendering/render_text.h" diff --git a/tdehtml/xml/xml_tokenizer.cpp b/tdehtml/xml/xml_tokenizer.cpp index 44f90673f..2ee90097b 100644 --- a/tdehtml/xml/xml_tokenizer.cpp +++ b/tdehtml/xml/xml_tokenizer.cpp @@ -36,7 +36,7 @@ #include "tdehtml_part.h" #include #include -#include +#include using namespace DOM; using namespace tdehtml; diff --git a/tdeio/bookmarks/kbookmark.cc b/tdeio/bookmarks/kbookmark.cc index e6bef2e02..8bbaa5e43 100644 --- a/tdeio/bookmarks/kbookmark.cc +++ b/tdeio/bookmarks/kbookmark.cc @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeio/bookmarks/kbookmarkexporter.cc b/tdeio/bookmarks/kbookmarkexporter.cc index 30c52bdb8..ee33612a2 100644 --- a/tdeio/bookmarks/kbookmarkexporter.cc +++ b/tdeio/bookmarks/kbookmarkexporter.cc @@ -24,7 +24,7 @@ #include #include -#include +#include #include "kbookmarkmanager.h" #include "kbookmarkexporter.h" diff --git a/tdeio/bookmarks/kbookmarkimporter.cc b/tdeio/bookmarks/kbookmarkimporter.cc index 366802905..513f89b40 100644 --- a/tdeio/bookmarks/kbookmarkimporter.cc +++ b/tdeio/bookmarks/kbookmarkimporter.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeio/bookmarks/kbookmarkimporter_crash.cc b/tdeio/bookmarks/kbookmarkimporter_crash.cc index 0443b3b1c..9b0cacf25 100644 --- a/tdeio/bookmarks/kbookmarkimporter_crash.cc +++ b/tdeio/bookmarks/kbookmarkimporter_crash.cc @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeio/bookmarks/kbookmarkimporter_ie.cc b/tdeio/bookmarks/kbookmarkimporter_ie.cc index 092ebe596..d588517a3 100644 --- a/tdeio/bookmarks/kbookmarkimporter_ie.cc +++ b/tdeio/bookmarks/kbookmarkimporter_ie.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/tdeio/bookmarks/kbookmarkimporter_kde1.cc b/tdeio/bookmarks/kbookmarkimporter_kde1.cc index 6aca22b84..95937f890 100644 --- a/tdeio/bookmarks/kbookmarkimporter_kde1.cc +++ b/tdeio/bookmarks/kbookmarkimporter_kde1.cc @@ -21,7 +21,7 @@ #include "kbookmarkimporter_kde1.h" #include #include -#include +#include #include #include #include diff --git a/tdeio/bookmarks/kbookmarkimporter_ns.cc b/tdeio/bookmarks/kbookmarkimporter_ns.cc index 8ce06a79b..29960ce51 100644 --- a/tdeio/bookmarks/kbookmarkimporter_ns.cc +++ b/tdeio/bookmarks/kbookmarkimporter_ns.cc @@ -25,7 +25,7 @@ #include "kbookmarkmanager.h" #include #include -#include +#include #include #include #include diff --git a/tdeio/bookmarks/kbookmarkimporter_opera.cc b/tdeio/bookmarks/kbookmarkimporter_opera.cc index 57b5d6208..0609c7a3b 100644 --- a/tdeio/bookmarks/kbookmarkimporter_opera.cc +++ b/tdeio/bookmarks/kbookmarkimporter_opera.cc @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/tdeio/bookmarks/kbookmarkmanager.cc b/tdeio/bookmarks/kbookmarkmanager.cc index 205d879ab..60d4f2932 100644 --- a/tdeio/bookmarks/kbookmarkmanager.cc +++ b/tdeio/bookmarks/kbookmarkmanager.cc @@ -29,9 +29,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeio/bookmarks/kbookmarkmenu.cc b/tdeio/bookmarks/kbookmarkmenu.cc index 0468bcd5a..e1b00bc40 100644 --- a/tdeio/bookmarks/kbookmarkmenu.cc +++ b/tdeio/bookmarks/kbookmarkmenu.cc @@ -32,8 +32,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeio/bookmarks/kbookmarkmenu.h b/tdeio/bookmarks/kbookmarkmenu.h index 0c1ebb27c..aeed441b0 100644 --- a/tdeio/bookmarks/kbookmarkmenu.h +++ b/tdeio/bookmarks/kbookmarkmenu.h @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include "kbookmark.h" diff --git a/tdeio/bookmarks/kbookmarkmenu_p.h b/tdeio/bookmarks/kbookmarkmenu_p.h index fc34e9029..b47af8ebf 100644 --- a/tdeio/bookmarks/kbookmarkmenu_p.h +++ b/tdeio/bookmarks/kbookmarkmenu_p.h @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include "kbookmark.h" diff --git a/tdeio/httpfilter/httpfilter.cc b/tdeio/httpfilter/httpfilter.cc index 21086d613..0f6a45790 100644 --- a/tdeio/httpfilter/httpfilter.cc +++ b/tdeio/httpfilter/httpfilter.cc @@ -19,7 +19,7 @@ #include -#include +#include #include "httpfilter.h" diff --git a/tdeio/kpasswdserver/kpasswdserver.cpp b/tdeio/kpasswdserver/kpasswdserver.cpp index 4986eb45a..cf4e0530c 100644 --- a/tdeio/kpasswdserver/kpasswdserver.cpp +++ b/tdeio/kpasswdserver/kpasswdserver.cpp @@ -30,8 +30,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeio/kssl/kssl.cc b/tdeio/kssl/kssl.cc index 66cc503d5..874da6aa6 100644 --- a/tdeio/kssl/kssl.cc +++ b/tdeio/kssl/kssl.cc @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #define sk_dup d->kossl->sk_dup diff --git a/tdeio/kssl/ksslcertdlg.cc b/tdeio/kssl/ksslcertdlg.cc index ea3c29556..26550e715 100644 --- a/tdeio/kssl/ksslcertdlg.cc +++ b/tdeio/kssl/ksslcertdlg.cc @@ -30,9 +30,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/tdeio/kssl/ksslcertificate.cc b/tdeio/kssl/ksslcertificate.cc index e7310ccdc..1f95c3912 100644 --- a/tdeio/kssl/ksslcertificate.cc +++ b/tdeio/kssl/ksslcertificate.cc @@ -37,9 +37,9 @@ #include #include -#include +#include #include -#include +#include #include diff --git a/tdeio/kssl/ksslinfodlg.cc b/tdeio/kssl/ksslinfodlg.cc index 03a1300e8..7567b8595 100644 --- a/tdeio/kssl/ksslinfodlg.cc +++ b/tdeio/kssl/ksslinfodlg.cc @@ -31,11 +31,11 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include diff --git a/tdeio/kssl/ksslkeygen.cc b/tdeio/kssl/ksslkeygen.cc index 93d6d2da4..654444994 100644 --- a/tdeio/kssl/ksslkeygen.cc +++ b/tdeio/kssl/ksslkeygen.cc @@ -25,12 +25,12 @@ #include #include -#include -#include +#include +#include #include #include #include -#include +#include #include #include diff --git a/tdeio/kssl/ksslpemcallback.cc b/tdeio/kssl/ksslpemcallback.cc index 2dfbb9146..207949a0c 100644 --- a/tdeio/kssl/ksslpemcallback.cc +++ b/tdeio/kssl/ksslpemcallback.cc @@ -23,7 +23,7 @@ #endif #include -#include +#include #include "ksslpemcallback.h" int KSSLPemCallback(char *buf, int size, int rwflag, void *userdata) { diff --git a/tdeio/kssl/ksslpkcs12.cc b/tdeio/kssl/ksslpkcs12.cc index b8b23cf1c..9521e907b 100644 --- a/tdeio/kssl/ksslpkcs12.cc +++ b/tdeio/kssl/ksslpkcs12.cc @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeio/kssl/ksslpkcs7.cc b/tdeio/kssl/ksslpkcs7.cc index 8db0000f0..cb66eb468 100644 --- a/tdeio/kssl/ksslpkcs7.cc +++ b/tdeio/kssl/ksslpkcs7.cc @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeio/kssl/ksslsettings.cc b/tdeio/kssl/ksslsettings.cc index 9895a702b..fbf10b476 100644 --- a/tdeio/kssl/ksslsettings.cc +++ b/tdeio/kssl/ksslsettings.cc @@ -33,7 +33,7 @@ #include #include "ksslsettings.h" -#include +#include #include #include diff --git a/tdeio/kssl/ksslutils.cc b/tdeio/kssl/ksslutils.cc index 80651757f..444e5dd4a 100644 --- a/tdeio/kssl/ksslutils.cc +++ b/tdeio/kssl/ksslutils.cc @@ -22,8 +22,8 @@ #include "ksslutils.h" #include -#include -#include +#include +#include #include #include "kopenssl.h" diff --git a/tdeio/misc/kpac/discovery.cpp b/tdeio/misc/kpac/discovery.cpp index 4f33d1389..533c4fcca 100644 --- a/tdeio/misc/kpac/discovery.cpp +++ b/tdeio/misc/kpac/discovery.cpp @@ -41,7 +41,7 @@ #include -#include +#include #include #include diff --git a/tdeio/misc/kpac/downloader.cpp b/tdeio/misc/kpac/downloader.cpp index c94cc9b72..483e836cb 100644 --- a/tdeio/misc/kpac/downloader.cpp +++ b/tdeio/misc/kpac/downloader.cpp @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include #include #include "downloader.moc" diff --git a/tdeio/misc/kpac/proxyscout.cpp b/tdeio/misc/kpac/proxyscout.cpp index a010d328e..dfb682005 100644 --- a/tdeio/misc/kpac/proxyscout.cpp +++ b/tdeio/misc/kpac/proxyscout.cpp @@ -23,9 +23,9 @@ #include #include -#include +#include #include -#include +#include #include "proxyscout.moc" #include "discovery.h" diff --git a/tdeio/misc/kssld/kssld.cpp b/tdeio/misc/kssld/kssld.cpp index d41041636..d47845bbb 100644 --- a/tdeio/misc/kssld/kssld.cpp +++ b/tdeio/misc/kssld/kssld.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeio/misc/tdefile/fileprops.cpp b/tdeio/misc/tdefile/fileprops.cpp index df210fa4d..aa6590ef5 100644 --- a/tdeio/misc/tdefile/fileprops.cpp +++ b/tdeio/misc/tdefile/fileprops.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include "fileprops.h" diff --git a/tdeio/misc/tdemailservice.cpp b/tdeio/misc/tdemailservice.cpp index 2d256c5c9..23066d633 100644 --- a/tdeio/misc/tdemailservice.cpp +++ b/tdeio/misc/tdemailservice.cpp @@ -17,7 +17,7 @@ */ #include -#include +#include #include static const TDECmdLineOptions options[] = diff --git a/tdeio/misc/tdesendbugmail/main.cpp b/tdeio/misc/tdesendbugmail/main.cpp index aaffd3b65..32465039d 100644 --- a/tdeio/misc/tdesendbugmail/main.cpp +++ b/tdeio/misc/tdesendbugmail/main.cpp @@ -9,8 +9,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeio/misc/tdetelnetservice.cpp b/tdeio/misc/tdetelnetservice.cpp index 99260d8d0..bf175bdc9 100644 --- a/tdeio/misc/tdetelnetservice.cpp +++ b/tdeio/misc/tdetelnetservice.cpp @@ -22,10 +22,10 @@ // $Id$ #include -#include +#include #include #include -#include +#include #include #include diff --git a/tdeio/misc/tdewalletd/tdewalletd.cpp b/tdeio/misc/tdewalletd/tdewalletd.cpp index 364197b72..126f0ce2b 100644 --- a/tdeio/misc/tdewalletd/tdewalletd.cpp +++ b/tdeio/misc/tdewalletd/tdewalletd.cpp @@ -32,9 +32,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/tdeio/misc/tdewalletd/tdewalletwizard.ui b/tdeio/misc/tdewalletd/tdewalletwizard.ui index aa3a1c09d..c31062c2a 100644 --- a/tdeio/misc/tdewalletd/tdewalletwizard.ui +++ b/tdeio/misc/tdewalletd/tdewalletwizard.ui @@ -531,7 +531,7 @@ tqcheckbox.h - klocale.h + tdelocale.h tdewalletwizard.ui.h diff --git a/tdeio/misc/uiserver.cpp b/tdeio/misc/uiserver.cpp index 107b57c64..c23628eae 100644 --- a/tdeio/misc/uiserver.cpp +++ b/tdeio/misc/uiserver.cpp @@ -31,12 +31,12 @@ #include #include #include -#include -#include +#include +#include #include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/CMakeLists.txt b/tdeio/tdefile/CMakeLists.txt index a69cad536..ed0350999 100644 --- a/tdeio/tdefile/CMakeLists.txt +++ b/tdeio/tdefile/CMakeLists.txt @@ -31,7 +31,7 @@ include_directories( install( FILES tdefiledialog.h kencodingfiledialog.h - kdiroperator.h tdefileview.h tdefilefiltercombo.h + tdediroperator.h tdefileview.h tdefilefiltercombo.h tdefiledetailview.h kcombiview.h kdiskfreesp.h tdefileiconview.h tderecentdocument.h kurlrequester.h tdefilepreview.h tdefile.h @@ -56,7 +56,7 @@ set( target tdefile ) set( ${target}_SRCS tdefilefiltercombo.cpp tdefileview.cpp tdefileiconview.cpp - tderecentdocument.cpp tdefiledialog.cpp kdiroperator.cpp + tderecentdocument.cpp tdefiledialog.cpp tdediroperator.cpp tdefiledetailview.cpp kcombiview.cpp kurlrequester.cpp tdefilepreview.cpp kurlcombobox.cpp kurlrequesterdlg.cpp kopenwith.cpp kpropertiesdialog.cpp kicondialog.cpp diff --git a/tdeio/tdefile/ChangeLog b/tdeio/tdefile/ChangeLog index ccfb45ab5..229f9f2f8 100644 --- a/tdeio/tdefile/ChangeLog +++ b/tdeio/tdefile/ChangeLog @@ -1,6 +1,6 @@ Sat Feb 26 00:26:55 2000 Carsten Pfeiffer - * kdiroperator.cpp: + * tdediroperator.cpp: lottsa changes, e.g. action handling more clear now. fixed completed item not clearning the previous selection @@ -17,7 +17,7 @@ Sat Feb 26 00:26:55 2000 Carsten Pfeiffer Sun Feb 20 01:50:44 2000 Carsten Pfeiffer - * kdiroperator.*, tdefiledialog.* (saveConfig): + * tdediroperator.*, tdefiledialog.* (saveConfig): implemented loading, saving and applying configuration * tdefiledialog.cpp (setURL): @@ -37,7 +37,7 @@ Thu Feb 17 19:09:54 2000 Carsten Pfeiffer Added KDirComboBox and replaced the directory combobox with it. It even does something now :) Items need to be indented tho. - * tdefilereader.cpp, kdiroperator.{cpp,h}: + * tdefilereader.cpp, tdediroperator.{cpp,h}: fixed showHidden default Tue Feb 15 14:21:41 2000 Carsten Pfeiffer @@ -60,7 +60,7 @@ Tue Feb 15 14:21:41 2000 Carsten Pfeiffer added static methods for multiselection added getOpenURL(), getOpenURLs and getSaveURL() - * kdiroperator.cpp (setSorting): + * tdediroperator.cpp (setSorting): added setSorting() and sorting() to keep sorting when switching views a few cosmetic and TDEAction changes @@ -86,7 +86,7 @@ Fri Feb 11 12:17:59 2000 Carsten Pfeiffer Thu Feb 10 17:06:36 2000 Carsten Pfeiffer - * kdiroperator.cpp (connectView): + * tdediroperator.cpp (connectView): - Now that TDEToggleAction is fixed, I can commit the new stuff: Offer Actions for all the common functionality, i.e. sorting, setting the view, home(), cdUp(), back, forward, etc. @@ -107,7 +107,7 @@ Thu Feb 10 17:06:36 2000 Carsten Pfeiffer Thu Feb 10 12:59:29 2000 Carsten Pfeiffer - * kdiroperator.cpp (insertNewFiles): + * tdediroperator.cpp (insertNewFiles): aahhh, finally fixed that infinite loop in KFileView::mergeLists clear the view before calling view->addItemList( currentContents ); @@ -173,7 +173,7 @@ Sat Jan 29 15:33:37 2000 Carsten Pfeiffer * tdefileviewitem.cpp: - added time_t mTime() to enable sorting by modification time - * kdiroperator.cpp: + * tdediroperator.cpp: - offer sorting options in popupmenu - use checkAccess before creating directories. I guess this will again change when the new kio will be used, tho. diff --git a/tdeio/tdefile/Makefile.am b/tdeio/tdefile/Makefile.am index 4e6b76ce1..857e843c5 100644 --- a/tdeio/tdefile/Makefile.am +++ b/tdeio/tdefile/Makefile.am @@ -27,7 +27,7 @@ METASOURCES = AUTO #SUBDIRS = . acl_prop_page include_HEADERS = tdefiledialog.h kencodingfiledialog.h\ - kdiroperator.h tdefileview.h tdefilefiltercombo.h \ + tdediroperator.h tdefileview.h tdefilefiltercombo.h \ tdefiledetailview.h kcombiview.h kdiskfreesp.h \ tdefileiconview.h tderecentdocument.h \ kurlrequester.h tdefilepreview.h tdefile.h \ @@ -44,7 +44,7 @@ noinst_HEADERS = config-tdefile.h tderecentdirs.h kmetaprops.h \ libtdefile_la_SOURCES = \ tdefilefiltercombo.cpp \ tdefileview.cpp tdefileiconview.cpp \ - tderecentdocument.cpp tdefiledialog.cpp kdiroperator.cpp \ + tderecentdocument.cpp tdefiledialog.cpp tdediroperator.cpp \ tdefiledetailview.cpp kcombiview.cpp kurlrequester.cpp \ tdefilepreview.cpp kurlcombobox.cpp kurlrequesterdlg.cpp \ kopenwith.cpp kpropertiesdialog.cpp kicondialog.cpp kdirsize.cpp \ diff --git a/tdeio/tdefile/kacleditwidget.cpp b/tdeio/tdefile/kacleditwidget.cpp index 01eb8bcb8..7e8e3dae2 100644 --- a/tdeio/tdefile/kacleditwidget.cpp +++ b/tdeio/tdefile/kacleditwidget.cpp @@ -38,7 +38,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/kcombiview.cpp b/tdeio/tdefile/kcombiview.cpp index 13830ab01..4c4f0cb06 100644 --- a/tdeio/tdefile/kcombiview.cpp +++ b/tdeio/tdefile/kcombiview.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include diff --git a/tdeio/tdefile/kcombiview.h b/tdeio/tdefile/kcombiview.h index 995b80ffc..af3680571 100644 --- a/tdeio/tdefile/kcombiview.h +++ b/tdeio/tdefile/kcombiview.h @@ -23,7 +23,7 @@ #define _KCOMBIVIEW_H #include -#include +#include #include #include diff --git a/tdeio/tdefile/kcustommenueditor.cpp b/tdeio/tdefile/kcustommenueditor.cpp index 65455aef0..b59108071 100644 --- a/tdeio/tdefile/kcustommenueditor.cpp +++ b/tdeio/tdefile/kcustommenueditor.cpp @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeio/tdefile/kdiroperator.cpp b/tdeio/tdefile/kdiroperator.cpp index 1ae03daec..dc44aa8ba 100644 --- a/tdeio/tdefile/kdiroperator.cpp +++ b/tdeio/tdefile/kdiroperator.cpp @@ -38,8 +38,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -55,7 +55,7 @@ #include "config-tdefile.h" #include "kcombiview.h" -#include "kdiroperator.h" +#include "tdediroperator.h" #include "tdefiledetailview.h" #include "tdefileiconview.h" #include "tdefilepreview.h" @@ -1737,4 +1737,4 @@ TQString KDirOperator::viewConfigGroup() const void KDirOperator::virtual_hook( int, void* ) { /*BASE::virtual_hook( id, data );*/ } -#include "kdiroperator.moc" +#include "tdediroperator.moc" diff --git a/tdeio/tdefile/kdirselectdialog.cpp b/tdeio/tdefile/kdirselectdialog.cpp index 39959229d..5027f631c 100644 --- a/tdeio/tdefile/kdirselectdialog.cpp +++ b/tdeio/tdefile/kdirselectdialog.cpp @@ -29,9 +29,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include @@ -41,7 +41,7 @@ #include #include #include -#include +#include #include "tdefiletreeview.h" #include "kdirselectdialog.h" diff --git a/tdeio/tdefile/kdirsize.cpp b/tdeio/tdefile/kdirsize.cpp index c2ea4079a..b2d48b4bf 100644 --- a/tdeio/tdefile/kdirsize.cpp +++ b/tdeio/tdefile/kdirsize.cpp @@ -19,7 +19,7 @@ #include "kdirsize.h" #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/kencodingfiledialog.cpp b/tdeio/tdefile/kencodingfiledialog.cpp index a49210642..d2d588a4e 100644 --- a/tdeio/tdefile/kencodingfiledialog.cpp +++ b/tdeio/tdefile/kencodingfiledialog.cpp @@ -24,11 +24,11 @@ #include "kencodingfiledialog.h" #include #include -#include -#include +#include +#include #include #include -#include +#include #include struct KEncodingFileDialogPrivate diff --git a/tdeio/tdefile/kicondialog.cpp b/tdeio/tdefile/kicondialog.cpp index 9d7975e2b..154f9e89d 100644 --- a/tdeio/tdefile/kicondialog.cpp +++ b/tdeio/tdefile/kicondialog.cpp @@ -20,8 +20,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeio/tdefile/kimagefilepreview.cpp b/tdeio/tdefile/kimagefilepreview.cpp index a1ce7d6b3..f96be72fc 100644 --- a/tdeio/tdefile/kimagefilepreview.cpp +++ b/tdeio/tdefile/kimagefilepreview.cpp @@ -16,12 +16,12 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/kmetaprops.cpp b/tdeio/tdefile/kmetaprops.cpp index ce6201177..21c75e0ce 100644 --- a/tdeio/tdefile/kmetaprops.cpp +++ b/tdeio/tdefile/kmetaprops.cpp @@ -23,9 +23,9 @@ #include #include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/tdeio/tdefile/knotifydialog.cpp b/tdeio/tdefile/knotifydialog.cpp index f23ac78e4..8397a5e74 100644 --- a/tdeio/tdefile/knotifydialog.cpp +++ b/tdeio/tdefile/knotifydialog.cpp @@ -29,8 +29,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeio/tdefile/knotifydialog.h b/tdeio/tdefile/knotifydialog.h index f31815e34..c8b5b21ac 100644 --- a/tdeio/tdefile/knotifydialog.h +++ b/tdeio/tdefile/knotifydialog.h @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "knotifywidgetbase.h" diff --git a/tdeio/tdefile/kopenwith.cpp b/tdeio/tdefile/kopenwith.cpp index 5a855de21..5db8b79d9 100644 --- a/tdeio/tdefile/kopenwith.cpp +++ b/tdeio/tdefile/kopenwith.cpp @@ -39,9 +39,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/kpreviewprops.cpp b/tdeio/tdefile/kpreviewprops.cpp index a053d5627..c45330893 100644 --- a/tdeio/tdefile/kpreviewprops.cpp +++ b/tdeio/tdefile/kpreviewprops.cpp @@ -22,8 +22,8 @@ #include #include -#include -#include +#include +#include class KPreviewPropsPlugin::KPreviewPropsPluginPrivate { diff --git a/tdeio/tdefile/kpropertiesdialog.cpp b/tdeio/tdefile/kpropertiesdialog.cpp index 389115a3c..87d3926b3 100644 --- a/tdeio/tdefile/kpropertiesdialog.cpp +++ b/tdeio/tdefile/kpropertiesdialog.cpp @@ -96,9 +96,9 @@ extern "C" { #include #include #include -#include -#include -#include +#include +#include +#include #include #include #include @@ -109,7 +109,7 @@ extern "C" { #include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/kurlbar.cpp b/tdeio/tdefile/kurlbar.cpp index 46b096c2b..2aa79353f 100644 --- a/tdeio/tdefile/kurlbar.cpp +++ b/tdeio/tdefile/kurlbar.cpp @@ -33,12 +33,12 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/kurlcombobox.cpp b/tdeio/tdefile/kurlcombobox.cpp index 150e64b34..66fe8efb8 100644 --- a/tdeio/tdefile/kurlcombobox.cpp +++ b/tdeio/tdefile/kurlcombobox.cpp @@ -20,9 +20,9 @@ #include #include -#include +#include #include -#include +#include #include #include diff --git a/tdeio/tdefile/kurlrequester.cpp b/tdeio/tdefile/kurlrequester.cpp index 9a76a69a6..7ecfd543d 100644 --- a/tdeio/tdefile/kurlrequester.cpp +++ b/tdeio/tdefile/kurlrequester.cpp @@ -30,10 +30,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/kurlrequesterdlg.cpp b/tdeio/tdefile/kurlrequesterdlg.cpp index d1e9ec109..1a040a656 100644 --- a/tdeio/tdefile/kurlrequesterdlg.cpp +++ b/tdeio/tdefile/kurlrequesterdlg.cpp @@ -28,10 +28,10 @@ #include #include -#include +#include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/tdefiledetailview.cpp b/tdeio/tdefile/tdefiledetailview.cpp index b3c44250e..e267bdb60 100644 --- a/tdeio/tdefile/tdefiledetailview.cpp +++ b/tdeio/tdefile/tdefiledetailview.cpp @@ -27,11 +27,11 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include diff --git a/tdeio/tdefile/tdefiledialog.cpp b/tdeio/tdefile/tdefiledialog.cpp index 8db764724..03bc17757 100644 --- a/tdeio/tdefile/tdefiledialog.cpp +++ b/tdeio/tdefile/tdefiledialog.cpp @@ -50,16 +50,16 @@ #include #include #include -#include -#include +#include +#include #include #include #include #include #include #include -#include -#include +#include +#include #include #include #include @@ -83,7 +83,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeio/tdefile/tdefilefiltercombo.cpp b/tdeio/tdefile/tdefilefiltercombo.cpp index cd7bd54d3..ed41f8f82 100644 --- a/tdeio/tdefile/tdefilefiltercombo.cpp +++ b/tdeio/tdefile/tdefilefiltercombo.cpp @@ -17,7 +17,7 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include #include #include diff --git a/tdeio/tdefile/tdefileiconview.cpp b/tdeio/tdefile/tdefileiconview.cpp index 131485273..92bbeba41 100644 --- a/tdeio/tdefile/tdefileiconview.cpp +++ b/tdeio/tdefile/tdefileiconview.cpp @@ -31,10 +31,10 @@ #include #include -#include +#include #include #include -#include +#include #include #include diff --git a/tdeio/tdefile/tdefilemetainfowidget.cpp b/tdeio/tdefile/tdefilemetainfowidget.cpp index dea9ea353..50fef856b 100644 --- a/tdeio/tdefile/tdefilemetainfowidget.cpp +++ b/tdeio/tdefile/tdefilemetainfowidget.cpp @@ -21,7 +21,7 @@ #include "tdefilemetainfowidget.h" #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/tdefilepreview.cpp b/tdeio/tdefile/tdefilepreview.cpp index 57543ea8c..acec61475 100644 --- a/tdeio/tdefile/tdefilepreview.cpp +++ b/tdeio/tdefile/tdefilepreview.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include diff --git a/tdeio/tdefile/tdefilesharedlg.cpp b/tdeio/tdefile/tdefilesharedlg.cpp index 6204fa6bb..a2fb01c2c 100644 --- a/tdeio/tdefile/tdefilesharedlg.cpp +++ b/tdeio/tdefile/tdefilesharedlg.cpp @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -39,7 +39,7 @@ #include #include #include -#include +#include class KFileSharePropsPlugin::Private { diff --git a/tdeio/tdefile/tdefilespeedbar.cpp b/tdeio/tdefile/tdefilespeedbar.cpp index defcb2157..6f3365a5f 100644 --- a/tdeio/tdefile/tdefilespeedbar.cpp +++ b/tdeio/tdefile/tdefilespeedbar.cpp @@ -25,9 +25,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/tdeio/tdefile/tdefiletreeview.cpp b/tdeio/tdefile/tdefiletreeview.cpp index 6138b3863..cb7432423 100644 --- a/tdeio/tdefile/tdefiletreeview.cpp +++ b/tdeio/tdefile/tdefiletreeview.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/tdefileview.cpp b/tdeio/tdefile/tdefileview.cpp index 63c973723..f171975d8 100644 --- a/tdeio/tdefile/tdefileview.cpp +++ b/tdeio/tdefile/tdefileview.cpp @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include #include #include "config-tdefile.h" diff --git a/tdeio/tdefile/tderecentdirs.cpp b/tdeio/tdefile/tderecentdirs.cpp index 12c2b6477..0548261dd 100644 --- a/tdeio/tdefile/tderecentdirs.cpp +++ b/tdeio/tdefile/tderecentdirs.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #define MAX_DIR_HISTORY 3 diff --git a/tdeio/tdefile/tests/kcustommenueditortest.cpp b/tdeio/tdefile/tests/kcustommenueditortest.cpp index 3d95b6c9f..9e2189406 100644 --- a/tdeio/tdefile/tests/kcustommenueditortest.cpp +++ b/tdeio/tdefile/tests/kcustommenueditortest.cpp @@ -1,6 +1,6 @@ #include "kcustommenueditor.h" #include -#include +#include #include int main(int argc, char** argv) diff --git a/tdeio/tdefile/tests/kdirselectdialogtest.cpp b/tdeio/tdefile/tests/kdirselectdialogtest.cpp index 0c2209d31..c1178c3bc 100644 --- a/tdeio/tdefile/tests/kdirselectdialogtest.cpp +++ b/tdeio/tdefile/tests/kdirselectdialogtest.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include int main( int argc, char **argv ) diff --git a/tdeio/tdefile/tests/kfdtest.cpp b/tdeio/tdefile/tests/kfdtest.cpp index baf82725f..ce7127d9e 100644 --- a/tdeio/tdefile/tests/kfdtest.cpp +++ b/tdeio/tdefile/tests/kfdtest.cpp @@ -3,7 +3,7 @@ #include #include #include -#include +#include #include KFDTest::KFDTest( const TQString& startDir, TQObject *parent, const char *name ) diff --git a/tdeio/tdefile/tests/kfstest.cpp b/tdeio/tdefile/tests/kfstest.cpp index c57e3678e..ada8d825e 100644 --- a/tdeio/tdefile/tests/kfstest.cpp +++ b/tdeio/tdefile/tests/kfstest.cpp @@ -30,12 +30,12 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdefile/tests/tdefiletreeviewtest.cpp b/tdeio/tdefile/tests/tdefiletreeviewtest.cpp index 529d12dda..9ff0199dc 100644 --- a/tdeio/tdefile/tests/tdefiletreeviewtest.cpp +++ b/tdeio/tdefile/tests/tdefiletreeviewtest.cpp @@ -19,7 +19,7 @@ #include -#include +#include #include #include #include diff --git a/tdeio/tdeio/CMakeLists.txt b/tdeio/tdeio/CMakeLists.txt index 8aaf395b6..e2b96ebb1 100644 --- a/tdeio/tdeio/CMakeLists.txt +++ b/tdeio/tdeio/CMakeLists.txt @@ -41,8 +41,8 @@ install( FILES kurlcompletion.h kshellcompletion.h tdefileitem.h tdefileshare.h ksambashare.h knfsshare.h kdirlister.h kservicegroup.h kimageio.h kdirnotify.h kdirnotify_stub.h - kurlpixmapprovider.h kprotocolinfo.h kprotocolmanager.h - kfilterbase.h kfilterdev.h kemailsettings.h kscan.h + kurlpixmapprovider.h kprotocolinfo.h tdeprotocolmanager.h + kfilterbase.h kfilterdev.h tdeemailsettings.h kscan.h kdatatool.h karchive.h tdefilefilter.h tdefilemetainfo.h renamedlgplugin.h kmimetyperesolver.h kdcopservicestarter.h kremoteencoding.h kmimetypechooser.h @@ -71,7 +71,7 @@ install( FILES set( target tdeiocore ) set( ${target}_SRCS - authinfo.cpp kshred.cpp kprotocolmanager.cpp slave.cpp + authinfo.cpp kshred.cpp tdeprotocolmanager.cpp slave.cpp slaveinterface.cpp observer.stub sessiondata.cpp scheduler.cpp connection.cpp job.cpp global.cpp slaveconfig.cpp kurlpixmapprovider.cpp netaccess.cpp @@ -79,7 +79,7 @@ set( ${target}_SRCS slavebase.cpp passdlg.cpp forwardingslavebase.cpp progressbase.cpp defaultprogress.cpp statusbarprogress.cpp kdirnotify.cpp kdirnotify.skel kdirnotify_stub.cpp - observer.cpp ../misc/uiserver.stub observer.skel kemailsettings.cpp + observer.cpp ../misc/uiserver.stub observer.skel tdeemailsettings.cpp kprotocolinfo.cpp renamedlg.cpp skipdlg.cpp kremoteencoding.cpp kmimetypechooser.cpp ) diff --git a/tdeio/tdeio/Makefile.am b/tdeio/tdeio/Makefile.am index f0766f5c8..587cfe511 100644 --- a/tdeio/tdeio/Makefile.am +++ b/tdeio/tdeio/Makefile.am @@ -53,8 +53,8 @@ include_HEADERS = \ kshellcompletion.h tdefileitem.h tdefileshare.h ksambashare.h knfsshare.h \ kdirlister.h kservicegroup.h \ kimageio.h kdirnotify.h kdirnotify_stub.h \ - kurlpixmapprovider.h kprotocolinfo.h kprotocolmanager.h \ - kfilterbase.h kfilterdev.h kemailsettings.h kscan.h kdatatool.h \ + kurlpixmapprovider.h kprotocolinfo.h tdeprotocolmanager.h \ + kfilterbase.h kfilterdev.h tdeemailsettings.h kscan.h kdatatool.h \ karchive.h tdefilefilter.h tdefilemetainfo.h renamedlgplugin.h \ kmimetyperesolver.h kdcopservicestarter.h kremoteencoding.h \ kmimetypechooser.h @@ -67,7 +67,7 @@ include_HEADERS += kacl.h libtdeiocore_la_SOURCES = authinfo.cpp \ kshred.cpp \ - kprotocolmanager.cpp \ + tdeprotocolmanager.cpp \ slave.cpp slaveinterface.cpp observer.stub \ sessiondata.cpp scheduler.cpp \ connection.cpp \ @@ -81,7 +81,7 @@ libtdeiocore_la_SOURCES = authinfo.cpp \ statusbarprogress.cpp \ kdirnotify.cpp kdirnotify.skel kdirnotify_stub.cpp \ observer.cpp uiserver.stub observer.skel \ - kemailsettings.cpp \ + tdeemailsettings.cpp \ kprotocolinfo.cpp \ renamedlg.cpp skipdlg.cpp kremoteencoding.cpp \ kmimetypechooser.cpp diff --git a/tdeio/tdeio/chmodjob.cpp b/tdeio/tdeio/chmodjob.cpp index 434466d77..24a5c247d 100644 --- a/tdeio/tdeio/chmodjob.cpp +++ b/tdeio/tdeio/chmodjob.cpp @@ -29,9 +29,9 @@ #include #include -#include +#include #include -#include +#include #include "tdeio/job.h" #include "tdeio/chmodjob.h" diff --git a/tdeio/tdeio/dataslave.cpp b/tdeio/tdeio/dataslave.cpp index 528368ba5..a5b6bdf69 100644 --- a/tdeio/tdeio/dataslave.cpp +++ b/tdeio/tdeio/dataslave.cpp @@ -23,7 +23,7 @@ #include "dataslave.h" #include "dataprotocol.h" -#include +#include #include #include diff --git a/tdeio/tdeio/defaultprogress.cpp b/tdeio/tdeio/defaultprogress.cpp index 4293e752e..5db9c5a0c 100644 --- a/tdeio/tdeio/defaultprogress.cpp +++ b/tdeio/tdeio/defaultprogress.cpp @@ -26,8 +26,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeio/tdeio/global.cpp b/tdeio/tdeio/global.cpp index e4bfec5f6..8dce8a5f4 100644 --- a/tdeio/tdeio/global.cpp +++ b/tdeio/tdeio/global.cpp @@ -33,9 +33,9 @@ #include "tdeio/job.h" #include -#include -#include -#include +#include +#include +#include #include #ifdef HAVE_VOLMGT diff --git a/tdeio/tdeio/job.cpp b/tdeio/tdeio/job.cpp index a4e731451..7f8b9bda3 100644 --- a/tdeio/tdeio/job.cpp +++ b/tdeio/tdeio/job.cpp @@ -42,12 +42,12 @@ extern "C" { #include #include -#include -#include +#include +#include #include #include #include -#include +#include #include #include #include @@ -60,14 +60,14 @@ extern "C" { #include "kdirwatch.h" #include "kmimemagic.h" #include "kprotocolinfo.h" -#include "kprotocolmanager.h" +#include "tdeprotocolmanager.h" #include "tdeio/observer.h" #include "kssl/ksslcsessioncache.h" #include -#include +#include #include #ifdef Q_OS_UNIX diff --git a/tdeio/tdeio/kdcopservicestarter.cpp b/tdeio/tdeio/kdcopservicestarter.cpp index c859cce2b..8a7a67632 100644 --- a/tdeio/tdeio/kdcopservicestarter.cpp +++ b/tdeio/tdeio/kdcopservicestarter.cpp @@ -22,7 +22,7 @@ #include "kservice.h" #include #include -#include +#include #include static KStaticDeleter dss_sd; diff --git a/tdeio/tdeio/kdirlister.cpp b/tdeio/tdeio/kdirlister.cpp index 669766ab5..b0027588d 100644 --- a/tdeio/tdeio/kdirlister.cpp +++ b/tdeio/tdeio/kdirlister.cpp @@ -28,11 +28,11 @@ #include #include -#include +#include #include -#include -#include -#include +#include +#include +#include #include #include diff --git a/tdeio/tdeio/kdirwatch.cpp b/tdeio/tdeio/kdirwatch.cpp index 63c89b9d7..01b4e0876 100644 --- a/tdeio/tdeio/kdirwatch.cpp +++ b/tdeio/tdeio/kdirwatch.cpp @@ -57,7 +57,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeio/tdeio/kemailsettings.cpp b/tdeio/tdeio/kemailsettings.cpp index 296455253..bd46d8708 100644 --- a/tdeio/tdeio/kemailsettings.cpp +++ b/tdeio/tdeio/kemailsettings.cpp @@ -26,10 +26,10 @@ * $Id$ */ -#include "kemailsettings.h" +#include "tdeemailsettings.h" #include -#include +#include #include class KEMailSettingsPrivate { diff --git a/tdeio/tdeio/kimageio.cpp b/tdeio/tdeio/kimageio.cpp index f9de08376..d3768d297 100644 --- a/tdeio/tdeio/kimageio.cpp +++ b/tdeio/tdeio/kimageio.cpp @@ -20,9 +20,9 @@ #include #include "kimageio.h" #include "kimageiofactory.h" -#include +#include #include -#include +#include #include #include #include diff --git a/tdeio/tdeio/kmessageboxwrapper.h b/tdeio/tdeio/kmessageboxwrapper.h index c55060549..524eafa74 100644 --- a/tdeio/tdeio/kmessageboxwrapper.h +++ b/tdeio/tdeio/kmessageboxwrapper.h @@ -18,7 +18,7 @@ #ifndef KMESSAGEBOXWRAPPER_H #define KMESSAGEBOXWRAPPER_H -#include +#include #include #include diff --git a/tdeio/tdeio/kmimetype.cpp b/tdeio/tdeio/kmimetype.cpp index 8129b31f9..636c04eea 100644 --- a/tdeio/tdeio/kmimetype.cpp +++ b/tdeio/tdeio/kmimetype.cpp @@ -52,7 +52,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdeio/kmimetypechooser.cpp b/tdeio/tdeio/kmimetypechooser.cpp index 95dfada9c..ffc9a4c78 100644 --- a/tdeio/tdeio/kmimetypechooser.cpp +++ b/tdeio/tdeio/kmimetypechooser.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdeio/kprotocolinfo.cpp b/tdeio/tdeio/kprotocolinfo.cpp index 9523b70cb..bf11060e4 100644 --- a/tdeio/tdeio/kprotocolinfo.cpp +++ b/tdeio/tdeio/kprotocolinfo.cpp @@ -24,7 +24,7 @@ #include "kprotocolinfo.h" #include "kprotocolinfofactory.h" -#include "kprotocolmanager.h" +#include "tdeprotocolmanager.h" // Most of this class is implemented in tdecore/kprotocolinfo_tdecore.cpp // This file only contains a few static class-functions that depend on diff --git a/tdeio/tdeio/kprotocolmanager.cpp b/tdeio/tdeio/kprotocolmanager.cpp index 7ed06376b..65ad393a3 100644 --- a/tdeio/tdeio/kprotocolmanager.cpp +++ b/tdeio/tdeio/kprotocolmanager.cpp @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -34,7 +34,7 @@ #include #include -#include "kprotocolmanager.h" +#include "tdeprotocolmanager.h" class KProtocolManagerPrivate diff --git a/tdeio/tdeio/krun.cpp b/tdeio/tdeio/krun.cpp index 8547802d6..d92e3ca11 100644 --- a/tdeio/tdeio/krun.cpp +++ b/tdeio/tdeio/krun.cpp @@ -44,7 +44,7 @@ #include #include #include -#include +#include #include #include #include @@ -55,7 +55,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdeio/krun.h b/tdeio/tdeio/krun.h index 40fd36416..6e5604f7a 100644 --- a/tdeio/tdeio/krun.h +++ b/tdeio/tdeio/krun.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include class TDEProcess; class KService; diff --git a/tdeio/tdeio/kscan.cpp b/tdeio/tdeio/kscan.cpp index 7b00f08a9..b49459771 100644 --- a/tdeio/tdeio/kscan.cpp +++ b/tdeio/tdeio/kscan.cpp @@ -19,7 +19,7 @@ #include -#include +#include #include #include "kscan.h" diff --git a/tdeio/tdeio/kservice.cpp b/tdeio/tdeio/kservice.cpp index 13be78bea..c9a6fdae2 100644 --- a/tdeio/tdeio/kservice.cpp +++ b/tdeio/tdeio/kservice.cpp @@ -40,9 +40,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeio/tdeio/kservicefactory.cpp b/tdeio/tdeio/kservicefactory.cpp index f4646fa75..abd6ec61e 100644 --- a/tdeio/tdeio/kservicefactory.cpp +++ b/tdeio/tdeio/kservicefactory.cpp @@ -24,9 +24,9 @@ #include -#include +#include #include -#include +#include #include #include diff --git a/tdeio/tdeio/kservicegroup.cpp b/tdeio/tdeio/kservicegroup.cpp index 2e27c99b0..4cb3b8dac 100644 --- a/tdeio/tdeio/kservicegroup.cpp +++ b/tdeio/tdeio/kservicegroup.cpp @@ -19,9 +19,9 @@ #include #include -#include +#include #include -#include +#include #include #include diff --git a/tdeio/tdeio/kservicegroupfactory.cpp b/tdeio/tdeio/kservicegroupfactory.cpp index 56ec0c07f..3caf9c027 100644 --- a/tdeio/tdeio/kservicegroupfactory.cpp +++ b/tdeio/tdeio/kservicegroupfactory.cpp @@ -24,9 +24,9 @@ #include -#include +#include #include -#include +#include #include KServiceGroupFactory::KServiceGroupFactory() diff --git a/tdeio/tdeio/kshred.cpp b/tdeio/tdeio/kshred.cpp index 470f9a03e..0bc01c20a 100644 --- a/tdeio/tdeio/kshred.cpp +++ b/tdeio/tdeio/kshred.cpp @@ -22,7 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "kshred.h" #include -#include +#include #include #include #include diff --git a/tdeio/tdeio/ktar.cpp b/tdeio/tdeio/ktar.cpp index 9bde2873a..cb5bba1fa 100644 --- a/tdeio/tdeio/ktar.cpp +++ b/tdeio/tdeio/ktar.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeio/tdeio/kurlcompletion.cpp b/tdeio/tdeio/kurlcompletion.cpp index e9ce26908..441d453ac 100644 --- a/tdeio/tdeio/kurlcompletion.cpp +++ b/tdeio/tdeio/kurlcompletion.cpp @@ -47,8 +47,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/tdeio/tdeio/kuserprofile.cpp b/tdeio/tdeio/kuserprofile.cpp index 124f7f8f8..a9bdc40c1 100644 --- a/tdeio/tdeio/kuserprofile.cpp +++ b/tdeio/tdeio/kuserprofile.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/tdeio/tdeio/netaccess.cpp b/tdeio/tdeio/netaccess.cpp index dd3a1bdc8..cbab6684e 100644 --- a/tdeio/tdeio/netaccess.cpp +++ b/tdeio/tdeio/netaccess.cpp @@ -34,8 +34,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeio/tdeio/observer.cpp b/tdeio/tdeio/observer.cpp index dfd847b04..2309c2142 100644 --- a/tdeio/tdeio/observer.cpp +++ b/tdeio/tdeio/observer.cpp @@ -34,12 +34,12 @@ #include "passdlg.h" #include "slavebase.h" #include "observer_stub.h" -#include +#include #include #include #include #include -#include +#include using namespace TDEIO; diff --git a/tdeio/tdeio/passdlg.cpp b/tdeio/tdeio/passdlg.cpp index 942d16c64..91fba050d 100644 --- a/tdeio/tdeio/passdlg.cpp +++ b/tdeio/tdeio/passdlg.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include using namespace TDEIO; diff --git a/tdeio/tdeio/paste.cpp b/tdeio/tdeio/paste.cpp index fd24f9a0d..42fff5ba2 100644 --- a/tdeio/tdeio/paste.cpp +++ b/tdeio/tdeio/paste.cpp @@ -24,16 +24,16 @@ #include "tdeio/netaccess.h" #include "tdeio/observer.h" #include "tdeio/renamedlg.h" -#include "tdeio/kprotocolmanager.h" +#include "tdeio/tdeprotocolmanager.h" #include #include #include -#include +#include #include -#include +#include #include -#include +#include #include #include diff --git a/tdeio/tdeio/pastedialog.cpp b/tdeio/tdeio/pastedialog.cpp index 0252baff1..d95cc7e88 100644 --- a/tdeio/tdeio/pastedialog.cpp +++ b/tdeio/tdeio/pastedialog.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff --git a/tdeio/tdeio/previewjob.cpp b/tdeio/tdeio/previewjob.cpp index c51ba154d..5e3148619 100644 --- a/tdeio/tdeio/previewjob.cpp +++ b/tdeio/tdeio/previewjob.cpp @@ -43,10 +43,10 @@ #include // Do not remove, needed for correct bool serialization #include #include -#include +#include #include #include -#include +#include #include #include diff --git a/tdeio/tdeio/renamedlg.cpp b/tdeio/tdeio/renamedlg.cpp index 06b12d129..715f73c42 100644 --- a/tdeio/tdeio/renamedlg.cpp +++ b/tdeio/tdeio/renamedlg.cpp @@ -30,15 +30,15 @@ #include #include -#include +#include #include #include #include #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeio/tdeio/scheduler.cpp b/tdeio/tdeio/scheduler.cpp index 01bcde298..3935a91cf 100644 --- a/tdeio/tdeio/scheduler.cpp +++ b/tdeio/tdeio/scheduler.cpp @@ -28,8 +28,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeio/tdeio/sessiondata.cpp b/tdeio/tdeio/sessiondata.cpp index 99c6a26f3..4e4dd14ac 100644 --- a/tdeio/tdeio/sessiondata.cpp +++ b/tdeio/tdeio/sessiondata.cpp @@ -23,11 +23,11 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include diff --git a/tdeio/tdeio/skipdlg.cpp b/tdeio/tdeio/skipdlg.cpp index 6cd924136..5871bbd09 100644 --- a/tdeio/tdeio/skipdlg.cpp +++ b/tdeio/tdeio/skipdlg.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeio/tdeio/slave.cpp b/tdeio/tdeio/slave.cpp index e66a719df..b4a7c8f2a 100644 --- a/tdeio/tdeio/slave.cpp +++ b/tdeio/tdeio/slave.cpp @@ -35,11 +35,11 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include @@ -48,7 +48,7 @@ #include "tdeio/slave.h" #include "tdeio/kservice.h" #include -#include +#include #include #ifdef HAVE_PATHS_H diff --git a/tdeio/tdeio/slavebase.cpp b/tdeio/tdeio/slavebase.cpp index 29a8e0c48..76bbc232d 100644 --- a/tdeio/tdeio/slavebase.cpp +++ b/tdeio/tdeio/slavebase.cpp @@ -48,7 +48,7 @@ #include #include #include -#include +#include #include #include "kremoteencoding.h" diff --git a/tdeio/tdeio/slaveconfig.cpp b/tdeio/tdeio/slaveconfig.cpp index e81146e76..af1b7b793 100644 --- a/tdeio/tdeio/slaveconfig.cpp +++ b/tdeio/tdeio/slaveconfig.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "slaveconfig.h" diff --git a/tdeio/tdeio/statusbarprogress.cpp b/tdeio/tdeio/statusbarprogress.cpp index e0497e391..d7ef698c4 100644 --- a/tdeio/tdeio/statusbarprogress.cpp +++ b/tdeio/tdeio/statusbarprogress.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/tdeio/tdeio/tcpslavebase.cpp b/tdeio/tdeio/tcpslavebase.cpp index 2a4aff68e..a0d9c86cb 100644 --- a/tdeio/tdeio/tcpslavebase.cpp +++ b/tdeio/tdeio/tcpslavebase.cpp @@ -43,19 +43,19 @@ #include #include #include -#include +#include #ifndef Q_WS_WIN //temporary #include #endif -#include +#include #include #include #include #include -#include +#include #include #include "tdeio/tcpslavebase.h" diff --git a/tdeio/tdeio/tdefilefilter.cpp b/tdeio/tdeio/tdefilefilter.cpp index 310b86221..c1663c2e8 100644 --- a/tdeio/tdeio/tdefilefilter.cpp +++ b/tdeio/tdeio/tdefilefilter.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include "tdefilefilter.h" diff --git a/tdeio/tdeio/tdefileitem.cpp b/tdeio/tdeio/tdefileitem.cpp index 3d09e6877..378cd5f0a 100644 --- a/tdeio/tdeio/tdefileitem.cpp +++ b/tdeio/tdeio/tdefileitem.cpp @@ -41,11 +41,11 @@ #include #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include diff --git a/tdeio/tdeio/tdefilemetainfo.cpp b/tdeio/tdeio/tdefilemetainfo.cpp index 796a48305..c1389695d 100644 --- a/tdeio/tdeio/tdefilemetainfo.cpp +++ b/tdeio/tdeio/tdefilemetainfo.cpp @@ -32,7 +32,7 @@ #include #include #include // needed for serialization of bool -#include +#include #include #include "tdefilemetainfo.h" diff --git a/tdeio/tdeio/tdefileshare.cpp b/tdeio/tdeio/tdefileshare.cpp index 16e281c16..dc3f8c05a 100644 --- a/tdeio/tdeio/tdefileshare.cpp +++ b/tdeio/tdeio/tdefileshare.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeio/tdeioexec/main.cpp b/tdeio/tdeioexec/main.cpp index eb615344b..f6324afa5 100644 --- a/tdeio/tdeioexec/main.cpp +++ b/tdeio/tdeioexec/main.cpp @@ -29,16 +29,16 @@ #include #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include -#include +#include #include #include diff --git a/tdeio/tests/kiopassdlgtest.cpp b/tdeio/tests/kiopassdlgtest.cpp index 3dd4d7294..ba429e67a 100644 --- a/tdeio/tests/kiopassdlgtest.cpp +++ b/tdeio/tests/kiopassdlgtest.cpp @@ -1,7 +1,7 @@ #include -#include +#include #include -#include +#include #include #include "passdlg.h" diff --git a/tdeio/tests/kpropsdlgtest.cpp b/tdeio/tests/kpropsdlgtest.cpp index 638a60ec2..527077eb0 100644 --- a/tdeio/tests/kpropsdlgtest.cpp +++ b/tdeio/tests/kpropsdlgtest.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include #include #include diff --git a/tdeio/tests/kprotocolinfotest.cpp b/tdeio/tests/kprotocolinfotest.cpp index 646249678..9b5242d65 100644 --- a/tdeio/tests/kprotocolinfotest.cpp +++ b/tdeio/tests/kprotocolinfotest.cpp @@ -17,9 +17,9 @@ */ #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeio/tests/tdeioslavetest.cpp b/tdeio/tests/tdeioslavetest.cpp index ecc5e4af5..3cc22d8e2 100644 --- a/tdeio/tests/tdeioslavetest.cpp +++ b/tdeio/tests/tdeioslavetest.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeioslave/file/file.cc b/tdeioslave/file/file.cc index 477db8754..1caeaef3e 100644 --- a/tdeioslave/file/file.cc +++ b/tdeioslave/file/file.cc @@ -75,8 +75,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include "file.h" @@ -93,7 +93,7 @@ #include #include #include -#include +#include #include using namespace TDEIO; diff --git a/tdeioslave/ftp/ftp.cc b/tdeioslave/ftp/ftp.cc index 5b582d376..cf358ce39 100644 --- a/tdeioslave/ftp/ftp.cc +++ b/tdeioslave/ftp/ftp.cc @@ -53,7 +53,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeioslave/http/http.cc b/tdeioslave/http/http.cc index 539cc4dc5..a492221d5 100644 --- a/tdeioslave/http/http.cc +++ b/tdeioslave/http/http.cc @@ -51,7 +51,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeioslave/http/http_cache_cleaner.cpp b/tdeioslave/http/http_cache_cleaner.cpp index af9ede123..aaf94d25a 100644 --- a/tdeioslave/http/http_cache_cleaner.cpp +++ b/tdeioslave/http/http_cache_cleaner.cpp @@ -33,12 +33,12 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include -#include +#include #include -#include +#include #include #include -#include +#include #include diff --git a/tdeioslave/http/kcookiejar/kcookiewin.cpp b/tdeioslave/http/kcookiejar/kcookiewin.cpp index 3b845a104..faa9cdc65 100644 --- a/tdeioslave/http/kcookiejar/kcookiewin.cpp +++ b/tdeioslave/http/kcookiejar/kcookiewin.cpp @@ -58,8 +58,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeioslave/http/kcookiejar/main.cpp b/tdeioslave/http/kcookiejar/main.cpp index 59d912524..414afb41f 100644 --- a/tdeioslave/http/kcookiejar/main.cpp +++ b/tdeioslave/http/kcookiejar/main.cpp @@ -23,7 +23,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include -#include +#include #include static const char description[] = diff --git a/tdeioslave/metainfo/metainfo.cpp b/tdeioslave/metainfo/metainfo.cpp index 54f7acc3a..389a9182e 100644 --- a/tdeioslave/metainfo/metainfo.cpp +++ b/tdeioslave/metainfo/metainfo.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include "metainfo.h" diff --git a/tdelfeditor/tdelfeditor.cpp b/tdelfeditor/tdelfeditor.cpp index 99af949ed..1db2a3d8b 100644 --- a/tdelfeditor/tdelfeditor.cpp +++ b/tdelfeditor/tdelfeditor.cpp @@ -42,7 +42,7 @@ extern "C" { #include #include -#include +#include #include #include #include diff --git a/tdemdi/tdemdi/dockcontainer.cpp b/tdemdi/tdemdi/dockcontainer.cpp index 88bfa020d..be7c00929 100644 --- a/tdemdi/tdemdi/dockcontainer.cpp +++ b/tdemdi/tdemdi/dockcontainer.cpp @@ -29,13 +29,13 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include //TODO: Well, this is already defined in tdeui/kdockwidget.cpp static const char* const tdemdi_not_close_xpm[]={ diff --git a/tdemdi/tdemdi/guiclient.cpp b/tdemdi/tdemdi/guiclient.cpp index 255150289..9201df7b3 100644 --- a/tdemdi/tdemdi/guiclient.cpp +++ b/tdemdi/tdemdi/guiclient.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdemdi/tdemdi/mainwindow.cpp b/tdemdi/tdemdi/mainwindow.cpp index 4d477fc9c..411d11771 100644 --- a/tdemdi/tdemdi/mainwindow.cpp +++ b/tdemdi/tdemdi/mainwindow.cpp @@ -51,12 +51,12 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include #include "dockcontainer.h" diff --git a/tdemdi/tdemdi/mainwindow.h b/tdemdi/tdemdi/mainwindow.h index e8ae6e9fc..0c333a151 100644 --- a/tdemdi/tdemdi/mainwindow.h +++ b/tdemdi/tdemdi/mainwindow.h @@ -43,7 +43,7 @@ #define _KMDI_MAINWINDOW_H_ #include -#include +#include #include #include diff --git a/tdemdi/tdemdichildarea.cpp b/tdemdi/tdemdichildarea.cpp index 9370bbbe7..29b0b3d2d 100644 --- a/tdemdi/tdemdichildarea.cpp +++ b/tdemdi/tdemdichildarea.cpp @@ -32,8 +32,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/tdemdi/tdemdichildfrm.cpp b/tdemdi/tdemdichildfrm.cpp index cbc4f4b29..40ced6ffb 100644 --- a/tdemdi/tdemdichildfrm.cpp +++ b/tdemdi/tdemdichildfrm.cpp @@ -45,7 +45,7 @@ #include #include -#include +#include #include ////////////////////////////////////////////////////////////////////////////// diff --git a/tdemdi/tdemdichildfrmcaption.cpp b/tdemdi/tdemdichildfrmcaption.cpp index cc1a4a187..e8e91ea94 100644 --- a/tdemdi/tdemdichildfrmcaption.cpp +++ b/tdemdi/tdemdichildfrmcaption.cpp @@ -38,7 +38,7 @@ #include "tdemdichildfrm.h" #include "tdemdichildarea.h" #include "tdemdimainfrm.h" -#include +#include #include #ifdef Q_WS_WIN diff --git a/tdemdi/tdemdichildview.cpp b/tdemdi/tdemdichildview.cpp index 1c3f521f7..4d0aa4166 100644 --- a/tdemdi/tdemdichildview.cpp +++ b/tdemdi/tdemdichildview.cpp @@ -39,7 +39,7 @@ #include "tdemdichildfrm.h" #include "tdemdidefines.h" #include -#include +#include #include //============ KMdiChildView ============// diff --git a/tdemdi/tdemdidockcontainer.cpp b/tdemdi/tdemdidockcontainer.cpp index ba0ba0de0..d6771b597 100644 --- a/tdemdi/tdemdidockcontainer.cpp +++ b/tdemdi/tdemdidockcontainer.cpp @@ -28,13 +28,13 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include //TODO: Well, this is already defined in tdeui/kdockwidget.cpp static const char* const tdemdi_not_close_xpm[] = diff --git a/tdemdi/tdemdiguiclient.cpp b/tdemdi/tdemdiguiclient.cpp index 1c43b8039..0a66ea6ff 100644 --- a/tdemdi/tdemdiguiclient.cpp +++ b/tdemdi/tdemdiguiclient.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdemdi/tdemdimainfrm.cpp b/tdemdi/tdemdimainfrm.cpp index 3c9f7c442..f21cc384b 100644 --- a/tdemdi/tdemdimainfrm.cpp +++ b/tdemdi/tdemdimainfrm.cpp @@ -43,12 +43,12 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include #include diff --git a/tdemdi/tdemdimainfrm.h b/tdemdi/tdemdimainfrm.h index 720324ad5..c73fa5af1 100644 --- a/tdemdi/tdemdimainfrm.h +++ b/tdemdi/tdemdimainfrm.h @@ -32,7 +32,7 @@ #define _KMDIMAINFRM_H_ #include -#include +#include #include #include diff --git a/tdeparts/browserextension.cpp b/tdeparts/browserextension.cpp index 630e4cb5a..85bfa4a94 100644 --- a/tdeparts/browserextension.cpp +++ b/tdeparts/browserextension.cpp @@ -29,8 +29,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeparts/browserrun.cpp b/tdeparts/browserrun.cpp index 34f4c21c9..3abd01524 100644 --- a/tdeparts/browserrun.cpp +++ b/tdeparts/browserrun.cpp @@ -17,15 +17,15 @@ */ #include "browserrun.h" -#include +#include #include #include #include -#include +#include #include #include #include -#include +#include #include #include #include diff --git a/tdeparts/factory.cpp b/tdeparts/factory.cpp index a3985fd05..485bd9a36 100644 --- a/tdeparts/factory.cpp +++ b/tdeparts/factory.cpp @@ -23,8 +23,8 @@ #include -#include -#include +#include +#include #include #include diff --git a/tdeparts/part.cpp b/tdeparts/part.cpp index 9372adc08..954fc83d5 100644 --- a/tdeparts/part.cpp +++ b/tdeparts/part.cpp @@ -33,9 +33,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/tdeparts/partmanager.cpp b/tdeparts/partmanager.cpp index 1af0f1ee3..0f6f59561 100644 --- a/tdeparts/partmanager.cpp +++ b/tdeparts/partmanager.cpp @@ -22,7 +22,7 @@ #include "partmanager.h" #include #include -#include +#include #include #include diff --git a/tdeparts/plugin.cpp b/tdeparts/plugin.cpp index e1469ad1c..378db4a27 100644 --- a/tdeparts/plugin.cpp +++ b/tdeparts/plugin.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeparts/tests/example.cpp b/tdeparts/tests/example.cpp index 403fda062..c8fb77b29 100644 --- a/tdeparts/tests/example.cpp +++ b/tdeparts/tests/example.cpp @@ -10,9 +10,9 @@ #include #include #include -#include +#include #include -#include +#include Shell::Shell() { diff --git a/tdeparts/tests/ghostview.cpp b/tdeparts/tests/ghostview.cpp index 72b165e65..d83ec8f41 100644 --- a/tdeparts/tests/ghostview.cpp +++ b/tdeparts/tests/ghostview.cpp @@ -2,9 +2,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include diff --git a/tdeparts/tests/normalktm.cpp b/tdeparts/tests/normalktm.cpp index 664d6c7ec..92e46254e 100644 --- a/tdeparts/tests/normalktm.cpp +++ b/tdeparts/tests/normalktm.cpp @@ -10,11 +10,11 @@ #include #include #include -#include +#include #include -#include +#include -#include +#include Shell::Shell() { diff --git a/tdeparts/tests/notepad.cpp b/tdeparts/tests/notepad.cpp index 81ff2c1f2..ad81b91b3 100644 --- a/tdeparts/tests/notepad.cpp +++ b/tdeparts/tests/notepad.cpp @@ -12,7 +12,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeparts/tests/parts.cpp b/tdeparts/tests/parts.cpp index 408e73280..ebfd9c9f1 100644 --- a/tdeparts/tests/parts.cpp +++ b/tdeparts/tests/parts.cpp @@ -14,9 +14,9 @@ #include #include #include -#include +#include #include -#include +#include Part1::Part1( TQObject *parent, TQWidget * parentWidget ) : KParts::ReadOnlyPart( parent, "Part1" ) diff --git a/tdeparts/tests/plugin_spellcheck.cpp b/tdeparts/tests/plugin_spellcheck.cpp index 73d5b7986..d7cf06eac 100644 --- a/tdeparts/tests/plugin_spellcheck.cpp +++ b/tdeparts/tests/plugin_spellcheck.cpp @@ -3,8 +3,8 @@ #include "plugin_spellcheck.h" #include #include -#include -#include +#include +#include #include PluginSpellCheck::PluginSpellCheck( TQObject* parent, const char* name, diff --git a/tdeprint/cups/cupsaddsmb2.cpp b/tdeprint/cups/cupsaddsmb2.cpp index 685ce6e7e..256f5ee23 100644 --- a/tdeprint/cups/cupsaddsmb2.cpp +++ b/tdeprint/cups/cupsaddsmb2.cpp @@ -26,8 +26,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeprint/cups/cupsdconf2/addressdialog.cpp b/tdeprint/cups/cupsdconf2/addressdialog.cpp index fab6a6fba..83b4d0813 100644 --- a/tdeprint/cups/cupsdconf2/addressdialog.cpp +++ b/tdeprint/cups/cupsdconf2/addressdialog.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include AddressDialog::AddressDialog(TQWidget *parent, const char *name) : KDialogBase(Swallow, i18n("ACL Address"), Ok|Cancel, Ok, parent, name, true, true) diff --git a/tdeprint/cups/cupsdconf2/browsedialog.cpp b/tdeprint/cups/cupsdconf2/browsedialog.cpp index b337eb883..3268c72bc 100644 --- a/tdeprint/cups/cupsdconf2/browsedialog.cpp +++ b/tdeprint/cups/cupsdconf2/browsedialog.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include BrowseDialog::BrowseDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, TQString::null, Ok|Cancel, Ok, true) diff --git a/tdeprint/cups/cupsdconf2/cupsdbrowsingpage.cpp b/tdeprint/cups/cupsdconf2/cupsdbrowsingpage.cpp index 4b056cdb0..e66048b73 100644 --- a/tdeprint/cups/cupsdconf2/cupsdbrowsingpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdbrowsingpage.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include CupsdBrowsingPage::CupsdBrowsingPage(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/cupsdcomment.cpp b/tdeprint/cups/cupsdconf2/cupsdcomment.cpp index d17c8bd0c..8a788cad3 100644 --- a/tdeprint/cups/cupsdconf2/cupsdcomment.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdcomment.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include TQString Comment::comment() diff --git a/tdeprint/cups/cupsdconf2/cupsdconf.cpp b/tdeprint/cups/cupsdconf2/cupsdconf.cpp index 102ead1c8..2c5610411 100644 --- a/tdeprint/cups/cupsdconf2/cupsdconf.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdconf.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/tdeprint/cups/cupsdconf2/cupsddialog.cpp b/tdeprint/cups/cupsdconf2/cupsddialog.cpp index c9b219112..22a3b2d54 100644 --- a/tdeprint/cups/cupsdconf2/cupsddialog.cpp +++ b/tdeprint/cups/cupsdconf2/cupsddialog.cpp @@ -33,11 +33,11 @@ #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include diff --git a/tdeprint/cups/cupsdconf2/cupsddirpage.cpp b/tdeprint/cups/cupsdconf2/cupsddirpage.cpp index 268465a76..282657255 100644 --- a/tdeprint/cups/cupsdconf2/cupsddirpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsddirpage.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include CupsdDirPage::CupsdDirPage(TQWidget *parent, const char *name) : CupsdPage(parent, name) diff --git a/tdeprint/cups/cupsdconf2/cupsdfilterpage.cpp b/tdeprint/cups/cupsdconf2/cupsdfilterpage.cpp index 79c8a9401..e9cb1a0ad 100644 --- a/tdeprint/cups/cupsdconf2/cupsdfilterpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdfilterpage.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include CupsdFilterPage::CupsdFilterPage(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/cupsdjobspage.cpp b/tdeprint/cups/cupsdconf2/cupsdjobspage.cpp index f12f82f1e..49fdecc7c 100644 --- a/tdeprint/cups/cupsdconf2/cupsdjobspage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdjobspage.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include CupsdJobsPage::CupsdJobsPage(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/cupsdlogpage.cpp b/tdeprint/cups/cupsdconf2/cupsdlogpage.cpp index 00972e368..22128b39c 100644 --- a/tdeprint/cups/cupsdconf2/cupsdlogpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdlogpage.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include CupsdLogPage::CupsdLogPage(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/cupsdnetworkpage.cpp b/tdeprint/cups/cupsdconf2/cupsdnetworkpage.cpp index 9edca5868..e939c151f 100644 --- a/tdeprint/cups/cupsdconf2/cupsdnetworkpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdnetworkpage.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include CupsdNetworkPage::CupsdNetworkPage(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/cupsdsecuritypage.cpp b/tdeprint/cups/cupsdconf2/cupsdsecuritypage.cpp index d11851c60..6d6061264 100644 --- a/tdeprint/cups/cupsdconf2/cupsdsecuritypage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdsecuritypage.cpp @@ -28,9 +28,9 @@ #include #include -#include +#include #include -#include +#include CupsdSecurityPage::CupsdSecurityPage(TQWidget *parent, const char *name) : CupsdPage(parent, name) diff --git a/tdeprint/cups/cupsdconf2/cupsdserverpage.cpp b/tdeprint/cups/cupsdconf2/cupsdserverpage.cpp index cfd731430..e89356af9 100644 --- a/tdeprint/cups/cupsdconf2/cupsdserverpage.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdserverpage.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include int findComboItem(TQComboBox *cb, const TQString& str) { diff --git a/tdeprint/cups/cupsdconf2/cupsdsplash.cpp b/tdeprint/cups/cupsdconf2/cupsdsplash.cpp index a058299f0..c28329e67 100644 --- a/tdeprint/cups/cupsdconf2/cupsdsplash.cpp +++ b/tdeprint/cups/cupsdconf2/cupsdsplash.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include CupsdSplash::CupsdSplash(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/editlist.cpp b/tdeprint/cups/cupsdconf2/editlist.cpp index 3e3fa80e2..936dee212 100644 --- a/tdeprint/cups/cupsdconf2/editlist.cpp +++ b/tdeprint/cups/cupsdconf2/editlist.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/cups/cupsdconf2/locationdialog.cpp b/tdeprint/cups/cupsdconf2/locationdialog.cpp index 3896f7845..0754ae573 100644 --- a/tdeprint/cups/cupsdconf2/locationdialog.cpp +++ b/tdeprint/cups/cupsdconf2/locationdialog.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include LocationDialog::LocationDialog(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/cupsdconf2/main.cpp b/tdeprint/cups/cupsdconf2/main.cpp index abc81477c..78b0e1edf 100644 --- a/tdeprint/cups/cupsdconf2/main.cpp +++ b/tdeprint/cups/cupsdconf2/main.cpp @@ -20,7 +20,7 @@ #include "cupsddialog.h" #include -#include +#include #include #include diff --git a/tdeprint/cups/cupsdconf2/portdialog.cpp b/tdeprint/cups/cupsdconf2/portdialog.cpp index 18cade9fc..f758d5d1e 100644 --- a/tdeprint/cups/cupsdconf2/portdialog.cpp +++ b/tdeprint/cups/cupsdconf2/portdialog.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include PortDialog::PortDialog(TQWidget *parent, const char *name) : KDialogBase(parent, name, true, TQString::null, Ok|Cancel, Ok, true) diff --git a/tdeprint/cups/cupsdconf2/qdirmultilineedit.cpp b/tdeprint/cups/cupsdconf2/qdirmultilineedit.cpp index 628e8d40c..0992e2935 100644 --- a/tdeprint/cups/cupsdconf2/qdirmultilineedit.cpp +++ b/tdeprint/cups/cupsdconf2/qdirmultilineedit.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/cups/cupsdconf2/sizewidget.cpp b/tdeprint/cups/cupsdconf2/sizewidget.cpp index 742702e48..eaa39152f 100644 --- a/tdeprint/cups/cupsdconf2/sizewidget.cpp +++ b/tdeprint/cups/cupsdconf2/sizewidget.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include SizeWidget::SizeWidget( TQWidget *parent, const char *name ) : TQWidget( parent, name ) diff --git a/tdeprint/cups/cupsinfos.cpp b/tdeprint/cups/cupsinfos.cpp index 330429583..f6d392bd9 100644 --- a/tdeprint/cups/cupsinfos.cpp +++ b/tdeprint/cups/cupsinfos.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeprint/cups/ippreportdlg.cpp b/tdeprint/cups/ippreportdlg.cpp index 1e07789ac..ed56804bc 100644 --- a/tdeprint/cups/ippreportdlg.cpp +++ b/tdeprint/cups/ippreportdlg.cpp @@ -21,9 +21,9 @@ #include "ipprequest.h" #include "kprinter.h" -#include +#include #include -#include +#include #include #include #include diff --git a/tdeprint/cups/ipprequest.cpp b/tdeprint/cups/ipprequest.cpp index 4edaefb58..ebbefefe9 100644 --- a/tdeprint/cups/ipprequest.cpp +++ b/tdeprint/cups/ipprequest.cpp @@ -24,8 +24,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeprint/cups/kmconfigcups.cpp b/tdeprint/cups/kmconfigcups.cpp index 1b0ccdaea..6bc9ec155 100644 --- a/tdeprint/cups/kmconfigcups.cpp +++ b/tdeprint/cups/kmconfigcups.cpp @@ -20,7 +20,7 @@ #include "kmconfigcups.h" #include "kmcupsconfigwidget.h" -#include +#include #include #include diff --git a/tdeprint/cups/kmconfigcupsdir.cpp b/tdeprint/cups/kmconfigcupsdir.cpp index 6f16f5dfa..10a455226 100644 --- a/tdeprint/cups/kmconfigcupsdir.cpp +++ b/tdeprint/cups/kmconfigcupsdir.cpp @@ -21,7 +21,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeprint/cups/kmcupsconfigwidget.cpp b/tdeprint/cups/kmcupsconfigwidget.cpp index a62583b1b..f93c1a4b3 100644 --- a/tdeprint/cups/kmcupsconfigwidget.cpp +++ b/tdeprint/cups/kmcupsconfigwidget.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeprint/cups/kmcupsfactory.cpp b/tdeprint/cups/kmcupsfactory.cpp index 47384eab6..f42bc449e 100644 --- a/tdeprint/cups/kmcupsfactory.cpp +++ b/tdeprint/cups/kmcupsfactory.cpp @@ -22,7 +22,7 @@ #include "kmcupsuimanager.h" #include "kcupsprinterimpl.h" -#include +#include #include typedef K_TYPELIST_4( KMCupsManager, KMCupsJobManager, KMCupsUiManager, KCupsPrinterImpl ) Products; diff --git a/tdeprint/cups/kmcupsjobmanager.cpp b/tdeprint/cups/kmcupsjobmanager.cpp index b7284d1ad..fa208e551 100644 --- a/tdeprint/cups/kmcupsjobmanager.cpp +++ b/tdeprint/cups/kmcupsjobmanager.cpp @@ -32,7 +32,7 @@ #include "kpcopiespage.h" #include "kptagspage.h" -#include +#include #include #include diff --git a/tdeprint/cups/kmcupsmanager.cpp b/tdeprint/cups/kmcupsmanager.cpp index cd472eefa..eaf5070b8 100644 --- a/tdeprint/cups/kmcupsmanager.cpp +++ b/tdeprint/cups/kmcupsmanager.cpp @@ -42,12 +42,12 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/cups/kmcupsuimanager.cpp b/tdeprint/cups/kmcupsuimanager.cpp index 60e683b84..03b85bb0a 100644 --- a/tdeprint/cups/kmcupsuimanager.cpp +++ b/tdeprint/cups/kmcupsuimanager.cpp @@ -55,10 +55,10 @@ #include #include -#include +#include #include #include -#include +#include #include "config.h" diff --git a/tdeprint/cups/kmpropbanners.cpp b/tdeprint/cups/kmpropbanners.cpp index 22098cdff..602af7f6d 100644 --- a/tdeprint/cups/kmpropbanners.cpp +++ b/tdeprint/cups/kmpropbanners.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include KMPropBanners::KMPropBanners(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/cups/kmpropquota.cpp b/tdeprint/cups/kmpropquota.cpp index 9df6cbcb2..773e667e9 100644 --- a/tdeprint/cups/kmpropquota.cpp +++ b/tdeprint/cups/kmpropquota.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include // some forward declarations (see kmwquota.cpp) const char* unitKeyword(int); diff --git a/tdeprint/cups/kmpropusers.cpp b/tdeprint/cups/kmpropusers.cpp index 0f67205b0..2a2147aed 100644 --- a/tdeprint/cups/kmpropusers.cpp +++ b/tdeprint/cups/kmpropusers.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include KMPropUsers::KMPropUsers(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/cups/kmwbanners.cpp b/tdeprint/cups/kmwbanners.cpp index c221f69d7..86f1347fb 100644 --- a/tdeprint/cups/kmwbanners.cpp +++ b/tdeprint/cups/kmwbanners.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include TQStringList defaultBanners() { diff --git a/tdeprint/cups/kmwfax.cpp b/tdeprint/cups/kmwfax.cpp index 05b1b2cfa..15d4f8180 100644 --- a/tdeprint/cups/kmwfax.cpp +++ b/tdeprint/cups/kmwfax.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/cups/kmwipp.cpp b/tdeprint/cups/kmwipp.cpp index cb9dedd6c..a8ec8d425 100644 --- a/tdeprint/cups/kmwipp.cpp +++ b/tdeprint/cups/kmwipp.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/tdeprint/cups/kmwippprinter.cpp b/tdeprint/cups/kmwippprinter.cpp index e80478f61..f7a4f0593 100644 --- a/tdeprint/cups/kmwippprinter.cpp +++ b/tdeprint/cups/kmwippprinter.cpp @@ -29,12 +29,12 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/cups/kmwippselect.cpp b/tdeprint/cups/kmwippselect.cpp index c3f48ad27..237d74fd1 100644 --- a/tdeprint/cups/kmwippselect.cpp +++ b/tdeprint/cups/kmwippselect.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include diff --git a/tdeprint/cups/kmwother.cpp b/tdeprint/cups/kmwother.cpp index 4e640d536..497fa03c3 100644 --- a/tdeprint/cups/kmwother.cpp +++ b/tdeprint/cups/kmwother.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeprint/cups/kmwquota.cpp b/tdeprint/cups/kmwquota.cpp index 67245fb20..5085913d0 100644 --- a/tdeprint/cups/kmwquota.cpp +++ b/tdeprint/cups/kmwquota.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #ifdef HAVE_LIMITS_H #include diff --git a/tdeprint/cups/kmwusers.cpp b/tdeprint/cups/kmwusers.cpp index 714f6f4d4..eed7c08af 100644 --- a/tdeprint/cups/kmwusers.cpp +++ b/tdeprint/cups/kmwusers.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include KMWUsers::KMWUsers(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/kphpgl2page.cpp b/tdeprint/cups/kphpgl2page.cpp index 67ad61aec..f804b249d 100644 --- a/tdeprint/cups/kphpgl2page.cpp +++ b/tdeprint/cups/kphpgl2page.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include KPHpgl2Page::KPHpgl2Page(TQWidget *parent, const char *name) diff --git a/tdeprint/cups/kpimagepage.cpp b/tdeprint/cups/kpimagepage.cpp index 669bab190..8d23fe3e0 100644 --- a/tdeprint/cups/kpimagepage.cpp +++ b/tdeprint/cups/kpimagepage.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/cups/kpschedulepage.cpp b/tdeprint/cups/kpschedulepage.cpp index f778139dc..d7f13c8a4 100644 --- a/tdeprint/cups/kpschedulepage.cpp +++ b/tdeprint/cups/kpschedulepage.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/cups/kptagspage.cpp b/tdeprint/cups/kptagspage.cpp index a5d465683..db134d9ba 100644 --- a/tdeprint/cups/kptagspage.cpp +++ b/tdeprint/cups/kptagspage.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include KPTagsPage::KPTagsPage(bool ro, TQWidget *parent, const char *name) : KPrintDialogPage(parent, name) diff --git a/tdeprint/cups/kptextpage.cpp b/tdeprint/cups/kptextpage.cpp index eb8bc3553..955434da4 100644 --- a/tdeprint/cups/kptextpage.cpp +++ b/tdeprint/cups/kptextpage.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/driver.cpp b/tdeprint/driver.cpp index abc468f7a..6afc75d0f 100644 --- a/tdeprint/driver.cpp +++ b/tdeprint/driver.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/driverview.cpp b/tdeprint/driverview.cpp index 02c7be610..fece6c40c 100644 --- a/tdeprint/driverview.cpp +++ b/tdeprint/driverview.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include DrListView::DrListView(TQWidget *parent, const char *name) : TDEListView(parent,name) diff --git a/tdeprint/droptionview.cpp b/tdeprint/droptionview.cpp index 1ec954251..77a910b0c 100644 --- a/tdeprint/droptionview.cpp +++ b/tdeprint/droptionview.cpp @@ -34,7 +34,7 @@ #include #include -#include +#include OptionBaseView::OptionBaseView(TQWidget *parent, const char *name) : TQWidget(parent,name) diff --git a/tdeprint/ext/kextprinterimpl.cpp b/tdeprint/ext/kextprinterimpl.cpp index 8959aa3e8..7923ea729 100644 --- a/tdeprint/ext/kextprinterimpl.cpp +++ b/tdeprint/ext/kextprinterimpl.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include KExtPrinterImpl::KExtPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/) : KPrinterImpl(parent,name) diff --git a/tdeprint/ext/kmextmanager.cpp b/tdeprint/ext/kmextmanager.cpp index 598dd6648..abc832d6f 100644 --- a/tdeprint/ext/kmextmanager.cpp +++ b/tdeprint/ext/kmextmanager.cpp @@ -20,7 +20,7 @@ #include "kmextmanager.h" #include "kmprinter.h" -#include +#include KMExtManager::KMExtManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMManager(parent,name) diff --git a/tdeprint/ext/kmextuimanager.cpp b/tdeprint/ext/kmextuimanager.cpp index 2fa200848..ee1c4e186 100644 --- a/tdeprint/ext/kmextuimanager.cpp +++ b/tdeprint/ext/kmextuimanager.cpp @@ -21,7 +21,7 @@ #include "kpqtpage.h" #include "kprinterpropertydialog.h" -#include +#include KMExtUiManager::KMExtUiManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMUiManager(parent,name) diff --git a/tdeprint/foomatic/kfoomaticprinterimpl.cpp b/tdeprint/foomatic/kfoomaticprinterimpl.cpp index aacf6be8d..dd694b31b 100644 --- a/tdeprint/foomatic/kfoomaticprinterimpl.cpp +++ b/tdeprint/foomatic/kfoomaticprinterimpl.cpp @@ -21,7 +21,7 @@ #include "kprinter.h" #include -#include +#include KFoomaticPrinterImpl::KFoomaticPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/) : KPrinterImpl(parent,name) diff --git a/tdeprint/foomatic/kmfoomaticmanager.cpp b/tdeprint/foomatic/kmfoomaticmanager.cpp index 19e8401d8..e1e741003 100644 --- a/tdeprint/foomatic/kmfoomaticmanager.cpp +++ b/tdeprint/foomatic/kmfoomaticmanager.cpp @@ -22,7 +22,7 @@ #include "driver.h" #include -#include +#include #include #include diff --git a/tdeprint/foomatic2loader.cpp b/tdeprint/foomatic2loader.cpp index 6add13378..0d0637c90 100644 --- a/tdeprint/foomatic2loader.cpp +++ b/tdeprint/foomatic2loader.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include void tdeprint_foomatic2scanner_init( TQIODevice* ); void tdeprint_foomatic2scanner_terminate(); diff --git a/tdeprint/kmfactory.cpp b/tdeprint/kmfactory.cpp index 09a2cf45a..16ec56c32 100644 --- a/tdeprint/kmfactory.cpp +++ b/tdeprint/kmfactory.cpp @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeprint/kmjob.cpp b/tdeprint/kmjob.cpp index 7ff1efb95..2b42506f5 100644 --- a/tdeprint/kmjob.cpp +++ b/tdeprint/kmjob.cpp @@ -19,7 +19,7 @@ #include "kmjob.h" -#include +#include KMJob::KMJob() : KMObject() diff --git a/tdeprint/kmmanager.cpp b/tdeprint/kmmanager.cpp index ca9b1036f..d43239fd7 100644 --- a/tdeprint/kmmanager.cpp +++ b/tdeprint/kmmanager.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/kmprinter.cpp b/tdeprint/kmprinter.cpp index 22fc9d970..c7676e382 100644 --- a/tdeprint/kmprinter.cpp +++ b/tdeprint/kmprinter.cpp @@ -21,7 +21,7 @@ #include "kprinter.h" #include "driver.h" -#include +#include #include KMPrinter::KMPrinter() diff --git a/tdeprint/kmspecialmanager.cpp b/tdeprint/kmspecialmanager.cpp index 84e120e77..910de4931 100644 --- a/tdeprint/kmspecialmanager.cpp +++ b/tdeprint/kmspecialmanager.cpp @@ -26,9 +26,9 @@ #include #include -#include +#include #include -#include +#include #include #include diff --git a/tdeprint/kmuimanager.cpp b/tdeprint/kmuimanager.cpp index 962653dd2..4dd6966d3 100644 --- a/tdeprint/kmuimanager.cpp +++ b/tdeprint/kmuimanager.cpp @@ -36,7 +36,7 @@ #include "kxmlcommand.h" #include "kpposterpage.h" -#include +#include #include KMUiManager::KMUiManager(TQObject *parent, const char *name) diff --git a/tdeprint/kmvirtualmanager.cpp b/tdeprint/kmvirtualmanager.cpp index b13637904..dabad3093 100644 --- a/tdeprint/kmvirtualmanager.cpp +++ b/tdeprint/kmvirtualmanager.cpp @@ -28,11 +28,11 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include diff --git a/tdeprint/kpcopiespage.cpp b/tdeprint/kpcopiespage.cpp index d804cc9f2..10eb6e204 100644 --- a/tdeprint/kpcopiespage.cpp +++ b/tdeprint/kpcopiespage.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include diff --git a/tdeprint/kpdriverpage.cpp b/tdeprint/kpdriverpage.cpp index 18cfeb207..2bea47bc8 100644 --- a/tdeprint/kpdriverpage.cpp +++ b/tdeprint/kpdriverpage.cpp @@ -22,7 +22,7 @@ #include "driver.h" #include -#include +#include KPDriverPage::KPDriverPage(KMPrinter *p, DrMain *d, TQWidget *parent, const char *name) : KPrintDialogPage(p,d,parent,name) diff --git a/tdeprint/kpfileselectpage.cpp b/tdeprint/kpfileselectpage.cpp index 6847ade2b..8b20386bd 100644 --- a/tdeprint/kpfileselectpage.cpp +++ b/tdeprint/kpfileselectpage.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include KPFileSelectPage::KPFileSelectPage(TQWidget *parent, const char *name) diff --git a/tdeprint/kpfilterpage.cpp b/tdeprint/kpfilterpage.cpp index 4704abb15..6f46085ee 100644 --- a/tdeprint/kpfilterpage.cpp +++ b/tdeprint/kpfilterpage.cpp @@ -27,9 +27,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeprint/kpgeneralpage.cpp b/tdeprint/kpgeneralpage.cpp index ea1ec61e3..821290704 100644 --- a/tdeprint/kpgeneralpage.cpp +++ b/tdeprint/kpgeneralpage.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include // Some ID's #define ORIENT_PORTRAIT_ID 0 diff --git a/tdeprint/kpmarginpage.cpp b/tdeprint/kpmarginpage.cpp index ab70211c8..78b9ca6ef 100644 --- a/tdeprint/kpmarginpage.cpp +++ b/tdeprint/kpmarginpage.cpp @@ -31,9 +31,9 @@ #include #include -#include +#include #include -#include +#include KPMarginPage::KPMarginPage(KPrinter *prt, DrMain *driver, TQWidget *parent, const char *name) : KPrintDialogPage(0, driver, parent, name) diff --git a/tdeprint/kpposterpage.cpp b/tdeprint/kpposterpage.cpp index f719e251b..9c0a42501 100644 --- a/tdeprint/kpposterpage.cpp +++ b/tdeprint/kpposterpage.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/kpqtpage.cpp b/tdeprint/kpqtpage.cpp index 11b5a6574..c0ca5656e 100644 --- a/tdeprint/kpqtpage.cpp +++ b/tdeprint/kpqtpage.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #define ORIENT_PORTRAIT_ID 0 diff --git a/tdeprint/kprintaction.cpp b/tdeprint/kprintaction.cpp index cc94fe3c8..4a4aac597 100644 --- a/tdeprint/kprintaction.cpp +++ b/tdeprint/kprintaction.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include class KPrintAction::KPrintActionPrivate { diff --git a/tdeprint/kprintdialog.cpp b/tdeprint/kprintdialog.cpp index 312146855..d881971ff 100644 --- a/tdeprint/kprintdialog.cpp +++ b/tdeprint/kprintdialog.cpp @@ -46,18 +46,18 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/kprinter.cpp b/tdeprint/kprinter.cpp index 95cfc1733..4b9a1c98f 100644 --- a/tdeprint/kprinter.cpp +++ b/tdeprint/kprinter.cpp @@ -35,15 +35,15 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include -#include +#include static void dumpOptions(const TQMap& opts); static void reportError(KPrinter*); diff --git a/tdeprint/kprinterimpl.cpp b/tdeprint/kprinterimpl.cpp index ac79220f5..edd380009 100644 --- a/tdeprint/kprinterimpl.cpp +++ b/tdeprint/kprinterimpl.cpp @@ -32,14 +32,14 @@ #include #include #include -#include +#include #include #include #include #include #include #include -#include +#include #include #include diff --git a/tdeprint/kprinterpropertydialog.cpp b/tdeprint/kprinterpropertydialog.cpp index 1128a7d3a..c120ba843 100644 --- a/tdeprint/kprinterpropertydialog.cpp +++ b/tdeprint/kprinterpropertydialog.cpp @@ -25,9 +25,9 @@ #include "kmprinter.h" #include "driver.h" -#include +#include #include -#include +#include #include #include diff --git a/tdeprint/kprintpreview.cpp b/tdeprint/kprintpreview.cpp index 0311f543d..623a7f934 100644 --- a/tdeprint/kprintpreview.cpp +++ b/tdeprint/kprintpreview.cpp @@ -34,8 +34,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeprint/kprintprocess.cpp b/tdeprint/kprintprocess.cpp index ec93fcce6..89ef5e2ca 100644 --- a/tdeprint/kprintprocess.cpp +++ b/tdeprint/kprintprocess.cpp @@ -19,7 +19,7 @@ #include "kprintprocess.h" #include -#include +#include #include KPrintProcess::KPrintProcess() diff --git a/tdeprint/kxmlcommand.cpp b/tdeprint/kxmlcommand.cpp index f2dcb99ce..2d5712674 100644 --- a/tdeprint/kxmlcommand.cpp +++ b/tdeprint/kxmlcommand.cpp @@ -30,13 +30,13 @@ #include #include #include -#include +#include #include #include #include #include #include -#include +#include static void setOptionText(DrBase *opt, const TQString& s) { diff --git a/tdeprint/lpd/klpdprinterimpl.cpp b/tdeprint/lpd/klpdprinterimpl.cpp index e81b3a8cd..3647f0b38 100644 --- a/tdeprint/lpd/klpdprinterimpl.cpp +++ b/tdeprint/lpd/klpdprinterimpl.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include KLpdPrinterImpl::KLpdPrinterImpl(TQObject *parent, const char *name) : KPrinterImpl(parent,name) diff --git a/tdeprint/lpd/kmlpdmanager.cpp b/tdeprint/lpd/kmlpdmanager.cpp index 23c0422d0..e72733f89 100644 --- a/tdeprint/lpd/kmlpdmanager.cpp +++ b/tdeprint/lpd/kmlpdmanager.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeprint/lpd/kmlpduimanager.cpp b/tdeprint/lpd/kmlpduimanager.cpp index fad3fcd58..173c03b2b 100644 --- a/tdeprint/lpd/kmlpduimanager.cpp +++ b/tdeprint/lpd/kmlpduimanager.cpp @@ -27,7 +27,7 @@ #include "kmpropdriver.h" #include -#include +#include KMLpdUiManager::KMLpdUiManager(TQObject *parent, const char *name) : KMUiManager(parent,name) diff --git a/tdeprint/lpd/lpdtools.cpp b/tdeprint/lpd/lpdtools.cpp index 5131b33f3..54f19c405 100644 --- a/tdeprint/lpd/lpdtools.cpp +++ b/tdeprint/lpd/lpdtools.cpp @@ -22,7 +22,7 @@ #include "kmprinter.h" #include -#include +#include static const char *pt_pagesize[] = { "ledger", I18N_NOOP("Ledger"), diff --git a/tdeprint/lpdunix/klpdunixprinterimpl.cpp b/tdeprint/lpdunix/klpdunixprinterimpl.cpp index 4237bda59..e628a1c41 100644 --- a/tdeprint/lpdunix/klpdunixprinterimpl.cpp +++ b/tdeprint/lpdunix/klpdunixprinterimpl.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include KLpdUnixPrinterImpl::KLpdUnixPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/) diff --git a/tdeprint/lpdunix/kmlpdunixmanager.cpp b/tdeprint/lpdunix/kmlpdunixmanager.cpp index 232a49eb0..7a291f6df 100644 --- a/tdeprint/lpdunix/kmlpdunixmanager.cpp +++ b/tdeprint/lpdunix/kmlpdunixmanager.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/lpdunix/kmlpdunixuimanager.cpp b/tdeprint/lpdunix/kmlpdunixuimanager.cpp index 686dfecbb..b7f059f1a 100644 --- a/tdeprint/lpdunix/kmlpdunixuimanager.cpp +++ b/tdeprint/lpdunix/kmlpdunixuimanager.cpp @@ -21,7 +21,7 @@ #include "kpqtpage.h" #include "kprinterpropertydialog.h" -#include +#include KMLpdUnixUiManager::KMLpdUnixUiManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMUiManager(parent,name) diff --git a/tdeprint/lpr/apshandler.cpp b/tdeprint/lpr/apshandler.cpp index 3d144644a..acb0e0c2d 100644 --- a/tdeprint/lpr/apshandler.cpp +++ b/tdeprint/lpr/apshandler.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/lpr/editentrydialog.cpp b/tdeprint/lpr/editentrydialog.cpp index 3977f12f8..9a8f9caa2 100644 --- a/tdeprint/lpr/editentrydialog.cpp +++ b/tdeprint/lpr/editentrydialog.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include EditEntryDialog::EditEntryDialog(PrintcapEntry *entry, TQWidget *parent, const char *name) diff --git a/tdeprint/lpr/kmconfiglpr.cpp b/tdeprint/lpr/kmconfiglpr.cpp index 8a6988188..fed1dd17d 100644 --- a/tdeprint/lpr/kmconfiglpr.cpp +++ b/tdeprint/lpr/kmconfiglpr.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include KMConfigLpr::KMConfigLpr(TQWidget *parent, const char *name) diff --git a/tdeprint/lpr/kmlprjobmanager.cpp b/tdeprint/lpr/kmlprjobmanager.cpp index 851663664..0738d17c1 100644 --- a/tdeprint/lpr/kmlprjobmanager.cpp +++ b/tdeprint/lpr/kmlprjobmanager.cpp @@ -25,7 +25,7 @@ #include "lprsettings.h" #include -#include +#include KMLprJobManager::KMLprJobManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMJobManager(parent, name) diff --git a/tdeprint/lpr/kmlprmanager.cpp b/tdeprint/lpr/kmlprmanager.cpp index 157105e60..046f082f7 100644 --- a/tdeprint/lpr/kmlprmanager.cpp +++ b/tdeprint/lpr/kmlprmanager.cpp @@ -30,13 +30,13 @@ #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include diff --git a/tdeprint/lpr/kmlpruimanager.cpp b/tdeprint/lpr/kmlpruimanager.cpp index 655309e0c..b7d23bb42 100644 --- a/tdeprint/lpr/kmlpruimanager.cpp +++ b/tdeprint/lpr/kmlpruimanager.cpp @@ -29,7 +29,7 @@ #include "kmwbackend.h" #include "kmconfiglpr.h" -#include +#include KMLprUiManager::KMLprUiManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMUiManager(parent,name) diff --git a/tdeprint/lpr/lpchelper.cpp b/tdeprint/lpr/lpchelper.cpp index f72901865..b366537e5 100644 --- a/tdeprint/lpr/lpchelper.cpp +++ b/tdeprint/lpr/lpchelper.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/lpr/lprhandler.cpp b/tdeprint/lpr/lprhandler.cpp index fcb838bb9..767b55382 100644 --- a/tdeprint/lpr/lprhandler.cpp +++ b/tdeprint/lpr/lprhandler.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include diff --git a/tdeprint/lpr/lprngtoolhandler.cpp b/tdeprint/lpr/lprngtoolhandler.cpp index d3e283123..960f5adb8 100644 --- a/tdeprint/lpr/lprngtoolhandler.cpp +++ b/tdeprint/lpr/lprngtoolhandler.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include diff --git a/tdeprint/lpr/matichandler.cpp b/tdeprint/lpr/matichandler.cpp index e1242c5fc..826867cd2 100644 --- a/tdeprint/lpr/matichandler.cpp +++ b/tdeprint/lpr/matichandler.cpp @@ -29,7 +29,7 @@ #include "util.h" #include "foomatic2loader.h" -#include +#include #include #include #include diff --git a/tdeprint/management/kaddprinterwizard.cpp b/tdeprint/management/kaddprinterwizard.cpp index 256b85011..466c75853 100644 --- a/tdeprint/management/kaddprinterwizard.cpp +++ b/tdeprint/management/kaddprinterwizard.cpp @@ -1,9 +1,9 @@ #include "kmmanager.h" #include #include -#include -#include -#include +#include +#include +#include static TDECmdLineOptions options[] = { diff --git a/tdeprint/management/kmconfigcommand.cpp b/tdeprint/management/kmconfigcommand.cpp index 32fb7db11..4cf33998f 100644 --- a/tdeprint/management/kmconfigcommand.cpp +++ b/tdeprint/management/kmconfigcommand.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include KMConfigCommand::KMConfigCommand(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmconfigdialog.cpp b/tdeprint/management/kmconfigdialog.cpp index 6f0e76e19..50eabe9b1 100644 --- a/tdeprint/management/kmconfigdialog.cpp +++ b/tdeprint/management/kmconfigdialog.cpp @@ -30,7 +30,7 @@ #include "kmconfigjobs.h" #include -#include +#include #include #include diff --git a/tdeprint/management/kmconfigfilter.cpp b/tdeprint/management/kmconfigfilter.cpp index 21cbc418e..b7be0a1e6 100644 --- a/tdeprint/management/kmconfigfilter.cpp +++ b/tdeprint/management/kmconfigfilter.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kmconfigfonts.cpp b/tdeprint/management/kmconfigfonts.cpp index 54ebdb87c..890a42045 100644 --- a/tdeprint/management/kmconfigfonts.cpp +++ b/tdeprint/management/kmconfigfonts.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kmconfiggeneral.cpp b/tdeprint/management/kmconfiggeneral.cpp index b7c0a1522..635667cec 100644 --- a/tdeprint/management/kmconfiggeneral.cpp +++ b/tdeprint/management/kmconfiggeneral.cpp @@ -26,13 +26,13 @@ #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kmconfigjobs.cpp b/tdeprint/management/kmconfigjobs.cpp index 667b40381..c31e525be 100644 --- a/tdeprint/management/kmconfigjobs.cpp +++ b/tdeprint/management/kmconfigjobs.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/tdeprint/management/kmconfigpreview.cpp b/tdeprint/management/kmconfigpreview.cpp index 3d084f735..2fdcbcb4b 100644 --- a/tdeprint/management/kmconfigpreview.cpp +++ b/tdeprint/management/kmconfigpreview.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kmdbcreator.cpp b/tdeprint/management/kmdbcreator.cpp index 2297d4034..6154ebea2 100644 --- a/tdeprint/management/kmdbcreator.cpp +++ b/tdeprint/management/kmdbcreator.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kmdriverdb.cpp b/tdeprint/management/kmdriverdb.cpp index 9eb28cf87..5a172281b 100644 --- a/tdeprint/management/kmdriverdb.cpp +++ b/tdeprint/management/kmdriverdb.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include KMDriverDB* KMDriverDB::m_self = 0; diff --git a/tdeprint/management/kmdriverdbwidget.cpp b/tdeprint/management/kmdriverdbwidget.cpp index 42d573e71..50297bdca 100644 --- a/tdeprint/management/kmdriverdbwidget.cpp +++ b/tdeprint/management/kmdriverdbwidget.cpp @@ -28,12 +28,12 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kmdriverdialog.cpp b/tdeprint/management/kmdriverdialog.cpp index ef37e333c..c43017cc7 100644 --- a/tdeprint/management/kmdriverdialog.cpp +++ b/tdeprint/management/kmdriverdialog.cpp @@ -20,8 +20,8 @@ #include "kmdriverdialog.h" #include "driverview.h" -#include -#include +#include +#include KMDriverDialog::KMDriverDialog(TQWidget *parent, const char *name) : KDialogBase(KDialogBase::Swallow,i18n("Configure"),KDialogBase::Ok|KDialogBase::Cancel,KDialogBase::Ok,parent,name,true,false) diff --git a/tdeprint/management/kminfopage.cpp b/tdeprint/management/kminfopage.cpp index 9987ccb4c..bae2b6ad6 100644 --- a/tdeprint/management/kminfopage.cpp +++ b/tdeprint/management/kminfopage.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/management/kminstancepage.cpp b/tdeprint/management/kminstancepage.cpp index 8c263bb48..0cadf3dba 100644 --- a/tdeprint/management/kminstancepage.cpp +++ b/tdeprint/management/kminstancepage.cpp @@ -30,10 +30,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kmjobviewer.cpp b/tdeprint/management/kmjobviewer.cpp index 741e69378..98e9595f9 100644 --- a/tdeprint/management/kmjobviewer.cpp +++ b/tdeprint/management/kmjobviewer.cpp @@ -33,15 +33,15 @@ #include #include #include -#include -#include +#include +#include #include #include #include #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kmlistview.cpp b/tdeprint/management/kmlistview.cpp index 10741d7fe..806cc0d9f 100644 --- a/tdeprint/management/kmlistview.cpp +++ b/tdeprint/management/kmlistview.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/tdeprint/management/kmmainview.cpp b/tdeprint/management/kmmainview.cpp index 5e68f3726..4aba92dad 100644 --- a/tdeprint/management/kmmainview.cpp +++ b/tdeprint/management/kmmainview.cpp @@ -36,15 +36,15 @@ #include "messagewindow.h" #include -#include +#include #include #include #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kmpages.cpp b/tdeprint/management/kmpages.cpp index 4f0f1f4f7..d0c413966 100644 --- a/tdeprint/management/kmpages.cpp +++ b/tdeprint/management/kmpages.cpp @@ -23,7 +23,7 @@ #include "kmpropertypage.h" #include "kminstancepage.h" -#include +#include #include #include diff --git a/tdeprint/management/kmprinterview.cpp b/tdeprint/management/kmprinterview.cpp index 6d7edb707..d311f75c3 100644 --- a/tdeprint/management/kmprinterview.cpp +++ b/tdeprint/management/kmprinterview.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include KMPrinterView::KMPrinterView(TQWidget *parent, const char *name) : TQWidgetStack(parent,name), m_type(KMPrinterView::Icons) diff --git a/tdeprint/management/kmpropbackend.cpp b/tdeprint/management/kmpropbackend.cpp index 98004d2ed..00aac2b40 100644 --- a/tdeprint/management/kmpropbackend.cpp +++ b/tdeprint/management/kmpropbackend.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include KMPropBackend::KMPropBackend(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/management/kmpropcontainer.cpp b/tdeprint/management/kmpropcontainer.cpp index 9c7808199..c94838098 100644 --- a/tdeprint/management/kmpropcontainer.cpp +++ b/tdeprint/management/kmpropcontainer.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include diff --git a/tdeprint/management/kmpropdriver.cpp b/tdeprint/management/kmpropdriver.cpp index 55daf0ed5..6f20494fc 100644 --- a/tdeprint/management/kmpropdriver.cpp +++ b/tdeprint/management/kmpropdriver.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include KMPropDriver::KMPropDriver(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/management/kmpropgeneral.cpp b/tdeprint/management/kmpropgeneral.cpp index c55603da9..6b24b0466 100644 --- a/tdeprint/management/kmpropgeneral.cpp +++ b/tdeprint/management/kmpropgeneral.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include KMPropGeneral::KMPropGeneral(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/management/kmpropmembers.cpp b/tdeprint/management/kmpropmembers.cpp index 26671eed8..7fc4155a0 100644 --- a/tdeprint/management/kmpropmembers.cpp +++ b/tdeprint/management/kmpropmembers.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include KMPropMembers::KMPropMembers(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/management/kmpropwidget.cpp b/tdeprint/management/kmpropwidget.cpp index ae8b03cbf..50c1a75e8 100644 --- a/tdeprint/management/kmpropwidget.cpp +++ b/tdeprint/management/kmpropwidget.cpp @@ -23,8 +23,8 @@ #include "kmmanager.h" #include "kmtimer.h" -#include -#include +#include +#include KMPropWidget::KMPropWidget(TQWidget *parent, const char *name) : TQWidget(parent,name) diff --git a/tdeprint/management/kmspecialprinterdlg.cpp b/tdeprint/management/kmspecialprinterdlg.cpp index 2d2a245c7..7c4c0173d 100644 --- a/tdeprint/management/kmspecialprinterdlg.cpp +++ b/tdeprint/management/kmspecialprinterdlg.cpp @@ -34,8 +34,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeprint/management/kmwbackend.cpp b/tdeprint/management/kmwbackend.cpp index 6fd8cf2dc..b2e8fdcd4 100644 --- a/tdeprint/management/kmwbackend.cpp +++ b/tdeprint/management/kmwbackend.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kmwclass.cpp b/tdeprint/management/kmwclass.cpp index aee060e5f..e04467632 100644 --- a/tdeprint/management/kmwclass.cpp +++ b/tdeprint/management/kmwclass.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include KMWClass::KMWClass(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwdriver.cpp b/tdeprint/management/kmwdriver.cpp index 58793c192..9876c0420 100644 --- a/tdeprint/management/kmwdriver.cpp +++ b/tdeprint/management/kmwdriver.cpp @@ -24,7 +24,7 @@ #include "kmdriverdb.h" #include -#include +#include KMWDriver::KMWDriver(TQWidget *parent, const char *name) : KMWizardPage(parent,name) diff --git a/tdeprint/management/kmwdriverselect.cpp b/tdeprint/management/kmwdriverselect.cpp index f60dcface..cc52f1015 100644 --- a/tdeprint/management/kmwdriverselect.cpp +++ b/tdeprint/management/kmwdriverselect.cpp @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include +#include KMWDriverSelect::KMWDriverSelect(TQWidget *parent, const char *name) : KMWizardPage(parent,name) diff --git a/tdeprint/management/kmwdrivertest.cpp b/tdeprint/management/kmwdrivertest.cpp index cb46a45a0..73871988a 100644 --- a/tdeprint/management/kmwdrivertest.cpp +++ b/tdeprint/management/kmwdrivertest.cpp @@ -28,9 +28,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include diff --git a/tdeprint/management/kmwend.cpp b/tdeprint/management/kmwend.cpp index 2881b4ea0..4ad564cf6 100644 --- a/tdeprint/management/kmwend.cpp +++ b/tdeprint/management/kmwend.cpp @@ -23,7 +23,7 @@ #include "util.h" #include -#include +#include #include KMWEnd::KMWEnd(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwfile.cpp b/tdeprint/management/kmwfile.cpp index f3b54dcdc..58a61e8e4 100644 --- a/tdeprint/management/kmwfile.cpp +++ b/tdeprint/management/kmwfile.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include KMWFile::KMWFile(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwinfopage.cpp b/tdeprint/management/kmwinfopage.cpp index fd9e92697..175ff7e74 100644 --- a/tdeprint/management/kmwinfopage.cpp +++ b/tdeprint/management/kmwinfopage.cpp @@ -22,7 +22,7 @@ #include #include -#include +#include #include KMWInfoPage::KMWInfoPage(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwizard.cpp b/tdeprint/management/kmwizard.cpp index 5bb86967a..bc894c478 100644 --- a/tdeprint/management/kmwizard.cpp +++ b/tdeprint/management/kmwizard.cpp @@ -26,9 +26,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kmwlocal.cpp b/tdeprint/management/kmwlocal.cpp index ea79563ec..424e40100 100644 --- a/tdeprint/management/kmwlocal.cpp +++ b/tdeprint/management/kmwlocal.cpp @@ -23,13 +23,13 @@ #include "kmfactory.h" #include "kmmanager.h" -#include +#include #include #include #include #include #include -#include +#include #include KMWLocal::KMWLocal(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwlpd.cpp b/tdeprint/management/kmwlpd.cpp index 352a075c5..3c4794ad1 100644 --- a/tdeprint/management/kmwlpd.cpp +++ b/tdeprint/management/kmwlpd.cpp @@ -23,11 +23,11 @@ #include "kmprinter.h" #include -#include +#include #include #include #include -#include +#include #include static bool checkLpdQueue(const char *host, const char *queue); diff --git a/tdeprint/management/kmwname.cpp b/tdeprint/management/kmwname.cpp index fe567f7bb..e8378371a 100644 --- a/tdeprint/management/kmwname.cpp +++ b/tdeprint/management/kmwname.cpp @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include #include KMWName::KMWName(TQWidget *parent, const char *name) diff --git a/tdeprint/management/kmwpassword.cpp b/tdeprint/management/kmwpassword.cpp index 8490a179c..3cd71aadd 100644 --- a/tdeprint/management/kmwpassword.cpp +++ b/tdeprint/management/kmwpassword.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/management/kmwsmb.cpp b/tdeprint/management/kmwsmb.cpp index e76240cf8..836a7fb15 100644 --- a/tdeprint/management/kmwsmb.cpp +++ b/tdeprint/management/kmwsmb.cpp @@ -23,7 +23,7 @@ #include "kmprinter.h" #include "util.h" -#include +#include #include #include #include diff --git a/tdeprint/management/kmwsocket.cpp b/tdeprint/management/kmwsocket.cpp index 6b8f4aae9..a3fb71b3d 100644 --- a/tdeprint/management/kmwsocket.cpp +++ b/tdeprint/management/kmwsocket.cpp @@ -26,9 +26,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include diff --git a/tdeprint/management/kmwsocketutil.cpp b/tdeprint/management/kmwsocketutil.cpp index a4f23959a..02b0a6b69 100644 --- a/tdeprint/management/kmwsocketutil.cpp +++ b/tdeprint/management/kmwsocketutil.cpp @@ -27,13 +27,13 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include diff --git a/tdeprint/management/kxmlcommanddlg.cpp b/tdeprint/management/kxmlcommanddlg.cpp index 2080149d9..9b165e432 100644 --- a/tdeprint/management/kxmlcommanddlg.cpp +++ b/tdeprint/management/kxmlcommanddlg.cpp @@ -38,13 +38,13 @@ #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/management/kxmlcommandselector.cpp b/tdeprint/management/kxmlcommandselector.cpp index 67627fb53..08722cf6e 100644 --- a/tdeprint/management/kxmlcommandselector.cpp +++ b/tdeprint/management/kxmlcommandselector.cpp @@ -30,9 +30,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeprint/management/networkscanner.cpp b/tdeprint/management/networkscanner.cpp index 1943f9354..ee4e7dbc7 100644 --- a/tdeprint/management/networkscanner.cpp +++ b/tdeprint/management/networkscanner.cpp @@ -30,9 +30,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeprint/management/smbview.cpp b/tdeprint/management/smbview.cpp index 10ac359f9..f5977bfb0 100644 --- a/tdeprint/management/smbview.cpp +++ b/tdeprint/management/smbview.cpp @@ -20,14 +20,14 @@ #include "smbview.h" #include -#include +#include #include #include #include -#include +#include #include -#include +#include #include #include diff --git a/tdeprint/management/tdeprint_management_module.cpp b/tdeprint/management/tdeprint_management_module.cpp index d15ef791f..89d315c0f 100644 --- a/tdeprint/management/tdeprint_management_module.cpp +++ b/tdeprint/management/tdeprint_management_module.cpp @@ -26,9 +26,9 @@ #include "kmprinter.h" #include "kmmainview.h" -#include +#include #include -#include +#include extern "C" { diff --git a/tdeprint/marginpreview.cpp b/tdeprint/marginpreview.cpp index 2a5e21e59..45f70b7f1 100644 --- a/tdeprint/marginpreview.cpp +++ b/tdeprint/marginpreview.cpp @@ -19,7 +19,7 @@ #include "marginpreview.h" -#include +#include #include #include #include diff --git a/tdeprint/marginwidget.cpp b/tdeprint/marginwidget.cpp index 3ec1872f2..c483be123 100644 --- a/tdeprint/marginwidget.cpp +++ b/tdeprint/marginwidget.cpp @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include +#include MarginWidget::MarginWidget(TQWidget *parent, const char* name, bool allowMetricUnit) : TQWidget(parent, name), m_default(4, 0), m_pagesize( 2 ) diff --git a/tdeprint/plugincombobox.cpp b/tdeprint/plugincombobox.cpp index 9ccfc8074..b2a686f6e 100644 --- a/tdeprint/plugincombobox.cpp +++ b/tdeprint/plugincombobox.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include PluginComboBox::PluginComboBox(TQWidget *parent, const char *name) diff --git a/tdeprint/posterpreview.cpp b/tdeprint/posterpreview.cpp index b76c0181a..0839af3d7 100644 --- a/tdeprint/posterpreview.cpp +++ b/tdeprint/posterpreview.cpp @@ -25,9 +25,9 @@ #include #include #include -#include +#include #include -#include +#include PosterPreview::PosterPreview( TQWidget *parent, const char *name ) : TQFrame( parent, name ) diff --git a/tdeprint/ppdloader.cpp b/tdeprint/ppdloader.cpp index dcf272b0a..b829e2e17 100644 --- a/tdeprint/ppdloader.cpp +++ b/tdeprint/ppdloader.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/tdeprint/printerfilter.cpp b/tdeprint/printerfilter.cpp index d1889dd1c..4fc362350 100644 --- a/tdeprint/printerfilter.cpp +++ b/tdeprint/printerfilter.cpp @@ -22,7 +22,7 @@ #include "kmfactory.h" #include -#include +#include #include PrinterFilter::PrinterFilter(TQObject *parent, const char *name) diff --git a/tdeprint/rlpr/kmconfigproxy.cpp b/tdeprint/rlpr/kmconfigproxy.cpp index 78513dad3..d41adcdee 100644 --- a/tdeprint/rlpr/kmconfigproxy.cpp +++ b/tdeprint/rlpr/kmconfigproxy.cpp @@ -21,7 +21,7 @@ #include "kmproxywidget.h" #include -#include +#include KMConfigProxy::KMConfigProxy(TQWidget *parent) : KMConfigPage(parent,"Proxy") diff --git a/tdeprint/rlpr/kmproprlpr.cpp b/tdeprint/rlpr/kmproprlpr.cpp index 62fe97827..08713a784 100644 --- a/tdeprint/rlpr/kmproprlpr.cpp +++ b/tdeprint/rlpr/kmproprlpr.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include KMPropRlpr::KMPropRlpr(TQWidget *parent, const char *name) : KMPropWidget(parent,name) diff --git a/tdeprint/rlpr/kmproxywidget.cpp b/tdeprint/rlpr/kmproxywidget.cpp index a2a3e6a85..870da43c4 100644 --- a/tdeprint/rlpr/kmproxywidget.cpp +++ b/tdeprint/rlpr/kmproxywidget.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeprint/rlpr/kmrlprmanager.cpp b/tdeprint/rlpr/kmrlprmanager.cpp index c6704ed09..7b8ceac2d 100644 --- a/tdeprint/rlpr/kmrlprmanager.cpp +++ b/tdeprint/rlpr/kmrlprmanager.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include KMRlprManager::KMRlprManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMManager(parent,name) diff --git a/tdeprint/rlpr/kmrlpruimanager.cpp b/tdeprint/rlpr/kmrlpruimanager.cpp index 9bae2cdc4..fa6383962 100644 --- a/tdeprint/rlpr/kmrlpruimanager.cpp +++ b/tdeprint/rlpr/kmrlpruimanager.cpp @@ -26,7 +26,7 @@ #include "kmproprlpr.h" #include "kmconfigproxy.h" -#include +#include KMRlprUiManager::KMRlprUiManager(TQObject *parent, const char *name, const TQStringList & /*args*/) : KMUiManager(parent,name) diff --git a/tdeprint/rlpr/kmwrlpr.cpp b/tdeprint/rlpr/kmwrlpr.cpp index 79682b91a..056cba1f0 100644 --- a/tdeprint/rlpr/kmwrlpr.cpp +++ b/tdeprint/rlpr/kmwrlpr.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include static TQListViewItem* rlpr_findChild(TQListViewItem *c, const TQString& txt) diff --git a/tdeprint/rlpr/krlprprinterimpl.cpp b/tdeprint/rlpr/krlprprinterimpl.cpp index 8ca1c6569..4ef5ebe1e 100644 --- a/tdeprint/rlpr/krlprprinterimpl.cpp +++ b/tdeprint/rlpr/krlprprinterimpl.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include KRlprPrinterImpl::KRlprPrinterImpl(TQObject *parent, const char *name, const TQStringList & /*args*/) : KPrinterImpl(parent,name) diff --git a/tdeprint/tdefilelist.cpp b/tdeprint/tdefilelist.cpp index 19ffb481b..bf2fb3d12 100644 --- a/tdeprint/tdefilelist.cpp +++ b/tdeprint/tdefilelist.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/tdeprintd.cpp b/tdeprint/tdeprintd.cpp index 5080cc40c..9b7b6c955 100644 --- a/tdeprint/tdeprintd.cpp +++ b/tdeprint/tdeprintd.cpp @@ -21,9 +21,9 @@ #include "kprintprocess.h" #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeprint/tests/helpwindow.cpp b/tdeprint/tests/helpwindow.cpp index 11cf22fd2..54d160c73 100644 --- a/tdeprint/tests/helpwindow.cpp +++ b/tdeprint/tests/helpwindow.cpp @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeprint/tools/escputil/escpwidget.cpp b/tdeprint/tools/escputil/escpwidget.cpp index de54f2de1..9afff64ac 100644 --- a/tdeprint/tools/escputil/escpwidget.cpp +++ b/tdeprint/tools/escputil/escpwidget.cpp @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeprint/util.h b/tdeprint/util.h index dafcdaa90..75811aee6 100644 --- a/tdeprint/util.h +++ b/tdeprint/util.h @@ -23,7 +23,7 @@ #include "kprinter.h" #include #include -#include +#include KURL smbToUrl(const TQString& work, const TQString& server, const TQString& printer); void urlToSmb(const KURL& url, TQString& work, TQString& server, TQString& printer); diff --git a/tderandr/ktimerdialog.cpp b/tderandr/ktimerdialog.cpp index 0be416be7..eba497372 100644 --- a/tderandr/ktimerdialog.cpp +++ b/tderandr/ktimerdialog.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include "ktimerdialog.h" diff --git a/tderandr/libtderandr.cc b/tderandr/libtderandr.cc index 976b156ac..fe9461715 100644 --- a/tderandr/libtderandr.cc +++ b/tderandr/libtderandr.cc @@ -26,8 +26,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/tderandr/randr.cpp b/tderandr/randr.cpp index 68bfc2e68..59fd0e8ae 100644 --- a/tderandr/randr.cpp +++ b/tderandr/randr.cpp @@ -22,8 +22,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/tderesources/configdialog.cpp b/tderesources/configdialog.cpp index b6d29dcd3..4eb528835 100644 --- a/tderesources/configdialog.cpp +++ b/tderesources/configdialog.cpp @@ -21,9 +21,9 @@ Boston, MA 02110-1301, USA. */ -#include +#include #include -#include +#include #include #include diff --git a/tderesources/configpage.cpp b/tderesources/configpage.cpp index e70332c71..8378707e6 100644 --- a/tderesources/configpage.cpp +++ b/tderesources/configpage.cpp @@ -28,8 +28,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tderesources/factory.cpp b/tderesources/factory.cpp index 09140e7b7..eea2d3673 100644 --- a/tderesources/factory.cpp +++ b/tderesources/factory.cpp @@ -22,7 +22,7 @@ */ #include -#include +#include #include #include #include diff --git a/tderesources/kcmtderesources.cpp b/tderesources/kcmtderesources.cpp index 1b779fabd..c3d5ae09e 100644 --- a/tderesources/kcmtderesources.cpp +++ b/tderesources/kcmtderesources.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include "configpage.h" diff --git a/tderesources/resource.cpp b/tderesources/resource.cpp index 41c08767e..e6fc4ebbd 100644 --- a/tderesources/resource.cpp +++ b/tderesources/resource.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include "resource.h" using namespace KRES; diff --git a/tderesources/selectdialog.cpp b/tderesources/selectdialog.cpp index c50bd36fd..c8009ae47 100644 --- a/tderesources/selectdialog.cpp +++ b/tderesources/selectdialog.cpp @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/tdersync/rsyncconfigdialog.cpp b/tdersync/rsyncconfigdialog.cpp index 78df9e335..675044140 100644 --- a/tdersync/rsyncconfigdialog.cpp +++ b/tdersync/rsyncconfigdialog.cpp @@ -71,13 +71,13 @@ #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/tdersync/tdersync.h b/tdersync/tdersync.h index a4908fe63..b57c350a4 100644 --- a/tdersync/tdersync.h +++ b/tdersync/tdersync.h @@ -49,14 +49,14 @@ #include #include -#include +#include #include #include #include #include #include -#include +#include #include #include #include diff --git a/tdespell2/settings.cpp b/tdespell2/settings.cpp index 57535b85c..a23fb062f 100644 --- a/tdespell2/settings.cpp +++ b/tdespell2/settings.cpp @@ -23,8 +23,8 @@ #include "broker.h" -#include -#include +#include +#include #include #include diff --git a/tdespell2/ui/configdialog.cpp b/tdespell2/ui/configdialog.cpp index 56e39ca2b..288d62a29 100644 --- a/tdespell2/ui/configdialog.cpp +++ b/tdespell2/ui/configdialog.cpp @@ -21,7 +21,7 @@ #include "configdialog.h" #include "configwidget.h" -#include +#include #include diff --git a/tdespell2/ui/configwidget.cpp b/tdespell2/ui/configwidget.cpp index 6d98955ae..2317f7307 100644 --- a/tdespell2/ui/configwidget.cpp +++ b/tdespell2/ui/configwidget.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/tdespell2/ui/dialog.cpp b/tdespell2/ui/dialog.cpp index a0ff36c01..0c45f3cd1 100644 --- a/tdespell2/ui/dialog.cpp +++ b/tdespell2/ui/dialog.cpp @@ -28,7 +28,7 @@ #include "settings.h" #include -#include +#include #include #include diff --git a/tdesu/ssh.cpp b/tdesu/ssh.cpp index f45b38e7e..c23ca459b 100644 --- a/tdesu/ssh.cpp +++ b/tdesu/ssh.cpp @@ -32,7 +32,7 @@ #include #include -#include +#include #include #include "ssh.h" diff --git a/tdesu/su.cpp b/tdesu/su.cpp index d75970dd8..e29288ab9 100644 --- a/tdesu/su.cpp +++ b/tdesu/su.cpp @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include "su.h" diff --git a/tdeui/CMakeLists.txt b/tdeui/CMakeLists.txt index 85d2fc9b4..8cff8df1c 100644 --- a/tdeui/CMakeLists.txt +++ b/tdeui/CMakeLists.txt @@ -43,7 +43,7 @@ install( FILES kcolordialog.h tdeselect.h kdatepik.h kdatepicker.h kdatetbl.h tdefontdialog.h tdepopupmenu.h tdefontrequester.h ktabctl.h kstatusbar.h - tdemainwindow.h tdemainwindowiface.h tdetoolbar.h kmenubar.h + tdemainwindow.h tdemainwindowiface.h tdetoolbar.h tdemenubar.h knuminput.h kseparator.h klineedit.h krestrictedline.h kcolorbutton.h kcolorbtn.h ksystemtray.h kdockwindow.h kbuttonbox.h @@ -54,7 +54,7 @@ install( FILES kcharselect.h kcolordrag.h qxembed.h knumvalidator.h kdialog.h kdialogbase.h kjanuswidget.h tdeaboutdialog.h - kauthicon.h kmessagebox.h ksharedpixmap.h + kauthicon.h tdemessagebox.h ksharedpixmap.h kdualcolorbtn.h kdualcolorbutton.h tdetoolbarbutton.h tdetoolbarradiogroup.h ktextbrowser.h tdeaction.h tdeactioncollection.h tdeactionclasses.h khelpmenu.h kswitchlanguagedialog.h @@ -103,7 +103,7 @@ set( ${target}_SRCS qxembed.cpp ksharedpixmap.cpp kpixmapio.cpp tdepopupmenu.cpp tdetoolbar.cpp tdeaction.cpp kstdaction.cpp tdeactioncollection.cpp tdeactionclasses.cpp - kurllabel.cpp kmenubar.cpp kinputdialog.cpp + kurllabel.cpp tdemenubar.cpp kinputdialog.cpp knuminput.cpp klineedit.cpp tdelistview.cpp kprogress.cpp kprogressbox.cpp kcolordialog.cpp tdeselect.cpp kdatepicker.cpp kdatetbl.cpp tdefontrequester.cpp tdefontdialog.cpp ktabctl.cpp @@ -118,7 +118,7 @@ set( ${target}_SRCS kcharselect.cpp kcolordrag.cpp knumvalidator.cpp kdialog.cpp kdialogbase.cpp kjanuswidget.cpp tdeaboutdialog.cpp - kauthicon.cpp kmessagebox.cpp kdualcolorbutton.cpp + kauthicon.cpp tdemessagebox.cpp kdualcolorbutton.cpp tdetoolbarradiogroup.cpp tdetoolbarbutton.cpp ktextbrowser.cpp khelpmenu.cpp kswitchlanguagedialog.cpp kcmenumngr.cpp kpanelmenu.cpp diff --git a/tdeui/MAINTAINERS b/tdeui/MAINTAINERS index f4e2165fb..2caa911a2 100644 --- a/tdeui/MAINTAINERS +++ b/tdeui/MAINTAINERS @@ -54,8 +54,8 @@ tdelistbox.cpp tdelistview.cpp tdemainwindow.cpp tdemainwindowiface.cpp -kmenubar.cpp -kmessagebox.cpp Waldo Bastian +tdemenubar.cpp +tdemessagebox.cpp Waldo Bastian knuminput.cpp Dirk Mueller knumvalidator.cpp kpanelapplet.cpp diff --git a/tdeui/Makefile.am b/tdeui/Makefile.am index 26a9423cd..eac8cde0e 100644 --- a/tdeui/Makefile.am +++ b/tdeui/Makefile.am @@ -40,7 +40,7 @@ include_HEADERS = kprogressbox.h kprogress.h kcolordlg.h \ kcolordialog.h tdeselect.h \ kdatepik.h kdatepicker.h kdatetbl.h tdefontdialog.h tdepopupmenu.h \ tdefontrequester.h ktabctl.h kstatusbar.h \ - tdemainwindow.h tdemainwindowiface.h tdetoolbar.h kmenubar.h \ + tdemainwindow.h tdemainwindowiface.h tdetoolbar.h tdemenubar.h \ knuminput.h kseparator.h klineedit.h \ krestrictedline.h kcolorbutton.h kcolorbtn.h \ ksystemtray.h kdockwindow.h kbuttonbox.h \ @@ -51,7 +51,7 @@ include_HEADERS = kprogressbox.h kprogress.h kcolordlg.h \ kcharselect.h kcolordrag.h qxembed.h \ knumvalidator.h kdialog.h kdialogbase.h \ kjanuswidget.h tdeaboutdialog.h \ - kauthicon.h kmessagebox.h ksharedpixmap.h \ + kauthicon.h tdemessagebox.h ksharedpixmap.h \ kdualcolorbtn.h kdualcolorbutton.h tdetoolbarbutton.h \ tdetoolbarradiogroup.h ktextbrowser.h \ tdeaction.h tdeactioncollection.h tdeactionclasses.h khelpmenu.h kswitchlanguagedialog.h \ @@ -84,7 +84,7 @@ libtdeui_la_SOURCES = \ qxembed.cpp ksharedpixmap.cpp kpixmapio.cpp \ tdepopupmenu.cpp tdetoolbar.cpp tdeaction.cpp kstdaction.cpp \ tdeactioncollection.cpp tdeactionclasses.cpp \ - kurllabel.cpp kmenubar.cpp kinputdialog.cpp \ + kurllabel.cpp tdemenubar.cpp kinputdialog.cpp \ knuminput.cpp klineedit.cpp tdelistview.cpp kprogress.cpp \ kprogressbox.cpp kcolordialog.cpp tdeselect.cpp kdatepicker.cpp \ kdatetbl.cpp tdefontrequester.cpp tdefontdialog.cpp ktabctl.cpp \ @@ -99,7 +99,7 @@ libtdeui_la_SOURCES = \ kcharselect.cpp kcolordrag.cpp \ knumvalidator.cpp kdialog.cpp kdialogbase.cpp \ kjanuswidget.cpp tdeaboutdialog.cpp \ - kauthicon.cpp kmessagebox.cpp kdualcolorbutton.cpp \ + kauthicon.cpp tdemessagebox.cpp kdualcolorbutton.cpp \ tdetoolbarradiogroup.cpp tdetoolbarbutton.cpp \ ktextbrowser.cpp khelpmenu.cpp kswitchlanguagedialog.cpp \ kcmenumngr.cpp kpanelmenu.cpp \ diff --git a/tdeui/kauthicon.cpp b/tdeui/kauthicon.cpp index d4c18a114..d45217d9b 100644 --- a/tdeui/kauthicon.cpp +++ b/tdeui/kauthicon.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include "kauthicon.h" diff --git a/tdeui/kbugreport.cpp b/tdeui/kbugreport.cpp index 91c6aa66c..3e49e112c 100644 --- a/tdeui/kbugreport.cpp +++ b/tdeui/kbugreport.cpp @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include @@ -50,7 +50,7 @@ #include "kdepackages.h" #include #include -#include +#include #include #include diff --git a/tdeui/kbuttonbox.cpp b/tdeui/kbuttonbox.cpp index 6351c512d..faa26e95e 100644 --- a/tdeui/kbuttonbox.cpp +++ b/tdeui/kbuttonbox.cpp @@ -50,7 +50,7 @@ */ #include "kbuttonbox.moc" -#include +#include #include #include #include diff --git a/tdeui/kcharselect.cpp b/tdeui/kcharselect.cpp index a623b3efa..5561e5883 100644 --- a/tdeui/kcharselect.cpp +++ b/tdeui/kcharselect.cpp @@ -40,7 +40,7 @@ #include #include #include -#include +#include class KCharSelect::KCharSelectPrivate { diff --git a/tdeui/kcmenumngr.cpp b/tdeui/kcmenumngr.cpp index b0f261890..60e250575 100644 --- a/tdeui/kcmenumngr.cpp +++ b/tdeui/kcmenumngr.cpp @@ -21,7 +21,7 @@ #include #include #include "kcmenumngr.h" -#include "kglobal.h" +#include "tdeglobal.h" #include "tdeconfig.h" #include "tdeshortcut.h" diff --git a/tdeui/kcolorbutton.cpp b/tdeui/kcolorbutton.cpp index 993530497..5a42406a0 100644 --- a/tdeui/kcolorbutton.cpp +++ b/tdeui/kcolorbutton.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include "kcolordialog.h" #include "kcolorbutton.h" diff --git a/tdeui/kcolorcombo.cpp b/tdeui/kcolorcombo.cpp index 7e9353cf4..87d5de32a 100644 --- a/tdeui/kcolorcombo.cpp +++ b/tdeui/kcolorcombo.cpp @@ -46,12 +46,12 @@ #include #include -#include -#include +#include +#include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeui/kcolordialog.cpp b/tdeui/kcolordialog.cpp index 29292f960..458fb50a8 100644 --- a/tdeui/kcolordialog.cpp +++ b/tdeui/kcolordialog.cpp @@ -47,13 +47,13 @@ #include #include -#include -#include +#include +#include #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeui/kcombobox.cpp b/tdeui/kcombobox.cpp index 3ddb4390b..cfef5fd5b 100644 --- a/tdeui/kcombobox.cpp +++ b/tdeui/kcombobox.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/kcommand.cpp b/tdeui/kcommand.cpp index e039a03ca..994d1262e 100644 --- a/tdeui/kcommand.cpp +++ b/tdeui/kcommand.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include KCommand::~KCommand() diff --git a/tdeui/kcursor.cpp b/tdeui/kcursor.cpp index 3cc224f4a..17f523d86 100644 --- a/tdeui/kcursor.cpp +++ b/tdeui/kcursor.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include #include diff --git a/tdeui/kdatepicker.cpp b/tdeui/kdatepicker.cpp index 98d72030d..99f1ce4af 100644 --- a/tdeui/kdatepicker.cpp +++ b/tdeui/kdatepicker.cpp @@ -32,10 +32,10 @@ #include #include "kdatepicker.h" -#include +#include #include #include -#include +#include #include #include #include diff --git a/tdeui/kdatetbl.cpp b/tdeui/kdatetbl.cpp index 542f89f08..56edf9a5c 100644 --- a/tdeui/kdatetbl.cpp +++ b/tdeui/kdatetbl.cpp @@ -33,11 +33,11 @@ // dateSelected(TQDate) #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include diff --git a/tdeui/kdatewidget.cpp b/tdeui/kdatewidget.cpp index 2f240a256..e9185a9c1 100644 --- a/tdeui/kdatewidget.cpp +++ b/tdeui/kdatewidget.cpp @@ -23,8 +23,8 @@ #include #include "knuminput.h" -#include "kglobal.h" -#include "klocale.h" +#include "tdeglobal.h" +#include "tdelocale.h" #include "kcalendarsystem.h" //#include "kdatepicker.h" #include "kdialog.h" diff --git a/tdeui/kdialog.cpp b/tdeui/kdialog.cpp index f6b2b8b56..86f7f7476 100644 --- a/tdeui/kdialog.cpp +++ b/tdeui/kdialog.cpp @@ -25,8 +25,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/tdeui/kdialogbase.cpp b/tdeui/kdialogbase.cpp index 6656d6803..890f79179 100644 --- a/tdeui/kdialogbase.cpp +++ b/tdeui/kdialogbase.cpp @@ -34,11 +34,11 @@ #include #include -#include +#include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeui/kdockwidget.cpp b/tdeui/kdockwidget.cpp index a761f43c6..bf99c6801 100644 --- a/tdeui/kdockwidget.cpp +++ b/tdeui/kdockwidget.cpp @@ -34,13 +34,13 @@ #ifndef NO_KDE2 #include -#include -#include +#include +#include #include #include #include #include -#include +#include #include "config.h" #ifdef Q_WS_X11 diff --git a/tdeui/kdualcolorbutton.cpp b/tdeui/kdualcolorbutton.cpp index f0cd5cae1..532e4aaaa 100644 --- a/tdeui/kdualcolorbutton.cpp +++ b/tdeui/kdualcolorbutton.cpp @@ -21,7 +21,7 @@ #include "kcolordrag.h" #include "dcolorarrow.xbm" #include "dcolorreset.xpm" -#include +#include #include #include #include diff --git a/tdeui/keditcl1.cpp b/tdeui/keditcl1.cpp index 37cee99fb..a550a7af1 100644 --- a/tdeui/keditcl1.cpp +++ b/tdeui/keditcl1.cpp @@ -29,8 +29,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/tdeui/keditcl2.cpp b/tdeui/keditcl2.cpp index a7db92555..4749a471f 100644 --- a/tdeui/keditcl2.cpp +++ b/tdeui/keditcl2.cpp @@ -34,9 +34,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include diff --git a/tdeui/keditlistbox.cpp b/tdeui/keditlistbox.cpp index 1a31bbaa4..6f22b091a 100644 --- a/tdeui/keditlistbox.cpp +++ b/tdeui/keditlistbox.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeui/kedittoolbar.cpp b/tdeui/kedittoolbar.cpp index e1abdc875..639b22926 100644 --- a/tdeui/kedittoolbar.cpp +++ b/tdeui/kedittoolbar.cpp @@ -33,11 +33,11 @@ #include #include -#include +#include #include #include #include -#include +#include #include #include #include diff --git a/tdeui/kguiitem.h b/tdeui/kguiitem.h index bb1233de3..538275f3d 100644 --- a/tdeui/kguiitem.h +++ b/tdeui/kguiitem.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include /** * @short An abstract class for GUI data such as ToolTip and Icon. diff --git a/tdeui/khelpmenu.cpp b/tdeui/khelpmenu.cpp index 41fa063c2..08755b860 100644 --- a/tdeui/khelpmenu.cpp +++ b/tdeui/khelpmenu.cpp @@ -36,8 +36,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeui/kiconview.cpp b/tdeui/kiconview.cpp index bcf9550b4..7273cbe13 100644 --- a/tdeui/kiconview.cpp +++ b/tdeui/kiconview.cpp @@ -27,8 +27,8 @@ #include "kwordwrap.h" #include #include -#include -#include +#include +#include #include #include diff --git a/tdeui/kiconviewsearchline.cpp b/tdeui/kiconviewsearchline.cpp index 33df94a6a..7082fc910 100644 --- a/tdeui/kiconviewsearchline.cpp +++ b/tdeui/kiconviewsearchline.cpp @@ -27,7 +27,7 @@ #include "kiconviewsearchline.h" #include -#include +#include #include #include diff --git a/tdeui/kjanuswidget.cpp b/tdeui/kjanuswidget.cpp index e9dd9df85..c3a8838e9 100644 --- a/tdeui/kjanuswidget.cpp +++ b/tdeui/kjanuswidget.cpp @@ -35,9 +35,9 @@ #include #include // Access to some static members -#include -#include -#include +#include +#include +#include #include #include #include "kjanuswidget.h" diff --git a/tdeui/kkeybutton.cpp b/tdeui/kkeybutton.cpp index 24191aa45..9b530b751 100644 --- a/tdeui/kkeybutton.cpp +++ b/tdeui/kkeybutton.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "config.h" #ifdef Q_WS_X11 diff --git a/tdeui/kkeydialog.cpp b/tdeui/kkeydialog.cpp index 7faad35c4..35fe0e45f 100644 --- a/tdeui/kkeydialog.cpp +++ b/tdeui/kkeydialog.cpp @@ -42,12 +42,12 @@ #include #include #include -#include +#include #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeui/klineedit.cpp b/tdeui/klineedit.cpp index a1c05aaab..588746ec1 100644 --- a/tdeui/klineedit.cpp +++ b/tdeui/klineedit.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/klineeditdlg.cpp b/tdeui/klineeditdlg.cpp index ca4fd8266..8fc0a9a4f 100644 --- a/tdeui/klineeditdlg.cpp +++ b/tdeui/klineeditdlg.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/kmenubar.cpp b/tdeui/kmenubar.cpp index 71158370b..0a5fe0188 100644 --- a/tdeui/kmenubar.cpp +++ b/tdeui/kmenubar.cpp @@ -33,10 +33,10 @@ #include #include -#include -#include +#include +#include #include -#include +#include #include #include @@ -568,4 +568,4 @@ void KMenuBar::drawContents( TQPainter* p ) void KMenuBar::virtual_hook( int, void* ) { /*BASE::virtual_hook( id, data );*/ } -#include "kmenubar.moc" +#include "tdemenubar.moc" diff --git a/tdeui/kmessagebox.cpp b/tdeui/kmessagebox.cpp index 5684c6484..3208e94d8 100644 --- a/tdeui/kmessagebox.cpp +++ b/tdeui/kmessagebox.cpp @@ -37,13 +37,13 @@ #include #include #include -#include -#include +#include +#include #include #include #include #include -#include +#include #ifdef Q_WS_X11 #include diff --git a/tdeui/knuminput.cpp b/tdeui/knuminput.cpp index f6c3d9dd7..40f87da29 100644 --- a/tdeui/knuminput.cpp +++ b/tdeui/knuminput.cpp @@ -44,8 +44,8 @@ #include #include -#include -#include +#include +#include #include #include "kdialog.h" diff --git a/tdeui/knumvalidator.cpp b/tdeui/knumvalidator.cpp index ce5c66842..6cf486ad1 100644 --- a/tdeui/knumvalidator.cpp +++ b/tdeui/knumvalidator.cpp @@ -26,8 +26,8 @@ #include #include "knumvalidator.h" -#include -#include +#include +#include #include /////////////////////////////////////////////////////////////// diff --git a/tdeui/kpanelmenu.cpp b/tdeui/kpanelmenu.cpp index 184e83422..287208b66 100644 --- a/tdeui/kpanelmenu.cpp +++ b/tdeui/kpanelmenu.cpp @@ -22,7 +22,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ******************************************************************/ -#include +#include #include #include diff --git a/tdeui/kpassdlg.cpp b/tdeui/kpassdlg.cpp index 302b4e679..64904c581 100644 --- a/tdeui/kpassdlg.cpp +++ b/tdeui/kpassdlg.cpp @@ -34,12 +34,12 @@ #include #include -#include +#include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeui/kpassivepopup.cpp b/tdeui/kpassivepopup.cpp index 8892ce153..ba3459b45 100644 --- a/tdeui/kpassivepopup.cpp +++ b/tdeui/kpassivepopup.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include "config.h" #ifdef Q_WS_X11 diff --git a/tdeui/kpixmapio.cpp b/tdeui/kpixmapio.cpp index 7ce3a1be2..02054aad3 100644 --- a/tdeui/kpixmapio.cpp +++ b/tdeui/kpixmapio.cpp @@ -18,7 +18,7 @@ #include #include -#include +#include #include #include diff --git a/tdeui/kpixmapregionselectordialog.cpp b/tdeui/kpixmapregionselectordialog.cpp index c394af0f3..8228cd2f1 100644 --- a/tdeui/kpixmapregionselectordialog.cpp +++ b/tdeui/kpixmapregionselectordialog.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include KPixmapRegionSelectorDialog::KPixmapRegionSelectorDialog(TQWidget *parent, diff --git a/tdeui/kpixmapregionselectorwidget.cpp b/tdeui/kpixmapregionselectorwidget.cpp index bd82cae72..21ac875db 100644 --- a/tdeui/kpixmapregionselectorwidget.cpp +++ b/tdeui/kpixmapregionselectorwidget.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/kprogress.cpp b/tdeui/kprogress.cpp index 3f0186e3d..8fb050a11 100644 --- a/tdeui/kprogress.cpp +++ b/tdeui/kprogress.cpp @@ -35,7 +35,7 @@ #include "kprogress.h" #include -#include +#include #include KProgress::KProgress(TQWidget *parent, const char *name, WFlags f) diff --git a/tdeui/kprogressbox.cpp b/tdeui/kprogressbox.cpp index 6dda25a33..2472207f4 100644 --- a/tdeui/kprogressbox.cpp +++ b/tdeui/kprogressbox.cpp @@ -38,7 +38,7 @@ #include "kprogressbox.h" #include -#include +#include #include struct KProgressBoxDialog::KProgressBoxDialogPrivate diff --git a/tdeui/kpushbutton.cpp b/tdeui/kpushbutton.cpp index e92fe8583..6f994dbe3 100644 --- a/tdeui/kpushbutton.cpp +++ b/tdeui/kpushbutton.cpp @@ -25,9 +25,9 @@ #include "config.h" -#include +#include #include -#include +#include #include #include diff --git a/tdeui/ksconfig.cpp b/tdeui/ksconfig.cpp index d27ae07ca..a9958dea9 100644 --- a/tdeui/ksconfig.cpp +++ b/tdeui/ksconfig.cpp @@ -30,9 +30,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include diff --git a/tdeui/kscrollview.cpp b/tdeui/kscrollview.cpp index 997de84b3..40cbb8ee4 100644 --- a/tdeui/kscrollview.cpp +++ b/tdeui/kscrollview.cpp @@ -25,7 +25,7 @@ #include "kscrollview.h" #include #include -#include +#include struct KScrollView::KScrollViewPrivate { KScrollViewPrivate() : dx(0), dy(0), ddx(0), ddy(0), rdx(0), rdy(0), scrolling(false) {} diff --git a/tdeui/ksplashscreen.cpp b/tdeui/ksplashscreen.cpp index a45a579bb..82234bd94 100644 --- a/tdeui/ksplashscreen.cpp +++ b/tdeui/ksplashscreen.cpp @@ -18,8 +18,8 @@ */ #include -#include -#include +#include +#include #include diff --git a/tdeui/kstatusbar.cpp b/tdeui/kstatusbar.cpp index 134d7f1a5..daa22f46b 100644 --- a/tdeui/kstatusbar.cpp +++ b/tdeui/kstatusbar.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include KStatusBarLabel::KStatusBarLabel( const TQString& text, int _id, diff --git a/tdeui/kstdaction.cpp b/tdeui/kstdaction.cpp index 8dd874a9d..652534601 100644 --- a/tdeui/kstdaction.cpp +++ b/tdeui/kstdaction.cpp @@ -25,9 +25,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include "kstdaction_p.h" diff --git a/tdeui/kstdaction_p.h b/tdeui/kstdaction_p.h index a5449d8e7..4a8fee92e 100644 --- a/tdeui/kstdaction_p.h +++ b/tdeui/kstdaction_p.h @@ -19,7 +19,7 @@ #ifndef _KSTDACTION_PRIVATE_H_ #define _KSTDACTION_PRIVATE_H_ -#include +#include #include namespace KStdAction diff --git a/tdeui/kstdguiitem.cpp b/tdeui/kstdguiitem.cpp index 78f3fd6f6..80bf54bce 100644 --- a/tdeui/kstdguiitem.cpp +++ b/tdeui/kstdguiitem.cpp @@ -19,7 +19,7 @@ #include "kstdguiitem.h" #include -#include +#include #include KGuiItem KStdGuiItem::guiItem ( StdItem ui_enum ) diff --git a/tdeui/kswitchlanguagedialog.cpp b/tdeui/kswitchlanguagedialog.cpp index c9bb7552a..c82ffb83d 100644 --- a/tdeui/kswitchlanguagedialog.cpp +++ b/tdeui/kswitchlanguagedialog.cpp @@ -28,8 +28,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/tdeui/ksyntaxhighlighter.cpp b/tdeui/ksyntaxhighlighter.cpp index ba938382b..f7627621c 100644 --- a/tdeui/ksyntaxhighlighter.cpp +++ b/tdeui/ksyntaxhighlighter.cpp @@ -26,10 +26,10 @@ #include #include -#include +#include #include #include -#include +#include #include #include diff --git a/tdeui/ksystemtray.cpp b/tdeui/ksystemtray.cpp index fcd0389da..5004d4bf1 100644 --- a/tdeui/ksystemtray.cpp +++ b/tdeui/ksystemtray.cpp @@ -20,12 +20,12 @@ #include "config.h" #include "tdeaction.h" -#include "kmessagebox.h" +#include "tdemessagebox.h" #include "tdeshortcut.h" #include "ksystemtray.h" #include "tdepopupmenu.h" #include "tdeapplication.h" -#include "klocale.h" +#include "tdelocale.h" #include "tdeaboutdata.h" #ifdef Q_WS_X11 diff --git a/tdeui/ksystemtray.h b/tdeui/ksystemtray.h index 711515985..f7e81c9b1 100644 --- a/tdeui/ksystemtray.h +++ b/tdeui/ksystemtray.h @@ -18,7 +18,7 @@ #ifndef KSYSTEMTRAY_H #define KSYSTEMTRAY_H -#include +#include #include class TDEActionCollection; diff --git a/tdeui/ktabbar.cpp b/tdeui/ktabbar.cpp index 2e2fbe301..911162f14 100644 --- a/tdeui/ktabbar.cpp +++ b/tdeui/ktabbar.cpp @@ -26,9 +26,9 @@ #include #include -#include +#include #include -#include +#include #include "ktabbar.h" #include "ktabwidget.h" diff --git a/tdeui/ktextbrowser.cpp b/tdeui/ktextbrowser.cpp index b17e38067..a4b716db7 100644 --- a/tdeui/ktextbrowser.cpp +++ b/tdeui/ktextbrowser.cpp @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/ktextedit.cpp b/tdeui/ktextedit.cpp index fb0e607fa..445540099 100644 --- a/tdeui/ktextedit.cpp +++ b/tdeui/ktextedit.cpp @@ -26,10 +26,10 @@ #include #include #include -#include +#include #include #include -#include +#include class KTextEdit::KTextEditPrivate { diff --git a/tdeui/ktimezonewidget.cpp b/tdeui/ktimezonewidget.cpp index c7046231f..f6488847f 100644 --- a/tdeui/ktimezonewidget.cpp +++ b/tdeui/ktimezonewidget.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/ktip.cpp b/tdeui/ktip.cpp index 44f710fb9..b3e7d832b 100644 --- a/tdeui/ktip.cpp +++ b/tdeui/ktip.cpp @@ -37,16 +37,16 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include -#include +#include #include -#include +#include #include #include #include #include #include #include -#include +#include #ifdef Q_WS_X11 #include diff --git a/tdeui/kurllabel.cpp b/tdeui/kurllabel.cpp index 0a95a2c70..749b4f5b5 100644 --- a/tdeui/kurllabel.cpp +++ b/tdeui/kurllabel.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include "kurllabel.h" diff --git a/tdeui/kwhatsthismanager.cpp b/tdeui/kwhatsthismanager.cpp index bcf48438c..46643f6f0 100644 --- a/tdeui/kwhatsthismanager.cpp +++ b/tdeui/kwhatsthismanager.cpp @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include KWhatsThisManager *KWhatsThisManager::s_instance = 0; diff --git a/tdeui/kwizard.cpp b/tdeui/kwizard.cpp index 0e378dbf2..b8fa1e88a 100644 --- a/tdeui/kwizard.cpp +++ b/tdeui/kwizard.cpp @@ -22,8 +22,8 @@ #include #include -#include -#include +#include +#include #include #include "kwizard.h" diff --git a/tdeui/kxmlguibuilder.cpp b/tdeui/kxmlguibuilder.cpp index 6fd472ad5..ff4083779 100644 --- a/tdeui/kxmlguibuilder.cpp +++ b/tdeui/kxmlguibuilder.cpp @@ -20,14 +20,14 @@ #include "tdeapplication.h" #include "kxmlguibuilder.h" -#include "kmenubar.h" +#include "tdemenubar.h" #include "tdepopupmenu.h" #include "tdetoolbar.h" #include "kstatusbar.h" #include "tdemainwindow.h" #include "tdeaction.h" -#include "kglobalsettings.h" -#include +#include "tdeglobalsettings.h" +#include #include #include #include diff --git a/tdeui/kxmlguifactory.cpp b/tdeui/kxmlguifactory.cpp index 0a2aae41d..87015bfd5 100644 --- a/tdeui/kxmlguifactory.cpp +++ b/tdeui/kxmlguifactory.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/kxmlguifactory_p.cpp b/tdeui/kxmlguifactory_p.cpp index ffe9ffab1..699f9579d 100644 --- a/tdeui/kxmlguifactory_p.cpp +++ b/tdeui/kxmlguifactory_p.cpp @@ -23,7 +23,7 @@ #include -#include +#include #include #include diff --git a/tdeui/tdeaboutapplication.cpp b/tdeui/tdeaboutapplication.cpp index 08ee46450..ef9efb181 100644 --- a/tdeui/tdeaboutapplication.cpp +++ b/tdeui/tdeaboutapplication.cpp @@ -27,8 +27,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include "ktextedit.h" diff --git a/tdeui/tdeaboutdialog.cpp b/tdeui/tdeaboutdialog.cpp index b46c0b959..895247161 100644 --- a/tdeui/tdeaboutdialog.cpp +++ b/tdeui/tdeaboutdialog.cpp @@ -32,9 +32,9 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include #include diff --git a/tdeui/tdeabouttde.cpp b/tdeui/tdeabouttde.cpp index 0e7078af4..d5f45c85a 100644 --- a/tdeui/tdeabouttde.cpp +++ b/tdeui/tdeabouttde.cpp @@ -22,7 +22,7 @@ // I (espen) prefer that header files are included alphabetically #include #include -#include +#include #include diff --git a/tdeui/tdeaction.cpp b/tdeui/tdeaction.cpp index d817a5ba4..6f29ab848 100644 --- a/tdeui/tdeaction.cpp +++ b/tdeui/tdeaction.cpp @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/tdeactionclasses.cpp b/tdeui/tdeactionclasses.cpp index 1fc963887..4b589f166 100644 --- a/tdeui/tdeactionclasses.cpp +++ b/tdeui/tdeactionclasses.cpp @@ -47,9 +47,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include #include diff --git a/tdeui/tdeactionselector.cpp b/tdeui/tdeactionselector.cpp index 3ef22a45f..c3c7329b8 100644 --- a/tdeui/tdeactionselector.cpp +++ b/tdeui/tdeactionselector.cpp @@ -19,7 +19,7 @@ #include "tdeactionselector.h" -#include +#include #include #include // for spacingHint() #include diff --git a/tdeui/tdecmodule.cpp b/tdeui/tdecmodule.cpp index 4e6ce943f..c6b7d3726 100644 --- a/tdeui/tdecmodule.cpp +++ b/tdeui/tdecmodule.cpp @@ -27,9 +27,9 @@ #include #include #include -#include +#include #include -#include +#include #include "tdecmodule.h" #include "tdecmodule.moc" diff --git a/tdeui/tdecompletionbox.cpp b/tdeui/tdecompletionbox.cpp index 53a8c71fb..96c9c1794 100644 --- a/tdeui/tdecompletionbox.cpp +++ b/tdeui/tdecompletionbox.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include "tdecompletionbox.h" diff --git a/tdeui/tdeconfigdialog.cpp b/tdeui/tdeconfigdialog.cpp index c8e848fa3..df43defc5 100644 --- a/tdeui/tdeconfigdialog.cpp +++ b/tdeui/tdeconfigdialog.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/tdeui/tdefontcombo.cpp b/tdeui/tdefontcombo.cpp index fc9ae830b..cb250385f 100644 --- a/tdeui/tdefontcombo.cpp +++ b/tdeui/tdefontcombo.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include "tdefontcombo.h" diff --git a/tdeui/tdefontdialog.cpp b/tdeui/tdefontdialog.cpp index 15c687e13..75f4599e0 100644 --- a/tdeui/tdefontdialog.cpp +++ b/tdeui/tdefontdialog.cpp @@ -45,11 +45,11 @@ #include #include #include -#include -#include +#include +#include #include #include -#include +#include #include #include #include diff --git a/tdeui/tdefontrequester.cpp b/tdeui/tdefontrequester.cpp index 64eba5701..459938d12 100644 --- a/tdeui/tdefontrequester.cpp +++ b/tdeui/tdefontrequester.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include TDEFontRequester::TDEFontRequester( TQWidget *parent, const char *name, bool onlyFixed ) : TQWidget( parent, name ), diff --git a/tdeui/tdelistbox.cpp b/tdeui/tdelistbox.cpp index 9f7c23688..0e4c5d520 100644 --- a/tdeui/tdelistbox.cpp +++ b/tdeui/tdelistbox.cpp @@ -19,7 +19,7 @@ #include -#include +#include #include #include #include diff --git a/tdeui/tdelistview.cpp b/tdeui/tdelistview.cpp index 020f18679..4750a7138 100644 --- a/tdeui/tdelistview.cpp +++ b/tdeui/tdelistview.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/tdelistviewsearchline.cpp b/tdeui/tdelistviewsearchline.cpp index 20d78add2..b74b4d1c1 100644 --- a/tdeui/tdelistviewsearchline.cpp +++ b/tdeui/tdelistviewsearchline.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeui/tdemainwindow.cpp b/tdeui/tdemainwindow.cpp index 01b6a09e0..ba9c51556 100644 --- a/tdeui/tdemainwindow.cpp +++ b/tdeui/tdemainwindow.cpp @@ -40,13 +40,13 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include #if defined Q_WS_X11 diff --git a/tdeui/tdeshortcutdialog.cpp b/tdeui/tdeshortcutdialog.cpp index fe3593b7e..35a7706c7 100644 --- a/tdeui/tdeshortcutdialog.cpp +++ b/tdeui/tdeshortcutdialog.cpp @@ -55,10 +55,10 @@ #include #include #include -#include +#include #include #include -#include +#include #include #include diff --git a/tdeui/tdespell.cpp b/tdeui/tdespell.cpp index 629013121..031011f0a 100644 --- a/tdeui/tdespell.cpp +++ b/tdeui/tdespell.cpp @@ -38,9 +38,9 @@ #include #include -#include +#include #include -#include +#include #include "tdespell.h" #include "tdespelldlg.h" #include diff --git a/tdeui/tdespelldlg.cpp b/tdeui/tdespelldlg.cpp index 280ddf861..9e8206505 100644 --- a/tdeui/tdespelldlg.cpp +++ b/tdeui/tdespelldlg.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/tdetoolbar.cpp b/tdeui/tdetoolbar.cpp index a095f1493..a3ced3a19 100644 --- a/tdeui/tdetoolbar.cpp +++ b/tdeui/tdetoolbar.cpp @@ -46,11 +46,11 @@ #include #include #include -#include +#include #include #include #include -#include +#include #include #include #include diff --git a/tdeui/tdetoolbar.h b/tdeui/tdetoolbar.h index 37e22c9bb..857673f28 100644 --- a/tdeui/tdetoolbar.h +++ b/tdeui/tdetoolbar.h @@ -33,7 +33,7 @@ #include #include -#include +#include class TQDomElement; class TQSize; diff --git a/tdeui/tdetoolbarbutton.cpp b/tdeui/tdetoolbarbutton.cpp index 608c31a32..abf23ffc7 100644 --- a/tdeui/tdetoolbarbutton.cpp +++ b/tdeui/tdetoolbarbutton.cpp @@ -40,8 +40,8 @@ #include #include -#include -#include +#include +#include #include #include diff --git a/tdeui/tdetoolbarbutton.h b/tdeui/tdetoolbarbutton.h index 49e906e6e..c73c1145a 100644 --- a/tdeui/tdetoolbarbutton.h +++ b/tdeui/tdetoolbarbutton.h @@ -27,7 +27,7 @@ #include #include #include -#include +#include class TDEToolBar; class TDEToolBarButtonPrivate; diff --git a/tdeui/tdetoolbarhandler.cpp b/tdeui/tdetoolbarhandler.cpp index 4242a119e..da621fadd 100644 --- a/tdeui/tdetoolbarhandler.cpp +++ b/tdeui/tdetoolbarhandler.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeui/tests/itemcontainertest.cpp b/tdeui/tests/itemcontainertest.cpp index c96d6a4eb..c3b6d1ddc 100644 --- a/tdeui/tests/itemcontainertest.cpp +++ b/tdeui/tests/itemcontainertest.cpp @@ -17,7 +17,7 @@ #include #include -#include +#include #include #include #include diff --git a/tdeui/tests/kaboutdialogtest.cpp b/tdeui/tests/kaboutdialogtest.cpp index c3be2de25..e0680b52f 100644 --- a/tdeui/tests/kaboutdialogtest.cpp +++ b/tdeui/tests/kaboutdialogtest.cpp @@ -12,7 +12,7 @@ // #include #include #include -#include +#include int main(int argc, char** argv) { diff --git a/tdeui/tests/kcharselecttest.cpp b/tdeui/tests/kcharselecttest.cpp index ccd6cd10a..5ee4ee381 100644 --- a/tdeui/tests/kcharselecttest.cpp +++ b/tdeui/tests/kcharselecttest.cpp @@ -1,5 +1,5 @@ #include -#include +#include #include "kcharselect.h" int main (int argc,char **argv) diff --git a/tdeui/tests/kcolordlgtest.cpp b/tdeui/tests/kcolordlgtest.cpp index f45df0de7..dbe39484c 100644 --- a/tdeui/tests/kcolordlgtest.cpp +++ b/tdeui/tests/kcolordlgtest.cpp @@ -20,7 +20,7 @@ #include #include "kcolordialog.h" #include -#include +#include int main( int argc, char *argv[] ) { diff --git a/tdeui/tests/kcomboboxtest.cpp b/tdeui/tests/kcomboboxtest.cpp index 225c80c0f..d2b59a4c2 100644 --- a/tdeui/tests/kcomboboxtest.cpp +++ b/tdeui/tests/kcomboboxtest.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeui/tests/kcompletiontest.cpp b/tdeui/tests/kcompletiontest.cpp index 12e3835dc..261534465 100644 --- a/tdeui/tests/kcompletiontest.cpp +++ b/tdeui/tests/kcompletiontest.cpp @@ -1,4 +1,4 @@ -#include +#include /**************************************************************************** ** Form implementation generated from reading ui file './kcompletiontest.ui' ** diff --git a/tdeui/tests/kdatepicktest.cpp b/tdeui/tests/kdatepicktest.cpp index abcfeb24a..8bdab90a4 100644 --- a/tdeui/tests/kdatepicktest.cpp +++ b/tdeui/tests/kdatepicktest.cpp @@ -1,7 +1,7 @@ #include "kdatepicker.h" #include #include -#include +#include int main(int argc, char** argv) { diff --git a/tdeui/tests/kdatetimewidgettest.cpp b/tdeui/tests/kdatetimewidgettest.cpp index 721f86492..f94a2a9f7 100644 --- a/tdeui/tests/kdatetimewidgettest.cpp +++ b/tdeui/tests/kdatetimewidgettest.cpp @@ -1,6 +1,6 @@ #include "kdatetimewidget.h" #include -#include +#include int main(int argc, char** argv) { diff --git a/tdeui/tests/kdatewidgettest.cpp b/tdeui/tests/kdatewidgettest.cpp index 11fb243f3..22340b4c9 100644 --- a/tdeui/tests/kdatewidgettest.cpp +++ b/tdeui/tests/kdatewidgettest.cpp @@ -1,7 +1,7 @@ #include "kdatewidget.h" #include #include -#include +#include int main(int argc, char** argv) { diff --git a/tdeui/tests/kdockwidgettest.cpp b/tdeui/tests/kdockwidgettest.cpp index 683d42acd..aacac19a0 100644 --- a/tdeui/tests/kdockwidgettest.cpp +++ b/tdeui/tests/kdockwidgettest.cpp @@ -18,7 +18,7 @@ #include #include #include -#include +#include #include #include diff --git a/tdeui/tests/kdualcolortest.cpp b/tdeui/tests/kdualcolortest.cpp index e52d6e671..512bfc610 100644 --- a/tdeui/tests/kdualcolortest.cpp +++ b/tdeui/tests/kdualcolortest.cpp @@ -1,7 +1,7 @@ #include "kdualcolortest.h" #include #include -#include +#include #include #include diff --git a/tdeui/tests/klineedittest.cpp b/tdeui/tests/klineedittest.cpp index 793988968..20e9b6ca8 100644 --- a/tdeui/tests/klineedittest.cpp +++ b/tdeui/tests/klineedittest.cpp @@ -9,9 +9,9 @@ #include #include #include -#include +#include #include -#include +#include #include #include "klineedittest.h" diff --git a/tdeui/tests/kmessageboxtest.cpp b/tdeui/tests/kmessageboxtest.cpp index ce333edee..2a56a7ead 100644 --- a/tdeui/tests/kmessageboxtest.cpp +++ b/tdeui/tests/kmessageboxtest.cpp @@ -1,4 +1,4 @@ -#include "kmessagebox.h" +#include "tdemessagebox.h" #include #include @@ -10,7 +10,7 @@ #include #include -#include +#include class ExampleWidget : public QLabel { diff --git a/tdeui/tests/kstatusbartest.cpp b/tdeui/tests/kstatusbartest.cpp index 82c03e271..0a8c6d10c 100644 --- a/tdeui/tests/kstatusbartest.cpp +++ b/tdeui/tests/kstatusbartest.cpp @@ -12,7 +12,7 @@ #include "kstatusbar.h" #include #include -#include +#include #include "kstatusbartest.h" testWindow::testWindow (TQWidget *, const char *name) diff --git a/tdeui/tests/kstatusbartest.h b/tdeui/tests/kstatusbartest.h index 34dd6df81..712f24352 100644 --- a/tdeui/tests/kstatusbartest.h +++ b/tdeui/tests/kstatusbartest.h @@ -1,7 +1,7 @@ #ifndef test_kstatusbar_h #define test_kstatusbar_h -#include +#include #include #include #include diff --git a/tdeui/tests/ktimewidgettest.cpp b/tdeui/tests/ktimewidgettest.cpp index bbff45648..731dc3219 100644 --- a/tdeui/tests/ktimewidgettest.cpp +++ b/tdeui/tests/ktimewidgettest.cpp @@ -1,6 +1,6 @@ #include "ktimewidget.h" #include -#include +#include int main(int argc, char** argv) { diff --git a/tdeui/tests/tdemainwindowtest.cpp b/tdeui/tests/tdemainwindowtest.cpp index c8ace159e..b19818d4c 100644 --- a/tdeui/tests/tdemainwindowtest.cpp +++ b/tdeui/tests/tdemainwindowtest.cpp @@ -3,7 +3,7 @@ #include #include -#include +#include #include "tdemainwindowtest.h" diff --git a/tdeui/tests/twindowtest.cpp b/tdeui/tests/twindowtest.cpp index 3823ab46f..77e01d289 100644 --- a/tdeui/tests/twindowtest.cpp +++ b/tdeui/tests/twindowtest.cpp @@ -13,14 +13,14 @@ #include #include #include -#include +#include #include #include #include #include #include "twindowtest.h" -#include +#include //#include diff --git a/tdeui/tests/twindowtest.h b/tdeui/tests/twindowtest.h index 83a0d75bf..d1d9d460e 100644 --- a/tdeui/tests/twindowtest.h +++ b/tdeui/tests/twindowtest.h @@ -4,7 +4,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeui/twindowlistmenu.cpp b/tdeui/twindowlistmenu.cpp index 7ca8fda3f..bc2df2f66 100644 --- a/tdeui/twindowlistmenu.cpp +++ b/tdeui/twindowlistmenu.cpp @@ -33,7 +33,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include -#include +#include #include #include diff --git a/tdeunittest/modrunner.cpp b/tdeunittest/modrunner.cpp index 4caa2d609..350778f6c 100644 --- a/tdeunittest/modrunner.cpp +++ b/tdeunittest/modrunner.cpp @@ -24,11 +24,11 @@ */ #include -#include +#include #include #include #include -#include +#include #include "runner.h" diff --git a/tdeunittest/runner.cpp b/tdeunittest/runner.cpp index 6a961fecd..c63b6ed6c 100644 --- a/tdeunittest/runner.cpp +++ b/tdeunittest/runner.cpp @@ -35,7 +35,7 @@ using namespace std; #include #include -#include +#include #include #include "runner.h" diff --git a/tdeunittest/tester.h b/tdeunittest/tester.h index 332381ec8..b0ce3e685 100644 --- a/tdeunittest/tester.h +++ b/tdeunittest/tester.h @@ -138,7 +138,7 @@ SampleTest - 1 test passed, 1 test failed * #include * #include * #include - * #include + * #include * #include * * static const char description[] = I18N_NOOP("SampleTests"); diff --git a/tdeutils/kcmultidialog.cpp b/tdeutils/kcmultidialog.cpp index 9bb067ca0..6a074040b 100644 --- a/tdeutils/kcmultidialog.cpp +++ b/tdeutils/kcmultidialog.cpp @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeutils/kcmultidialog.h b/tdeutils/kcmultidialog.h index 46dde98fb..ca6d2d6c7 100644 --- a/tdeutils/kcmultidialog.h +++ b/tdeutils/kcmultidialog.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include class TDECModuleProxy; diff --git a/tdeutils/kfind.cpp b/tdeutils/kfind.cpp index 99ef317b6..74fb46e9a 100644 --- a/tdeutils/kfind.cpp +++ b/tdeutils/kfind.cpp @@ -22,8 +22,8 @@ #include "kfind.h" #include "kfinddialog.h" #include -#include -#include +#include +#include #include #include #include diff --git a/tdeutils/kfinddialog.cpp b/tdeutils/kfinddialog.cpp index d9a5284e1..718fdca2f 100644 --- a/tdeutils/kfinddialog.cpp +++ b/tdeutils/kfinddialog.cpp @@ -29,8 +29,8 @@ #include #include #include -#include -#include +#include +#include #include #include diff --git a/tdeutils/kplugininfo.cpp b/tdeutils/kplugininfo.cpp index cb93b2600..9ea0eb2bc 100644 --- a/tdeutils/kplugininfo.cpp +++ b/tdeutils/kplugininfo.cpp @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeutils/kpluginselector.cpp b/tdeutils/kpluginselector.cpp index 5747df7c4..9fe08b027 100644 --- a/tdeutils/kpluginselector.cpp +++ b/tdeutils/kpluginselector.cpp @@ -35,12 +35,12 @@ #include #include -#include +#include #include #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdeutils/kreplace.cpp b/tdeutils/kreplace.cpp index 0aad733da..98e3ce93c 100644 --- a/tdeutils/kreplace.cpp +++ b/tdeutils/kreplace.cpp @@ -22,8 +22,8 @@ #include #include -#include -#include +#include +#include #include "kreplace.h" #include "kreplacedialog.h" #include diff --git a/tdeutils/kreplacedialog.cpp b/tdeutils/kreplacedialog.cpp index 88c006b4d..d8e74af44 100644 --- a/tdeutils/kreplacedialog.cpp +++ b/tdeutils/kreplacedialog.cpp @@ -26,8 +26,8 @@ #include #include #include -#include -#include +#include +#include #include /** diff --git a/tdeutils/ksettings/componentsdialog.cpp b/tdeutils/ksettings/componentsdialog.cpp index 50ad97a03..f60613bce 100644 --- a/tdeutils/ksettings/componentsdialog.cpp +++ b/tdeutils/ksettings/componentsdialog.cpp @@ -18,7 +18,7 @@ */ #include "ksettings/componentsdialog.h" -#include +#include #include #include #include diff --git a/tdeutils/ksettings/dialog.cpp b/tdeutils/ksettings/dialog.cpp index 49918b5e7..e74b9ac48 100644 --- a/tdeutils/ksettings/dialog.cpp +++ b/tdeutils/ksettings/dialog.cpp @@ -21,7 +21,7 @@ #include -#include +#include #include #include #include diff --git a/tdeutils/tdecmodulecontainer.cpp b/tdeutils/tdecmodulecontainer.cpp index c379a9857..004ceb78a 100644 --- a/tdeutils/tdecmodulecontainer.cpp +++ b/tdeutils/tdecmodulecontainer.cpp @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdeutils/tdecmoduleinfo.cpp b/tdeutils/tdecmoduleinfo.cpp index 3a7fdfd63..4869bb1ef 100644 --- a/tdeutils/tdecmoduleinfo.cpp +++ b/tdeutils/tdecmoduleinfo.cpp @@ -25,9 +25,9 @@ #include #include -#include +#include #include -#include +#include #include "tdecmoduleinfo.h" diff --git a/tdeutils/tdecmoduleloader.cpp b/tdeutils/tdecmoduleloader.cpp index 73f92379f..ced28ae7a 100644 --- a/tdeutils/tdecmoduleloader.cpp +++ b/tdeutils/tdecmoduleloader.cpp @@ -27,8 +27,8 @@ #include #include -#include -#include +#include +#include #include #include "tdecmoduleloader.h" diff --git a/tdeutils/tdecmoduleproxy.cpp b/tdeutils/tdecmoduleproxy.cpp index 2d3150935..eeac43b02 100644 --- a/tdeutils/tdecmoduleproxy.cpp +++ b/tdeutils/tdecmoduleproxy.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdewallet/backend/tdewalletbackend.cc b/tdewallet/backend/tdewalletbackend.cc index 9871b9d7b..17fecae0c 100644 --- a/tdewallet/backend/tdewalletbackend.cc +++ b/tdewallet/backend/tdewalletbackend.cc @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include #include #include #include diff --git a/tdewallet/tests/tdewalletasync.cpp b/tdewallet/tests/tdewalletasync.cpp index 7668b90a7..75d475b97 100644 --- a/tdewallet/tests/tdewalletasync.cpp +++ b/tdewallet/tests/tdewalletasync.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdewallet/tests/tdewalletboth.cpp b/tdewallet/tests/tdewalletboth.cpp index a5ba26711..efeeebc98 100644 --- a/tdewallet/tests/tdewalletboth.cpp +++ b/tdewallet/tests/tdewalletboth.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/tdewallet/tests/tdewalletsync.cpp b/tdewallet/tests/tdewalletsync.cpp index 4774e289e..9ee39e4d4 100644 --- a/tdewallet/tests/tdewalletsync.cpp +++ b/tdewallet/tests/tdewalletsync.cpp @@ -5,7 +5,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/win/pro_files/kabc/kabc.pro b/win/pro_files/kabc/kabc.pro index 7e38e3c7d..b3eae05b4 100644 --- a/win/pro_files/kabc/kabc.pro +++ b/win/pro_files/kabc/kabc.pro @@ -8,8 +8,8 @@ LIBS += $$KDELIBDESTDIR\tdecore$$KDELIB_SUFFIX $$KDELIBDESTDIR\tdeui$$KDELIB_SUF $$KDELIBDESTDIR\tderesources$$KDELIB_SUFFIX $$KDELIBDESTDIR\dcop$$KDELIB_SUFFIX \ $$KDELIBDESTDIR\kio$$KDELIB_SUFFIX $$KDELIBDESTDIR\kvcard$$KDELIB_SUFFIX -INCLUDEPATH += $(KDELIBS)/kabc/vcard/include $(KDELIBS)/kabc/vcard/include/generated \ - $(KDELIBS)/kabc/vcardparser +INCLUDEPATH += $(KDELIBS)/tdeabc/vcard/include $(KDELIBS)/tdeabc/vcard/include/generated \ + $(KDELIBS)/tdeabc/vcardparser system( bash kmoc ) system( bash kdcopidl ) diff --git a/win/pro_files/kabc/vcard/vcard.pro b/win/pro_files/kabc/vcard/vcard.pro index 8dedc015e..e2de8e6d7 100644 --- a/win/pro_files/kabc/vcard/vcard.pro +++ b/win/pro_files/kabc/vcard/vcard.pro @@ -7,8 +7,8 @@ DEFINES += MAKE_KVCARD_LIB LIBS += $$KDELIBDESTDIR\tdecore$$KDELIB_SUFFIX -INCLUDEPATH += $(KDELIBS)/kabc/vcard/include $(KDELIBS)/kabc/vcard/include/generated \ - $(KDELIBS)/kabc/vcardparser +INCLUDEPATH += $(KDELIBS)/tdeabc/vcard/include $(KDELIBS)/tdeabc/vcard/include/generated \ + $(KDELIBS)/tdeabc/vcardparser system( bash kmoc ) system( bash kdcopidl ) diff --git a/win/pro_files/kio/kio.pro b/win/pro_files/kio/kio.pro index da790d7d1..dc16d76b8 100644 --- a/win/pro_files/kio/kio.pro +++ b/win/pro_files/kio/kio.pro @@ -46,7 +46,7 @@ tdeio/kdcopservicestarter.cpp \ tdeio/kdirlister.cpp \ tdeio/kdirnotify.cpp \ tdeio/kdirwatch.cpp \ -tdeio/kemailsettings.cpp \ +tdeio/tdeemailsettings.cpp \ tdeio/tdefilefilter.cpp \ tdeio/tdefileitem.cpp \ tdeio/tdefilemetainfo.cpp \ @@ -59,7 +59,7 @@ tdeio/kmimetype.cpp \ tdeio/kmimetypechooser.cpp \ tdeio/knfsshare.cpp \ tdeio/kprotocolinfo.cpp \ -tdeio/kprotocolmanager.cpp \ +tdeio/tdeprotocolmanager.cpp \ tdeio/kremoteencoding.cpp \ tdeio/krun.cpp \ tdeio/ksambashare.cpp \ @@ -118,7 +118,7 @@ bookmarks/kbookmarkmenu.cc \ \ tdefile/kcombiview.cpp \ tdefile/kcustommenueditor.cpp \ -tdefile/kdiroperator.cpp \ +tdefile/tdediroperator.cpp \ tdefile/kdirselectdialog.cpp \ tdefile/kdirsize.cpp \ tdefile/kdiskfreesp.cpp \ diff --git a/win/pro_files/tdecore/tdecore.pro b/win/pro_files/tdecore/tdecore.pro index 7e564a250..fbc415726 100644 --- a/win/pro_files/tdecore/tdecore.pro +++ b/win/pro_files/tdecore/tdecore.pro @@ -49,9 +49,9 @@ kstandarddirs.cpp \ tdeconfig.cpp \ tdeconfigdialogmanager.cpp \ kcharsets.cpp \ -kglobal.cpp \ +tdeglobal.cpp \ kdebug.cpp \ -ktempfile.cpp \ +tdetempfile.cpp \ ktempdir.cpp \ ksavefile.cpp \ tdeconfigbackend.cpp \ @@ -70,11 +70,11 @@ tdeshortcutmenu.cpp \ tdeshortcutlist.cpp \ kinstance.cpp \ tdeversion.cpp \ -klocale.cpp \ +tdelocale.cpp \ kicontheme.cpp \ kiconloader.cpp \ kiconeffect.cpp \ -kglobalsettings.cpp \ +tdeglobalsettings.cpp \ kckey.cpp \ kglobalaccel.cpp \ kglobalaccel_win.cpp \ @@ -120,7 +120,7 @@ kqiodevicegzip_p.cpp #network/tdesocketdevice.cpp \ #network/ksockssocketdevice.cpp -#kstartupinfo.cpp \ +#tdestartupinfo.cpp \ #todo: kextsock.cpp \ #todo: ksock.cpp \ #todo: ksocks.cpp \ diff --git a/win/pro_files/tdeui/tdeui.pro b/win/pro_files/tdeui/tdeui.pro index b5a506f8b..aa1065c7d 100644 --- a/win/pro_files/tdeui/tdeui.pro +++ b/win/pro_files/tdeui/tdeui.pro @@ -71,7 +71,7 @@ tdelistview.cpp \ tdelistviewsearchline.cpp \ tdemainwindowiface.cpp \ tdemainwindow.cpp \ -kmenubar.cpp \ +tdemenubar.cpp \ knuminput.cpp \ knumvalidator.cpp \ kpanelapplet.cpp \ @@ -132,7 +132,7 @@ exists( kmessagebox_win.cpp ) { SOURCES += kmessagebox_win.cpp } !exists( kmessagebox_win.cpp ) { - SOURCES += kmessagebox.cpp + SOURCES += tdemessagebox.cpp } # generated: diff --git a/win/tools/build_tdelibs_dbg b/win/tools/build_tdelibs_dbg index 3fcfe0c20..79f3b0f32 100644 --- a/win/tools/build_tdelibs_dbg +++ b/win/tools/build_tdelibs_dbg @@ -48,7 +48,7 @@ tdecore \ tdeui \ kio \ tderesources \ -kabc/vcard \ +tdeabc/vcard \ kabc \ tdeutils \ tdeparts \ diff --git a/win/tools/build_tdelibs_rel b/win/tools/build_tdelibs_rel index 399dcadda..2fe77ef36 100644 --- a/win/tools/build_tdelibs_rel +++ b/win/tools/build_tdelibs_rel @@ -48,7 +48,7 @@ tdeui \ kstyles/thinkeramik/widget-engine \ kio \ tderesources \ -kabc/vcard \ +tdeabc/vcard \ kabc \ tdeutils \ tdeparts \ -- cgit v1.2.3