VR-Forces 4.1.1 Class Documentation
entityEditorHistory.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2008 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 /*******************************************************************************
6 ** $RCSfile: entityEditorHistory.h,v $ $Revision: 1.7 $ $State: Exp $
7 *******************************************************************************/
8 
11 
12 #ifndef DtEntityEditorHistory_H_
13 #define DtEntityEditorHistory_H_
14 
16 #include <QtGui/QWidget>
17 #include <QtCore/QMap>
18 #include <QtCore/QVariant>
19 #include <QtCore/QString>
20 
21 class DtEntityEditorList;
22 class QPushButton;
23 class DtModelSetEntry;
24 class DtUiElementEvent;
25 
27 {
28 public:
29  DtHistoryItem() : myModel(0) {};
30  DtHistoryItem(DtModelSetEntry* m, const QMap<QString, QVariant>& state) : myModel(m), myState(state) {};
31  DtHistoryItem(const DtHistoryItem& orig) : myModel(orig.myModel), myState(orig.myState) {};
32  DtHistoryItem& operator=(const DtHistoryItem& rhs) { myModel = rhs.myModel; myState = rhs.myState; return *this; };
33 
34  DtModelSetEntry* myModel;
35  QMap<QString, QVariant> myState;
36 };
37 
39 {
40  Q_OBJECT
41 protected:
42  static const QMap<QString, QVariant> theEmptyStringVariantMap;
43 public:
45 
47  virtual void init(DtEntityEditorList* parent);
48 
49  virtual void clearHistory();
50 
53  virtual void addHistoryItem(DtModelSetEntry*, const QMap<QString, QVariant>& state = theEmptyStringVariantMap);
54  virtual void setUiState(int i, const QMap<QString, QVariant>&);
55 
56  int count() const { return myHistory.count(); };
57  int historyIndex() const { return myHistoryIndex; };
58 
60  virtual void updateUiSaveState(int i, const DtUiElementEvent& e);
61  virtual QMap<QString, QVariant> currentUiState() const;
62 
63 public slots:
65  virtual void moveBackward();
66  virtual void moveForward();
67 
69  virtual void moveTo(int);
70 
71 protected:
73  virtual void updateButtons();
74 
75 protected:
79  QVector<DtHistoryItem> myHistory;
81  bool myMoving;
82 };
83 
84 #endif

Document ID: Generated on Mon Apr 8 19:24:01 EDT 2013 from SVN revision 125877
Copyright © 2005-2013 VT MÄK. All Rights Reserved (www.mak.com)