00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef THEMEFILE_H
00025 #define THEMEFILE_H
00026
00027 #include <kurl.h>
00028 #include <tqstring.h>
00029 #include <tqcstring.h>
00030 #include <tqpixmap.h>
00031 #include <tqfile.h>
00032 #include <tqvaluevector.h>
00033
00034 class LineParser;
00035 class TQTextStream;
00036 class ThemeLocale;
00037 class ZipFile;
00038
00042 class ThemeFile
00043 {
00044 public:
00045 typedef TQValueVector<ThemeFile> List;
00046
00047 ThemeFile(const KURL& url = KURL());
00048 ~ThemeFile();
00049
00050 bool isZipTheme() const { return m_zipTheme; };
00051 const TQString& name() const { return m_name; };
00052 const TQString& version() const { return m_version; };
00053 const TQString& license() const { return m_license; };
00054 const TQString& id() const { return m_id; };
00055 const TQString& mo() const { return m_mo; };
00056 const TQString& file() const { return m_file; };
00057 const TQString& pythonModule() const { return m_python; };
00058 bool pythonModuleExists() const;
00059 const TQString& path() const { return m_path; };
00060 const TQString& description() const { return m_description; };
00061 const TQString& author() const { return m_author; };
00062 const TQString& authorEmail() const { return m_authorEmail; };
00063 const TQString& homepage() const { return m_homepage; };
00064 TQPixmap icon() const;
00065 bool exists() const;
00066 bool isThemeFile(const TQString& filename) const;
00067 bool isValid() const;
00068 TQByteArray readThemeFile(const TQString& filename) const;
00069 bool fileExists(const TQString& filename) const;
00070 const ThemeLocale* locale() const { return m_locale; };
00071 bool canUninstall() const;
00072
00073 bool set(const KURL& url);
00074 bool open();
00075 bool nextLine(LineParser& parser);
00076 bool close();
00077
00078 static bool isZipFile(const TQString& filename);
00079 static TQString canonicalFile(const TQString& file);
00080
00081 private:
00082 void parseXml();
00083 void mkdir(TQDir dir);
00084
00085 TQString m_path;
00086 bool m_zipTheme;
00087 TQString m_file;
00088 TQString m_id;
00089 TQString m_mo;
00090 TQString m_name;
00091 TQString m_theme;
00092 TQString m_python;
00093 TQString m_icon;
00094 TQString m_version;
00095 TQString m_license;
00096 TQTextStream* m_stream;
00097 TQByteArray m_ba;
00098 TQFile m_fl;
00099 TQString m_description;
00100 TQString m_author;
00101 TQString m_authorEmail;
00102 TQString m_homepage;
00103 ThemeLocale* m_locale;
00104 ZipFile* m_zip;
00105 };
00106
00107 #endif