Diffstat (limited to 'noncore/settings/packagemanager/oipkg.h') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oipkg.h | 100 |
1 files changed, 100 insertions, 0 deletions
diff --git a/noncore/settings/packagemanager/oipkg.h b/noncore/settings/packagemanager/oipkg.h new file mode 100644 index 0000000..4065f48 --- a/dev/null +++ b/noncore/settings/packagemanager/oipkg.h | |||
@@ -0,0 +1,100 @@ | |||
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 OIPKG_H | ||
33 | #define OIPKG_H | ||
34 | |||
35 | #include <qobject.h> | ||
36 | |||
37 | #include <qpe/config.h> | ||
38 | |||
39 | #include "oconfitem.h" | ||
40 | #include "opackage.h" | ||
41 | |||
42 | // Ipkg execution options (m_ipkgExecOptions) | ||
43 | #define FORCE_DEPENDS 0x0001 | ||
44 | #define FORCE_REMOVE 0x0002 | ||
45 | #define FORCE_REINSTALL 0x0004 | ||
46 | #define FORCE_OVERWRITE 0x0008 | ||
47 | |||
48 | class OConfItemList; | ||
49 | class OProcess; | ||
50 | |||
51 | class OIpkg : public QObject | ||
52 | { | ||
53 | Q_OBJECT | ||
54 | |||
55 | public: | ||
56 | OIpkg( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 ); | ||
57 | ~OIpkg(); | ||
58 | |||
59 | OConfItemList *configItems(); | ||
60 | OConfItemList *servers(); | ||
61 | OConfItemList *destinations(); | ||
62 | OConfItemList *options(); | ||
63 | |||
64 | int ipkgExecOptions() { return m_ipkgExecOptions; } | ||
65 | int ipkgExecVerbosity() { return m_ipkgExecVerbosity; } | ||
66 | |||
67 | void setConfigItems( OConfItemList *configList ); | ||
68 | void setIpkgExecOptions( int options ) { m_ipkgExecOptions = options; } | ||
69 | void setIpkgExecVerbosity( int verbosity ) { m_ipkgExecVerbosity = verbosity; } | ||
70 | |||
71 | void saveSettings(); | ||
72 | |||
73 | OPackageList *availablePackages( const QString &server = QString::null ); | ||
74 | OPackageList *installedPackages( const QString &destName = QString::null, | ||
75 | const QString &destPath = QString::null ); | ||
76 | |||
77 | bool executeCommand( OPackage::Command command = OPackage::NotDefined, QStringList *parameters = 0x0, | ||
78 | const QString &destination = QString::null, const QObject *receiver = 0x0, | ||
79 | const char *slotOutput = 0x0, const char *slotErrors = 0x0, | ||
80 | const char *slotFinished = 0x0, bool rawOutput = true ); | ||
81 | void abortCommand(); | ||
82 | |||
83 | private: | ||
84 | Config *m_config; // Pointer to application configuration file | ||
85 | QString m_ipkgExec; // Fully qualified path/filename of ipkg binary | ||
86 | OConfItemList *m_confInfo; // Contains info from all Ipkg configuration files | ||
87 | int m_ipkgExecOptions; // Bit-mapped flags for Ipkg execution options | ||
88 | int m_ipkgExecVerbosity; // Ipkg execution verbosity level | ||
89 | OProcess *m_ipkgProcess; // Pointer to process which Ipkg will run in | ||
90 | |||
91 | void loadConfiguration(); | ||
92 | OConfItemList *filterConfItems( OConfItem::Type typefilter = OConfItem::NotDefined ); | ||
93 | |||
94 | signals: | ||
95 | void execOutput( OProcess *process, char *buffer, int length ); | ||
96 | void execErrors( OProcess *process, char *buffer, int length ); | ||
97 | void execFinished( OProcess *process, char *buffer, int length ); | ||
98 | }; | ||
99 | |||
100 | #endif | ||