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
|
/***************************************************************************
* Copyright (C) 2003 by Sylvain Joyeux *
* [email protected] *
* *
* 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 <tqobject.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 TQObject
{
Q_OBJECT
TQ_OBJECT
public:
PackageManager(TQObject *tqparent = 0, const char *name = 0);
virtual ~PackageManager();
virtual bool search(const TQString& file);
virtual bool list(const TQString& 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 TQString getOnlineForm();
virtual TQString getOnlineURL(const TQString& query, const TQMap<TQString, TQString>& 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 TQString& tag, const TQString& value);
};
#endif
|