/usr/include/PackageKit/packagekit-qt2/daemon.h is in libpackagekit-qt2-dev 0.7.2-4ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 | /*
* This file is part of the QPackageKit project
* Copyright (C) 2008 Adrien Bustany <madcat@mymadcat.com>
* Copyright (C) 2010-2011 Daniel Nicoletti <dantti85-pk@yahoo.com.br>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#ifndef PACKAGEKIT_DAEMON_H
#define PACKAGEKIT_DAEMON_H
#include <QtCore/QObject>
#include "package.h"
#include "transaction.h"
namespace PackageKit {
/**
* \class Daemon daemon.h Daemon
* \author Adrien Bustany \e <madcat@mymadcat.com>
* \author Daniel Nicoletti \e <dantti85-pk@yahoo.com.br>
*
* \brief Base class used to interact with the PackageKit daemon
*
* This class holds all the functions enabling the user to interact with the PackageKit daemon.
*
* Most methods are static so that you can just call Daemon::backendName() to get the name of the backend.
*
* This class is a singleton, its constructor is private. Call Daemon::global() to get
* an instance of the Daemon object, you only need Daemon::global() when connecting to the signals
* of this class.
*/
class DaemonPrivate;
class Daemon : public QObject
{
Q_OBJECT
Q_ENUMS(Network)
Q_ENUMS(Authorize)
public:
/**
* Describes the current network state
*/
typedef enum {
UnknownNetwork,
NetworkOffline,
NetworkOnline,
NetworkWired,
NetworkWifi,
NetworkMobile
} Network;
/**
* Describes the authorization result
* \sa canAuthorize()
*/
typedef enum {
UnknownAuthorize,
AuthorizeYes,
AuthorizeNo,
AuthorizeInteractive
} Authorize;
/**
* \brief Returns an instance of the Daemon
*
* The Daemon class is a singleton, you can call this method several times,
* a single Daemon object will exist.
* Use this only when connecting to this class signals
*/
static Daemon* global();
/**
* Destructor
*/
~Daemon();
/**
* Returns all the actions supported by the current backend
*/
static Transaction::Roles actions();
/**
* The backend name, e.g. "yum".
*/
static QString backendName();
/**
* The backend description, e.g. "Yellow Dog Update Modifier".
*/
static QString backendDescription();
/**
* The backend author, e.g. "Joe Bloggs <joe@blogs.com>"
*/
static QString backendAuthor();
/**
* Returns the package filters supported by the current backend
*/
static Transaction::Filters filters();
/**
* Returns the package groups supported by the current backend
*/
static Package::Groups groups();
/**
* Set when the backend is locked and native tools would fail.
*/
static bool locked();
/**
* Returns a list containing the MIME types supported by the current backend
*/
static QStringList mimeTypes();
/**
* Returns the current network state
*/
static Daemon::Network networkState();
/**
* The distribution identifier in the
* distro;version;arch form,
* e.g. "debian;squeeze/sid;x86_64".
*/
static QString distroId();
/**
* Allows a client to find out if it would be allowed to authorize an action.
* The action ID, e.g. org.freedesktop.packagekit.system-network-proxy-configure
* specified in \p actionId
* Returm might be either yes, no or interactive \sa Authorize.
*/
static Daemon::Authorize canAuthorize(const QString &actionId);
/**
* Returns the time (in seconds) since the specified \p action
*/
static uint getTimeSinceAction(Transaction::Role action);
/**
* \brief creates a new transaction path
*
* This function register a new DBus path on PackageKit
* allowing a \c Transaction object to be created.
*
* \note Unless you want to know the transaction id
* before creating the \c Transaction object this function
* is not useful as simply creating a \c Transaction object will
* automatically create this path.
*/
static QString getTid();
/**
* Returns the list of current transactions
*/
static QStringList getTransactions();
/**
* Convenience function
* Returns the list of current transactions as \c Transaction objects
*
* You must delete these yourself or pass a
* \p parent for these comming transactions
*/
static QList<Transaction*> getTransactionsObj(QObject *parent = 0);
/**
* \brief Sets a global hints for all the transactions to be created
*
* This method allows the calling session to set transaction \p hints for
* the package manager which can change as the transaction runs.
*
* This method can be sent before the transaction has been run
* (by using Daemon::setHints) or whilst it is running
* (by using Transaction::setHints).
* There is no limit to the number of times this
* method can be sent, although some backends may only use the values
* that were set before the transaction was started.
*
* The \p hints can be filled with entries like these
* ('locale=en_GB.utf8','idle=true','interactive=false').
*
* \sa Transaction::setHints
*/
static void setHints(const QStringList &hints);
/**
* Convenience function to set global hints
* \sa setHints(const QStringList &hints)
*/
static void setHints(const QString &hints);
/**
* This method returns the current hints
*/
static QStringList hints();
/**
* Sets a proxy to be used for all the network operations
*/
static Transaction::InternalError setProxy(const QString &http_proxy, const QString &ftp_proxy);
/**
* Sets a proxy to be used for all the network operations
*/
static Transaction::InternalError setProxy(const QString &http_proxy, const QString &https_proxy, const QString &ftp_proxy, const QString &socks_proxy, const QString &no_proxy, const QString &pac);
/**
* \brief Tells the daemon that the system state has changed, to make it reload its cache
*
* \p reason can be resume or posttrans
*/
static void stateHasChanged(const QString &reason);
/**
* Asks PackageKit to quit, for example to let a native package manager operate
*/
static void suggestDaemonQuit();
/**
* Returns the major version number.
*/
static uint versionMajor();
/**
* The minor version number.
*/
static uint versionMinor();
/**
* The micro version number.
*/
static uint versionMicro();
Q_SIGNALS:
/**
* This signal is emitted when a property on the interface changes.
*/
void changed();
/**
* Emitted when the list of repositories changes
*/
void repoListChanged();
/**
* Emmitted when a restart is scheduled
*/
void restartScheduled();
/**
* \brief Emitted when the current transactions list changes.
*
* \note This is mostly useful for monitoring the daemon's state.
*/
void transactionListChanged(const QStringList &tids);
/**
* Emitted when new updates are available
*/
void updatesChanged();
/**
* Emitted when the daemon quits
*/
void daemonQuit();
protected:
DaemonPrivate * const d_ptr;
private:
Q_DECLARE_PRIVATE(Daemon);
Q_PRIVATE_SLOT(d_ptr, void serviceUnregistered());
Daemon(QObject *parent = 0);
static Daemon *m_global;
};
} // End namespace PackageKit
#endif
|