summaryrefslogtreecommitdiffstats
path: root/src/packagemanager.h
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-10 20:23:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-02-10 20:23:29 +0000
commitea4406b4779306f4d0c65f0619cd8241bbdcef7b (patch)
treea63d24ddd768559eb993d9bb847acbc3750ef261 /src/packagemanager.h
downloadtdeio-apt-ea4406b4779306f4d0c65f0619cd8241bbdcef7b.tar.gz
tdeio-apt-ea4406b4779306f4d0c65f0619cd8241bbdcef7b.zip
Added abandoned version of kio-apt
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kio-apt@1088432 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/packagemanager.h')
-rw-r--r--src/packagemanager.h76
1 files changed, 76 insertions, 0 deletions
diff --git a/src/packagemanager.h b/src/packagemanager.h
new file mode 100644
index 0000000..6d8d771
--- /dev/null
+++ b/src/packagemanager.h
@@ -0,0 +1,76 @@
+/***************************************************************************
+ * Copyright (C) 2003 by Sylvain Joyeux *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ ***************************************************************************/
+#ifndef PACKAGEMANAGER_H
+#define PACKAGEMANAGER_H
+
+#include <qobject.h>
+
+/** Base class for accessing package-manager specific
+ * functionalities. ATM, it supports listing files in a
+ * package and searching the package which owns a file.
+ *
+ * Support for online-search support is also included.
+ *
+ * @author Sylvain Joyeux
+ */
+
+class PackageManager : public QObject
+{
+ Q_OBJECT
+public:
+ PackageManager(QObject *parent = 0, const char *name = 0);
+ virtual ~PackageManager();
+
+ virtual bool search(const QString& file);
+ virtual bool list(const QString& package);
+
+ /** Checks what the package manager is capable of.
+ * The \c cap parameter should be a or of exactly
+ * one function (SEARCH, LIST, ...) and one access
+ * (ONLINE, OFFLINE).
+ * The function returns NOT_SUPPORTED if the specified query is not
+ * supported. Otherwise, it returns cap with some
+ * restrictions (EXHAUSTIVE, INSTALLED_ONLY, ...) if
+ * they apply
+ *
+ * INSTALLED_ONLY meaning changes with the function considered.
+ * With SEARCH_FILE, it means that SEARCH_FILE only finds
+ * installed files. With LIST_FILES, it means that listing the
+ * files of a package is possible only if the package is already
+ * installed */
+ virtual int capabilities(int query) const;
+
+ virtual QString getOnlineForm();
+ virtual QString getOnlineURL(const QString& query, const QMap<QString, QString>& options);
+
+ enum Capabilities
+ {
+ NOT_SUPPORTED = 0,
+
+ SEARCH_FILE = 0x01,
+ LIST_FILES = 0x02,
+ SHOW = 0x04,
+ OFFLINE = 0x10,
+ ONLINE = 0x20,
+
+ INSTALLED_ONLY = 0x200
+ };
+
+signals:
+ /** Tags:
+ * warning (warning text)
+ * error (error text)
+ * file (file_name) [for dpkg]
+ * end
+ */
+ void token(const QString& tag, const QString& value);
+};
+
+#endif