mainwindow.h
00001 /* 00002 This file is part of Akregator. 00003 00004 Copyright (C) 2004 Stanislav Karchebny <Stanislav.Karchebny@kdemail.net> 00005 00006 This program is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License as published by 00008 the Free Software Foundation; either version 2 of the License, or 00009 (at your option) any later version. 00010 00011 This program is distributed in the hope that it will be useful, 00012 but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 GNU General Public License for more details. 00015 00016 You should have received a copy of the GNU General Public License 00017 along with this program; if not, write to the Free Software 00018 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00019 00020 As a special exception, permission is given to link this program 00021 with any edition of TQt, and distribute the resulting executable, 00022 without including the source code for TQt in the source distribution. 00023 */ 00024 00025 #ifndef _AKREGATOR_H_ 00026 #define _AKREGATOR_H_ 00027 00028 #ifdef HAVE_CONFIG_H 00029 #include <config.h> 00030 #endif 00031 00032 #include <kapplication.h> 00033 #include <kparts/mainwindow.h> 00034 #include <kparts/browserinterface.h> 00035 #include <kparts/browserextension.h> 00036 #include <kio/job.h> 00037 00038 class KActionCollection; 00039 class KToggleAction; 00040 class KSqueezedTextLabel; 00041 class KProgress; 00042 00043 namespace KPIM 00044 { 00045 class StatusbarProgressWidget; 00046 } 00047 00048 namespace Akregator 00049 { 00050 00051 class Part; 00052 class MainWindow; 00053 00054 class BrowserInterface : public KParts::BrowserInterface 00055 { 00056 Q_OBJECT 00057 TQ_OBJECT 00058 00059 public: 00060 BrowserInterface(Akregator::MainWindow *shell, const char *name ); 00061 00062 private: 00063 Akregator::MainWindow *m_shell; 00064 }; 00065 00066 00073 class MainWindow : public KParts::MainWindow 00074 { 00075 Q_OBJECT 00076 TQ_OBJECT 00077 public: 00078 00079 MainWindow(); 00080 virtual ~MainWindow(); 00081 00086 void setupProgressWidgets(); 00087 00088 virtual void setCaption(const TQString &); 00089 00094 bool loadPart(); 00095 00096 public slots: 00097 void slotClearStatusText(); 00098 void slotSetStatusBarText(const TQString &c); 00099 00100 protected: 00105 void saveProperties(KConfig *); 00106 00112 void readProperties(KConfig *); 00116 virtual bool queryExit(); 00117 00121 virtual bool queryClose(); 00122 00123 protected slots: 00124 00125 void slotQuit(); 00126 00127 private: 00128 00129 void setupActions(); 00130 void connectActionCollection(KActionCollection *coll); 00131 00132 KParts::BrowserExtension *browserExtension(KParts::ReadOnlyPart *p); 00133 00134 private slots: 00135 00136 void optionsConfigureKeys(); 00137 void optionsConfigureToolbars(); 00138 00139 void applyNewToolbarConfig(); 00140 00141 private: 00142 BrowserInterface *m_browserIface; 00143 00144 Akregator::Part *m_part; 00145 KPIM::StatusbarProgressWidget *m_progressBar; 00146 KSqueezedTextLabel *m_statusLabel; 00147 }; 00148 00149 } // namespace Akregator 00150 00151 #endif // _AKREGATOR_H_