kaddressbook

core.h
1 /*
2  This file is part of KAddressbook.
3  Copyright (c) 2003 Tobias Koenig <tokoe@kde.org>
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9 
10  This program 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
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 
19  As a special exception, permission is given to link this program
20  with any edition of TQt, and distribute the resulting executable,
21  without including the source code for TQt in the source distribution.
22 */
23 
24 #ifndef KAB_CORE_H
25 #define KAB_CORE_H
26 
27 #include <config.h> // for TDEPIM_NEW_DISTRLISTS
28 
29 #ifdef TDEPIM_NEW_DISTRLISTS
30 #include <libtdepim/distributionlist.h>
31 #endif
32 
33 #include <tqobject.h>
34 
35 #include <tdeabc/field.h>
36 #include <kcommand.h>
37 #include <kxmlguiclient.h>
38 #include <tdemacros.h>
39 
40 namespace TDEABC {
41 class AddressBook;
42 class Resource;
43 }
44 
45 class TQWidget;
46 
47 class TDEActionCollection;
48 class TDEConfig;
49 class KURL;
50 
51 namespace KAB {
52 
53 class SearchManager;
54 
55 class TDE_EXPORT Core : public TQObject
56 {
57  TQ_OBJECT
58 
59 
60  public:
61  Core( KXMLGUIClient *client, TQObject *parent, const char *name = 0 );
62 
66  virtual TDEABC::AddressBook *addressBook() const = 0;
67 
71  virtual TDEConfig *config() const = 0;
72 
77  virtual TDEActionCollection *actionCollection() const = 0;
78 
82  virtual KXMLGUIClient *guiClient() const { return mGUIClient; }
83 
87  virtual TDEABC::Field *currentSortField() const = 0;
88 
92  virtual TQStringList selectedUIDs() const = 0;
93 
99  virtual TDEABC::Resource *requestResource( TQWidget *parent ) = 0;
100 
104  virtual TQWidget *widget() const = 0;
105 
111  virtual void deleteContacts( const TQStringList &uids ) = 0;
112 
118  virtual void deleteDistributionLists( const TQStringList &uids ) = 0;
119 
120 #ifdef TDEPIM_NEW_DISTRLISTS
124  virtual KPIM::DistributionList::List distributionLists() const = 0;
125 
126 
130  virtual TQStringList distributionListNames() const = 0;
131 
136  virtual void setSelectedDistributionList( const TQString &name ) = 0;
137 #endif
138 
140  virtual SearchManager *searchManager() const = 0;
141 
142  virtual KCommandHistory *commandHistory() const = 0;
143 
144  signals:
149  void contactsUpdated();
150 
151  public slots:
155  virtual void setContactSelected( const TQString &uid ) = 0;
156 
160  virtual void addEmail( const TQString& addr ) = 0;
161 
165  virtual void importVCard( const KURL& url ) = 0;
166 
170  virtual void importVCardFromData( const TQString& vCard ) = 0;
171 
175  virtual void newContact() = 0;
176 
180  virtual void newDistributionList() = 0;
181 
186  virtual TQString getNameByPhone( const TQString& phone ) = 0;
187 
191  virtual void editContact( const TQString &uid = TQString() ) = 0;
192 
196  virtual void editDistributionList( const TQString &name ) = 0;
197 
198  private:
199  KXMLGUIClient *mGUIClient;
200 };
201 
202 }
203 
204 #endif