VR-Forces 4.0.4 Class Documentation
include/entityEditorImpl/entityEditorHistory.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2008 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: entityEditorHistory.h,v $ $Revision: 1.7 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00012 #ifndef DtEntityEditorHistory_H_
00013 #define DtEntityEditorHistory_H_
00014 
00015 #include "entityEditorImpl/entityEditorImplDefines.h"
00016 #include <QtGui/QWidget>
00017 #include <QtCore/QMap>
00018 #include <QtCore/QVariant>
00019 #include <QtCore/QString>
00020 
00021 class DtEntityEditorList;
00022 class QPushButton;
00023 class DtModelSetEntry;
00024 class DtUiElementEvent;
00025 
00026 class DT_DLL_entityeditorimpl DtHistoryItem
00027 {
00028 public:
00029    DtHistoryItem() : myModel(0) {};
00030    DtHistoryItem(DtModelSetEntry* m, const QMap<QString, QVariant>& state) : myModel(m), myState(state) {};
00031    DtHistoryItem(const DtHistoryItem& orig) : myModel(orig.myModel), myState(orig.myState) {};
00032    DtHistoryItem& operator=(const DtHistoryItem& rhs) { myModel = rhs.myModel; myState = rhs.myState; return *this; };
00033 
00034    DtModelSetEntry* myModel;
00035    QMap<QString, QVariant> myState;
00036 };
00037 
00038 class DT_DLL_entityeditorimpl DtEntityEditorHistory : public QWidget
00039 {
00040    Q_OBJECT
00041 protected:
00042    static const QMap<QString, QVariant> theEmptyStringVariantMap;
00043 public:
00044    DtEntityEditorHistory(QWidget* p);
00045 
00047    virtual void init(DtEntityEditorList* parent);
00048 
00049    virtual void clearHistory();
00050 
00053    virtual void addHistoryItem(DtModelSetEntry*, const QMap<QString, QVariant>& state = theEmptyStringVariantMap);
00054    virtual void setUiState(int i, const QMap<QString, QVariant>&);
00055 
00056    int count() const { return myHistory.count(); };
00057    int historyIndex() const { return myHistoryIndex; };
00058 
00060    virtual void updateUiSaveState(int i, const DtUiElementEvent& e);
00061    virtual QMap<QString, QVariant> currentUiState() const;
00062 
00063 public slots:
00065    virtual void moveBackward();
00066    virtual void moveForward();
00067 
00069    virtual void moveTo(int);
00070 
00071 protected:
00073    virtual void updateButtons();
00074 
00075 protected:
00076    DtEntityEditorList*  myParent;
00077    QPushButton*         myForward;
00078    QPushButton*         myBackward;
00079    QVector<DtHistoryItem>    myHistory;
00080    int                  myHistoryIndex;
00081    bool                 myMoving;
00082 };
00083 
00084 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)