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

# FileHandleC.h

    00001 //-------------------------------------------------------------------------
    00002 //
    00003 // File:        FileHandleC.h
    00004 // Desc:        File handle 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_FILEHANDLEC_H__
    00015 #define __DEMOPAJA_FILEHANDLEC_H__
    00016
    00017
    00018 namespace Import {
    00019     class FileHandleC;
    00020 };
    00021
    00022
    00023 #include "PajaTypes.h"
    00024 #include "DataBlockI.h"
    00025 #include "EditableI.h"
    00026 #include "UndoC.h"
    00027 #include "ImportableI.h"
    00028 #include <string>
    00029
    00030 namespace Import {
    00031
    00033     enum FileHandleFlagsE {
    00034         FILEHANDLE_FOLDER =                 0x001,
    00035         FILEHANDLE_FOLDER_EXPANDED =        0x002,
    00036         FILEHANDLE_FOLDERCOLOR_WHITE =      0x010,
    00037         FILEHANDLE_FOLDERCOLOR_RED =        0x020,
    00038         FILEHANDLE_FOLDERCOLOR_YELLOW =     0x040,
    00039         FILEHANDLE_FOLDERCOLOR_GREEN =      0x080,
    00040         FILEHANDLE_FOLDERCOLOR_CYAN =       0x100,
    00041         FILEHANDLE_FOLDERCOLOR_BLUE =       0x200,
    00042         FILEHANDLE_FOLDERCOLOR_MAGENTA =    0x400,
    00043         FILEHANDLE_FOLDERCOLOR_BLACK =      0x800,
    00044         FILEHANDLE_FOLDERCOLOR_MASK =       0xff0,
    00045         FILEHANDLE_INVALID_ID = -1,
    00046     };
    00047
    00049
    00056     class FileHandleC : public Edit::EditableI
    00057     {
    00058     public:
    00060         static FileHandleC*         create_new();
    00062         virtual Edit::DataBlockI*   create();
    00064         virtual Edit::DataBlockI*   create( Edit::EditableI* pOriginal );
    00066         virtual void                copy( Edit::EditableI* pEditable );
    00068         virtual void                restore( Edit::EditableI* pEditable );
    00069
    00071
    00075         virtual ImportableI*        get_importable();
    00076
    00078         virtual void                set_importable( ImportableI* pImportable );
    00079
    00081
    00083         virtual PajaTypes::uint32   get_id();
    00084
    00086
    00092         virtual void                set_id( PajaTypes::uint32 i32ID );
    00093
    00095         virtual void                inc_reference_count();
    00097         virtual void                reset_reference_count();
    00099         virtual PajaTypes::int32    get_reference_count();
    00100
    00102         virtual FileHandleC*        get_parent();
    00104         virtual void                set_parent( FileHandleC* pHandle );
    00106         virtual PajaTypes::int32    get_parent_id();
    00108         virtual void                set_parent_id( PajaTypes::int32 i32ID );
    00109
    00111         virtual const char*         get_folder_name() const;
    00113         virtual void                set_folder_name( const char* szName );
    00114
    00115         virtual void                set_flags( PajaTypes::int32 i32Flags );
    00116         virtual void                add_flags( PajaTypes::int32 i32Flags );
    00117         virtual void                del_flags( PajaTypes::int32 i32Flags );
    00118         virtual void                toggle_flags( PajaTypes::int32 i32Flags );
    00119         virtual PajaTypes::int32    get_flags();
    00120
    00121         // Serialize editable to a Demopaja output stream.
    00122         virtual PajaTypes::uint32   save( FileIO::SaveC* pSave );
    00123         // Serialize editable from a Demopaja input stream.
    00124         virtual PajaTypes::uint32   load( FileIO::LoadC* pLoad );
    00125
    00126     protected:
    00128         FileHandleC();
    00130         FileHandleC( Edit::EditableI* pOriginal );
    00132         virtual ~FileHandleC();
    00133
    00134     private:
    00135         PajaTypes::int32    m_i32RefCount;
    00136         ImportableI*        m_pImportable;
    00137         PajaTypes::uint32   m_i32ID;
    00138         FileHandleC*        m_pParent;
    00139         PajaTypes::uint32   m_i32ParentID;
    00140         PajaTypes::int32    m_i32Flags;
    00141         std::string         m_sFolderName;
    00142     };
    00143
    00144 };  // namespace
    00145
    00146 #endif