00001 /* 00002 This file is part of the OPIE Project 00003 00004 =. Copyright (c) 2002 Andy Qua <andy.qua@blueyonder.co.uk> 00005 .=l. Dan Williams <drw@handhelds.org> 00006 .>+-= 00007 _;:, .> :=|. This file is free software; you can 00008 .> <`_, > . <= redistribute it and/or modify it under 00009 :`=1 )Y*s>-.-- : the terms of the GNU General Public 00010 .="- .-=="i, .._ License as published by the Free Software 00011 - . .-<_> .<> Foundation; either version 2 of the License, 00012 ._= =} : or (at your option) any later version. 00013 .%`+i> _;_. 00014 .i_,=:_. -<s. This file is distributed in the hope that 00015 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 00016 : .. .:, . . . without even the implied warranty of 00017 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 00018 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU General 00019 ..}^=.= = ; Public License for more details. 00020 ++= -. .` .: 00021 : = ...= . :.=- You should have received a copy of the GNU 00022 -. .:....=;==+<; General Public License along with this file; 00023 -_. . . )=. = see the file COPYING. If not, write to the 00024 -- :-=` Free Software Foundation, Inc., 00025 59 Temple Place - Suite 330, 00026 Boston, MA 02111-1307, USA. 00027 00028 */ 00029 00030 #ifndef DATAMGR_H 00031 #define DATAMGR_H 00032 00033 #include <qlist.h> 00034 #include <qobject.h> 00035 #include <qstring.h> 00036 00037 #include "server.h" 00038 #include "destination.h" 00039 00040 //#define LOCAL_SERVER "Installed Pkgs" 00041 //#define LOCAL_IPKGS "local IPKG" 00042 extern QString LOCAL_SERVER; 00043 extern QString LOCAL_IPKGS; 00044 00050 class DataManager : public QObject 00051 { 00052 Q_OBJECT 00053 public: 00054 DataManager(); 00055 ~DataManager(); 00056 00057 void setActiveServer( const QString &act ) { activeServer = act; } 00058 QString &getActiveServer( ) { return activeServer; } 00059 00060 Server *getLocalServer() { return ( getServer( LOCAL_SERVER ) ); } 00061 QList<Server> &getServerList() { return serverList; } 00062 Server *getServer( const char *name ); 00063 00064 QList<Destination> &getDestinationList() { return destList; } 00065 Destination *getDestination( const char *name ); 00066 00067 void loadServers(); 00068 void reloadServerData( ); 00069 00070 void writeOutIpkgConf(); 00071 00072 static QString getAvailableCategories() { return availableCategories; } 00073 static void setAvailableCategories( QString section ); 00074 00075 QString getHttpProxy() { return httpProxy; } 00076 QString getFtpProxy() { return ftpProxy; } 00077 QString getProxyUsername() { return proxyUsername; } 00078 QString getProxyPassword() { return proxyPassword; } 00079 00080 bool getHttpProxyEnabled() { return httpProxyEnabled; } 00081 bool getFtpProxyEnabled() { return ftpProxyEnabled; } 00082 00083 void setHttpProxy( QString proxy ) { httpProxy = proxy; } 00084 void setFtpProxy( QString proxy ) { ftpProxy = proxy; } 00085 void setProxyUsername( QString name ) { proxyUsername = name; } 00086 void setProxyPassword( QString pword ) { proxyPassword = pword; } 00087 00088 void setHttpProxyEnabled( bool val ) { httpProxyEnabled = val; } 00089 void setFtpProxyEnabled( bool val ) { ftpProxyEnabled = val; } 00090 private: 00091 static QString availableCategories; 00092 QString activeServer; 00093 QString httpProxy; 00094 QString ftpProxy; 00095 QString proxyUsername; 00096 QString proxyPassword; 00097 00098 bool httpProxyEnabled; 00099 bool ftpProxyEnabled; 00100 00101 QList<Server> serverList; 00102 QList<Destination> destList; 00103 00104 signals: 00105 void progressSetSteps( int ); 00106 void progressSetMessage( const QString & ); 00107 void progressUpdate( int ); 00108 }; 00109 00110 #endif
1.4.2