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 SERVER_H 00031 #define SERVER_H 00032 00033 #include <qlist.h> 00034 #include <qstring.h> 00035 00036 #include "package.h" 00037 #include "destination.h" 00038 00039 class Server 00040 { 00041 public: 00042 Server() {} 00043 Server( const char *name, const char *url ); 00044 Server( const char *name, const char *url, const char *file ); 00045 ~Server(); 00046 00047 void cleanUp(); 00048 00049 void readStatusFile( QList<Destination> &v ); 00050 void readLocalIpks( Server *local ); 00051 void readPackageFile( Server *local = 0, bool clearAll = true, bool installedToRoot= false, Destination *dest = 0 ); 00052 void buildLocalPackages( Server *local ); 00053 Package *getPackage( const char *name ); 00054 Package *getPackage( QString &name ); 00055 QString toString(); 00056 QList<Package> &getPackageList(); 00057 bool isServerActive() { return active; } 00058 00059 void setServerName( const QString &name ) { serverName = name; } 00060 void setServerUrl( const QString &url ) { serverUrl = url; } 00061 void setActive( bool val ) { active = val; } 00062 QString &getServerName() { return serverName; } 00063 QString &getServerUrl() { return serverUrl; } 00064 00065 protected: 00066 00067 private: 00068 QString serverName; 00069 QString serverUrl; 00070 QString packageFile; 00071 bool active; 00072 00073 00074 QList<Package> packageList; 00075 }; 00076 00077 #endif
1.4.2