VR-Vantage 3.1 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) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvCoreQt/vrvCoreQt.h>
13 
14 #include <QtWidgets/QWidget>
15 
16 #include <QtGui/QIcon>
17 
18 namespace makVrv
19 {
20  class DtDe;
21 
31  {
32 
33  public:
35  {
36  None = 0x0000,
37  Switching = 0x0001,
38  Closing = 0x0010
39  };
40  public:
44  DtPage(DtDe& de,QWidget* parent = 0, Qt::WindowFlags f = 0);
45 
47  virtual ~DtPage();
48 
50  virtual QIcon icon() = 0;
51 
54  virtual DtQIconConfigurations qIconConfigurations() const = 0;
55 
57  virtual QString title() = 0;
58 
60  virtual const std::string& pageClassName() const = 0;
61 
63  virtual PageAction pageAction();
64 
66  virtual void setPageAction(PageAction action);
67 
69  virtual void setActionFlag(int flag);
70 
72  virtual int actionFlag();
73 
75  virtual void setParentDialog(QWidget* paraentDialog);
76 
78  virtual QWidget* parentDialog();
79 
81  virtual void activate() = 0;
82 
84  virtual void deactivate() = 0;
85 
88  virtual bool shouldAskBeforeAction(PageAction action);
89 
93  virtual void askBeforeAction();
94 
97  virtual void executeAfterAsk(bool revert);
98 
100  virtual void resumeLastAction();
101 
103  virtual void onCloseEvent();
104 
106  virtual void onSwitchEvent();
107 
108  protected:
112  //the flag that will ask before executing the action, may revert or continue depends on the user input
114  };
115 
122  {
123  public:
125  DtPageCreator(DtDe& de);
126 
128  virtual ~DtPageCreator();
129 
133  virtual std::string pageClassName() const = 0;
134 
136  virtual DtPage* create(QWidget* parent = 0, Qt::WindowFlags f = 0) = 0;
137 
138  protected:
140  };
141 
142 
149  template <typename PageClass>
151  {
152  public:
153 
156  : DtPageCreator(de)
157  {
158  }
159 
162  {
163  }
164 
167  virtual std::string pageClassName() const
168  {
169  return PageClass::thePageClassName();
170  }
171 
173  virtual DtPage* create(QWidget* parent = 0, Qt::WindowFlags f = 0)
174  {
175  return new PageClass(myDe, parent, f);
176  }
177  };
178 }
179 


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