arcsinterface.h
1 /*
2  name: include/arcs/arcsinterface.h
3 
4  This file is part of ARCS - Augmented Reality Component System
5  (version 2-current), written by Jean-Yves Didier
6  for IBISC Laboratory (http://www.ibisc.univ-evry.fr)
7 
8  Copyright (C) 2013 Université d'Evry-Val d'Essonne
9 
10  This program is free software: you can redistribute it and/or modify
11  it under the terms of the GNU General Public License as published by
12  the Free Software Foundation, either version 2 of the License, or
13  (at your option) any later version.
14 
15  This program is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  GNU General Public License for more details.
19 
20  You should have received a copy of the GNU General Public License
21  along with this program. If not, see <http://www.gnu.org/licenses/>.
22 
23 
24  Please send bugreports with examples or suggestions to
25  jean-yves.didier__at__ibisc.univ-evry.fr
26 */
27 
28 
29 #ifndef __ARCSINTERFACE_H__
30 #define __ARCSINTERFACE_H__
31 
32 #include<QStringList>
33 
35 
36 
38 
43 {
44 public:
45  ARCSInterface() { baseClass = "QObject"; }
46  ARCSInterface(ARCSAbstractComponent* cmp) { importFromComponent(cmp); }
47  ARCSInterface(const ARCSInterface & inf);
48 
49  QStringList getSlots() { return slotList; }
50  QStringList getSignals() { return signalList; }
51  bool addSlot(QString s) { if (slotList.contains(s)) return false; slotList << s ; return true; }
52  bool addSignal(QString s) { if (signalList.contains(s)) return false; signalList << s ; return true; }
53  bool removeSlot(QString s) { if (!slotList.contains(s)) return false; slotList.removeAll(s); return true; }
54  bool removeSignal(QString s) { if (!signalList.contains(s)) return false; signalList.removeAll(s); return true; }
55 
56  bool hasSignal(QString s) { return signalList.contains(s); }
57  bool hasSlot(QString s) { return slotList.contains(s); }
58 
59  void clear() { signalList.clear(); slotList.clear(); }
60  void importFromComponent(ARCSAbstractComponent* cmp);
61  bool checkComponentInterface(ARCSAbstractComponent* cmp);
62 
63  void setClassName(QString s) { className = s ; }
64  void setBaseClass(QString s) { baseClass = s ; }
65 
66  QString getClassName() { return className ;}
67  QString getBaseClass() { return baseClass ;}
68 
69  QString getHeaderDeclaration();
70 
71 
72 private :
73  QStringList signalList;
74  QStringList slotList;
75  QString className;
76  QString baseClass;
77 };
78 
79 #endif // __ARCSINTERFACE_H__
A class describing interfaces of components.
Definition: arcsinterface.h:42
Class handling the generic description of a component.