home *** CD-ROM | disk | FTP | other *** search
- /* %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- % Copyright (C) 1994, by WATCOM International Inc. All rights %
- % reserved. No part of this software may be reproduced or %
- % used in any form or by any means - graphic, electronic or %
- % mechanical, including photocopying, recording, taping or %
- % information storage and retrieval systems - except with the %
- % written permission of WATCOM International Inc. %
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- */
-
- /*************************************************************************
- *
- * WOlePersistentObjects -- Ole Persistent Storage interface family
- *
- * Events:
- *
- * PersistenceInitNew -- initialize new persistence storage
- *
- * PersistenceLoad -- load an object from persistence storage
- *
- * PersistenceSave -- save an object to persistence storage
- *
- * PersistenceSaveCompleted -- save to persistent storage is
- * complete
- *
- * PersistenceHandsOff -- dump all held storage elements
- *
- * PersistenceMaximumSize -- request for the max size of a
- * stream persistent storage object
- *
- *************************************************************************/
-
- #ifndef _WOLEPSIS_HPP_INCLUDED
- #define _WOLEPSIS_HPP_INCLUDED
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma pack(push,8);
- #pragma enum int;
- #endif
-
- #ifndef _WOLETYPE_HPP_INCLUDED
- # include "woletype.hpp"
- #endif
- #ifndef _WOLEIFAM_HPP_INCLUDED
- # include "woleifam.hpp"
- #endif
-
- enum WStorageType {
- WStorageTypeNone = 0,
- WStorageTypeStorage = 1,
- WStorageTypeStream = 2,
- WStorageTypeFile = 3,
- };
-
- struct WPersistenceEventData : public WEventData {
- WStorageType storageType;
- union {
- WPIStorage storage;
- WPIStream stream;
- WFilePath *fileName;
- };
-
- // Applies only when persisting to Storages (IPersistStorage)
- WBool sameAsLoad;
-
- // Applies only when persisting to Files (IPersistFile)
- WDWord mode;
- WBool remember;
- };
-
- #define PERSISTENCE_STREAM_DEF_MAX_SIZE 102
-
- struct WPersistenceMaximumSizeEventData : public WEventData {
- WULARGE_INTEGER maximumSize;
- };
-
- // forward class declarations
- class WOlePersistentObjects_IPStg;
- class WOlePersistentObjects_IPStrmI;
- class WOlePersistentObjects_IPFile;
-
- class WCMCLASS WOlePersistentObjects : public WOleInterfaceFamily
- {
- WDeclareSubclass( WOlePersistentObjects, WOleInterfaceFamily );
-
- friend class WOlePersistentObjects_IPStg;
- friend class WOlePersistentObjects_IPStrmI;
- friend class WOlePersistentObjects_IPFile;
-
- public:
-
- /**********************************************************
- * Constructors and Destructors
- *********************************************************/
-
- WOlePersistentObjects( WOleServerObject *serverObject );
- virtual ~WOlePersistentObjects();
-
- /**************************************************************
- * Properties
- **************************************************************/
-
- // Dirty
- WBool SetDirty( WBool dirty );
- WBool GetDirty( void ) const;
-
- // Storage type
- WBool SetStorageType( WStorageType storageType );
- WStorageType GetStorageType( void ) const;
-
- // Native Clipboard Format
- WBool SetNativeFormat( WInt format );
- WInt GetNativeFormat( void ) const;
-
- // User Type string
- WBool SetUserType( const WString & userType );
- WString GetUserType( void ) const;
-
- // Default Save Prompt
- WBool SetDefaultSavePrompt( const WFilePath & defaultSavePrompt );
- WFilePath GetDefaultSavePrompt( void ) const;
-
- // Storage Type Locked
- WBool GetStorageTypeLocked( void ) const;
-
- // Hands Off Storage
- WBool GetHandsOffStorage( void ) const;
-
- // Storage
- WPIStorage GetStorage( void ) const;
-
- // Filename
- WFilePath GetFileName( void ) const;
-
- /**************************************************************
- * Methods
- **************************************************************/
-
- // overrides
- virtual WBool QueryInterface( const WCLSID & clsid, void **iface );
-
- /**********************************************************
- * Operators
- *********************************************************/
-
- /**********************************************************
- * Data Members
- *********************************************************/
-
- protected:
-
- WStorageType _storageType;
- WBool _storageTypeLocked;
- WBool _dirty;
- WInt _clipboardFormat;
- WString _userType;
- WFilePath _defaultSavePrompt;
- WOlePersistentObjects_IPStg *_pIPersistStorage;
- WOlePersistentObjects_IPStrmI *_pIPersistStreamInit;
- WOlePersistentObjects_IPFile *_pIPersistFile;
-
- };
-
-
- #ifndef _WNO_PRAGMA_PUSH
- #pragma enum pop;
- #pragma pack(pop);
- #endif
-
- #endif // _WOLEPSIS_HPP_INCLUDED
-
-