2007-12-01 10:47:15 +00:00
|
|
|
/*
|
2012-01-01 22:51:51 +00:00
|
|
|
Copyright 2006-2012 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-04 02:13:14 +00:00
|
|
|
#ifndef ELEMENTS_CATEGORIES_LIST_H
|
|
|
|
#define ELEMENTS_CATEGORIES_LIST_H
|
|
|
|
#include <QtGui>
|
2009-04-03 19:30:25 +00:00
|
|
|
#include "qet.h"
|
|
|
|
#include "elementslocation.h"
|
2012-02-06 21:21:43 +00:00
|
|
|
#include "genericpanel.h"
|
2009-04-03 19:30:25 +00:00
|
|
|
class ElementsCollection;
|
|
|
|
class ElementsCategory;
|
|
|
|
class ElementDefinition;
|
2007-04-04 02:13:14 +00:00
|
|
|
/**
|
|
|
|
Cette classe fournit une liste graphique des categories d'elements de
|
|
|
|
l'utilisateur.
|
|
|
|
*/
|
2012-02-06 21:21:43 +00:00
|
|
|
class ElementsCategoriesList : public GenericPanel {
|
2007-04-04 02:13:14 +00:00
|
|
|
Q_OBJECT
|
2007-04-12 03:13:13 +00:00
|
|
|
|
|
|
|
// Constructeurs, destructeur
|
2007-04-04 02:13:14 +00:00
|
|
|
public:
|
2009-04-03 19:30:25 +00:00
|
|
|
ElementsCategoriesList(bool = false, uint = QET::All, QWidget * = 0);
|
2007-04-12 03:13:13 +00:00
|
|
|
virtual ~ElementsCategoriesList();
|
2007-04-04 02:13:14 +00:00
|
|
|
|
|
|
|
private:
|
2007-04-12 03:13:13 +00:00
|
|
|
ElementsCategoriesList(const ElementsCategoriesList &);
|
2007-04-04 02:13:14 +00:00
|
|
|
|
2007-04-12 03:13:13 +00:00
|
|
|
// methodes
|
2007-04-04 02:13:14 +00:00
|
|
|
public:
|
2009-04-03 19:30:25 +00:00
|
|
|
ElementsLocation selectedLocation() const;
|
|
|
|
bool selectLocation(const ElementsLocation &);
|
2007-04-04 02:13:14 +00:00
|
|
|
|
2007-04-12 03:13:13 +00:00
|
|
|
private:
|
|
|
|
QString categoryName(QDir &);
|
2012-02-06 21:21:43 +00:00
|
|
|
QTreeWidgetItem *makeItem(QET::ItemType, QTreeWidgetItem *, const QString &, const QIcon &);
|
2007-04-12 03:13:13 +00:00
|
|
|
|
2007-04-04 02:13:14 +00:00
|
|
|
public slots:
|
|
|
|
void reload();
|
2009-04-03 19:30:25 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void selectionChanged(QTreeWidgetItem *, QTreeWidgetItem *);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void locationChanged(const ElementsLocation &);
|
|
|
|
|
|
|
|
// attributs
|
|
|
|
private:
|
|
|
|
bool display_elements_;
|
|
|
|
int selectables_;
|
|
|
|
bool first_load;
|
2007-04-04 02:13:14 +00:00
|
|
|
};
|
|
|
|
#endif
|