summaryrefslogtreecommitdiffabout
path: root/pluginopiekabc
Unidiff
Diffstat (limited to 'pluginopiekabc') (more/less context) (ignore whitespace changes)
-rw-r--r--pluginopiekabc/opieaddressbook.cpp33
-rw-r--r--pluginopiekabc/opieaddressbook.h63
-rw-r--r--pluginopiekabc/opieaddressbookplugin.cpp71
-rw-r--r--pluginopiekabc/opieaddressbookplugin.h19
-rw-r--r--pluginopiekabc/opieaddressee.cpp21
-rw-r--r--pluginopiekabc/opieaddressee.h16
-rw-r--r--pluginopiekabc/pluginopiekabcE.pro27
7 files changed, 0 insertions, 250 deletions
diff --git a/pluginopiekabc/opieaddressbook.cpp b/pluginopiekabc/opieaddressbook.cpp
deleted file mode 100644
index ff0ef63..0000000
--- a/pluginopiekabc/opieaddressbook.cpp
+++ b/dev/null
@@ -1,33 +0,0 @@
1#include "opieaddressbook.h"
2#include <qstringlist.h>
3#include <opie/ocontact.h>
4#include <opie/orecordlist.h>
5#include <stdio.h>
6
7using namespace KABC;
8
9OpieAddressBook *StdOpieAddressBook::mSelf = 0;
10
11OpieAddressBook::OpieAddressBook() {
12 access = new OContactAccess("Addressbook");
13}
14
15OpieAddressBook::~OpieAddressBook() {
16}
17
18
19StdOpieAddressBook::StdOpieAddressBook() {
20 access = new OContactAccess("Addressbook");
21}
22
23StdOpieAddressBook::~StdOpieAddressBook() {
24}
25
26OpieAddressBook *StdOpieAddressBook::self() {
27 if ( !mSelf ) {
28 mSelf = new StdOpieAddressBook();
29 }
30 return mSelf;
31}
32
33 \ No newline at end of file
diff --git a/pluginopiekabc/opieaddressbook.h b/pluginopiekabc/opieaddressbook.h
deleted file mode 100644
index d2a3b38..0000000
--- a/pluginopiekabc/opieaddressbook.h
+++ b/dev/null
@@ -1,63 +0,0 @@
1/*
2 This file is part of libkabc.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Library General Public
7 License as published by the Free Software Foundation; either
8 version 2 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
19*/
20
21#ifndef KABC_STDADDRESSBOOK_H
22#define KABC_STDADDRESSBOOK_H
23
24#include <opie/ocontactaccess.h>
25#include "opieaddressee.h"
26#include "opieaddress.h"
27
28namespace KABC {
29
30class AddressBook {
31
32 public:
33 AddressBook();
34 ~AddressBook();
35 Addressee::List findByEmail( const QString & );
36
37 protected:
38 OContactAccess *access;
39};
40
41
42class StdAddressBook : public AddressBook
43{
44 public:
45 /**
46 Return the standard addressbook object.
47 */
48 static AddressBook *self();
49
50
51 protected:
52 StdAddressBook();
53 ~StdAddressBook();
54
55 void init( bool onlyFastResources );
56
57 private:
58 static AddressBook *mSelf;
59 static bool mAutomaticSave;
60};
61
62}
63#endif
diff --git a/pluginopiekabc/opieaddressbookplugin.cpp b/pluginopiekabc/opieaddressbookplugin.cpp
deleted file mode 100644
index 0b22289..0000000
--- a/pluginopiekabc/opieaddressbookplugin.cpp
+++ b/dev/null
@@ -1,71 +0,0 @@
1#include <stdio.h>
2#include <qwidget.h>
3#include <qlayout.h>
4#include <qlistbox.h>
5#include <opie/ocontact.h>
6#include <opie/orecordlist.h>
7#include "opieaddressbookplugin.h"
8#include "opieaddressee.h"
9
10OpieAddressBookPlugin::OpieAddressBookPlugin() : ref(0) {
11
12 access = new OContactAccess("OpieAddressBookPlugin");
13
14}
15
16KABC::Addressee::List OpieAddressBookPlugin::getAddressees() {
17 KABC::Addressee::List results;
18 OContactAccess access("OpieAddressBookPlugin");
19 OContactAccess::List::Iterator it;
20 ORecordList<OContact> accessList = access.sorted(true,0,0,0);
21 for(it = accessList.begin(); it != accessList.end(); ++it ) {
22 OpieAddressee addressee( *it );
23 results.append(addressee);
24 }
25 return results;
26}
27
28QString OpieAddressBookPlugin::name() {
29 return QString::QString("OpieAddressBookPlugin");
30}
31
32
33KABC::Addressee::List OpieAddressBookPlugin::findByEmail(const QString &email) {
34printf("OpieAddressBookPlugin::findByEmail: email=%s\n", email.ascii());
35 KABC::Addressee::List results;
36
37 ORecordList<OContact> accessList = access->sorted(true,0,0,0);
38 OContactAccess::List::Iterator it;
39 for(it = accessList.begin(); it != accessList.end(); ++it ) {
40 OContact contact = *it;
41 QStringList emailList = contact.emailList();
42 QStringList foundEmails = emailList.grep(email,false);
43 if (foundEmails.count() >= 1) {
44 OpieAddressee a(contact);
45 printf("Found Contact %s\n", a.formattedName().ascii());
46 results.append(a);
47 }
48 }
49 return results;
50
51}
52
53QRESULT OpieAddressBookPlugin::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
54{
55printf("Start: OpieAddressBookPlugin::queryInterface\n");
56 *iface = 0;
57 if ( uuid == IID_QUnknown )
58 *iface = this;
59 else if ( uuid == IID_KOAddressBookInterface )
60 *iface = this;
61 if ( *iface )
62 (*iface)->addRef();
63 return QS_OK;
64printf("End: OpieAddressBookPlugin::queryInterface\n");
65}
66
67Q_EXPORT_INTERFACE()
68{
69 Q_CREATE_INSTANCE( OpieAddressBookPlugin )
70}
71
diff --git a/pluginopiekabc/opieaddressbookplugin.h b/pluginopiekabc/opieaddressbookplugin.h
deleted file mode 100644
index 1ad1c15..0000000
--- a/pluginopiekabc/opieaddressbookplugin.h
+++ b/dev/null
@@ -1,19 +0,0 @@
1#include <qwidget.h>
2#include <kabc/koaddressbookinterface.h>
3#include <kabc/addressee.h>
4#include <opie/ocontactaccess.h>
5
6struct OpieAddressBookPlugin : public KOAddressBookInterface {
7
8 public:
9
10 OpieAddressBookPlugin::OpieAddressBookPlugin();
11 QString name();
12 KABC::Addressee::List getAddressees();
13 KABC::Addressee::List findByEmail(const QString &email);
14 QRESULT queryInterface( const QUuid&, QUnknownInterface** );
15 Q_REFCOUNT
16 protected:
17 OContactAccess *access;
18 ulong ref;
19};
diff --git a/pluginopiekabc/opieaddressee.cpp b/pluginopiekabc/opieaddressee.cpp
deleted file mode 100644
index 3325152..0000000
--- a/pluginopiekabc/opieaddressee.cpp
+++ b/dev/null
@@ -1,21 +0,0 @@
1#include <stdio.h>
2#include "opieaddressee.h"
3
4OpieAddressee::OpieAddressee(const OContact & ocontact) {
5 setOContact(ocontact);
6}
7
8OpieAddressee::OpieAddressee() {
9 empty = true;
10}
11
12void OpieAddressee::setOContact(const OContact & ocontact) {
13 contact = ocontact;
14 QString id;
15 id.setNum(contact.uid());
16 fName = contact.lastName() + ", " + contact.firstName();
17 rName = contact.fullName();
18 pEmail = contact.defaultEmail();
19 empty = false;
20}
21
diff --git a/pluginopiekabc/opieaddressee.h b/pluginopiekabc/opieaddressee.h
deleted file mode 100644
index b0e8b0d..0000000
--- a/pluginopiekabc/opieaddressee.h
+++ b/dev/null
@@ -1,16 +0,0 @@
1#include <opie/ocontact.h>
2#include <kabc/addressee.h>
3
4class OpieAddressee : public KABC::Addressee {
5
6 public:
7
8 OpieAddressee::OpieAddressee(const OContact & contact);
9 OpieAddressee::OpieAddressee();
10 void setOContact(const OContact & contact);
11
12 private:
13 OContact contact;
14 QString id;
15 bool empty;
16};
diff --git a/pluginopiekabc/pluginopiekabcE.pro b/pluginopiekabc/pluginopiekabcE.pro
deleted file mode 100644
index 8411fc5..0000000
--- a/pluginopiekabc/pluginopiekabcE.pro
+++ b/dev/null
@@ -1,27 +0,0 @@
1 TEMPLATE= lib
2 CONFIG += qt warn_on release
3
4 TARGET = opiekabc
5OBJECTS_DIR = obj/$(PLATFORM)
6MOC_DIR = moc/$(PLATFORM)
7DESTDIR=$(QPEDIR)/plugins/korganizer
8INCLUDEPATH += $(QPEDIR)/include ../libkabcwrap $(OPIEDIR)/include
9DEFINES +=
10LIBS += -L$(QPEDIR)/lib
11LIBS += -lmicrokabc
12LIBS += -lopie
13LIBS += -lqpe
14LIBS += -lqte
15
16INTERFACES = \
17
18#select_attendee_base.ui
19
20HEADERS = \
21 opieaddressbookplugin.h \
22 opieaddressee.h
23
24SOURCES = \
25 opieaddressbookplugin.cpp \
26 opieaddressee.cpp
27