VR-Vantage 3.2 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtPage.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvCoreQt/vrvCoreQt.h>
14 
15 #include <QtWidgets/QWidget>
16 #include <QtWidgets/QScrollArea>
17 
18 #include <QtGui/QIcon>
19 
20 namespace makVrv
21 {
22  class DtDe;
23 
27  {
28  public:
30  DtPageScrollArea(QWidget* content, QWidget* parent, bool isHorizontalScrollingEnabled, bool isVerticalScrollingEnabled);
31 
33  virtual ~DtPageScrollArea();
34 
35  virtual bool eventFilter(QObject* o, QEvent* e);
36 
37  protected:
41  };
42 
52  {
53 
54  public:
56  {
57  None = 0x0000,
58  Switching = 0x0001,
59  Closing = 0x0010
60  };
61  public:
65  DtPage(DtDe& de,QWidget* parent = 0, Qt::WindowFlags f = 0);
66 
68  virtual ~DtPage();
69 
71  virtual QIcon icon() = 0;
72 
75  virtual DtQIconConfigurations qIconConfigurations() const = 0;
76 
78  virtual QString title() = 0;
79 
81  virtual const std::string& pageClassName() const = 0;
82 
84  virtual PageAction pageAction();
85 
87  virtual void setPageAction(PageAction action);
88 
90  virtual void setActionFlag(int flag);
91 
93  virtual int actionFlag();
94 
96  virtual void setParentDialog(QWidget* paraentDialog);
97 
99  virtual QWidget* parentDialog();
100 
102  virtual void activate() = 0;
103 
105  virtual void deactivate() = 0;
106 
109  virtual bool shouldAskBeforeAction(PageAction action);
110 
114  virtual void askBeforeAction();
115 
118  virtual void executeAfterAsk(bool revert);
119 
121  virtual void resumeLastAction();
122 
124  virtual void onCloseEvent();
125 
127  virtual void onSwitchEvent();
128 
129  protected:
130  // Helper to wrap a page in a scroll area if enabled
131  virtual QWidget* wrapPageWithScrollArea(QWidget* scrollableWidget,
132  bool isHorizontalScrollingEnabled = false, bool isVerticalScrollingEnabled = true);
133 
135  virtual DtPageScrollArea* createScrollArea(QWidget* scrollableWidget, QWidget* parent,
136  bool isHorizontalScrollingEnabled = false, bool isVerticalScrollingEnabled = true);
137 
138  protected:
142 
143  //the flag that will ask before executing the action, may revert or continue depends on the user input
145  };
146 
153  {
154  public:
156  DtPageCreator(DtDe& de);
157 
159  virtual ~DtPageCreator();
160 
164  virtual std::string pageClassName() const = 0;
165 
167  virtual DtPage* create(QWidget* parent = 0, Qt::WindowFlags f = 0) = 0;
168 
169  protected:
171  };
172 
173 
180  template <typename PageClass>
182  {
183  public:
184 
187  : DtPageCreator(de)
188  {
189  }
190 
193  {
194  }
195 
198  virtual std::string pageClassName() const
199  {
200  return PageClass::thePageClassName();
201  }
202 
204  virtual DtPage* create(QWidget* parent = 0, Qt::WindowFlags f = 0)
205  {
206  return new PageClass(myDe, parent, f);
207  }
208  };
209 }
210 


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)