OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
WidgetView.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
12
13// Qt header
14#include <QtCore/qstring.h>
15
16// std header
17#include <string>
18
19class QWidget;
20class QAction;
21
22namespace ads {
23 class CDockWidget;
24}
25
26namespace ot {
27
28 class WidgetViewManager;
29
35 public:
37 NoInsertFlags = 0 << 0,
38 KeepCurrentFocus = 1 << 0
39 };
41
42 static std::string createStoredViewName(const WidgetViewBase& _view);
43
46 static std::string createStoredViewName(const std::string& _entityName, WidgetViewBase::ViewType _viewType);
47
49 virtual ~WidgetView();
50
51 // ###########################################################################################################################################################################################################################################################################################################################
52
54 virtual QWidget* getViewWidget(void) = 0;
55
59 virtual void setViewWidgetFocus(void);
60
61 // ###########################################################################################################################################################################################################################################################################################################################
62
63 // Setter/Getter
64
65 void setViewData(const WidgetViewBase& _data);
66 WidgetViewBase& getViewData(void) { return m_data; };
67 const WidgetViewBase& getViewData(void) const { return m_data; };
68
70 ads::CDockWidget* getViewDockWidget(void) const { return m_dockWidget; };
71
74 QAction* getViewToggleAction(void) const;
75
77 void setViewIsPermanent(bool _permanent = true) { m_isPermanent = _permanent; };
78
80 bool getViewIsPermanent(void) const { return m_isPermanent; };
81
84 void setViewContentModified(bool _isModified);
85 bool getViewContentModified(void) const { return m_isModified; };
86
88 QString getCurrentViewTitle(void) const;
89
90 void setAsCurrentViewTab(void);
91
92 bool isCurrentViewTab(void) const;
93
94 protected:
95
97 void addWidgetToDock(QWidget* _widget);
98
99 private:
100 friend class WidgetViewManager;
101
102 ads::CDockWidget* m_dockWidget;
103
104 WidgetViewBase m_data;
105 bool m_isDeletedByManager;
106 bool m_isPermanent;
107 bool m_isModified;
108 };
109
110}
111
#define OT_ADD_FLAG_FUNCTIONS(___enumName)
Will add the default bitwise operations for the provided 32 bit bitfield. Use this at the bottom of t...
Definition Flags.h:60
This file contains defines that may be used simplyfy class creation.
#define OT_DECL_NODEFAULT(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:22
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_WIDGETS_API_EXPORT
Definition OTWidgetsAPIExport.h:12
This class is used to manage flags. Don't forget to add OT_ADD_FLAG_FUNCTIONS and the bottom of your ...
Definition Flags.h:91
General widget view information class. The WidgetViewBase holds the general information of a WidgetVi...
Definition WidgetViewBase.h:25
ViewType
Definition WidgetViewBase.h:49
The WidgetView class is used to integrate the Qt-ADS functionallity into open twin.
Definition WidgetView.h:32
virtual QWidget * getViewWidget(void)=0
Returns the widget that is set to this widget view.
WidgetViewBase & getViewData(void)
Definition WidgetView.h:66
const WidgetViewBase & getViewData(void) const
Definition WidgetView.h:67
InsertFlag
Definition WidgetView.h:36
bool getViewIsPermanent(void) const
Permanent views wont be removed from the widget view manager when calling remove view.
Definition WidgetView.h:80
ads::CDockWidget * getViewDockWidget(void) const
Returns the dock widget that belongs to this widget view.
Definition WidgetView.h:70
ot::Flags< InsertFlag > InsertFlags
Definition WidgetView.h:40
void setViewIsPermanent(bool _permanent=true)
Permanent views wont be removed from the widget view manager when calling remove view.
Definition WidgetView.h:77
bool getViewContentModified(void) const
Definition WidgetView.h:85
The widget view manager is used to manage widget views.
Definition WidgetViewManager.h:38
Definition WidgetView.h:22
Definition Connector.h:8