kontact
mainwindow.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef KONTACT_MAINWINDOW_H
00025 #define KONTACT_MAINWINDOW_H
00026
00027 #include <qguardedptr.h>
00028 #include <qptrlist.h>
00029 #include <qwidgetstack.h>
00030
00031 #include <kparts/mainwindow.h>
00032 #include <kparts/part.h>
00033 #include <kparts/partmanager.h>
00034 #include <kdcopservicestarter.h>
00035
00036 #include "core.h"
00037 #include "kontactiface.h"
00038
00039 class QHBox;
00040 class QSplitter;
00041 class QVBox;
00042 class QFrame;
00043
00044 class KAction;
00045 class KConfig;
00046 class KPluginInfo;
00047 class KRSqueezedTextLabel;
00048 class KHTMLPart;
00049 class KeyPressEater;
00050
00051 namespace KPIM
00052 {
00053 class StatusbarProgressWidget;
00054 }
00055
00056 namespace Kontact
00057 {
00058
00059 class Plugin;
00060 class SidePaneBase;
00061 class AboutDialog;
00062
00063 typedef QValueList<Kontact::Plugin*> PluginList;
00064
00065 class MainWindow : public Kontact::Core, public KDCOPServiceStarter, public KontactIface
00066 {
00067 Q_OBJECT
00068
00069 public:
00070 MainWindow();
00071 ~MainWindow();
00072
00073
00074 virtual int startServiceFor( const QString& serviceType,
00075 const QString& constraint = QString::null,
00076 const QString& preferences = QString::null,
00077 QString *error = 0, QCString* dcopService = 0,
00078 int flags = 0 );
00079
00080 virtual PluginList pluginList() const { return mPlugins; }
00081 void setActivePluginModule( const QString & );
00082
00083 public slots:
00084 virtual void selectPlugin( Kontact::Plugin *plugin );
00085 virtual void selectPlugin( const QString &pluginName );
00086
00087 void updateConfig();
00088
00089 protected slots:
00090 void initObject();
00091 void initGUI();
00092 void slotActivePartChanged( KParts::Part *part );
00093 void slotPreferences();
00094 void slotNewClicked();
00095 void slotSyncClicked();
00096 void slotQuit();
00097 void slotShowTip();
00098 void slotRequestFeature();
00099 void slotConfigureProfiles();
00100 void slotLoadProfile( const QString& id );
00101 void slotSaveToProfile( const QString& id );
00102 void slotNewToolbarConfig();
00103 void slotShowIntroduction();
00104 void showAboutDialog();
00105 void slotShowStatusMsg( const QString& );
00106 void activatePluginModule();
00107 void slotOpenUrl( const KURL &url );
00108
00109 private:
00110 void initWidgets();
00111 void initAboutScreen();
00112 void loadSettings();
00113 void saveSettings();
00114
00115 bool isPluginLoaded( const KPluginInfo * );
00116 Kontact::Plugin *pluginFromInfo( const KPluginInfo * );
00117 void loadPlugins();
00118 void unloadPlugins();
00119 bool removePlugin( const KPluginInfo * );
00120 void addPlugin( Kontact::Plugin *plugin );
00121 void partLoaded( Kontact::Plugin *plugin, KParts::ReadOnlyPart *part );
00122 void setupActions();
00123 void showTip( bool );
00124 virtual bool queryClose();
00125 virtual void readProperties( KConfig *config );
00126 virtual void saveProperties( KConfig *config );
00127 void paintAboutScreen( const QString& msg );
00128 static QString introductionString();
00129 KToolBar* findToolBar(const char* name);
00130
00131 private slots:
00132 void pluginsChanged();
00133
00134 void configureShortcuts();
00135 void configureToolbars();
00136
00137 private:
00138 QFrame *mTopWidget;
00139
00140 QSplitter *mSplitter;
00141
00142 KToolBarPopupAction *mNewActions;
00143 KToolBarPopupAction *mSyncActions;
00144 SidePaneBase *mSidePane;
00145 QWidgetStack *mPartsStack;
00146 Plugin *mCurrentPlugin;
00147 KParts::PartManager *mPartManager;
00148 PluginList mPlugins;
00149 PluginList mDelayedPreload;
00150 QValueList<KPluginInfo*> mPluginInfos;
00151 KHTMLPart *mIntroPart;
00152
00153 KRSqueezedTextLabel* mStatusMsgLabel;
00154 KPIM::StatusbarProgressWidget *mLittleProgress;
00155
00156 QString mActiveModule;
00157
00158 QMap<QString, QGuardedPtr<QWidget> > mFocusWidgets;
00159
00160 AboutDialog *mAboutDialog;
00161 bool mReallyClose;
00162 bool mSyncActionsEnabled;
00163 };
00164
00165 }
00166
00167 #endif
00168
|