2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2008-02-06 19:40:45 +00:00
|
|
|
Copyright 2006-2008 Xavier Guerrin
|
2007-12-01 10:47:15 +00:00
|
|
|
This file is part of QElectroTech.
|
|
|
|
|
|
|
|
QElectroTech is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
QElectroTech is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
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
|