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/qobject.h>
15#include <QtCore/qstring.h>
16
17// std header
18#include <string>
19
20class QWidget;
21class QAction;
22
23namespace ads {
24 class CDockWidget;
25}
26
27namespace ot {
28
29 class WidgetViewManager;
30
33 class OT_WIDGETS_API_EXPORT WidgetView : public QObject {
34 Q_OBJECT
37 public:
39 NoInsertFlags = 0 << 0,
40 KeepCurrentFocus = 1 << 0
41 };
43
44 static std::string createStoredViewName(const WidgetViewBase& _view);
45
48 static std::string createStoredViewName(const std::string& _entityName, WidgetViewBase::ViewType _viewType);
49
51 virtual ~WidgetView();
52
53 // ###########################################################################################################################################################################################################################################################################################################################
54
56 virtual QWidget* getViewWidget(void) = 0;
57
61 virtual void setViewWidgetFocus(void);
62
63 // ###########################################################################################################################################################################################################################################################################################################################
64
65 // Setter/Getter
66
67 void setViewData(const WidgetViewBase& _data);
68 WidgetViewBase& getViewData(void) { return m_data; };
69 const WidgetViewBase& getViewData(void) const { return m_data; };
70
72 ads::CDockWidget* getViewDockWidget(void) const { return m_dockWidget; };
73
76 QAction* getViewToggleAction(void) const;
77
79 void setViewIsPermanent(bool _permanent = true) { m_isPermanent = _permanent; };
80
82 bool getViewIsPermanent(void) const { return m_isPermanent; };
83
86 void setViewContentModified(bool _isModified);
87 bool getViewContentModified(void) const { return m_isModified; };
88
90 QString getCurrentViewTitle(void) const;
91
92 void setAsCurrentViewTab(void);
93
94 bool isCurrentViewTab(void) const;
95
96 Q_SIGNALS:
98
99 protected:
100
102 void addWidgetToDock(QWidget* _widget);
103
104 private:
105 friend class WidgetViewManager;
106
107 ads::CDockWidget* m_dockWidget;
108
109 WidgetViewBase m_data;
110 bool m_isDeletedByManager;
111 bool m_isPermanent;
112 bool m_isModified;
113 };
114
115}
116
#define OT_ADD_FLAG_FUNCTIONS(___enumName)
Will add the default bitwise operations for the provided private 32/64 bit bitfield....
Definition Flags.h:129
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
The Flags class is a wrapper around a enum that allows bitwise operations (flags)....
Definition Flags.h:214
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:33
virtual QWidget * getViewWidget(void)=0
Returns the widget that is set to this widget view.
WidgetViewBase & getViewData(void)
Definition WidgetView.h:68
const WidgetViewBase & getViewData(void) const
Definition WidgetView.h:69
InsertFlag
Definition WidgetView.h:38
bool getViewIsPermanent(void) const
Permanent views wont be removed from the widget view manager when calling remove view.
Definition WidgetView.h:82
void viewDataModifiedChanged(void)
ads::CDockWidget * getViewDockWidget(void) const
Returns the dock widget that belongs to this widget view.
Definition WidgetView.h:72
ot::Flags< InsertFlag > InsertFlags
Definition WidgetView.h:42
void setViewIsPermanent(bool _permanent=true)
Permanent views wont be removed from the widget view manager when calling remove view.
Definition WidgetView.h:79
bool getViewContentModified(void) const
Definition WidgetView.h:87
The widget view manager is used to manage widget views.
Definition WidgetViewManager.h:38
Definition WidgetView.h:23
Definition Connector.h:8