Image Component Library (ICL)
GUIHandle.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLQt/src/ICLQt/GUIHandle.h **
10 ** Module : ICLQt **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLQt/GUIHandleBase.h>
35 
36 namespace icl{
37  namespace qt{
39  template <class T>
40  class GUIHandle : public GUIHandleBase{
41 
42  protected:
45 
48 
49  public:
50 
52  const T *operator*() const{
53  return m_poContent;
54  }
55 
57  T *&operator*(){ return m_poContent; }
58 
60  T* operator->(){ return m_poContent; }
61 
63  const T* operator->() const{ return m_poContent; }
64 
66  bool isNull() const { return m_poContent; }
67 
69  void enable() { m_poContent->setEnabled(true); }
70 
72  void disable() { m_poContent->setEnabled(false); }
73  private:
76  };
77  } // namespace qt
78 }
79 
GUIHandle(T *t, GUIWidget *w)
as GUIHandle is just an interface, its base constructor is protected
Definition: GUIHandle.h:47
undocument this line if you encounter any issues!
Definition: Any.h:37
const T * operator *() const
use the *-oprator to get the wrapped component (const)
Definition: GUIHandle.h:52
Abstract base class for Handle classes.
Definition: GUIHandle.h:40
const T * operator->() const
this can be used for direct access to wrapped type
Definition: GUIHandle.h:63
T * operator->()
this can be used for direct access to wrapped type
Definition: GUIHandle.h:60
Abstract class for GUI components.
Definition: GUIWidget.h:52
void disable()
disables the wrapped GUI component
Definition: GUIHandle.h:72
bool isNull() const
returns whether wrapped pointer is null or not
Definition: GUIHandle.h:66
void enable()
enables the wrapped GUI component
Definition: GUIHandle.h:69
Base class for GUIHandles providing functions to register callbacks.
Definition: GUIHandleBase.h:40
GUIHandle()
as GUIHandle is just an interface, its base constructor is protected
Definition: GUIHandle.h:44
T * m_poContent
wrapped component
Definition: GUIHandle.h:75