fw4spl
Code.hpp
1 /* ***** BEGIN LICENSE BLOCK *****
2  * FW4SPL - Copyright (C) IRCAD, 2009-2018.
3  * Distributed under the terms of the GNU Lesser General Public License (LGPL) as
4  * published by the Free Software Foundation.
5  * ****** END LICENSE BLOCK ****** */
6 
7 #pragma once
8 
9 #include "guiQt/config.hpp"
10 
11 #include <fwGui/editor/IEditor.hpp>
12 
13 #include <fwTools/Failed.hpp>
14 
15 #include <QObject>
16 #include <QPointer>
17 #include <QString>
18 #include <QSyntaxHighlighter>
19 #include <QTextEdit>
20 
21 namespace guiQt
22 {
23 
24 namespace editor
25 {
26 
46 class GUIQT_CLASS_API Code : public QObject,
48 {
49 Q_OBJECT
50 public:
51 
53 
55  GUIQT_API Code() noexcept;
56 
58  GUIQT_API virtual ~Code() noexcept;
59 
60 protected:
61 
63  virtual void starting() override;
64 
66  virtual void stopping() override;
67 
69  virtual void updating() override;
70 
72  virtual void swapping() override;
73 
75  virtual void configuring() override;
76 
78  virtual void info( std::ostream& _sstream ) override;
79 
86  GUIQT_API virtual KeyConnectionsMap getAutoConnections() const override;
87 
88 protected Q_SLOTS:
94  void onModifyValue();
95 
96 private:
97 
98  static const std::string s_PYTHON;
99  static const std::string s_CPP;
100 
101  std::string m_language;
102  QPointer< QTextEdit > m_valueCtrl;
103  QPointer< QSyntaxHighlighter > m_highlighter;
104 };
105 
106 } // namespace editor
107 
108 } // namespace guiQt
This class is a helper to define the connections of a service and its data.
Definition: IService.hpp:454
This service displays a code editor and works on a fwData::String.
Definition: Code.hpp:46
Defines the service interface managing the editor service for object.
Definition: IEditor.hpp:25
STL namespace.
#define fwCoreServiceClassDefinitionsMacro(_classinfo_)
Generate common code for services classes.
The namespace guiQt contains the basic services to build the application IHM with Qt...
Definition: Code.hpp:21