kontact Library API Documentation

mainwindow.h

00001 /*
00002     This file is part of KDE Kontact.
00003 
00004     Copyright (c) 2001 Matthias Hoelzer-Kluepfel <mhk@kde.org>
00005     Copyright (c) 2002-2003 Daniel Molkentin <molkentin@kde.org>
00006 
00007     This program is free software; you can redistribute it and/or modify
00008     it under the terms of the GNU General Public License as published by
00009     the Free Software Foundation; either version 2 of the License, or
00010     (at your option) any later version.
00011 
00012     This program is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015     GNU General Public License for more details.
00016 
00017     You should have received a copy of the GNU General Public License
00018     along with this program; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00020 */
00021 
00022 
00023 #ifndef KONTACT_MAINWINDOW_H
00024 #define KONTACT_MAINWINDOW_H
00025 
00026 #include <qwidgetstack.h>
00027 #include <qptrlist.h>
00028 
00029 #include <kparts/mainwindow.h>
00030 #include <kparts/part.h>
00031 #include <kparts/partmanager.h>
00032 #include <kdcopservicestarter.h>
00033 
00034 #include "core.h"
00035 
00036 class KAction;
00037 class KPluginInfo;
00038 class KStatusBarLabel;
00039 class QHBox;
00040 class QSplitter;
00041 class QVBox;
00042 
00043 namespace KPIM
00044 {
00045   class StatusbarProgressWidget;
00046 }
00047 
00048 namespace KParts
00049 {
00050   class InfoExtension;
00051 }
00052 
00053 namespace Kontact
00054 {
00055 
00056 struct InfoExtData
00057 {
00058   QString text;
00059   QPixmap pixmap;
00060 };
00061 
00062 class Plugin;
00063 class SidePaneBase;
00064 class AboutDialog;
00065 class Splash;
00066 
00067 typedef QValueList<Kontact::Plugin*> PluginList;
00068 
00069 class MainWindow : public Kontact::Core, public KDCOPServiceStarter
00070 {
00071   Q_OBJECT
00072 
00073   public:
00074     MainWindow(Splash *splash);
00075     ~MainWindow();
00076 
00077     // KDCOPServiceStarter interface
00078     virtual int startServiceFor( const QString& serviceType,
00079                                  const QString& constraint = QString::null,
00080                                  const QString& preferences = QString::null,
00081                                  QString *error = 0, QCString* dcopService = 0,
00082                                  int flags = 0 );
00083 
00084     virtual PluginList pluginList() const { return mPlugins; }
00085     void activePluginModule( const QString & );
00086   public slots:
00087     virtual void selectPlugin( Kontact::Plugin *plugin );
00088     virtual void selectPlugin( const QString &pluginName );
00089 
00090     void updateConfig();
00091 
00092   signals:
00093     void textChanged( const QString& );
00094     void iconChanged( const QPixmap& );
00095 
00096   protected slots:
00097     void initObject();
00098     void initGUI();
00099     void slotActivePartChanged( KParts::Part *part );
00100     void slotPreferences();
00101     void slotSelectComponents();
00102     void slotNewClicked();
00103     void slotQuit();
00104     void slotShowTip();
00105     void slotRequestFeature();
00106     void slotNewToolbarConfig();
00107     void showAboutDialog();
00108     void slotShowStatusMsg( const QString& );
00109     void activatePluginModule();
00110 
00111   protected:
00112     void initWidgets();
00113 
00114     void loadSettings();
00115     void saveSettings();
00116 
00117     bool isPluginLoaded( const KPluginInfo * );
00118     Kontact::Plugin *pluginFromInfo( const KPluginInfo * );
00119     void loadPlugins();
00120     void unloadPlugins();
00121     bool removePlugin( const KPluginInfo * );
00122     void addPlugin( Kontact::Plugin *plugin );
00123     void partLoaded( Kontact::Plugin *plugin, KParts::Part *part );
00124     void setupActions();
00125     void initHeaderWidget( QVBox *vBox );
00126     void showTip( bool );
00127     virtual bool queryClose ();
00128 
00129   private slots:
00130     void pluginsChanged();
00131     void setHeaderText( const QString& );
00132     void setHeaderPixmap( const QPixmap& );
00133 
00134     void configureShortcuts();
00135     void configureToolbars();
00136 
00137   private:
00138     QWidget *mTopWidget;
00139 
00140     QHBox *mHeaderFrame;
00141     QLabel *mHeaderText;
00142     QLabel *mHeaderPixmap;
00143     QSplitter *mSplitter;
00144 
00145     Splash *mSplash;
00146 
00147     KToolBarPopupAction *mNewActions;
00148     SidePaneBase *mSidePane;
00149     QWidgetStack *mStack;
00150     Plugin *mCurrentPlugin;
00151     KParts::PartManager *mPartManager;
00152     PluginList mPlugins;
00153     PluginList mDelayedPreload;
00154     QValueList<KPluginInfo*> mPluginInfos;
00155     KParts::InfoExtension *mLastInfoExtension;
00156 
00157     QMap<KParts::InfoExtension*, InfoExtData> mInfoExtCache;
00158 
00159     int mSidePaneType;
00160     //QStringList mActivePlugins;
00161 
00162     KStatusBarLabel* mStatusMsgLabel;
00163     KPIM::StatusbarProgressWidget *mLittleProgress;
00164 
00165     QString mActiveModule;
00166 
00167     AboutDialog *mAboutDialog;
00168     bool mReallyClose;
00169 };
00170 
00171 }
00172 
00173 #endif
00174 // vim: sw=2 sts=2 et
KDE Logo
This file is part of the documentation for kontact Library Version 3.3.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Thu Oct 4 14:43:45 2007 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003