arcsconstantmodifier.h
1 /*
2  name: include/arcs/arcsconstantmodifier.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 __ARCSCONSTANTMODIFIER_H__
30 #define __ARCSCONSTANTMODIFIER_H__
31 
32 #include <QObject>
33 #include <QMap>
34 #include <arcs/arcsqdynamicobject.h>
35 
37 
41  class ARCSConstantModifier : public QObject, public ARCSQDynamicObject
42  {
43  public:
44  ARCSConstantModifier(QObject* parent=0) : QObject(parent) { idx = 0;}
45 
46  virtual int qt_metacall(QMetaObject::Call call, int id, void ** arguments);
47  virtual QStringList getSignalList() ;
48  virtual QStringList getSlotList() ;
49  virtual int prepareSlotConnect(QString sigName, QString sltName, QString objectName = QString::null, QString actualSignal = QString::null, bool simulate = false) ;
50  virtual int prepareSignalConnect(QString sigName, QString sltName, QString objectName = QString::null, QString actualSlot = QString::null, bool simulate = false);
51  virtual int cleanSlotConnect(QString sigName, QString sltName, QString objectName, QString actualSignal);
52  virtual int cleanSignalConnect(QString sigName, QString sltName, QString objectName, QString actualSlot);
53 
54  private:
55  class ConstantAttributes
56  {
57  public:
58  ConstantAttributes(QString sig=QString::null, QString cst= QString::null, int t=0)
59  { signature = sig; constantName = cst; type = t; }
60  ConstantAttributes(const ConstantAttributes & att )
61  {
62  signature = att.signature;
63  constantName = att.constantName ;
64  type = att.type;
65  }
66 
67  QString getConstantName() { return constantName ; }
68  int getType() { return type; }
69 
70  private:
71  QString signature ;
72  QString constantName ;
73  int type;
74  };
75 
76  QMap<QString, int> map; // this should map a signal to a an integer, which is a slot.
77  QMap<int, ConstantAttributes> invertMap;
78  int idx;
79 
80  };
81 
82 #endif // __ARCSCONSTANTMODIFIER_H__
A class to store constants in contexts.
virtual int cleanSignalConnect(QString sigName, QString sltName, QString objectName, QString actualSlot)
virtual QStringList getSignalList()
virtual int prepareSignalConnect(QString sigName, QString sltName, QString objectName=QString::null, QString actualSlot=QString::null, bool simulate=false)
Prepares a connection with a slot which does not belong to this object.
virtual int prepareSlotConnect(QString sigName, QString sltName, QString objectName=QString::null, QString actualSignal=QString::null, bool simulate=false)
Prepares a connection with a slot which is belonging to this object.
Interface to extend QObject functionnalities in order to make objects with dynamic signals or slots...
virtual int cleanSlotConnect(QString sigName, QString sltName, QString objectName, QString actualSignal)
virtual int qt_metacall(QMetaObject::Call call, int id, void **arguments)
Method performing the actual callback task.
virtual QStringList getSlotList()