2007-04-05 01:13:14 +00:00
|
|
|
#ifndef ELEMENTS_CATEGORY_H
|
|
|
|
#define ELEMENTS_CATEGORY_H
|
|
|
|
#include <QtCore>
|
2007-04-13 15:48:00 +00:00
|
|
|
#include "nameslist.h"
|
2007-04-09 02:56:47 +00:00
|
|
|
/**
|
|
|
|
Cette classe represente une categorie d'elements.
|
|
|
|
Une categorie d'elements est en fait un dossier avec un fichier
|
|
|
|
qet_directory contenant ses caracteristiques (pour le moment : ses noms).
|
|
|
|
*/
|
2007-04-05 01:13:14 +00:00
|
|
|
class ElementsCategory : public QDir {
|
2007-04-12 03:13:13 +00:00
|
|
|
// constructeurs, destructeur
|
2007-04-05 01:13:14 +00:00
|
|
|
public:
|
|
|
|
ElementsCategory(const QString & = QString());
|
2007-04-12 03:13:13 +00:00
|
|
|
virtual ~ElementsCategory();
|
|
|
|
|
|
|
|
private:
|
|
|
|
ElementsCategory(const ElementsCategory &);
|
2007-04-05 01:13:14 +00:00
|
|
|
|
|
|
|
// attributs
|
|
|
|
private:
|
2007-04-13 15:48:00 +00:00
|
|
|
NamesList category_names;
|
2007-04-05 01:13:14 +00:00
|
|
|
|
|
|
|
// methodes
|
|
|
|
public:
|
|
|
|
QString name() const;
|
2007-04-13 15:48:00 +00:00
|
|
|
NamesList categoryNames() const;
|
2007-04-05 01:13:14 +00:00
|
|
|
void clearNames();
|
|
|
|
void addName(const QString &, const QString &);
|
|
|
|
bool write() const;
|
|
|
|
bool remove() const;
|
2007-06-30 17:41:07 +00:00
|
|
|
bool isWritable() const;
|
2007-04-05 01:13:14 +00:00
|
|
|
//bool move(const QString &new_parent);
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool rmdir(const QString &) const;
|
|
|
|
void loadNames();
|
2007-04-05 01:13:14 +00:00
|
|
|
};
|
|
|
|
#endif
|