kitchensync

kitchensync.h

00001 /*
00002     This file is part of KitchenSync.
00003 
00004     Copyright (c) 2002 Holger Freyther <zecke@handhelds.org>
00005     Copyright (c) 2002 Maximilian Reiß <harlekin@handhelds.org>
00006     Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
00007 
00008     This library is free software; you can redistribute it and/or
00009     modify it under the terms of the GNU Library General Public
00010     License as published by the Free Software Foundation; either
00011     version 2 of the License, or (at your option) any later version.
00012 
00013     This library is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00016     Library General Public License for more details.
00017 
00018     You should have received a copy of the GNU Library General Public License
00019     along with this library; see the file COPYING.LIB.  If not, write to
00020     the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00021     Boston, MA 02110-1301, USA.
00022 */
00023 #ifndef KSYNC_KITCHENSYNC_H
00024 #define KSYNC_KITCHENSYNC_H
00025 
00026 #include "actionpart.h"
00027 #include "profilemanager.h"
00028 #include "actionpartservice.h"
00029 #include "core.h"
00030 #include "systemtray.h"
00031 
00032 #include <kdebug.h>
00033 #include <kparts/mainwindow.h>
00034 
00035 #include <qptrlist.h>
00036 #include <qmap.h>
00037 
00038 class QHBox;
00039 class QWidgetStack;
00040 class KSelectAction;
00041 
00042 namespace KSync {
00043 
00044 class PartBar;
00045 class KonnectorBar;
00046 class MainWindow;
00047 class ActionManager;
00048 class Engine;
00049 
00055 class KDE_EXPORT KitchenSync : public Core
00056 {
00057     Q_OBJECT
00058   public:
00064     KitchenSync( ActionManager *actionManager, QWidget *parent );
00065     ~KitchenSync();
00066 
00067     void readProfileConfig();
00068     void writeProfileConfig();
00069 
00073     QWidget *widgetStack();
00074 
00078     KSyncSystemTray *tray();
00079 
00083     Profile currentProfile() const;
00084 
00088     // FIXME make const pointer to const object
00089     ProfileManager *profileManager() const;
00090 
00091     Engine *engine() const;
00092 
00096     SyncUi *syncUi();
00097 
00101     const QPtrList<ActionPart> parts() const;
00102 
00103   public slots:
00104     void initProfiles();
00108     void activateProfile();
00109 
00110   private:
00111     void addPart( const ActionPartService & );
00112     void initSystray ( void );
00113 
00114   private slots:
00118     void initProfileList();
00119     void activateProfile( const Profile &prof );
00123     void configureProfiles();
00124     void configureCurrentProfile();
00125     void slotSync();
00126     void slotActivated( ActionPart * );
00127     void slotKonnectorBar( bool );
00128 
00129     void slotPreferences();
00130     void updateConfig();
00131 
00132     /* slots for the KonnectorManager */
00133   private slots:
00134     /* slots for the ActionParts */
00135     void slotPartProg( ActionPart *, int );
00136     void slotPartSyncStatus( ActionPart *, int );
00137 
00138   private:
00139     ActionManager *mActionManager;
00140 
00141     PartBar *m_bar;
00142     QWidgetStack *m_stack;
00143     // loaded parts
00144     QPtrList<ActionPart> m_parts;
00145     QPtrListIterator<ActionPart> *m_partsIt;
00146     bool m_isSyncing;
00147 
00148     KSyncSystemTray *m_tray;
00149 
00150     ProfileManager *m_profileManager;
00151     SyncUi *m_syncUi;
00152 
00153     Engine *mEngine;
00154     QMap<ActionPart *, QWidget *> mActionWidgetMap;
00155 };
00156 
00157 }
00158 
00159 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys