Home · All Namespaces · All Classes |
00001 /*************************************************************************** 00002 ** 00003 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 00004 ** All rights reserved. 00005 ** Contact: Nokia Corporation (directui@nokia.com) 00006 ** 00007 ** This file is part of mhome. 00008 ** 00009 ** If you have questions regarding the use of this file, please contact 00010 ** Nokia at directui@nokia.com. 00011 ** 00012 ** This library is free software; you can redistribute it and/or 00013 ** modify it under the terms of the GNU Lesser General Public 00014 ** License version 2.1 as published by the Free Software Foundation 00015 ** and appearing in the file LICENSE.LGPL included in the packaging 00016 ** of this file. 00017 ** 00018 ****************************************************************************/ 00019 00020 #ifndef APPLICATIONPACKAGEMONITOR_H 00021 #define APPLICATIONPACKAGEMONITOR_H 00022 00023 #include <QObject> 00024 #include <QDBusConnection> 00025 #include <QSharedPointer> 00026 00027 #include "extradirwatcher.h" 00028 00037 class ApplicationPackageMonitor : public QObject 00038 { 00039 Q_OBJECT 00040 public: 00044 ApplicationPackageMonitor(); 00048 virtual ~ApplicationPackageMonitor(); 00049 00055 void updatePackageStates(); 00056 00058 static const QString INSTALLER_EXTRA_FOLDER; 00059 00066 QString packageName(const QString &dekstopEntryPath); 00067 00068 signals: 00078 void downloadProgress(const QString &packageExtraPath, const QString &packageName, int bytesLoaded, int bytesTotal, bool packageRemovable); 00087 void installProgress(const QString &packageExtraPath, const QString &packageName, int percentage, bool packageRemovable); 00095 void operationSuccess(const QString &packageExtraPath, const QString &packageName, bool packageRemovable); 00104 void operationError(const QString &packageExtraPath, const QString &packageName, const QString& error, bool packageRemovable); 00105 00111 void installExtraEntryRemoved(const QString &desktopEntryPath); 00112 00119 void updatePackageName(const QString &desktopEntryPath, const QString &packageName); 00120 00128 void packageUninstall(const QString &desktopEntryPath, const QString &packageName, bool packageRemovable); 00129 00130 private slots: 00134 void packageDownloadProgress(const QString& operation, const QString& packageName, const QString& packageVersion, int already, int total); 00138 void packageOperationStarted(const QString& operation, const QString& packageName, const QString& packageVersion); 00142 void packageOperationProgress(const QString& operation, const QString& packageame, const QString& packageVersion, int percentage); 00146 void packageOperationComplete(const QString& operation, const QString& packageName, const QString& packageVersion, const QString& error, bool need_reboot); 00147 00151 void updatePackageState(const QString &desktopEntryPath); 00152 00157 void packageRemoved(const QString &desktopEntryPath); 00158 00159 private: 00160 00167 bool isValidOperation(const QString &desktopEntryPath, const QString &operation); 00168 00170 QDBusConnection con; 00171 00176 ExtraDirWatcherData *dataStore; 00177 00181 QSharedPointer<ExtraDirWatcher> extraDirWatcher; 00182 00188 bool isPackageRemovable(const QString &desktopEntryPath); 00189 00190 #ifdef UNIT_TEST 00191 friend class Ut_ApplicationPackageMonitor; 00192 #endif 00193 00194 }; 00195 00196 #endif
Copyright © 2011 Nokia Corporation | Generated on Thu Jul 7 2011 22:14:50 Doxygen 1.7.1 |
MeeGo Touch |