kmail

kmail_part.h

Go to the documentation of this file.
00001 /*
00002     This file is part of KMail.
00003     Copyright (c) 2002-2003 Don Sanders <sanders@kde.org>,
00004     Copyright (c) 2003      Zack Rusin  <zack@kde.org>,
00005     Based on the work of Cornelius Schumacher <schumacher@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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020 
00021     As a special exception, permission is given to link this program
00022     with any edition of Qt, and distribute the resulting executable,
00023     without including the source code for Qt in the source distribution.
00024 */
00025 #ifndef KMail_PART_H
00026 #define KMail_PART_H
00027 
00028 #include "kmailpartIface.h"
00029 
00030 #include <kdeversion.h>
00031 #include <kparts/browserextension.h>
00032 #include <kparts/statusbarextension.h>
00033 #include <kparts/factory.h>
00034 #include <kparts/event.h>
00035 #include <kparts/part.h>
00036 
00037 #include <qwidget.h>
00038 #include <kdepimmacros.h>
00039 
00040 class KInstance;
00041 class KAboutData;
00042 class KMailStatusBarExtension;
00043 class KMKernel;
00044 class KMMainWidget;
00045 namespace KPIM { class StatusbarProgressWidget; }
00046 using KPIM::StatusbarProgressWidget;
00047 class KMFolder;
00048 class KMFolderTreeItem;
00049 
00050 class ActionManager;
00051 
00052 class KDE_EXPORT KMailPart: public KParts::ReadOnlyPart, virtual public KMailPartIface
00053 {
00054     Q_OBJECT
00055   public:
00056     KMailPart(QWidget *parentWidget, const char *widgetName,
00057               QObject *parent, const char *name, const QStringList &);
00058     virtual ~KMailPart();
00059 
00060     QWidget* parentWidget() const;
00061 
00062     static KAboutData *createAboutData();
00063 
00064   public slots:
00065     virtual void save() { /*TODO*/ }
00066     virtual void exit();
00067     virtual void updateEditMenu() {}
00068     void exportFolder( KMFolder* folder );
00069     void slotIconChanged( KMFolderTreeItem *fti );
00070     void slotNameChanged( KMFolderTreeItem *fti );
00071 
00072   signals:
00073     void textChanged( const QString& );
00074     void iconChanged( const QPixmap& );
00075 
00076   protected:
00077     virtual bool openFile();
00078     virtual void guiActivateEvent(KParts::GUIActivateEvent *e);
00079 
00080   private:
00081     KMKernel *mKMailKernel;
00082     KMMainWidget *mainWidget;
00083     ActionManager *mActionManager;
00084     KMailStatusBarExtension *mStatusBar;
00085     QWidget *mParentWidget;
00086 };
00087 
00088 class KMailStatusBarExtension : public KParts::StatusBarExtension
00089 {
00090 public:
00091   KMailStatusBarExtension( KMailPart *parent );
00092 
00093   KMainWindow *mainWindow() const;
00094 
00095 private:
00096   KMailPart *mParent;
00097   StatusbarProgressWidget *mLittleProgress;
00098 };
00099 
00100 #endif