kmobiletools
kmobiletools_mainpart.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 Copyright (C) 2007 00003 by Marco Gulino <marco@kmobiletools.org> 00004 by Matthias Lechner <matthias@lmme.de> 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 00018 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00019 Boston, MA 02110-1301, USA. 00020 ***************************************************************************/ 00021 #ifndef _KMOBILETOOLSMAINPART_H_ 00022 #define _KMOBILETOOLSMAINPART_H_ 00023 00024 #include <KParts/Part> 00025 #include <KParts/StatusBarExtension> 00026 #include <KParts/MainWindow> 00027 00028 #include <QVariantList> 00029 #include <QList> 00030 #include <QHash> 00031 #include <QMutex> 00032 #include <QtCore/QModelIndex> 00033 00034 #include "deviceslist.h" 00035 00036 class QStackedWidget; 00037 class QString; 00038 class QTreeWidgetItem; 00039 class QTreeWidget; 00040 class QTreeView; 00041 class QModelIndex; 00042 class DeviceItem; 00043 class ServiceItem; 00044 class DeviceManager; 00045 class KAboutData; 00046 class KSystemTrayIcon; 00047 class ErrorLogDialog; 00048 class DeviceHome; 00049 class ServiceModel; 00050 class QProgressDialog; 00051 class JobSignalMapper; 00052 class JobQueueView; 00053 00054 namespace KMobileTools { 00055 class CoreService; 00056 class homepagePart; 00057 class JobXP; 00058 } 00059 00070 class kmobiletoolsMainPart : public KParts::ReadOnlyPart/*, virtual public MainIFace*/ 00071 { 00072 Q_OBJECT 00073 00074 public: 00078 kmobiletoolsMainPart( QWidget *parentWidget, QObject *parent, 00079 const QVariantList &args= QVariantList() ); 00080 00084 virtual ~kmobiletoolsMainPart(); 00085 00091 static KAboutData *createAboutData(); 00092 00096 bool openFile(); 00097 00098 KSystemTrayIcon * sysTray() { return p_sysTray; } 00099 00100 private Q_SLOTS: 00101 void slotConfigNotify(); 00102 00107 void unloadDeviceActions( const QString& ); 00108 00113 void removeServiceWidget( const QString&, KMobileTools::CoreService* ); 00114 00119 void shutDownSucceeded(); 00120 00125 void slotQuit(); 00126 00130 void slotFinallyQuit(); 00131 00135 void slotAutoLoadDevices(); 00136 00142 void treeItemClicked( const QModelIndex& index ); 00143 00150 void treeViewContextMenu( const QPoint& position ); 00151 00159 void jobEnqueued( const QString& deviceName, KMobileTools::JobXP* job ); 00160 00165 void deviceLoaded( const QString& deviceName ); 00166 00167 private: 00168 void setupGUI( QWidget* parent ); 00169 void setupActions(); 00170 void setupDialogs(); 00171 00177 void handleDeviceItem( DeviceItem* deviceItem ); 00178 00184 void handleServiceItem( ServiceItem* serviceItem ); 00185 00187 QModelIndex m_lastIndex; 00188 00190 QProgressDialog* m_shutDownDialog; 00191 00193 ServiceModel* m_serviceModel; 00194 00196 QMultiHash<QString,QWidget*> m_loadedWidgets; 00197 00198 JobSignalMapper* m_jobSignalMapper; 00199 KStatusBar* m_statusBar; 00200 JobQueueView* m_jobQueueView; 00201 00202 QStackedWidget *m_widget; 00203 QTreeView *m_treeView; 00204 KSystemTrayIcon * p_sysTray; 00205 00206 ErrorLogDialog* m_errorLogDialog; 00207 DeviceManager* m_deviceManager; 00208 00209 QMutex m_mutex; 00210 00211 Q_SIGNALS: 00212 void showServiceToolBar( bool ); 00213 void showDeviceToolBar( bool ); 00214 }; 00215 00216 #endif
KDE 4.2 API Reference