core.h
00001 // -*- Mode: C++; c-basic-offset: 2; indent-tabs-mode: nil; -*- 00022 #ifndef KOMPOSER_CORE_H 00023 #define KOMPOSER_CORE_H 00024 00025 #include "komposerIface.h" 00026 00027 #include <kmainwindow.h> 00028 #include <tqptrlist.h> 00029 00030 namespace KSettings { 00031 class Dialog; 00032 } 00033 class TQWidgetStack; 00034 00035 namespace Komposer 00036 { 00037 00038 class Editor; 00039 class Plugin; 00040 class PluginManager; 00041 00045 class Core : public KMainWindow, virtual public KomposerIface 00046 { 00047 Q_OBJECT 00048 TQ_OBJECT 00049 public: 00050 Core( TQWidget *parentWidget = 0, const char *name = 0 ); 00051 virtual ~Core(); 00052 00053 public slots: 00054 virtual void send( int how ); 00055 virtual void addAttachment( const KURL &url, const TQString &comment ); 00056 virtual void setBody( const TQString &body ); 00057 virtual void addAttachment( const TQString &name, 00058 const TQCString &cte, 00059 const TQByteArray &data, 00060 const TQCString &type, 00061 const TQCString &subType, 00062 const TQCString ¶mAttr, 00063 const TQString ¶mValue, 00064 const TQCString &contDisp ); 00065 00066 00067 00068 protected slots: 00069 //void slotActivePartChanged( KParts::Part *part ); 00070 void slotPluginLoaded( Plugin* ); 00071 void slotAllPluginsLoaded(); 00072 void slotPreferences(); 00073 void slotQuit(); 00074 void slotClose(); 00075 00076 void slotSendNow(); 00077 void slotSendLater(); 00078 void slotSaveDraft(); 00079 void slotInsertFile(); 00080 void slotAddrBook(); 00081 void slotNewComposer(); 00082 void slotAttachFile(); 00083 00084 protected: 00085 virtual void initWidgets(); 00086 void initCore(); 00087 void initConnections(); 00088 void loadSettings(); 00089 void saveSettings(); 00090 void createActions(); 00091 00092 void addEditor( Komposer::Editor *editor ); 00093 void addPlugin( Komposer::Plugin *plugin ); 00094 00095 private: 00096 TQWidgetStack *m_stack; 00097 Editor *m_currentEditor; 00098 PluginManager *m_pluginManager; 00099 00100 KSettings::Dialog *m_dlg; 00101 00102 class Private; 00103 Private *d; 00104 }; 00105 00106 } 00107 00108 #endif