kaddressbook

kaddressbook_part.h
1 /*
2  This file is part of KAddressbook.
3  Copyright (c) 2000 Cornelius Schumacher <schumacher@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 #ifndef KADDRESSBOOK_PART_H
24 #define KADDRESSBOOK_PART_H
25 
26 #include <tdeparts/event.h>
27 #include <tdeparts/factory.h>
28 #include <tdeparts/part.h>
29 
30 #include "kaddressbookiface.h"
31 
32 class TDEAboutData;
33 class TDEInstance;
34 
35 class KABCore;
36 
37 class KAddressbookPart: public KParts::ReadOnlyPart, virtual public KAddressBookIface
38 {
39  TQ_OBJECT
40 
41 
42  public:
43  KAddressbookPart( TQWidget *parentWidget, const char *widgetName,
44  TQObject *parent, const char *name, const TQStringList& );
45  virtual ~KAddressbookPart();
46 
47  static TDEAboutData *createAboutData();
48 
49  virtual void saveToProfile( const TQString& path ) const;
50  virtual void loadProfile( const TQString& path );
51  public slots:
52  virtual void addEmail( TQString addr );
53  virtual void importVCard( const KURL& url );
54  virtual void importVCardFromData( const TQString& vCard );
55 #ifndef Q_MOC_RUN
56  virtual ASYNC showContactEditor( TQString uid );
57 #else // Q_MOC_RUN
58  virtual void showContactEditor( TQString uid );
59 #endif // Q_MOC_RUN
60  virtual void newContact();
61  virtual void newDistributionList();
62  virtual TQString getNameByPhone( TQString phone );
63  virtual void save();
64  virtual void exit();
65  virtual bool openURL( const KURL &url );
66  virtual bool handleCommandLine();
67  virtual void syncAllResources();
68 
69  protected:
70  virtual bool openFile();
71  virtual void guiActivateEvent( KParts::GUIActivateEvent* );
72 
73  private:
74  KABCore *mCore;
75 };
76 
77 #endif