diff options
Diffstat (limited to 'kaddressbook-plugins/xxports/gmx')
-rw-r--r-- | kaddressbook-plugins/xxports/gmx/Makefile.am | 18 | ||||
-rw-r--r-- | kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp | 346 | ||||
-rw-r--r-- | kaddressbook-plugins/xxports/gmx/gmx_xxport.desktop | 109 | ||||
-rw-r--r-- | kaddressbook-plugins/xxports/gmx/gmx_xxport.h | 47 | ||||
-rw-r--r-- | kaddressbook-plugins/xxports/gmx/gmx_xxportui.rc | 14 |
5 files changed, 534 insertions, 0 deletions
diff --git a/kaddressbook-plugins/xxports/gmx/Makefile.am b/kaddressbook-plugins/xxports/gmx/Makefile.am new file mode 100644 index 0000000..facdd37 --- /dev/null +++ b/kaddressbook-plugins/xxports/gmx/Makefile.am @@ -0,0 +1,18 @@ +INCLUDES = $(all_includes) + +kde_module_LTLIBRARIES = libkaddrbk_gmx_xxport.la + +servicedir = $(kde_servicesdir)/kaddressbook +service_DATA = gmx_xxport.desktop + +libkaddrbk_gmx_xxport_la_SOURCES = gmx_xxport.cpp +libkaddrbk_gmx_xxport_la_LDFLAGS = -module $(KDE_PLUGIN) $(KDE_RPATH) $(all_libraries) -no-undefined +libkaddrbk_gmx_xxport_la_LIBADD = $(LIB_KDEUI) -lkabc -lkabinterfaces +libkaddrbk_gmx_xxport_la_METASOURCES = AUTO + +rc_DATA = gmx_xxportui.rc +rcdir = $(kde_datadir)/kaddressbook + +messages: rc.cpp + $(XGETTEXT) *.cpp *.h -o $(podir)/libkaddrbk_gmx_xxport.pot + diff --git a/kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp b/kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp new file mode 100644 index 0000000..524ad70 --- /dev/null +++ b/kaddressbook-plugins/xxports/gmx/gmx_xxport.cpp @@ -0,0 +1,346 @@ +/* + This file is part of KAddressbook. + Copyright (c) 2003 - 2004 Helge Deller <[email protected]> + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License version 2 as + published by the Free Software Foundation. + + This program 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. + + + Description: + This import/export filter reads and writes addressbook entries in the + gmx format which is natively used by the german freemail provider GMX. + The big advantage of this format is, that it stores it's information + very consistent and makes parsing pretty simple. Furthermore, most + information needed by KABC is available when compared to other formats. + For further information please visit http://www.gmx.com +*/ + +#include <qfile.h> +#include <qmap.h> + +#include <kfiledialog.h> +#include <kio/netaccess.h> +#include <klocale.h> +#include <kmdcodec.h> +#include <kmessagebox.h> +#include <ktempfile.h> +#include <kurl.h> + +#include <kdebug.h> + +#include "gmx_xxport.h" + +K_EXPORT_KADDRESSBOOK_XXFILTER_CATALOG( libkaddrbk_gmx_xxport, GMXXXPort, "libkaddrbk_gmx_xxport" ) + +#define GMX_FILESELECTION_STRING "*.gmxa|" + i18n( "GMX addressbook file (*.gmxa)" ) + +GMXXXPort::GMXXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name ) + : KAB::XXPort( ab, parent, name ) +{ + createImportAction( i18n( "Import GMX Address Book..." ) ); + createExportAction( i18n( "Export GMX Address Book..." ) ); +} + +static bool checkDateTime( const QString &dateStr, QDateTime &dt ) +{ + if (dateStr.isEmpty()) + return false; + dt = QDateTime::fromString(dateStr, Qt::ISODate); + if (dt.isValid() && dt.date().year()>1901) + return true; + dt.setDate(QDate()); + return false; +} + +/* import */ + +KABC::AddresseeList GMXXXPort::importContacts( const QString& ) const +{ + KABC::AddresseeList addrList; + + QString fileName = KFileDialog::getOpenFileName( ":xxport_gmx", + GMX_FILESELECTION_STRING, 0 ); + if ( fileName.isEmpty() ) + return addrList; + + QFile file( fileName ); + if ( !file.open( IO_ReadOnly ) ) { + QString msg = i18n( "<qt>Unable to open <b>%1</b> for reading.</qt>" ); + KMessageBox::error( parentWidget(), msg.arg( fileName ) ); + return addrList; + } + + QDateTime dt; + QTextStream gmxStream( &file ); + gmxStream.setEncoding( QTextStream::Latin1 ); + QString line, line2; + line = gmxStream.readLine(); + line2 = gmxStream.readLine(); + if (!line.startsWith("AB_ADDRESSES:") || !line2.startsWith("Address_id")) { + KMessageBox::error( parentWidget(), i18n("%1 is not a GMX address book file.").arg(fileName) ); + return addrList; + } + + QStringList strList; + typedef QMap<QString, KABC::Addressee *> AddressMap; + AddressMap addrMap; + + // "Address_id,Nickname,Firstname,Lastname,Title,Birthday,Comments,Change_date,Status,Address_link_id,Categories" + line = gmxStream.readLine(); + while (!line.startsWith("####") && !gmxStream.atEnd()) { + while (1) { + strList = QStringList::split('#', line, true); + if (strList.count() >= 11) + break; + line.append('\n'); + line.append(gmxStream.readLine()); + }; + + KABC::Addressee *addr = new KABC::Addressee; + addr->setNickName(strList[1]); + addr->setGivenName(strList[2]); + addr->setFamilyName(strList[3]); + addr->setTitle(strList[4]); + + if (addr->formattedName().isEmpty()) + addr->setFormattedName(addr->realName()); + + if (checkDateTime(strList[5],dt)) addr->setBirthday(dt); + addr->setNote(strList[6]); + if (checkDateTime(strList[7],dt)) addr->setRevision(dt); + // addr->setStatus(strList[8]); Status + // addr->xxx(strList[9]); Address_link_id + // addr->setCategory(strList[10]); Categories + addrMap[strList[0]] = addr; + + line = gmxStream.readLine(); + } + + // now read the address records + line = gmxStream.readLine(); + if (!line.startsWith("AB_ADDRESS_RECORDS:")) { + kdWarning() << "Could not find address records!\n"; + return addrList; + } + // Address_id,Record_id,Street,Country,Zipcode,City,Phone,Fax,Mobile,Mobile_type,Email, + // Homepage,Position,Comments,Record_type_id,Record_type,Company,Department,Change_date,Preferred,Status + line = gmxStream.readLine(); + line = gmxStream.readLine(); + + while (!line.startsWith("####") && !gmxStream.atEnd()) { + while (1) { + strList = QStringList::split('#', line, true); + if (strList.count() >= 21) + break; + line.append('\n'); + line.append(gmxStream.readLine()); + }; + + KABC::Addressee *addr = addrMap[strList[0]]; + if (addr) { + for ( QStringList::Iterator it = strList.begin(); it != strList.end(); ++it ) + *it = (*it).simplifyWhiteSpace(); + // strList[1] = Record_id (numbered item, ignore here) + int id = strList[14].toInt(); // Record_type_id (0=work,1=home,2=other) + int type = (id==0) ? KABC::Address::Work : KABC::Address::Home; + if (!strList[19].isEmpty() && strList[19].toInt()!=0) + type |= KABC::Address::Pref; // Preferred address (seems to be bitfield for telephone Prefs) + KABC::Address adr = addr->address(type); + adr.setStreet(strList[2]); + adr.setCountry(strList[3]); + adr.setPostalCode(strList[4]); + adr.setLocality(strList[5]); + addr->insertPhoneNumber( KABC::PhoneNumber(strList[6], KABC::PhoneNumber::Home) ); + addr->insertPhoneNumber( KABC::PhoneNumber(strList[7], KABC::PhoneNumber::Fax) ); + int celltype = KABC::PhoneNumber::Cell; + // strList[9]=Mobile_type // always 0 or -1(default phone). + if (strList[9].toInt()) celltype |= KABC::PhoneNumber::Pref; + addr->insertPhoneNumber( KABC::PhoneNumber(strList[8], celltype) ); + addr->insertEmail(strList[10]); + if (!strList[11].isEmpty()) addr->setUrl(strList[11]); + if (!strList[12].isEmpty()) addr->setRole(strList[12]); + // strList[13]=Comments + // strList[14]=Record_type_id (0,1,2) - see above + // strList[15]=Record_type (name of this additional record entry) + if (!strList[16].isEmpty()) addr->setOrganization(strList[16]); // Company + if (!strList[17].isEmpty()) addr->insertCustom( + "KADDRESSBOOK", "X-Department", strList[17]); // Department + if (checkDateTime(strList[18],dt)) addr->setRevision(dt); // Change_date + // strList[19]=Preferred (see above) + // strList[20]=Status (should always be "1") + addr->insertAddress(adr); + } else { + kdWarning() << "unresolved line: " << line << endl; + } + + line = gmxStream.readLine(); + } + + // now add the addresses to to addrList + for ( AddressMap::Iterator it = addrMap.begin(); it != addrMap.end(); ++it ) { + KABC::Addressee *addr = it.data(); + addrList.append(*addr); + delete addr; + } + + file.close(); + return addrList; +} + + +/* export */ + +bool GMXXXPort::exportContacts( const KABC::AddresseeList &list, const QString& ) +{ + KURL url = KFileDialog::getSaveURL( ":xxport_gmx", GMX_FILESELECTION_STRING ); + if ( url.isEmpty() ) + return true; + + if ( !url.isLocalFile() ) { + KTempFile tmpFile; + if ( tmpFile.status() != 0 ) { + QString txt = i18n( "<qt>Unable to open file <b>%1</b>.%2.</qt>" ); + KMessageBox::error( parentWidget(), txt.arg( url.url() ) + .arg( strerror( tmpFile.status() ) ) ); + return false; + } + + doExport( tmpFile.file(), list ); + tmpFile.close(); + + return KIO::NetAccess::upload( tmpFile.name(), url, parentWidget() ); + } else { + QString filename = url.path(); + QFile file( filename ); + + if ( !file.open( IO_WriteOnly ) ) { + QString txt = i18n( "<qt>Unable to open file <b>%1</b>.</qt>" ); + KMessageBox::error( parentWidget(), txt.arg( filename ) ); + return false; + } + + doExport( &file, list ); + file.close(); + + return true; + } +} + +static const QString dateString( const QDateTime &dt ) +{ + if (!dt.isValid()) + return QString::fromLatin1("1000-01-01 00:00:00"); + QString d(dt.toString(Qt::ISODate)); + d[10] = ' '; // remove the "T" in the middle of the string + return d; +} + +void GMXXXPort::doExport( QFile *fp, const KABC::AddresseeList &list ) +{ + if (!fp || !list.count()) + return; + + QTextStream t( fp ); + t.setEncoding( QTextStream::Latin1 ); + + KABC::AddresseeList::ConstIterator it; + typedef QMap<int, const KABC::Addressee *> AddressMap; + AddressMap addrMap; + const KABC::Addressee *addr; + + t << "AB_ADDRESSES:\n"; + t << "Address_id,Nickname,Firstname,Lastname,Title,Birthday,Comments," + "Change_date,Status,Address_link_id,Categories\n"; + + int no = 0; + const QChar DELIM('#'); + for ( it = list.begin(); it != list.end(); ++it ) { + addr = &(*it); + if (addr->isEmpty()) + continue; + addrMap[++no] = addr; + t << no << DELIM // Address_id + << addr->nickName() << DELIM // Nickname + << addr->givenName() << DELIM // Firstname + << addr->familyName() << DELIM // Lastname + << addr->title() << DELIM // Title + << dateString(addr->birthday()) << DELIM // Birthday + << addr->note() /*.replace('\n',"\r\n")*/ << DELIM // Comments + << dateString(addr->revision()) << DELIM // Change_date + << "1##0\n"; // Status, Address_link_id, Categories + } + + t << "####\n"; + t << "AB_ADDRESS_RECORDS:\n"; + t << "Address_id,Record_id,Street,Country,Zipcode,City,Phone,Fax,Mobile," + "Mobile_type,Email,Homepage,Position,Comments,Record_type_id,Record_type," + "Company,Department,Change_date,Preferred,Status\n"; + + no = 1; + while ( (addr = addrMap[no]) != NULL ) { + for (unsigned int record_id=0; record_id<3; record_id++) { + + KABC::Address address; + KABC::PhoneNumber phone, fax, cell; + + + if (record_id == 0) { + address = addr->address(KABC::Address::Work); + phone = addr->phoneNumber(KABC::PhoneNumber::Work); + fax = addr->phoneNumber(KABC::PhoneNumber::Fax); + cell = addr->phoneNumber(KABC::PhoneNumber::Work | KABC::PhoneNumber::Cell); + } else { + address = addr->address(KABC::Address::Home); + phone = addr->phoneNumber(KABC::PhoneNumber::Home); + cell = addr->phoneNumber(KABC::PhoneNumber::Cell); + } + + const QStringList emails = addr->emails(); + QString email; + if (emails.count()>record_id) email = emails[record_id]; + + t << no << DELIM // Address_id + << record_id << DELIM // Record_id + << address.street() << DELIM // Street + << address.country() << DELIM // Country + << address.postalCode() << DELIM // Zipcode + << address.locality() << DELIM // City + << phone.number() << DELIM // Phone + << fax.number() << DELIM // Fax + << cell.number() << DELIM // Mobile + << ((cell.type()&KABC::PhoneNumber::Pref)?-1:0) << DELIM // Mobile_type + << email << DELIM // Email + << ((record_id==0)?addr->url().url():QString::null) << DELIM // Homepage + << ((record_id==0)?addr->role():QString::null) << DELIM // Position + << DELIM // Comments + << record_id << DELIM // Record_type_id (0,1,2) - see above + << DELIM // Record_type (name of this additional record entry) + << ((record_id==0)?addr->organization():QString::null) << DELIM // Company + << ((record_id==0)?addr->custom("KADDRESSBOOK", "X-Department"):QString::null) << DELIM // Department + << dateString(addr->revision()) << DELIM // Change_date + << 5 << DELIM // Preferred + << 1 << endl; // Status (should always be "1") + } + + ++no; + }; + + t << "####"; +} + +#include "gmx_xxport.moc" + diff --git a/kaddressbook-plugins/xxports/gmx/gmx_xxport.desktop b/kaddressbook-plugins/xxports/gmx/gmx_xxport.desktop new file mode 100644 index 0000000..1b31521 --- /dev/null +++ b/kaddressbook-plugins/xxports/gmx/gmx_xxport.desktop @@ -0,0 +1,109 @@ +[Desktop Entry] +X-KDE-Library=libkaddrbk_gmx_xxport +Name=KAB GMX XXPort Plugin +Name[br]=Lugent XXPorzh GMX KAB +Name[ca]=Connector GMX XXPort per a KAB +Name[cs]=KAB GMX XXPort modul +Name[de]=GMX Adressbuchmodul +Name[el]=Πρόσθετο KAB GMX XXPort +Name[eo]=KAB GMX porta kromaĵo +Name[es]=Complemento KAB KWorldClock XXPort +Name[et]=KAB GMX eksport/importplugin +Name[eu]=KAB GMX XXPort plugina +Name[fa]=وصلۀ KAB GMX XXPort +Name[fi]=KAB-GMX XXPort-liitännäinen +Name[fr]=Module d'XXportation GMX KAB +Name[fy]=KAB GMX XXPort-plugin +Name[ga]=Breiseán KAB GMX XXPort +Name[gl]=Plugin XXPort GMX de KAB +Name[he]= תוסיף יבוא/ייצוא של KAB GMX +Name[hi]=केएबी जीएमएक्स एक्सएक्स-पोर्ट प्लगइन +Name[hr]=KAB GMX XXPort dodatak +Name[hu]=KAB GMX XXPort bővítőmodul +Name[is]=KAB GMX XXPort íforrit +Name[it]=Plugin per KAB GMX XXPort +Name[ja]=KAB KWorldClock XXPort プラグイン +Name[ka]=KAB GMX XXPort მოდული +Name[kk]=KAB GMX XXPort плагин модулі +Name[km]=កម្មវិធីជំនួយ KAB GMX XXPort +Name[lt]=KAB GMX XXPort priedas +Name[mk]=Приклучок KAB GMX XXPort +Name[nb]=Programtillegg for KAB GMX XXPort +Name[nds]=GMX-Moduul för KAdressbook +Name[ne]=KAB GMX XX पोर्ट प्लगइन +Name[nl]=KAB GMX XXPort-plugin +Name[nn]=Programtillegg KAB GMX XXPort +Name[pa]=KAB GMX XXPort ਪਲੱਗਇਨ +Name[pl]=Wtyczka KAB GMX XXPort +Name[pt]='Plugin' XXPort GMX do KAB +Name[pt_BR]=Plug-in GMX para o Livro de Endereços +Name[ru]=Модуль KAB GMX XXPort +Name[sk]=KAB GMX XXPort modul +Name[sl]=Vstavek KAB GMX XXPort +Name[sr]=XXPort прикључак KAB-а за GMX +Name[sr@Latn]=XXPort priključak KAB-a za GMX +Name[sv]=Adressbokens överföringsinsticksprogram för GMX +Name[ta]=KAB GMX XXமுனைய சொருகுப்பொருள் +Name[tr]=KAB GMX XXPort Eklentisi +Name[uk]=Втулок KAB GMX XXPort +Name[uz]=KAB GMX XXPort plagini +Name[uz@cyrillic]=KAB GMX XXPort плагини +Name[vi]=Bổ sung XXPort GMX KAB +Name[zh_CN]=KAB GMX XXPort 插件 +Name[zh_TW]=KAB GMX XXPort 外掛程式 +Comment=Plugin to import and export contacts in GMX's addressbook format +Comment[bg]=Приставка за импортиране и експортиране на контакти от адресник във формат GMX +Comment[ca]=Connector per a importar i exportar contactes en el format de llibreta d'adreces GMX +Comment[cs]=Modul pro export kontaktů v adresářovém formátu GMX +Comment[da]=Plugin til at importere og eksportere kontakter i GMX's adressebogsformat +Comment[de]=Modul zum Import und Export von Kontaktdaten im Adressbuchformat von GMX +Comment[el]=Πρόσθετο για εισαγωγή και εξαγωγή επαφών στη μορφή του βιβλίου διευθύνσεων του GMX +Comment[eo]=Kromaĵo por enporti kaj elporti kontaktojn en GMX-a adreslibra formato +Comment[es]=Complemento para importar y exportar contactos en el formato GMX de la libreta de direcciones +Comment[et]=Plugin, mis impordib ja ekspordib kontakte GMX aadressiraamatu vormingust/vormingusse +Comment[eu]=GMX formatuan dauden helbide liburuxkak inportatu eta esportatzeko plugina +Comment[fa]=وصله برای واردات و صادرات تماسها در قالب کتاب نشانی GMX +Comment[fi]=Sovelma GMX-osoitekirjamuodossa olevien tietueiden tuontiin ja vientiin +Comment[fr]=Module externe permettant d'importer et d'exporter des contacts avec le format du carnet d'adresses GMX +Comment[fy]=Plugin foar it ym-en eksportearjen fan kontakten út it adresboekformaat fan GMX +Comment[ga]=Breiseán chun teagmhálacha i bhformáid leabhair seoltaí GMX a iompórtáil agus a easpórtáil +Comment[gl]=Un plugin para importar e exportar contactos no formato de libro de enderezos GMX +Comment[he]= תוסף לייבוא וייצוא של אנשי קשר בפורמט פנקס הכתובות של GMX +Comment[hi]=जीएमएक्स पता पुस्तिका फार्मेट में सम्पर्कों को आयात और निर्यात करने का प्लगइन +Comment[hr]=Dodatak za uvoz i izvoz kontakata u oblikovanju GMX adresara +Comment[hu]=Bővítőmodul GMX formátumú névjegyek importálásához és exportálásához +Comment[is]=Íforrit sem flytur inn og út tengiliði í GMX vistfangasniði +Comment[it]=Plugin per importare ed esportare contatti in formato GXM +Comment[ja]=KWorldClock の旗を GMX 形式の地図データでインポート、エクスポートするプラグイン +Comment[ka]=GMX's მისამართთა წიგნის ფორმატში კონტაქტების იმპორტის და ექსპორტის მოდული +Comment[kk]=GMX адрестік кітапша пішіміне контакттарды импорт және экспорттау +Comment[km]=កម្មវិធីជំនួយដើម្បីនាំចូល និងនាំចេញទំនាក់ទំនងនៅក្នុងទ្រង់ទ្រាយសៀវភៅអាសយដ្ឋានរបស់ GMX +Comment[lt]=Priedas GMX formato adresų knygutės eksportavimui ir importavimui +Comment[mk]=Приклучок за внесување и изнесување на контакти во GMX-формат на адресар +Comment[ms]=Plugin akan mengimport dan mengeksport hubungan dalam format buku alamat GMX +Comment[nb]=Modul som eksporterer kontakter i adressebok-formatet til GMX +Comment[nds]=Moduul för't Im- un Exporteren vun Kontakten in GMX-Adressbookformaat +Comment[ne]=जीएमएक्सको ठेगाना पुस्तक ढाँचामा सम्पर्क आयात र निर्यात गर्ने प्लगइन +Comment[nl]=Plugin voor het im-en exporteren van contacten uit het adresboekformaat van GMX +Comment[nn]=Programtillegg for å importera og eksportera kontaktar i GMX-adressebokformatet +Comment[pl]=Wtyczka do importu i eksportu kontaktów z formatu książki adresowej GMX +Comment[pt]=Um 'plugin' para importar e exportar contactos no formato de livro de endereços GMX +Comment[pt_BR]=Plug-in para exportar e importar contatos usando o formato de livro de endereços GMX +Comment[ru]=Модуль для экспорта и импорта контактов в формат адресной книги GMX +Comment[sk]=Modul pre import a export kontaktov v GMX formáte adresára +Comment[sl]=Vstavek za uvoz in izvoz stikov v obliko adresarja GMX +Comment[sr]=Прикључак за увоз и извоз контаката у формату GMX-овог адресара +Comment[sr@Latn]=Priključak za uvoz i izvoz kontakata u formatu GMX-ovog adresara +Comment[sv]=Insticksprogram för import och export av kontakter med GMX adressboksformat +Comment[ta]=GMX's முகவரிப்புத்தக வடிவத்தில் உள்ள தொடர்புகளை ஏற்ற, இறக்க சொருகுப்பொருள் +Comment[tr]=GMX'in adresdefteri biçimindeki bağlantıları ekleme ve oluşturma eklentisi +Comment[uk]=Втулок для імпортування та експортування контактів у форматі адресної книги GMX +Comment[uz]=Aloqalarni GMX manzillar daftari formatida eksport-import qilish vositasi +Comment[uz@cyrillic]=Алоқаларни GMX манзиллар дафтари форматида экспорт-импорт қилиш воситаси +Comment[vi]=Bổ sung nhập/xuất khẩu liên lạc định dạng sổ địa chỉ của GMX +Comment[zh_CN]=以 GMX 的地址簿格式导入和导出联系人 +Comment[zh_TW]=匯入/匯出 GMX 通訊錄格式的外掛程式 +Type=Service +ServiceTypes=KAddressBook/XXPort +X-KDE-KAddressBook-XXPortPluginVersion=1 + diff --git a/kaddressbook-plugins/xxports/gmx/gmx_xxport.h b/kaddressbook-plugins/xxports/gmx/gmx_xxport.h new file mode 100644 index 0000000..9ced4da --- /dev/null +++ b/kaddressbook-plugins/xxports/gmx/gmx_xxport.h @@ -0,0 +1,47 @@ +/* + This file is part of KAddressbook. + Copyright (c) 2000 - 2003 Oliver Strutynski <[email protected]> + Tobias Koenig <[email protected]> + + This program 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 program 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. + + As a special exception, permission is given to link this program + with any edition of Qt, and distribute the resulting executable, + without including the source code for Qt in the source distribution. +*/ + +#ifndef GMX_XXPORT_H +#define GMX_XXPORT_H + +#include <kaddressbook/xxport.h> + +class GMXXXPort : public KAB::XXPort +{ + Q_OBJECT + + public: + GMXXXPort( KABC::AddressBook *ab, QWidget *parent, const char *name = 0 ); + + QString identifier() const { return "gmx"; } + + public slots: + bool exportContacts( const KABC::AddresseeList &list, const QString &data ); + KABC::AddresseeList importContacts( const QString &data ) const; + + private: + void doExport( QFile *fp, const KABC::AddresseeList &list ); +}; + +#endif diff --git a/kaddressbook-plugins/xxports/gmx/gmx_xxportui.rc b/kaddressbook-plugins/xxports/gmx/gmx_xxportui.rc new file mode 100644 index 0000000..9239d6b --- /dev/null +++ b/kaddressbook-plugins/xxports/gmx/gmx_xxportui.rc @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<!DOCTYPE gui> +<gui name="gmx_xxport" version="1"> +<MenuBar> + <Menu name="file"><text>&File</text> + <Menu name="file_import"><text>&Import</text> + <Action name="file_import_gmx"/> + </Menu> + <Menu name="file_export"><text>&Export</text> + <Action name="file_export_gmx"/> + </Menu> + </Menu> +</MenuBar> +</gui> |