core.h
1 /*
2  This file is part of KDE Kontact.
3 
4  Copyright (c) 2001 Matthias Hoelzer-Kluepfel <mhk@kde.org>
5  Copyright (c) 2002-2003 Daniel Molkentin <molkentin@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 
22 */
23 #ifndef KONTACT_CORE_H
24 #define KONTACT_CORE_H
25 
26 #include <tqdatetime.h>
27 #include <kdemacros.h>
28 #include <tdeparts/mainwindow.h>
29 #include <tdeparts/part.h>
30 
31 class TDEAction;
32 
33 namespace Kontact
34 {
35 
36 class Plugin;
37 
41 class TDE_EXPORT Core : public KParts::MainWindow
42 {
43  TQ_OBJECT
44 
45  public:
46  virtual ~Core();
47 
52  virtual void selectPlugin( Kontact::Plugin *plugin ) = 0;
53 
58  virtual void selectPlugin( const TQString &plugin ) = 0;
59 
63  virtual TQValueList<Kontact::Plugin*> pluginList() const = 0;
64 
68  KParts::ReadOnlyPart *createPart( const char *libname );
69 
74  virtual void partLoaded( Plugin* plugin, KParts::ReadOnlyPart * part ) = 0;
75 
76  signals:
80  void dayChanged( const TQDate& );
81 
82  protected:
83  Core( TQWidget *parentWidget = 0, const char *name = 0 );
84 
85  TQString lastErrorMessage() const;
86 
87  private slots:
88  void slotPartDestroyed( TQObject * );
89  void checkNewDay();
90 
91  private:
92  TQMap<TQCString,KParts::ReadOnlyPart *> mParts;
93  TQDate mLastDate;
94 
95  class Private;
96  Private *d;
97 };
98 
99 }
100 
101 #endif
This class provides the interface to the Kontact core for the plugins.
Definition: core.h:42
void dayChanged(const TQDate &)
Emitted when a new day starts.
virtual void selectPlugin(Kontact::Plugin *plugin)=0
Selects the given plugin.
virtual void selectPlugin(const TQString &plugin)=0
This is an overloaded member function.
virtual TQValueList< Kontact::Plugin * > pluginList() const =0
Returns the pointer list of available plugins.
Base class for all Plugins in Kontact.
Definition: plugin.h:59