00001 /* 00002 * Copyright (C) 2009 - 2011 Nokia Corporation. 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License version 00006 * 2 as published by the Free Software Foundation. 00007 * 00008 * This program is distributed in the hope that it will be useful, but 00009 * WITHOUT ANY WARRANTY; without even the implied warranty of 00010 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00011 * General Public License for more details. 00012 * 00013 * You should have received a copy of the GNU General Public License 00014 * along with this program. If not, see http://www.gnu.org/licenses/. 00015 * 00016 */ 00017 00018 #ifndef PACKAGEMANAGERPENDINGCALLWATCHER_H 00019 #define PACKAGEMANAGERPENDINGCALLWATCHER_H 00020 00021 #include <QString> 00022 #include <QtDBus/QtDBus> 00023 #include "packagemanager.h" 00024 00025 class PackageManager; 00026 00035 class PackageManagerPendingCallWatcher : public QObject 00036 { 00037 Q_OBJECT 00038 00039 public: 00045 PackageManagerPendingCallWatcher( const QString& packageidentifier, QObject * parent = 0 ); 00046 00050 ~PackageManagerPendingCallWatcher(); 00051 00055 QString packageidentifier(); 00056 00060 PackageManager::ErrorCode errorCode(); 00061 00065 QString errorName(); 00066 00070 QString errorMessage(); 00071 00075 bool isFinished(); 00076 00077 public Q_SLOTS: // Move to private class 00078 void callFinished( QDBusPendingCallWatcher* self ); 00079 00080 protected: 00081 QString _packageidentifier; 00082 QString _errorName; 00083 QString _errorMessage; 00084 QDBusError::ErrorType _errorType; 00085 bool isError; 00086 bool finished; 00087 00088 signals: 00089 void callFinished( PackageManagerPendingCallWatcher* watcher ); 00090 void dbusError( PackageManagerPendingCallWatcher* watcher ); 00091 }; 00092 00093 00105 class PackageManagerPendingFetchWatcher : public PackageManagerPendingCallWatcher 00106 { 00107 Q_OBJECT 00108 public: 00114 PackageManagerPendingFetchWatcher( const QString& packageidentifier, QObject * parent = 0 ); 00115 00119 ~PackageManagerPendingFetchWatcher(); 00120 00121 public Q_SLOTS: // Move to private class 00122 void fetchOneFinishedSlot( QDBusPendingCallWatcher* self ); 00123 void fetchManyFinishedSlot( QDBusPendingCallWatcher* self ); 00124 void fetchStringListFinishedSlot( QDBusPendingCallWatcher* self ); 00125 void fetchStringFinishedSlot( QDBusPendingCallWatcher* self ); 00126 00127 signals: 00152 void dataFetched(const QList< QMap<QString, QVariant> >& data); 00153 00162 void dataFetched(const QMap<QString, QVariant>& data); 00163 00171 void dataFetched(const QStringList& fileList); 00172 00182 void dataFetched(const QString& data); 00183 }; 00184 00185 #endif