now it can remove themes\!
[xcurtheme.git] / src / xcr / xcrtheme.h
blob84ccc38bf217337a9aba3aab172a9d7636643e4a
1 /* coded by Ketmar // Vampire Avalon (psyc://ketmar.no-ip.org/~Ketmar)
3 * This program is free software. It comes without any warranty, to
4 * the extent permitted by applicable law. You can redistribute it
5 * and/or modify it under the terms of the Do What The Fuck You Want
6 * To Public License, Version 2, as published by Sam Hocevar. See
7 * http://sam.zoy.org/wtfpl/COPYING for more details.
8 */
9 #ifndef XCRTHEME_H
10 #define XCRTHEME_H
12 #include <QtCore>
13 #include <QCursor>
14 #include <QPixmap>
16 #include "xcrimg.h"
19 class XCursorTheme {
20 public:
21 XCursorTheme (const QDir &aDir, const QString &aName);
22 //XCursorTheme (const QString &aName);
23 virtual ~XCursorTheme ();
25 inline const QString &name () const { return mName; }
26 inline const QString &path () const { return mPath; }
27 inline const QString &title () const { return mTitle; }
28 inline const QString &author () const { return mAuthor; }
29 inline const QString &license () const { return mLicense; }
30 inline const QString &mail () const { return mEMail; }
31 inline const QString &site () const { return mSite; }
32 inline const QString &descr () const { return mDescr; }
33 inline const QString &im () const { return mIM; }
34 inline const QString &sample () const { return mSample; }
35 inline const QStringList &inherits () const { return mInherits; }
37 inline void setName (const QString &v) { mName = v; }
38 inline void setPath (const QString &v) { mPath = v; }
39 inline void setTitle (const QString &v) { mTitle = v; }
40 inline void setAuthor (const QString &v) { mAuthor = v; }
41 inline void setLicense (const QString &v) { mLicense = v; }
42 inline void setEMail (const QString &v) { mEMail = v; }
43 inline void setSite (const QString &v) { mSite = v; }
44 inline void setDescr (const QString &v) { mDescr = v; }
45 inline void setIM (const QString &v) { mIM = v; }
46 inline void setSample (const QString &v) { mSample = v; }
47 inline void setInherits (const QStringList &v) { mInherits.clear(); mInherits.append(v); }
49 inline const QList<XCursorImages *> &list () const { return mList; }
50 inline const XCursorImages *at (int idx) const { return mList.at(idx); }
51 inline int count () const { return mList.size(); }
52 inline int size () const { return mList.size(); }
54 inline void append (XCursorImages *img) { mList << img; }
56 bool writeToDir (const QDir &destDir);
58 void fixInfoFields ();
60 protected:
61 bool writeIndexTheme (const QDir &destDir);
62 QString findCursorFile (const QDir &dir, const char *name);
63 void parseXCursorTheme (const QDir &dir);
64 void parseThemeIndex (const QDir &dir);
66 void dumpInfo ();
68 protected:
69 QString mName;
70 QString mPath;
71 QString mTitle;
72 QString mAuthor;
73 QString mLicense;
74 QString mEMail;
75 QString mSite;
76 QString mDescr;
77 QString mIM;
78 QString mSample;
79 QStringList mInherits;
80 QList<XCursorImages *> mList;
84 bool removeXCursorTheme (const QDir &thDir, const QString &name);
85 bool removeXCursorTheme (const QString &name);
86 bool removeXCursorTheme (const QDir &thDir);
89 #endif