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 QHBox; 00039 class QSplitter; 00040 class QVBox; 00041 00042 namespace KParts 00043 { 00044 class InfoExtension; 00045 } 00046 00047 namespace Kontact 00048 { 00049 00050 struct InfoExtData 00051 { 00052 QString text; 00053 QPixmap pixmap; 00054 }; 00055 00056 class Plugin; 00057 class SidePaneBase; 00058 class AboutDialog; 00059 00060 class MainWindow : public Kontact::Core, public KDCOPServiceStarter 00061 { 00062 Q_OBJECT 00063 00064 public: 00065 MainWindow(); 00066 ~MainWindow(); 00067 00068 // KDCOPServiceStarter interface 00069 virtual int startServiceFor( const QString& serviceType, 00070 const QString& constraint = QString::null, 00071 const QString& preferences = QString::null, 00072 QString *error = 0, QCString* dcopService = 0, 00073 int flags = 0 ); 00074 00075 virtual QValueList<Kontact::Plugin*> pluginList() const { return mPlugins; } 00076 00077 public slots: 00078 virtual void selectPlugin( Kontact::Plugin *plugin ); 00079 virtual void selectPlugin( const QString &pluginName ); 00080 00081 void updateConfig(); 00082 00083 signals: 00084 void textChanged( const QString& ); 00085 void iconChanged( const QPixmap& ); 00086 00087 protected slots: 00088 void slotActivePartChanged( KParts::Part *part ); 00089 void slotPreferences(); 00090 void slotNewClicked(); 00091 void slotQuit(); 00092 void slotShowTip(); 00093 void slotNewToolbarConfig(); 00094 void showAboutDialog(); 00095 00096 protected: 00097 void initWidgets(); 00098 00099 void loadSettings(); 00100 void saveSettings(); 00101 00102 bool isPluginLoaded( const KPluginInfo * ); 00103 Kontact::Plugin *pluginFromInfo( const KPluginInfo * ); 00104 void loadPlugins(); 00105 void unloadPlugins(); 00106 bool removePlugin( const KPluginInfo * ); 00107 void addPlugin( Kontact::Plugin *plugin ); 00108 void partLoaded( Kontact::Plugin *plugin, KParts::Part *part ); 00109 void setupActions(); 00110 void initHeaderWidget( QVBox *vBox ); 00111 void showTip( bool ); 00112 00113 private slots: 00114 void pluginsChanged(); 00115 void setHeaderText( const QString& ); 00116 void setHeaderPixmap( const QPixmap& ); 00117 00118 void configureShortcuts(); 00119 void configureToolbars(); 00120 00121 private: 00122 QWidget *mTopWidget; 00123 00124 QHBox *mHeaderFrame; 00125 QLabel *mHeaderText; 00126 QLabel *mHeaderPixmap; 00127 QSplitter *mSplitter; 00128 00129 KToolBarPopupAction *mNewActions; 00130 SidePaneBase *mSidePane; 00131 QWidgetStack *mStack; 00132 Plugin *mCurrentPlugin; 00133 KParts::PartManager *mPartManager; 00134 typedef QValueList<Kontact::Plugin*> PluginList; 00135 PluginList mPlugins; 00136 PluginList mDelayedPreload; 00137 QValueList<KPluginInfo*> mPluginInfos; 00138 KParts::InfoExtension *mLastInfoExtension; 00139 00140 QMap<KParts::InfoExtension*, InfoExtData> mInfoExtCache; 00141 00142 int mSidePaneType; 00143 //QStringList mActivePlugins; 00144 00145 AboutDialog *mAboutDialog; 00146 }; 00147 00148 } 00149 00150 #endif 00151 // vim: sw=2 sts=2 et
KDE Logo
This file is part of the documentation for kontact Library Version 3.2.2.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Wed Jul 28 23:58:15 2004 by doxygen 1.3.7 written by Dimitri van Heesch, © 1997-2003