Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members Related Pages

# UndoC.h

    00001 //-------------------------------------------------------------------------
    00002 //
    00003 // File:        UndoC.h
    00004 // Desc:        Undo object class.
    00005 // Author:      memon <memon@inside.org>
    00006 //
    00007 //-------------------------------------------------------------------------
    00008 //  Copyright (c) 2000-2002 Moppi Productions. All Rights Reserved.
    00009 //  This file is part of Moppi Demopaja SDK. For conditions of
    00010 //  distribution and use, see the accompanying license.txt file.
    00011 //  http://moppi.inside.org/demopaja/
    00012 //-------------------------------------------------------------------------
    00013
    00014 #ifndef __DEMOPAJA_UNDOC_H__
    00015 #define __DEMOPAJA_UNDOC_H__
    00016
    00017 // Forward declaration.
    00018 namespace Edit {
    00019     class UndoC;
    00020 };
    00021
    00022 #include "DataBlockI.h"
    00023 #include "PajaTypes.h"
    00024 #include <vector>
    00025 #include <string>
    00026 #include "EditableI.h"
    00027
    00028 namespace Edit {
    00029
    00031     enum DiscardableTypeE {
    00032         DATA_REMOVED = 1,
    00033         DATA_CREATED = 2,
    00034     };
    00035
    00037
    00049     class UndoC
    00050     {
    00051     public:
    00052
    00054
    00055         UndoC( const char* szName );
    00056
    00058         virtual ~UndoC();
    00059
    00061         virtual void            undo();
    00062
    00064         virtual void            redo();
    00065
    00067
    00079         virtual void            add_restore_data( EditableI* pBlock );
    00080
    00082
    00087         virtual void            add_discardable_data( DataBlockI* pBlock, PajaTypes::uint32 ui32Flags );
    00088
    00090         virtual const char*     get_name();
    00091
    00093         virtual bool            can_redo();
    00094
    00095     private:
    00096
    00097         struct DiscardableS {
    00098             DataBlockI* m_pData;
    00099             bool        m_bDiscard;
    00100         };
    00101
    00102         std::vector<EditableI*>     m_rUndoBlocks;
    00103         std::vector<EditableI*>     m_rRedoBlocks;
    00104         std::vector<DiscardableS>   m_rDiscardable;
    00105         std::string                 m_sName;
    00106         bool                        m_bUndoDone;
    00107     };
    00108
    00109
    00110 };  // namespace Edit
    00111
    00112
    00113
    00114 #endif  //__DEMOPAJA_UNDOC_H__