VR-Vantage 3.1.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 
DtDe & myDe
Definition: DtPage.h:109
PageAction myCurrentPageAction
Definition: DtPage.h:111
DtDe & myDe
Definition: DtPage.h:139
QWidget * myParentDialog
Definition: DtPage.h:110
virtual DtPage * create(QWidget *parent=0, Qt::WindowFlags f=0)
Simple implementation of the create call to make a PageClass.
Definition: DtPage.h:173
The page creator.
Definition: DtPage.h:121
Contains makVrv::DtWidgetIconStyleManager class declaration.
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
Contains DLL export macros.
Definition: DtPage.h:150
virtual std::string pageClassName() const
get the name of the PageClass.
Definition: DtPage.h:167
virtual ~DtPageCreatorTemplate()
Virtual DTOR allows subclasses to clean up resources.
Definition: DtPage.h:161
int myActionFlag
Definition: DtPage.h:113
The page is a single widget component which is viewed in a page collection.
Definition: DtPage.h:30
DtPageCreatorTemplate(DtDe &de)
CTOR takes a reference to the DtDe object.
Definition: DtPage.h:155
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:72
A collection of icon configurations.
Definition: DtQIconConfiguration.h:131
PageAction
Definition: DtPage.h:34


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