root / kadu-core / themes.h @ d8068106
History | View | Annotate | Download (4.5 kB)
| 1 | /*
|
|---|---|
| 2 | * %kadu copyright begin% |
| 3 | * Copyright 2007, 2008 Dawid Stawiarski (neeo@kadu.net) |
| 4 | * Copyright 2005, 2007 Marcin Ślusarz (joi@kadu.net) |
| 5 | * Copyright 2007, 2008, 2010 Rafał Malinowski (rafal.przemyslaw.malinowski@gmail.com) |
| 6 | * Copyright 2008 Michał Podsiadlik (michal@kadu.net) |
| 7 | * %kadu copyright end% |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or |
| 10 | * modify it under the terms of the GNU General Public License as |
| 11 | * published by the Free Software Foundation; either version 2 of |
| 12 | * the License, or (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 21 | */ |
| 22 | |
| 23 | #ifndef KADU_THEMES_H
|
| 24 | #define KADU_THEMES_H
|
| 25 | |
| 26 | #include <QtCore/QStringList> |
| 27 | #include <QtCore/QMap> |
| 28 | |
| 29 | #include "exports.h" |
| 30 | |
| 31 | /**
|
| 32 | Klasa obs�uguj�ca r��ne zestawy (jak ikony i emotikony) |
| 33 | \class Themes |
| 34 | \brief Klasa zarz�dzaj�ca zestawami |
| 35 | **/ |
| 36 | |
| 37 | class KADUAPI Themes : public QObject |
| 38 | {
|
| 39 | Q_OBJECT |
| 40 | |
| 41 | friend class EmoticonsManager; |
| 42 | |
| 43 | QStringList ThemesList; //!< lista z nazwami dost�pnych zestaw�w
|
| 44 | QStringList ThemesPaths; //!< lista �cie�ek w kt�rych szukamy zestaw�w
|
| 45 | QStringList additional; |
| 46 | QString ConfigName; //!< nazwa pliku z konfiguracj� zestawu
|
| 47 | QString Name; //!< typ zestawu (np. "icons", "emoticons")
|
| 48 | QString ActualTheme; //!< nazwa aktualnie wybranego zestawu
|
| 49 | QMap<QString, QString> entries; |
| 50 | |
| 51 | /**
|
| 52 | \fn QStringList getSubDirs(const QString &path, bool validate = true) const |
| 53 | Wyszukuje podkatalogi w podanej �cie�ce i zwraca list� tych zawieraj�cych |
| 54 | pliki konfiguracyjne zestawu. Je�li parametr validate ma warto�� false, |
| 55 | zwr�cona zostanie lista wszystkich znalezionych podkatalog�w. |
| 56 | \param path �cie�ka do katalogu |
| 57 | \param validate sprawdzenie zawarto�ci |
| 58 | \return lista podkatalog�w |
| 59 | **/ |
| 60 | QStringList getSubDirs(const QString &path, bool validate = true) const; |
| 61 | |
| 62 | /**
|
| 63 | \fn bool validateDir(const QString &path) const |
| 64 | Sprawdza czy w podanym katalogu, b�d� jego podkatalogach znajduj� |
| 65 | si� pliki z konfiguracj� zestawu. |
| 66 | \param path �cie�ka do katalogu |
| 67 | **/ |
| 68 | bool validateDir(const QString &path) const; |
| 69 | |
| 70 | QString fixFileName(const QString &path, const QString &fn) const; |
| 71 | |
| 72 | public:
|
| 73 | /**
|
| 74 | \fn Themes(const QString &name, const QString &configname) |
| 75 | Konstruktor tworz�cy nowy zestaw |
| 76 | \param name typ zestawu |
| 77 | \param configname plik z konfiguracj� zestawu |
| 78 | **/ |
| 79 | Themes(const QString &name, const QString &configname); |
| 80 | |
| 81 | /**
|
| 82 | \fn QStringList defaultKaduPathsWithThemes() const |
| 83 | Tworzy list� �cie�ek do zestaw�w znajduj�cych si� w lokalizacjach |
| 84 | domy�lnych dla typu zestawu. |
| 85 | \return lista �cie�ek do zestaw�w |
| 86 | **/ |
| 87 | QStringList defaultKaduPathsWithThemes() const;
|
| 88 | |
| 89 | /**
|
| 90 | \fn const QStringList &themes() const |
| 91 | Funkcja zwraca list� z nazwami dost�pnych zestaw�w |
| 92 | **/ |
| 93 | const QStringList & themes() const; |
| 94 | |
| 95 | /**
|
| 96 | \fn const QString &theme() const |
| 97 | Funkcja zwraca nazw� aktualnie wybranego zestawu |
| 98 | **/ |
| 99 | const QString & theme() const; |
| 100 | |
| 101 | /**
|
| 102 | \fn const QStringList &paths() const |
| 103 | Funkcja zwraca list� �cie�ek, w kt�rych wyszukiwane s� zestawy |
| 104 | **/ |
| 105 | const QStringList & paths() const; |
| 106 | |
| 107 | const QStringList & additionalPaths() const; |
| 108 | |
| 109 | /**
|
| 110 | \fn const QStringList &paths() const |
| 111 | Funkcja zwraca �cie�k� do wskazanego zestawu |
| 112 | **/ |
| 113 | QString themePath(const QString &theme = QString::null) const; |
| 114 | |
| 115 | QString getThemeEntry(const QString &name) const; |
| 116 | const QMap<QString, QString> &getEntries() { return entries; } |
| 117 | |
| 118 | public slots: |
| 119 | /**
|
| 120 | \fn void setTheme(const QString &theme) |
| 121 | Zmienia aktualny zestaw na wskazany o ile ten istnieje |
| 122 | \param theme nazwa zestawu |
| 123 | **/ |
| 124 | void setTheme(const QString &theme); |
| 125 | |
| 126 | /**
|
| 127 | \fn void setPaths(const QStringList &paths) |
| 128 | Ustawia list� �cie�ek, w kt�rych wyszukiwane s� zestawy |
| 129 | \param paths lista �cie�ek |
| 130 | **/ |
| 131 | void setPaths(const QStringList &paths); |
| 132 | |
| 133 | signals:
|
| 134 | /**
|
| 135 | \fn void themeChanged(const QString &theme) |
| 136 | Sygna� jest emitowany, gdy zmieniono aktualny zestaw |
| 137 | \param theme nazwa nowego zestawu |
| 138 | **/ |
| 139 | void themeChanged(const QString &theme); |
| 140 | |
| 141 | /**
|
| 142 | \fn void pathsChanged(const QStringList &list) |
| 143 | Sygna� jest emitowany, gdy zmieniono �cie�k� wyszukiwania |
| 144 | \param list lista nowych �cie�ek |
| 145 | **/ |
| 146 | void pathsChanged(const QStringList &list); |
| 147 | |
| 148 | }; |
| 149 | |
| 150 | #endif
|