2 This file is part of KDE Kontact.
4 Copyright (c) 2001 Matthias Hoelzer-Kluepfel <mhk@kde.org>
5 Copyright (c) 2002-2005 Daniel Molkentin <molkentin@kde.org>
6 Copyright (c) 2003-2005 Cornelius Schumacher <schumacher@kde.org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
24 #ifndef KONTACT_MAINWINDOW_H
25 #define KONTACT_MAINWINDOW_H
27 #include <qguardedptr.h>
29 #include <qwidgetstack.h>
31 #include <kparts/mainwindow.h>
32 #include <kparts/part.h>
33 #include <kparts/partmanager.h>
34 #include <kdcopservicestarter.h>
46 class KRSqueezedTextLabel
;
52 class StatusbarProgressWidget
;
62 typedef QValueList
<Kontact::Plugin
*> PluginList
;
64 class MainWindow
: public Kontact::Core
, public KDCOPServiceStarter
72 // KDCOPServiceStarter interface
73 virtual int startServiceFor( const QString
& serviceType
,
74 const QString
& constraint
= QString::null
,
75 const QString
& preferences
= QString::null
,
76 QString
*error
= 0, QCString
* dcopService
= 0,
79 virtual PluginList
pluginList() const { return mPlugins
; }
80 void setActivePluginModule( const QString
& );
83 virtual void selectPlugin( Kontact::Plugin
*plugin
);
84 virtual void selectPlugin( const QString
&pluginName
);
91 void slotActivePartChanged( KParts::Part
*part
);
92 void slotPreferences();
93 void slotNewClicked();
94 void slotSyncClicked();
97 void slotRequestFeature();
98 void slotNewToolbarConfig();
99 void slotShowIntroduction();
100 void showAboutDialog();
101 void slotShowStatusMsg( const QString
& );
102 void activatePluginModule();
103 void slotOpenUrl( const KURL
&url
);
107 void initAboutScreen();
111 bool isPluginLoaded( const KPluginInfo
* );
112 Kontact::Plugin
*pluginFromInfo( const KPluginInfo
* );
114 void unloadPlugins();
115 bool removePlugin( const KPluginInfo
* );
116 void addPlugin( Kontact::Plugin
*plugin
);
117 void partLoaded( Kontact::Plugin
*plugin
, KParts::ReadOnlyPart
*part
);
119 void showTip( bool );
120 virtual bool queryClose();
121 virtual void readProperties( KConfig
*config
);
122 virtual void saveProperties( KConfig
*config
);
123 void paintAboutScreen( const QString
& msg
);
124 static QString
introductionString();
125 KToolBar
* findToolBar(const char* name
);
128 void pluginsChanged();
130 void configureShortcuts();
131 void configureToolbars();
136 QSplitter
*mSplitter
;
138 KToolBarPopupAction
*mNewActions
;
139 KToolBarPopupAction
*mSyncActions
;
140 SidePaneBase
*mSidePane
;
141 QWidgetStack
*mPartsStack
;
142 Plugin
*mCurrentPlugin
;
143 KParts::PartManager
*mPartManager
;
145 PluginList mDelayedPreload
;
146 QValueList
<KPluginInfo
*> mPluginInfos
;
147 KHTMLPart
*mIntroPart
;
149 KRSqueezedTextLabel
* mStatusMsgLabel
;
150 KPIM::StatusbarProgressWidget
*mLittleProgress
;
152 QString mActiveModule
;
154 QMap
<QString
, QGuardedPtr
<QWidget
> > mFocusWidgets
;
156 AboutDialog
*mAboutDialog
;
163 // vim: sw=2 sts=2 et