kpilot
kpilot.h
Go to the documentation of this file.00001 #ifndef _KPILOT_KPILOT_H 00002 #define _KPILOT_KPILOT_H 00003 /* kpilot.h KPilot 00004 ** 00005 ** Copyright (C) 1998-2001 by Dan Pilone 00006 ** Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> 00007 ** 00008 ** This is the main program in KPilot. 00009 */ 00010 00011 /* 00012 ** This program is free software; you can redistribute it and/or modify 00013 ** it under the terms of the GNU General Public License as published by 00014 ** the Free Software Foundation; either version 2 of the License, or 00015 ** (at your option) any later version. 00016 ** 00017 ** This program is distributed in the hope that it will be useful, 00018 ** but WITHOUT ANY WARRANTY; without even the implied warranty of 00019 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00020 ** GNU General Public License for more details. 00021 ** 00022 ** You should have received a copy of the GNU General Public License 00023 ** along with this program in a file called COPYING; if not, write to 00024 ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 00025 ** MA 02110-1301, USA. 00026 */ 00027 00028 /* 00029 ** Bug reports and questions can be sent to kde-pim@kde.org 00030 */ 00031 00032 #include <kmainwindow.h> 00033 00034 00035 class QPopupMenu; 00036 class QComboBox; 00037 class KAction; 00038 class KProgress; 00039 class KJanusWidget; 00040 00041 class PilotDaemonDCOP_stub; 00042 class PilotComponent; 00043 class FileInstallWidget; 00044 class LogWidget; 00045 00046 00047 #include "kpilotDCOP.h" 00048 00049 00050 00051 class KPilotInstaller : public KMainWindow, public KPilotDCOP 00052 { 00053 Q_OBJECT 00054 00055 public: 00056 KPilotInstaller(); 00057 KPilotInstaller(QStrList& fileList); 00058 ~KPilotInstaller(); 00059 00066 static const char *version(int kind); 00067 00068 00069 // Adds 'name' to the pull down menu of components 00070 void addComponentPage(PilotComponent *, const QString &name); 00071 00072 00073 KPilotStatus status() const { return fAppStatus; } ; 00074 00075 00076 protected: 00077 void closeEvent(QCloseEvent *e); 00078 KJanusWidget *getManagingWidget() { return fManagingWidget; } 00079 00084 protected: 00085 PilotDaemonDCOP_stub &getDaemon() { return *fDaemonStub; } ; 00086 private: 00087 PilotDaemonDCOP_stub *fDaemonStub; 00088 00094 protected: 00095 void killDaemonIfNeeded(); 00096 00097 public slots: 00102 void slotRestoreRequested(); 00103 void slotBackupRequested(); 00104 void slotHotSyncRequested(); 00105 void slotFullSyncRequested(); 00106 void slotHHtoPCRequested(); 00107 void slotPCtoHHRequested(); 00108 00109 void startDaemonIfNeeded(); 00110 00117 void optionsConfigureKeys(); 00118 void optionsConfigureToolbars(); 00119 00120 00121 public: 00125 virtual ASYNC daemonStatus(int); 00126 virtual int kpilotStatus(); 00127 00128 public slots: 00133 virtual ASYNC configure(); 00134 virtual ASYNC configureWizard(); 00135 00136 protected: 00137 void readConfig(); 00138 00139 00143 bool componentPreSync(); 00144 void setupSync(int kind,const QString& msg); 00145 void componentPostSync(); 00150 void componentUpdate(); 00151 00152 void initIcons(); 00153 void initMenu(); 00154 void setupWidget(); 00155 void initComponents(); 00156 00161 class KPilotPrivate; 00162 KPilotPrivate *fP; 00163 00164 private: 00165 bool fQuitAfterCopyComplete; // Used for GUI-less interface 00166 KJanusWidget *fManagingWidget; 00167 bool fDaemonWasRunning; 00168 00169 KPilotStatus fAppStatus; 00170 00171 FileInstallWidget *fFileInstallWidget; 00172 LogWidget *fLogWidget; 00173 00174 // Used to track if dialog is visible - needed for new DCOP calls 00175 bool fConfigureKPilotDialogInUse; 00176 00177 00178 protected slots: 00179 void quit(); 00180 void fileInstalled(int which); 00181 void slotNewToolbarConfig(); 00182 00187 void slotResetLink(); 00188 00198 void slotSelectComponent( PilotComponent *c ); 00199 void slotAboutToShowComponent( QWidget *c ); 00200 00205 void initializeComponents(); 00206 00207 signals: 00208 void modeSelected(int selected); 00209 }; 00210 00211 00212 00213 00214 #endif