summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/datamgr.h
Unidiff
Diffstat (limited to 'noncore/settings/aqpkg/datamgr.h') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/datamgr.h44
1 files changed, 28 insertions, 16 deletions
diff --git a/noncore/settings/aqpkg/datamgr.h b/noncore/settings/aqpkg/datamgr.h
index 7fa42c1..32a1e57 100644
--- a/noncore/settings/aqpkg/datamgr.h
+++ b/noncore/settings/aqpkg/datamgr.h
@@ -1,99 +1,111 @@
1/*************************************************************************** 1/*
2 datamgr.h - description 2                This file is part of the OPIE Project
3 ------------------- 3
4 begin : Thu Aug 29 2002 4 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk>
5 copyright : (C) 2002 by Andy Qua 5             .=l. Dan Williams <drw@handhelds.org>
6 email : andy.qua@blueyonder.co.uk 6           .>+-=
7 ***************************************************************************/ 7 _;:,     .>    :=|. This file is free software; you can
8 8.> <`_,   >  .   <= redistribute it and/or modify it under
9/*************************************************************************** 9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10 * * 10.="- .-=="i,     .._ License as published by the Free Software
11 * This program is free software; you can redistribute it and/or modify * 11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12 * it under the terms of the GNU General Public License as published by * 12     ._= =}       : or (at your option) any later version.
13 * the Free Software Foundation; either version 2 of the License, or * 13    .%`+i>       _;_.
14 * (at your option) any later version. * 14    .i_,=:_.      -<s. This file is distributed in the hope that
15 * * 15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16 ***************************************************************************/ 16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
19..}^=.=       =       ; Public License for more details.
20++=   -.     .`     .:
21 :     =  ...= . :.=- You should have received a copy of the GNU
22 -.   .:....=;==+<; General Public License along with this file;
23  -_. . .   )=.  = see the file COPYING. If not, write to the
24    --        :-=` Free Software Foundation, Inc.,
25 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA.
27
28*/
17 29
18#ifndef DATAMGR_H 30#ifndef DATAMGR_H
19#define DATAMGR_H 31#define DATAMGR_H
20 32
21#include <map> 33#include <map>
22using namespace std; 34using namespace std;
23 35
24#include <qlist.h> 36#include <qlist.h>
25#include <qobject.h> 37#include <qobject.h>
26#include <qstring.h> 38#include <qstring.h>
27 39
28#include "server.h" 40#include "server.h"
29#include "destination.h" 41#include "destination.h"
30 42
31 #define LOCAL_SERVER "Installed Pkgs" 43 #define LOCAL_SERVER "Installed Pkgs"
32 #define LOCAL_IPKGS "local IPKG" 44 #define LOCAL_IPKGS "local IPKG"
33 45
34/** 46/**
35 *@author Andy Qua 47 *@author Andy Qua
36 */ 48 */
37 49
38 50
39class DataManager : public QObject 51class DataManager : public QObject
40{ 52{
41 Q_OBJECT 53 Q_OBJECT
42public: 54public:
43 DataManager(); 55 DataManager();
44 ~DataManager(); 56 ~DataManager();
45 57
46 void setActiveServer( const QString &act ) { activeServer = act; } 58 void setActiveServer( const QString &act ) { activeServer = act; }
47 QString &getActiveServer( ) { return activeServer; } 59 QString &getActiveServer( ) { return activeServer; }
48 60
49 Server *getLocalServer() { return ( getServer( LOCAL_SERVER ) ); } 61 Server *getLocalServer() { return ( getServer( LOCAL_SERVER ) ); }
50 QList<Server> &getServerList() { return serverList; } 62 QList<Server> &getServerList() { return serverList; }
51 Server *getServer( const char *name ); 63 Server *getServer( const char *name );
52 64
53 QList<Destination> &getDestinationList() { return destList; } 65 QList<Destination> &getDestinationList() { return destList; }
54 Destination *getDestination( const char *name ); 66 Destination *getDestination( const char *name );
55 67
56 void loadServers(); 68 void loadServers();
57 void reloadServerData( ); 69 void reloadServerData( );
58 70
59 void writeOutIpkgConf(); 71 void writeOutIpkgConf();
60 72
61 static QString getAvailableCategories() { return availableCategories; } 73 static QString getAvailableCategories() { return availableCategories; }
62 static void setAvailableCategories( QString section ); 74 static void setAvailableCategories( QString section );
63 75
64 QString getHttpProxy() { return httpProxy; } 76 QString getHttpProxy() { return httpProxy; }
65 QString getFtpProxy() { return ftpProxy; } 77 QString getFtpProxy() { return ftpProxy; }
66 QString getProxyUsername() { return proxyUsername; } 78 QString getProxyUsername() { return proxyUsername; }
67 QString getProxyPassword() { return proxyPassword; } 79 QString getProxyPassword() { return proxyPassword; }
68 80
69 bool getHttpProxyEnabled() { return httpProxyEnabled; } 81 bool getHttpProxyEnabled() { return httpProxyEnabled; }
70 bool getFtpProxyEnabled() { return ftpProxyEnabled; } 82 bool getFtpProxyEnabled() { return ftpProxyEnabled; }
71 83
72 void setHttpProxy( QString proxy ) { httpProxy = proxy; } 84 void setHttpProxy( QString proxy ) { httpProxy = proxy; }
73 void setFtpProxy( QString proxy ) { ftpProxy = proxy; } 85 void setFtpProxy( QString proxy ) { ftpProxy = proxy; }
74 void setProxyUsername( QString name ) { proxyUsername = name; } 86 void setProxyUsername( QString name ) { proxyUsername = name; }
75 void setProxyPassword( QString pword ) { proxyPassword = pword; } 87 void setProxyPassword( QString pword ) { proxyPassword = pword; }
76 88
77 void setHttpProxyEnabled( bool val ) { httpProxyEnabled = val; } 89 void setHttpProxyEnabled( bool val ) { httpProxyEnabled = val; }
78 void setFtpProxyEnabled( bool val ) { ftpProxyEnabled = val; } 90 void setFtpProxyEnabled( bool val ) { ftpProxyEnabled = val; }
79private: 91private:
80 static QString availableCategories; 92 static QString availableCategories;
81 QString activeServer; 93 QString activeServer;
82 QString httpProxy; 94 QString httpProxy;
83 QString ftpProxy; 95 QString ftpProxy;
84 QString proxyUsername; 96 QString proxyUsername;
85 QString proxyPassword; 97 QString proxyPassword;
86 98
87 bool httpProxyEnabled; 99 bool httpProxyEnabled;
88 bool ftpProxyEnabled; 100 bool ftpProxyEnabled;
89 101
90 QList<Server> serverList; 102 QList<Server> serverList;
91 QList<Destination> destList; 103 QList<Destination> destList;
92 104
93signals: 105signals:
94 void progressSetSteps( int ); 106 void progressSetSteps( int );
95 void progressSetMessage( const QString & ); 107 void progressSetMessage( const QString & );
96 void progressUpdate( int ); 108 void progressUpdate( int );
97}; 109};
98 110
99#endif 111#endif