kmail

kmail_part.h

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 TQt, and distribute the resulting executable,
00023     without including the source code for TQt in the source distribution.
00024 */
00025 #ifndef KMail_PART_H
00026 #define KMail_PART_H
00027 
00028 #include "kmailpartIface.h"
00029 
00030 #include <tdeversion.h>
00031 #include <tdeparts/browserextension.h>
00032 #include <tdeparts/statusbarextension.h>
00033 #include <tdeparts/factory.h>
00034 #include <tdeparts/event.h>
00035 #include <tdeparts/part.h>
00036 
00037 #include <tqwidget.h>
00038 #include <tdepimmacros.h>
00039 
00040 class TDEInstance;
00041 class TDEAboutData;
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   
00056   public:
00057     KMailPart(TQWidget *parentWidget, const char *widgetName,
00058               TQObject *parent, const char *name, const TQStringList &);
00059     virtual ~KMailPart();
00060 
00061     TQWidget* parentWidget() const;
00062 
00063     static TDEAboutData *createAboutData();
00064 
00065   public slots:
00066     virtual void save() { /*TODO*/ }
00067     virtual void exit();
00068     virtual void updateEditMenu() {}
00069     void exportFolder( KMFolder* folder );
00070     void slotIconChanged( KMFolderTreeItem *fti );
00071     void slotNameChanged( KMFolderTreeItem *fti );
00072 
00073   signals:
00074     void textChanged( const TQString& );
00075     void iconChanged( const TQPixmap& );
00076 
00077   protected:
00078     virtual bool openFile();
00079     virtual void guiActivateEvent(KParts::GUIActivateEvent *e);
00080 
00081   private:
00082     KMKernel *mKMailKernel;
00083     KMMainWidget *mainWidget;
00084     ActionManager *mActionManager;
00085     KMailStatusBarExtension *mStatusBar;
00086     TQWidget *mParentWidget;
00087 };
00088 
00089 class KMailStatusBarExtension : public KParts::StatusBarExtension
00090 {
00091 public:
00092   KMailStatusBarExtension( KMailPart *parent );
00093 
00094   TDEMainWindow *mainWindow() const;
00095 
00096 private:
00097   KMailPart *mParent;
00098   StatusbarProgressWidget *mLittleProgress;
00099 };
00100 
00101 #endif