#ifndef TDx9_XFileBinaryH #define TDx9_XFileBinaryH // ========================================================================== // File: TDx9_XFileBinary.H // Authors: BCB_Code_Generator v2.00, // Darren Dwyer (source code, documentation, demos, website), // Hugh Edwards (documentation, icons) // Description: This file defines the TDx9_XFileBinary Component // // "TDx9_XFile_Library v1.00" // (c) 2005 BCB-Tools.com Pty. Ltd., Sydney, Australia. // All Rights Reserved. // // Refer to the 'Licence.Txt' file for licencing & copyright information. // ========================================================================== // -------------------------------------------------------------------------- #include "TDx_Library_Defns.H" #include "TDx_Library_Functions.H" // -------------------------------------------------------------------------- #include "TDx9_XFile_Library_Defns.H" #include "TDx9_XFile_Library_Functions.H" // -------------------------------------------------------------------------- // ========================================================================== // Class: TDx9_XFileBinary // Description: The TDx9_XFileBinary object is used to ... // ========================================================================== #if (__BORLANDC__ >= 0x0530) // BCB Version 3 + class PACKAGE TDx9_XFileBinary : public TDx9_XFileObject { // -------------------------------------------------------------------------- #else // BCB Version 1 class TDx9_XFileBinary : public TDx9_XFileObject { #endif // ========================================================================== __published: // ========================================================================== // ---------------------------------------------------------------------- // Event: OnCreate() // Description: The OnCreate() event is triggered by the // TDx9_XFileBinary::Create() method after it has // successfully created the internal LPIDIRECTXFILEBINARY // used within the TDx9_XFileBinary component. // // Note that since this event is only called upon successful // creation, this event is an ideal place for code that is // to be activated only once, immediately upon the // successful creation of the LPIDIRECTXFILEBINARY // interface. // // For example, you could retrieve the TDx9_XFileBinary // component's capabilities, Create() dependant components, // allocate memory, etc. // // When used in conjunction with the // TDx9_XFileBinary::OnDestroy() event, you can fully // automate and insulate your code on a per-component basis. // ---------------------------------------------------------------------- __property TDx_Event OnCreate = {read=FOnCreate, write=FOnCreate, nodefault}; // ---------------------------------------------------------------------- // Event: OnDestroy() // Description: The OnDestroy() event is triggered by the // TDx9_XFileBinary::Destroy() method, just before the // TDx9_XFileBinary internal LPIDIRECTXFILEBINARY interface // is destroyed. // // Note: This event is an ideal place to place code that // reverses the results of the TDx9_XFileBinary::OnCreate() // event. For example, assume you have already setup the // TDx9_XFileBinary::OnCreate() event to retrieve the // component's capabilities, Create() a dependant component // and allocate some memory; // You can then fully automate and insulate your code on a // per-component basis by placing code in the // TDx9_XFileBinary::OnDestroy() event to deallocate memory, // Destroy() the dependant components and, when required, // destroy the capabilities component. // ---------------------------------------------------------------------- __property TDx_Event OnDestroy = {read=FOnDestroy, write=FOnDestroy, nodefault}; // ---------------------------------------------------------------------- // Event: OnError() // Description: The OnError event is called when an error occurs in the // TDx9_XFileBinary component. // ---------------------------------------------------------------------- __property TDx_Error OnError = {read=FOnError, write=FOnError, nodefault}; // ========================================================================== public: // ========================================================================== // ---------------------------------------------------------------------- // Property: Created // Description: The Created property is true if the internal // LPIDIRECTXFILEBINARY used in this component has been // successfully created, otherwise Created is false. // // To create the internal LPIDIRECTXFILEBINARY, call the // TDx9_XFileBinary::Create() method. // ---------------------------------------------------------------------- __property bool Created = { read=FGetCreated, write=FSetCreated, default=false }; // ---------------------------------------------------------------------- // Property: ErrorValue // Description: The ErrorValue property contains the last error value // returned from a call to a TDx9_XFileBinary method or // fget/fset. eg. or DDERR_SURFACELOST or TDX_ERROR // ---------------------------------------------------------------------- __property HRESULT ErrorValue = { read=FGetErrorValue, write=FSetErrorValue, nodefault }; // ---------------------------------------------------------------------- // Method: Create() // Description: The Create() method is used to automatically create the // internal LPIDIRECTXFILEBINARY interface used in the // TDx9_XFileBinary component and must be called before any // methods of the TDx9_XFileBinary component will function. // ---------------------------------------------------------------------- virtual bool __fastcall Create(); // ---------------------------------------------------------------------- // Method: Destroy() // Description: The Destroy() method is used to automatically destroy the // internal LPIDIRECTXFILEBINARY interface used in the // TDx9_XFileBinary component and should be called when the // internal interface is no longer required. // // Note: This method is called by the component's // destructor. // ---------------------------------------------------------------------- virtual bool __fastcall Destroy(); // ---------------------------------------------------------------------- // Method: GetId() // Description: The GetId method is used to ... // Params: pGuid - // The Guid parameter ... // ---------------------------------------------------------------------- virtual bool __fastcall GetId( GUID* pGuid ); // ---------------------------------------------------------------------- // Method: GetMimeType() // Description: The GetMimeType method is used to ... // Params: pMimeType - // The MimeType parameter ... // ---------------------------------------------------------------------- virtual bool __fastcall GetMimeType( AnsiString** pMimeType ); // ---------------------------------------------------------------------- // Method: GetName() // Description: The GetName method is used to ... // Params: pNameBuf - // The NameBuf parameter ... // pBufLen - // The BufLen parameter ... // ---------------------------------------------------------------------- virtual bool __fastcall GetName( AnsiString* pNameBuf, dword* pBufLen ); // ---------------------------------------------------------------------- // Method: GetSize() // Description: The GetSize method is used to ... // Params: pSize - // The Size parameter ... // ---------------------------------------------------------------------- virtual bool __fastcall GetSize( dword* pSize ); // ---------------------------------------------------------------------- // Method: Read() // Description: The Read method is used to ... // Params: pData - // The Data parameter ... // pSize - // The Size parameter ... // pRead - // The Read parameter ... // ---------------------------------------------------------------------- virtual bool __fastcall Read( void* pData, dword pSize, dword* pRead ); // ---------------------------------------------------------------------- // Constructor() and Destructor() // ---------------------------------------------------------------------- __fastcall TDx9_XFileBinary(TComponent* Owner); virtual __fastcall ~TDx9_XFileBinary(); // ---------------------------------------------------------------------- // The following properties and methods are used internally by // TDx9_XFile_Library and should not be used. // ---------------------------------------------------------------------- __property LPIDIRECTXFILEBINARY Internal_LPIDIRECTXFILEBINARY = { read=FGetInternal_LPIDIRECTXFILEBINARY, write=FSetInternal_LPIDIRECTXFILEBINARY, nodefault }; __property LPIDIRECTXFILEBINARY* Internal_LPIDIRECTXFILEBINARY_Ptr = { read=FGetInternal_LPIDIRECTXFILEBINARY_Ptr, nodefault }; void __fastcall Internal_LPIDIRECTXFILEBINARY_Update(); // ========================================================================== protected: // ========================================================================== // ---------------------------------------------------------------------- // Property Access Methods // ---------------------------------------------------------------------- bool __fastcall FGetCreated(); void __fastcall FSetCreated( bool pCreated ); HRESULT __fastcall FGetErrorValue(); void __fastcall FSetErrorValue( HRESULT pErrorValue ); // ========================================================================== private: // ========================================================================== // ---------------------------------------------------------------------- // Internal Interface Access // ---------------------------------------------------------------------- LPIDIRECTXFILEBINARY __fastcall FGetInternal_LPIDIRECTXFILEBINARY(); void __fastcall FSetInternal_LPIDIRECTXFILEBINARY( LPIDIRECTXFILEBINARY pLPIDIRECTXFILEBINARY ); LPIDIRECTXFILEBINARY* __fastcall FGetInternal_LPIDIRECTXFILEBINARY_Ptr(); // ---------------------------------------------------------------------- // Property Variables // ---------------------------------------------------------------------- bool fCreated; HRESULT fErrorValue; // ---------------------------------------------------------------------- // Interface Variables // ---------------------------------------------------------------------- LPIDIRECTXFILEBINARY fLPIDIRECTXFILEBINARY; // ---------------------------------------------------------------------- // Event Variables // ---------------------------------------------------------------------- TDx_Event FOnCreate; TDx_Event FOnDestroy; TDx_Error FOnError; }; // -------------------------------------------------------------------------- #endif // --------------------------------------------------------------------------