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 slotConfigureProfiles();
00099 void slotLoadProfile( const QString& id );
00100 void slotSaveToProfile( const QString& id );
00101 void slotNewToolbarConfig();
00102 void slotShowIntroduction();
00103 void showAboutDialog();
00104 void slotShowStatusMsg( const QString& );
00105 void activatePluginModule();
00106 void slotOpenUrl( const KURL &url );
00107
00108 private:
00109 void initWidgets();
00110 void initAboutScreen();
00111 void loadSettings();
00112 void saveSettings();
00113
00114 bool isPluginLoaded( const KPluginInfo * );
00115 Kontact::Plugin *pluginFromInfo( const KPluginInfo * );
00116 void loadPlugins();
00117 void unloadPlugins();
00118 bool removePlugin( const KPluginInfo * );
00119 void addPlugin( Kontact::Plugin *plugin );
00120 void partLoaded( Kontact::Plugin *plugin, KParts::ReadOnlyPart *part );
00121 void setupActions();
00122 void showTip( bool );
00123 virtual bool queryClose();
00124 virtual void readProperties( KConfig *config );
00125 virtual void saveProperties( KConfig *config );
00126 void paintAboutScreen( const QString& msg );
00127 static QString introductionString();
00128 KToolBar* findToolBar(const char* name);
00129
00130 private slots:
00131 void pluginsChanged();
00132
00133 void configureShortcuts();
00134 void configureToolbars();
00135
00136 private:
00137 QFrame *mTopWidget;
00138
00139 QSplitter *mSplitter;
00140
00141 KToolBarPopupAction *mNewActions;
00142 KToolBarPopupAction *mSyncActions;
00143 SidePaneBase *mSidePane;
00144 QWidgetStack *mPartsStack;
00145 Plugin *mCurrentPlugin;
00146 KParts::PartManager *mPartManager;
00147 PluginList mPlugins;
00148 PluginList mDelayedPreload;
00149 QValueList<KPluginInfo*> mPluginInfos;
00150 KHTMLPart *mIntroPart;
00151
00152 KRSqueezedTextLabel* mStatusMsgLabel;
00153 KPIM::StatusbarProgressWidget *mLittleProgress;
00154
00155 QString mActiveModule;
00156
00157 QMap<QString, QGuardedPtr<QWidget> > mFocusWidgets;
00158
00159 AboutDialog *mAboutDialog;
00160 bool mReallyClose;
00161 bool mSyncActionsEnabled;
00162 };
00163
00164 }
00165
00166 #endif
00167
|