kpilot/kpilot

kpilot.h

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 slotFastSyncRequested();
00106     void slotFullSyncRequested();
00107     void slotHHtoPCRequested();
00108     void slotPCtoHHRequested();
00109 
00110     void startDaemonIfNeeded();
00111 
00118     void optionsConfigureKeys();
00119     void optionsConfigureToolbars();
00120 
00121 
00122 public:
00126     virtual ASYNC daemonStatus(int);
00127     virtual int kpilotStatus();
00128 
00129 public slots:
00134     virtual ASYNC configure();
00135     virtual ASYNC configureWizard();
00136 
00137 protected:
00138     void readConfig();
00139 
00140 
00144     bool componentPreSync();
00145     void setupSync(int kind,const QString& msg);
00146     void componentPostSync();
00151     void componentUpdate();
00152 
00153     void initIcons();
00154     void initMenu();
00155     void setupWidget();
00156     void initComponents();
00157 
00162     class KPilotPrivate;
00163     KPilotPrivate *fP;
00164 
00165 private:
00166     bool            fQuitAfterCopyComplete; // Used for GUI-less interface
00167     KJanusWidget    *fManagingWidget;
00168     bool fDaemonWasRunning;
00169 
00170     KPilotStatus fAppStatus;
00171 
00172     FileInstallWidget *fFileInstallWidget;
00173     LogWidget *fLogWidget;
00174 
00175     // Used to track if dialog is visible - needed for new DCOP calls
00176     bool fConfigureKPilotDialogInUse;
00177 
00178 
00179 protected slots:
00180     void quit();
00181     void fileInstalled(int which);
00182     void slotNewToolbarConfig();
00183 
00188     void slotResetLink();
00189 
00199     void slotSelectComponent( PilotComponent *c );
00200     void slotAboutToShowComponent( QWidget *c );
00201 
00206     void initializeComponents();
00207 
00208 signals:
00209     void modeSelected(int selected);
00210 };
00211 
00212 
00213 
00214 
00215 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys