VR-Forces 4.10 Class 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) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 #include <vrvCoreQt/vrvCoreQt.h>
12 #include <QtWidgets/QWidget>
13 #include <QtGui/QIcon>
14 
15 namespace makVrv
16 {
17  class DtDe;
18 
27  class DT_DLL_VRVCOREQT DtPage : public QWidget
28  {
29 
30  public:
32  {
33  None = 0x0000,
34  Switching = 0x0001,
35  Closing = 0x0010
36  };
37  public:
41  DtPage(DtDe& de,QWidget* parent = 0, Qt::WindowFlags f = 0);
42 
44  virtual ~DtPage();
45 
47  virtual QIcon icon() = 0;
48 
50  virtual QString title() = 0;
51 
53  virtual const std::string& pageClassName() const = 0;
54 
56  virtual PageAction pageAction();
57 
59  virtual void setPageAction(PageAction action);
60 
62  virtual void setActionFlag(int flag);
63 
65  virtual int actionFlag();
66 
68  virtual void setParentDialog(QWidget* paraentDialog);
69 
71  virtual QWidget* parentDialog();
72 
74  virtual void activate() = 0;
75 
77  virtual void deactivate() = 0;
78 
81  virtual bool shouldAskBeforeAction(PageAction action);
82 
86  virtual void askBeforeAction();
87 
90  virtual void executeAfterAsk(bool revert);
91 
93  virtual void resumeLastAction();
94 
96  virtual void onCloseEvent();
97 
99  virtual void onSwitchEvent();
100 
101  protected:
103  QWidget* myParentDialog;
105  //the flag that will ask before executing the action, may revert or continue depends on the user input
107  };
108 
115  {
116  public:
118  DtPageCreator(DtDe& de);
119 
121  virtual ~DtPageCreator();
122 
126  virtual std::string pageClassName() const = 0;
127 
129  virtual DtPage* create(QWidget* parent = 0, Qt::WindowFlags f = 0) = 0;
130 
131  protected:
133  };
134 
135 
142  template <typename PageClass>
144  {
145  public:
146 
149  : DtPageCreator(de)
150  {
151  }
152 
155  {
156  }
157 
160  virtual std::string pageClassName() const
161  {
162  return PageClass::thePageClassName();
163  }
164 
166  virtual DtPage* create(QWidget* parent = 0, Qt::WindowFlags f = 0)
167  {
168  return new PageClass(myDe, parent, f);
169  }
170  };
171 }
172 
DtDe & myDe
Definition: DtPage.h:102
PageAction myCurrentPageAction
Definition: DtPage.h:104
DtDe & myDe
Definition: DtPage.h:132
QWidget * myParentDialog
Definition: DtPage.h:103
virtual DtPage * create(QWidget *parent=0, Qt::WindowFlags f=0)
Simple implementation of the create call to make a PageClass.
Definition: DtPage.h:166
The page creator.
Definition: DtPage.h:114
#define DT_DLL_VRVCOREQT
Definition: vrvCoreQt.h:20
Contains DLL export macros.
Definition: DtPage.h:143
virtual std::string pageClassName() const
get the name of the PageClass.
Definition: DtPage.h:160
virtual ~DtPageCreatorTemplate()
Virtual DTOR allows subclasses to clean up resources.
Definition: DtPage.h:154
int myActionFlag
Definition: DtPage.h:106
The page is a single widget component which is viewed in a page collection.
Definition: DtPage.h:27
DtPageCreatorTemplate(DtDe &de)
CTOR takes a reference to the DtDe object.
Definition: DtPage.h:148
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
PageAction
Definition: DtPage.h:31

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)