Diffstat (limited to 'noncore/settings/packagemanager/opackagemanager.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/opackagemanager.h | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/noncore/settings/packagemanager/opackagemanager.h b/noncore/settings/packagemanager/opackagemanager.h new file mode 100644 index 0000000..5e1a30a --- a/dev/null +++ b/noncore/settings/packagemanager/opackagemanager.h | |||
@@ -0,0 +1,91 @@ | |||
1 | /* | ||
2 | This file is part of the Opie Project | ||
3 | |||
4 | Copyright (c) 2003 Dan Williams <drw@handhelds.org> | ||
5 | =. | ||
6 | .=l. | ||
7 | .>+-= | ||
8 | _;:, .> :=|. This program is free software; you can | ||
9 | .> <`_, > . <= redistribute it and/or modify it under | ||
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | ||
11 | .="- .-=="i, .._ License as published by the Free Software | ||
12 | - . .-<_> .<> Foundation; either version 2 of the License, | ||
13 | ._= =} : or (at your option) any later version. | ||
14 | .%`+i> _;_. | ||
15 | .i_,=:_. -<s. This program is distributed in the hope that | ||
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | ||
17 | : .. .:, . . . without even the implied warranty of | ||
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | ||
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | ||
20 | ..}^=.= = ; Library General Public License for more | ||
21 | ++= -. .` .: details. | ||
22 | : = ...= . :.=- | ||
23 | -. .:....=;==+<; You should have received a copy of the GNU | ||
24 | -_. . . )=. = Library General Public License along with | ||
25 | -- :-=` this library; see the file COPYING.LIB. | ||
26 | If not, write to the Free Software Foundation, | ||
27 | Inc., 59 Temple Place - Suite 330, | ||
28 | Boston, MA 02111-1307, USA. | ||
29 | |||
30 | */ | ||
31 | |||
32 | #ifndef OPACKAGEMANAGER_H | ||
33 | #define OPACKAGEMANAGER_H | ||
34 | |||
35 | #include <qdict.h> | ||
36 | #include <qobject.h> | ||
37 | #include <qstringlist.h> | ||
38 | |||
39 | #include <qpe/config.h> | ||
40 | |||
41 | #include "oipkg.h" | ||
42 | |||
43 | class OPackageManager : public QObject | ||
44 | { | ||
45 | Q_OBJECT | ||
46 | |||
47 | public: | ||
48 | OPackageManager( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 ); | ||
49 | |||
50 | void loadAvailablePackages(); | ||
51 | void loadInstalledPackages(); | ||
52 | |||
53 | enum Status { All, NotInstalled, Installed, Updated, NotDefined }; | ||
54 | |||
55 | OPackageList *packages(); | ||
56 | OPackageList *filterPackages( const QString &name = 0x0,const QString &server = 0x0, | ||
57 | const QString &destination = 0x0, Status status = NotDefined, | ||
58 | const QString &category = 0x0 ); | ||
59 | |||
60 | const QStringList &categories() { return m_categories; } | ||
61 | QStringList *servers(); | ||
62 | QStringList *destinations(); | ||
63 | |||
64 | int compareVersions( const QString &version1, const QString &version2 ); | ||
65 | |||
66 | OConfItem *findConfItem( OConfItem::Type type = OConfItem::NotDefined, | ||
67 | const QString &name = QString::null ); | ||
68 | OPackage *findPackage( const QString &name = QString::null ); | ||
69 | |||
70 | bool configureDlg( bool installOptions = false ); | ||
71 | void saveSettings(); | ||
72 | |||
73 | bool executeCommand( OPackage::Command command = OPackage::NotDefined, QStringList *parameters = 0x0, | ||
74 | const QString &destination = QString::null, const QObject *receiver = 0x0, | ||
75 | const char *slotOutput = 0x0, const char *slotErrors = 0x0, | ||
76 | const char *slotFinished = 0x0, bool rawOutput = true ); | ||
77 | void abortCommand(); | ||
78 | |||
79 | private: | ||
80 | Config *m_config; // Pointer to application configuration file | ||
81 | OIpkg m_ipkg; // OIpkg object to retrieve package/configuration information | ||
82 | QDict<OPackage> m_packages; // Global list of available packages | ||
83 | QStringList m_categories; // List of all categories | ||
84 | |||
85 | signals: | ||
86 | void initStatus( int numSteps ); | ||
87 | void statusText( const QString &status ); | ||
88 | void statusBar( int currStep ); | ||
89 | }; | ||
90 | |||
91 | #endif | ||