VR-Forces 4.6 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) 2010 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: $ $Revision: $ $State: $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 #include <vrvCoreQt/vrvCoreQt.h>
15  #include <QtWidgets/QWidget>
16 #include <QtGui/QIcon>
17 
18 namespace makVrv
19 {
20  class DtDe;
21 
30  class DT_DLL_VRVCOREQT DtPage : public QWidget
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 
53  virtual QString title() = 0;
54 
56  virtual const std::string& pageClassName() const = 0;
57 
59  virtual PageAction pageAction();
60 
62  virtual void setPageAction(PageAction action);
63 
65  virtual void setActionFlag(int flag);
66 
68  virtual int actionFlag();
69 
71  virtual void setParentDialog(QWidget* paraentDialog);
72 
74  virtual QWidget* parentDialog();
75 
77  virtual void activate() = 0;
78 
80  virtual void deactivate() = 0;
81 
84  virtual bool shouldAskBeforeAction(PageAction action);
85 
89  virtual void askBeforeAction();
90 
93  virtual void executeAfterAsk(bool revert);
94 
96  virtual void resumeLastAction();
97 
99  virtual void onCloseEvent();
100 
102  virtual void onSwitchEvent();
103 
104  protected:
106  QWidget* myParentDialog;
108  //the flag that will ask before executing the action, may revert or continue depends on the user input
110  };
111 
118  {
119  public:
121  DtPageCreator(DtDe& de);
122 
124  virtual ~DtPageCreator();
125 
129  virtual std::string pageClassName() const = 0;
130 
132  virtual DtPage* create(QWidget* parent = 0, Qt::WindowFlags f = 0) = 0;
133 
134  protected:
136  };
137 
138 
145  template <typename PageClass>
147  {
148  public:
149 
152  : DtPageCreator(de)
153  {
154  }
155 
158  {
159  }
160 
163  virtual std::string pageClassName() const
164  {
165  return PageClass::thePageClassName();
166  }
167 
169  virtual DtPage* create(QWidget* parent = 0, Qt::WindowFlags f = 0)
170  {
171  return new PageClass(myDe, parent, f);
172  }
173  };
174 }
175 

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)