Diffstat (limited to 'noncore/settings/packagemanager/oipkg.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oipkg.h | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/noncore/settings/packagemanager/oipkg.h b/noncore/settings/packagemanager/oipkg.h index b8a859a..3c96200 100644 --- a/noncore/settings/packagemanager/oipkg.h +++ b/noncore/settings/packagemanager/oipkg.h | |||
@@ -1,105 +1,108 @@ | |||
1 | /* | 1 | /* |
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | 3 | ||
4 | Copyright (c) 2003 Dan Williams <drw@handhelds.org> | 4 | Copyright (c) 2003 Dan Williams <drw@handhelds.org> |
5 | =. | 5 | =. |
6 | .=l. | 6 | .=l. |
7 | .>+-= | 7 | .>+-= |
8 | _;:, .> :=|. This program is free software; you can | 8 | _;:, .> :=|. This program is free software; you can |
9 | .> <`_, > . <= redistribute it and/or modify it under | 9 | .> <`_, > . <= redistribute it and/or modify it under |
10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 10 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
11 | .="- .-=="i, .._ License as published by the Free Software | 11 | .="- .-=="i, .._ License as published by the Free Software |
12 | - . .-<_> .<> Foundation; either version 2 of the License, | 12 | - . .-<_> .<> Foundation; either version 2 of the License, |
13 | ._= =} : or (at your option) any later version. | 13 | ._= =} : or (at your option) any later version. |
14 | .%`+i> _;_. | 14 | .%`+i> _;_. |
15 | .i_,=:_. -<s. This program is distributed in the hope that | 15 | .i_,=:_. -<s. This program is distributed in the hope that |
16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 16 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
17 | : .. .:, . . . without even the implied warranty of | 17 | : .. .:, . . . without even the implied warranty of |
18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 18 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 19 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
20 | ..}^=.= = ; Library General Public License for more | 20 | ..}^=.= = ; Library General Public License for more |
21 | ++= -. .` .: details. | 21 | ++= -. .` .: details. |
22 | : = ...= . :.=- | 22 | : = ...= . :.=- |
23 | -. .:....=;==+<; You should have received a copy of the GNU | 23 | -. .:....=;==+<; You should have received a copy of the GNU |
24 | -_. . . )=. = Library General Public License along with | 24 | -_. . . )=. = Library General Public License along with |
25 | -- :-=` this library; see the file COPYING.LIB. | 25 | -- :-=` this library; see the file COPYING.LIB. |
26 | If not, write to the Free Software Foundation, | 26 | If not, write to the Free Software Foundation, |
27 | Inc., 59 Temple Place - Suite 330, | 27 | Inc., 59 Temple Place - Suite 330, |
28 | Boston, MA 02111-1307, USA. | 28 | Boston, MA 02111-1307, USA. |
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #ifndef OIPKG_H | 32 | #ifndef OIPKG_H |
33 | #define OIPKG_H | 33 | #define OIPKG_H |
34 | 34 | ||
35 | #include "oconfitem.h" | 35 | #include "oconfitem.h" |
36 | #include "opackage.h" | 36 | #include "opackage.h" |
37 | 37 | ||
38 | #include <qpe/config.h> | 38 | #include <qpe/config.h> |
39 | 39 | ||
40 | #include <qobject.h> | 40 | #include <qobject.h> |
41 | 41 | ||
42 | extern "C" { | 42 | extern "C" { |
43 | #include <libipkg.h> | 43 | #include <libipkg.h> |
44 | }; | 44 | }; |
45 | 45 | ||
46 | // Ipkg execution options (m_ipkgExecOptions) | 46 | // Ipkg execution options (m_ipkgExecOptions) |
47 | #define FORCE_DEPENDS 0x0001 | 47 | #define FORCE_DEPENDS 0x0001 |
48 | #define FORCE_REMOVE 0x0002 | 48 | #define FORCE_REMOVE 0x0002 |
49 | #define FORCE_REINSTALL 0x0004 | 49 | #define FORCE_REINSTALL 0x0004 |
50 | #define FORCE_OVERWRITE 0x0008 | 50 | #define FORCE_OVERWRITE 0x0008 |
51 | 51 | ||
52 | class OConfItemList; | 52 | class OConfItemList; |
53 | 53 | ||
54 | class OIpkg : public QObject | 54 | class OIpkg : public QObject |
55 | { | 55 | { |
56 | Q_OBJECT | 56 | Q_OBJECT |
57 | 57 | ||
58 | public: | 58 | public: |
59 | OIpkg( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 ); | 59 | OIpkg( Config *config = 0x0, QObject *parent = 0x0, const char *name = 0x0 ); |
60 | ~OIpkg(); | 60 | ~OIpkg(); |
61 | 61 | ||
62 | OConfItemList *configItems(); | 62 | OConfItemList *configItems(); |
63 | OConfItemList *servers(); | 63 | OConfItemList *servers(); |
64 | OConfItemList *destinations(); | 64 | OConfItemList *destinations(); |
65 | OConfItemList *options(); | 65 | OConfItemList *options(); |
66 | 66 | ||
67 | int ipkgExecOptions() { return m_ipkgExecOptions; } | 67 | int ipkgExecOptions() { return m_ipkgExecOptions; } |
68 | int ipkgExecVerbosity() { return m_ipkgExecVerbosity; } | 68 | int ipkgExecVerbosity() { return m_ipkgExecVerbosity; } |
69 | 69 | ||
70 | void setConfigItems( OConfItemList *configList ); | 70 | void setConfigItems( OConfItemList *configList ); |
71 | void setIpkgExecOptions( int options ) { m_ipkgExecOptions = options; } | 71 | void setIpkgExecOptions( int options ) { m_ipkgExecOptions = options; } |
72 | void setIpkgExecVerbosity( int verbosity ) { m_ipkgExecVerbosity = verbosity; } | 72 | void setIpkgExecVerbosity( int verbosity ) { m_ipkgExecVerbosity = verbosity; } |
73 | 73 | ||
74 | void saveSettings(); | 74 | void saveSettings(); |
75 | 75 | ||
76 | OPackageList *availablePackages( const QString &server = QString::null ); | 76 | OPackageList *availablePackages( const QString &server = QString::null ); |
77 | OPackageList *installedPackages( const QString &destName = QString::null, | 77 | OPackageList *installedPackages( const QString &destName = QString::null, |
78 | const QString &destPath = QString::null ); | 78 | const QString &destPath = QString::null ); |
79 | 79 | ||
80 | bool executeCommand( OPackage::Command command = OPackage::NotDefined, QStringList *parameters = 0x0, | 80 | bool executeCommand( OPackage::Command command = OPackage::NotDefined, |
81 | const QString &destination = QString::null, const QObject *receiver = 0x0, | 81 | const QStringList ¶meters = QStringList(), |
82 | const char *slotOutput = 0x0, bool rawOutput = true ); | 82 | const QString &destination = QString::null, |
83 | const QObject *receiver = 0x0, | ||
84 | const char *slotOutput = 0x0, | ||
85 | bool rawOutput = true ); | ||
83 | void abortCommand(); | 86 | void abortCommand(); |
84 | 87 | ||
85 | void ipkgMessage( char *msg ); | 88 | void ipkgMessage( char *msg ); |
86 | void ipkgStatus( char *status ); | 89 | void ipkgStatus( char *status ); |
87 | void ipkgList( char *filelist ); | 90 | void ipkgList( char *filelist ); |
88 | 91 | ||
89 | private: | 92 | private: |
90 | Config *m_config; // Pointer to application configuration file | 93 | Config *m_config; // Pointer to application configuration file |
91 | args_t m_ipkgArgs; // libipkg configuration arguments | 94 | args_t m_ipkgArgs; // libipkg configuration arguments |
92 | OConfItemList *m_confInfo; // Contains info from all Ipkg configuration files | 95 | OConfItemList *m_confInfo; // Contains info from all Ipkg configuration files |
93 | int m_ipkgExecOptions; // Bit-mapped flags for Ipkg execution options | 96 | int m_ipkgExecOptions; // Bit-mapped flags for Ipkg execution options |
94 | int m_ipkgExecVerbosity; // Ipkg execution verbosity level | 97 | int m_ipkgExecVerbosity; // Ipkg execution verbosity level |
95 | 98 | ||
96 | void loadConfiguration(); | 99 | void loadConfiguration(); |
97 | OConfItemList *filterConfItems( OConfItem::Type typefilter = OConfItem::NotDefined ); | 100 | OConfItemList *filterConfItems( OConfItem::Type typefilter = OConfItem::NotDefined ); |
98 | 101 | ||
99 | signals: | 102 | signals: |
100 | void signalIpkgMessage( char *msg ); | 103 | void signalIpkgMessage( char *msg ); |
101 | void signalIpkgStatus( char *status ); | 104 | void signalIpkgStatus( char *status ); |
102 | void signalIpkgList( char *filelist ); | 105 | void signalIpkgList( char *filelist ); |
103 | }; | 106 | }; |
104 | 107 | ||
105 | #endif | 108 | #endif |