LibEngsas
emodulelistwidgetitem.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2010 - 2012 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Lesser General Public
6  License as published by the Free Software Foundation; either
7  version 2.1 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Lesser General Public License for more details.
13 
14  You should have received a copy of the GNU Lesser General Public
15  License along with this library; if not, write to the Free Software
16  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
17  MA 02110-1301 USA.
18 */
19 
20 #ifndef EMODULELISTWIDGETITEM_H
21 #define EMODULELISTWIDGETITEM_H
22 
23 #include "eglobal.h"
24 
25 #include <QListWidgetItem>
26 #include <QFileInfo>
27 
45 class E_CORE_EXPORT EModuleListWidgetItem : public QListWidgetItem
46 {
47  public:
48  EModuleListWidgetItem ( QObject *plugin, QListWidget* parent = 0, int type = Type);
49  EModuleListWidgetItem ( QListWidget *parent = 0, int type = Type );
50  EModuleListWidgetItem ( QString text, QListWidget * parent = 0, int type = Type );
51  EModuleListWidgetItem ( QIcon icon, QString text, QListWidget *parent = 0, int type = Type );
52 
53  QObject* plugin() const;
54  void setPlugin(QObject *plugin);
55  void setName ( QString name );
56  QString name() const;
57  void setFile ( QString file );
58  QString file() const;
59  void setStatus ( bool status );
60  bool status() const;
61  void setErrorMessage ( QString message );
62  QString errorMessage() const;
63  void setDescription ( QString description );
64  QString description() const;
65  void setModuleIcon(QImage modIcon);
66  QIcon moduleIcon() const;
67 
80  void extractFromPlugin(QObject *plugin);
81 
82  QListWidgetItem *clone() const;
83 
84  bool operator== (const EModuleListWidgetItem &item) const;
85  bool operator!= (const EModuleListWidgetItem &item) const;
86 
87  private:
88  QFileInfo myFile;
89  QString myErrorMessage;
90  QString myDescription;
91  QImage myModuleIcon;
92  QObject *myPlugin;
93  bool myStatus;
94 
95  void init();
96 };
97 
98 #endif // EMODULELISTWIDGETITEM_H