/***********************************************************************************************
RclsoftwareDendrosV2.idl
www.rclsoftware.org.uk Dendros v2 COM Interfaces
(c)2005-2007 R.C.Lafferty
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in the
Software without restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so, subject to the
following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
***********************************************************************************************/
import "objidl.idl";
/* The C++ header file needs to use the RclsoftwareOrgUk namespace. */
cpp_quote("#ifdef __cplusplus")
cpp_quote("namespace RclsoftwareOrgUk")
cpp_quote("{")
cpp_quote("#endif")
/***********************************************************************************************
Forward declarations
***********************************************************************************************/
interface IDendros0200Element1;
/***********************************************************************************************
IDendros0200Content1
***********************************************************************************************/
[
object,
uuid(1E5E11E1-4B4A-4880-8840-975DF3CD48DC),
helpstring("Represents Dendros v2.0 content in memory."),
local
]
interface IDendros0200Content1 : IUnknown
{
[propget, helpstring("The parent of this content, or null if there is none.")]
HRESULT Parent
(
[out,retval] IDendros0200Element1** theParent
);
}
/***********************************************************************************************
Dendros0200ValueType
***********************************************************************************************/
typedef [v1_enum] enum
{
dendros0200ValueTypeNone = 0x00, /* Reserved */
dendros0200ValueTypeBool = 0x01, /* 1bit boolean, 0 = false, 1 = true (size == 1 byte) */
dendros0200ValueTypeUInt8 = 0x02, /* 8bit unsigned integer, little endian */
dendros0200ValueTypeSInt8 = 0x03, /* 8bit signed integer, little endian 2s complement */
dendros0200ValueTypeUInt16 = 0x04, /* 16bit unsigned integer, little endian */
dendros0200ValueTypeSInt16 = 0x05, /* 16bit signed integer, little endian 2s complement */
dendros0200ValueTypeUInt32 = 0x06, /* 32bit unsigned integer, little endian */
dendros0200ValueTypeSInt32 = 0x07, /* 32bit signed integer, little endian 2s complement */
dendros0200ValueTypeUInt64 = 0x08, /* 64bit unsigned integer, little endian */
dendros0200ValueTypeSInt64 = 0x09, /* 64bit signed integer, little endian 2s complement */
dendros0200ValueTypeFloat = 0x0A, /* 32bit floating point number, little endian IEEE-754 */
dendros0200ValueTypeDouble = 0x0B, /* 64bit floating point number, little endian IEEE-754 */
dendros0200ValueTypeText = 0x0C, /* UTF-16LE encoded character (must not be zero) */
dendros0200ValueTypeForce32Bit = 0x7FFFffff
}
Dendros0200ValueType;
/***********************************************************************************************
IDendros0200Value1
***********************************************************************************************/
[
object,
uuid(2AE9EF89-5CFB-4d76-8379-338BB0629D4D),
helpstring("Represents a Dendros v2.0 Value in memory."),
local
]
interface IDendros0200Value1 : IDendros0200Content1
{
[helpstring("Assigns the data items of a Value to this Value.")]
HRESULT Assign
(
[in] IDendros0200Value1* inValue
);
[helpstring("Swaps the data items of this Value and another Value.")]
HRESULT Swap
(
[in] IDendros0200Value1* inoutValue
);
[helpstring("Retrieves a series of data items from this Value.")]
HRESULT ReadData
(
[in] unsigned int inBegin,
[in] unsigned int inEnd,
[in] void* outBuffer
);
[helpstring("Copies a series of data items into this Value.")]
HRESULT WriteData
(
[in] unsigned int inBegin,
[in] unsigned int inEnd,
[in] const void* inBuffer
);
[propget, helpstring("The number of data items which are stored in this Value.")]
HRESULT ItemCount
(
[out,retval] unsigned int* theItemCount
);
[propput, helpstring("The number of data items which are stored in this Value.")]
HRESULT ItemCount
(
[in] unsigned int theItemCount
);
[propget, helpstring("The size, in bytes, of each data item in this Value.")]
HRESULT ItemSize
(
[out,retval] unsigned int* theItemSize
);
[propget, helpstring("The type of data items which are stored in this Value.")]
HRESULT ItemType
(
[out,retval] Dendros0200ValueType* theItemType
);
[propput, helpstring("The type of data items which are stored in this Value.")]
HRESULT ItemType
(
[in] Dendros0200ValueType theItemType
);
}
/***********************************************************************************************
IDendros0200Element1
***********************************************************************************************/
[
object,
uuid(3BC3A18E-A170-4e39-85F0-1A9F1644A2E3),
helpstring("Represents a Dendros v2.0 Element in memory."),
local
]
interface IDendros0200Element1 : IDendros0200Content1
{
[helpstring("Assigns a deep copy of an Element to this Element.")]
HRESULT Assign
(
[in] IDendros0200Element1* inElement
);
[helpstring("Creates a deep clone of this Element.")]
HRESULT Clone
(
[out,retval] IDendros0200Element1** outNewElement
);
[helpstring("Removes all content from this Element.")]
HRESULT Clear
(
void
);
[helpstring("Inserts content into this Element before a given sibling (null = front).")]
HRESULT InsertBefore
(
[in] IDendros0200Element1* inContent,
[in] IDendros0200Element1* inBefore /* null = front */
);
[helpstring("Inserts content into this Element after a given sibling (null = back).")]
HRESULT InsertAfter
(
[in] IDendros0200Element1* inContent,
[in] IDendros0200Element1* inAfter /* null = back */
);
[helpstring("Removes content from this Element.")]
HRESULT Remove
(
[in] IDendros0200Element1* inContent
);
[propget, helpstring("The previous sibling of this Element, or null if there is none.")]
HRESULT PreviousSibling
(
[out,retval] IDendros0200Element1** thePreviousSibling
);
[propget, helpstring("The next sibling of this Element, or null if there is none.")]
HRESULT NextSibling
(
[out,retval] IDendros0200Element1** theNextSibling
);
[propget, helpstring("The first child Element of this Element, or null if there is none.")]
HRESULT FirstChildElement
(
[out,retval] IDendros0200Element1** theFirstElement
);
[propget, helpstring("The last child Element of this Element, or null if there is none.")]
HRESULT LastChildElement
(
[out,retval] IDendros0200Element1** theLastElement
);
[propget, helpstring("The number of child Elements in this Element.")]
HRESULT ChildElementCount
(
[out,retval] unsigned int* theElementCount
);
[propget, helpstring("A child Value of this Element.")]
HRESULT ChildValue
(
[in] unsigned int inValueIndex,
[out,retval] IDendros0200Value1** theChildValue
);
[propget, helpstring("The number of child Values in this Element.")]
HRESULT ChildValueCount
(
[out,retval] unsigned int* theValueCount
);
[propput, helpstring("The number of child Values in this Element.")]
HRESULT ChildValueCount
(
[in] unsigned int theValueCount
);
[propget, helpstring("The name of this Element.")]
HRESULT Name
(
[out,retval] BSTR* theName
);
[propput, helpstring("The name of this Element.")]
HRESULT Name
(
[in] BSTR theName
);
}
/***********************************************************************************************
Dendros0200Marker
***********************************************************************************************/
typedef [v1_enum] enum
{
dendros0200MarkerNone = 0,
dendros0200MarkerElementOpen = 1,
dendros0200MarkerElementClose = 2,
dendros0200MarkerValue = 3,
dendros0200MarkerForce32Bit = 0x7FFFffff
}
Dendros0200Marker;
/***********************************************************************************************
Dendros0200ValueInfo
***********************************************************************************************/
typedef struct
{
Dendros0200ValueType valueItemType;
unsigned int valueItemCount;
}
Dendros0200ValueInfo;
/***********************************************************************************************
IDendros0200Codec1
***********************************************************************************************/
[
object,
uuid(4EA79883-0F8B-492e-BD34-BF1355809907),
helpstring("Encodes/decodes Dendros v2 Documents"),
local
]
interface IDendros0200Codec1 : IUnknown
{
[helpstring("Creates an initialised Dendros v2.0 Element.")]
HRESULT CreateElement
(
[in] BSTR inNewName,
[out,retval] IDendros0200Element1** outNewElement
);
[helpstring("Reads and verifies the header of a Dendros v2 Document.")]
HRESULT DecodeHeader
(
void
);
[helpstring("Reads a marker from a Dendros v2 Document.")]
HRESULT DecodeMarker
(
[out,retval] Dendros0200Marker* outMarkerType
);
[helpstring("Reads information about an Element from a Dendros v2 Document.")]
HRESULT DecodeElementInfo
(
[out,retval] BSTR* outElementName
);
[helpstring("Reads information about a Value from a Dendros v2 Document.")]
HRESULT DecodeValueInfo
(
[out,retval] Dendros0200ValueInfo* outValueInfo
);
[helpstring("Reads data items of a Value from a Dendros v2 Document into a buffer (null = skip 'inCount' items).")]
HRESULT DecodeValueItems
(
[in] void* outBuffer, /* null = skip 'inCount' items */
[in] unsigned int inCount
);
[helpstring("Writes the header of a Dendros v2.0 Document.")]
HRESULT EncodeHeader
(
void
);
[helpstring("Writes a marker into a Dendros v2 Document.")]
HRESULT EncodeMarker
(
[in] Dendros0200Marker inMarker
);
[helpstring("Writes information about an Element into a Dendros v2 Document.")]
HRESULT EncodeElementInfo
(
[in] BSTR inElementName
);
[helpstring("Writes information about a Value into a Dendros v2 Document.")]
HRESULT EncodeValueInfo
(
[in] Dendros0200ValueType inValueItemType,
[in] unsigned int inValueItemCount
);
[helpstring("Writes data items of a Value from a buffer into a Dendros v2 Document.")]
HRESULT EncodeValueItems
(
[in] const void* inBuffer,
[in] unsigned int inCount
);
[propget, helpstring("The Stream used by this Codec.")]
HRESULT Stream
(
[out,retval] ISequentialStream** theStream
);
[propput, helpstring("The Stream used by this Codec.")]
HRESULT Stream
(
[in] ISequentialStream* theStream
);
}
/***********************************************************************************************
IDendros0200Support1
***********************************************************************************************/
[
object,
uuid(5D33BB1C-D03D-4672-89CB-9D1B214C1D01),
helpstring("Provides support functions for managing Dendros data trees."),
local
]
interface IDendros0200Support1 : IUnknown
{
[helpstring("Reports the size, in bytes, of a data item of a given type.")]
HRESULT FetchDataItemSize
(
[in] Dendros0200ValueType inType,
[out,retval] unsigned int* outSize
);
[helpstring("Drills for an Element according to a given path.")]
HRESULT DrillElement
(
[in] IDendros0200Element1* inTopElement,
[in] BSTR inPath,
[out,retval] IDendros0200Element1** outElement
);
[helpstring("Finds the first Element along a given path.")]
HRESULT FindFirstElement
(
[in] BSTR inPath,
[in] IDendros0200Element1* inTopElement,
[out,retval] IDendros0200Element1** outFoundElement
);
[helpstring("Finds the next Element along a given path.")]
HRESULT FindNextElement
(
[in] BSTR inPath,
[in] IDendros0200Element1* inPreviousFoundElement,
[out,retval] IDendros0200Element1** outNextFoundElement
);
[helpstring("Reports the path of an Element.")]
HRESULT FetchElementPath
(
[in] IDendros0200Element1* inElement,
[out,retval] BSTR* outPath
);
[helpstring("Reports the type and count of data items in a given leaf.")]
HRESULT FetchLeafInfo
(
[in] IDendros0200Element1* inElement,
[in] BSTR inLeafName,
[out,retval] Dendros0200ValueInfo* outLeafInfo
);
[helpstring("Reads the data items in a given leaf.")]
HRESULT ReadLeafData
(
[in] IDendros0200Element1* inElement,
[in] BSTR inLeafName,
[in] Dendros0200ValueType inType,
[in] unsigned int inCount,
[in] void* outBuffer
);
[helpstring("Writes the data items in a given leaf.")]
HRESULT WriteLeafData
(
[in] IDendros0200Element1* inElement,
[in] BSTR inLeafName,
[in] Dendros0200ValueType inType,
[in] unsigned int inCount,
[in] const void* inBuffer
);
[helpstring("Loads a Dendros data tree from a binary stream.")]
HRESULT LoadDocumentFromStream
(
[in] ISequentialStream* inInputStream,
[out,retval] IDendros0200Element1** outNewElement
);
[helpstring("Saves a Dendros data tree to a binary stream.")]
HRESULT SaveDocumentToStream
(
[in] IDendros0200Element1* inElement,
[in] ISequentialStream* inOutputStream
);
[helpstring("Loads a Dendros data tree from a binary file.")]
HRESULT LoadDocumentFromFile
(
[in] BSTR inFilename,
[out,retval] IDendros0200Element1** outNewElement
);
[helpstring("Saves a Dendros data tree to a binary file.")]
HRESULT SaveDocumentToFile
(
[in] BSTR inFilename,
[in] IDendros0200Element1* inElement
);
[helpstring("Loads a Dendros data tree from a binary resource.")]
HRESULT LoadDocumentFromResource
(
[in] HMODULE inModule,
[in] HRSRC inResource,
[out,retval] IDendros0200Element1** outNewElement
);
[propget, helpstring("The Codec used by this object.")]
HRESULT Codec
(
[out,retval] IDendros0200Codec1** theCodec
);
[propput, helpstring("The Codec used by this object.")]
HRESULT Codec
(
[in] IDendros0200Codec1* theCodec
);
[propget, helpstring("The Windows clipboard format ID for Dendros v2.0 Documents.")]
HRESULT ClipboardFormatID
(
[out,retval] unsigned int* theFormatID
);
[propget, helpstring("The Windows clipboard.")]
HRESULT Clipboard
(
[out,retval] IDendros0200Element1** theElement
);
[propput, helpstring("The Windows clipboard.")]
HRESULT Clipboard
(
[in] IDendros0200Element1* theElement
);
}
/***********************************************************************************************
IResourceSequentialStream1
***********************************************************************************************/
[
object,
uuid(6D532826-8C20-42cf-BA6D-DEE6DBFD1948),
helpstring("Sequential stream which represents a Windows resource (read only)."),
local
]
interface IResourceSequentialStream1 : ISequentialStream
{
[helpstring("Loads a Windows resource.")]
HRESULT LoadResource
(
[in] HMODULE inModule,
[in] HRSRC inResource
);
}
/***********************************************************************************************
ICountingSequentialStream1
***********************************************************************************************/
[
object,
uuid(7F116B8B-F336-4da1-90DE-D2A797B20FC7),
helpstring("Sequential stream which merely counts bytes (write only)."),
local
]
interface ICountingSequentialStream1 : ISequentialStream
{
[helpstring("Resets the byte count to zero.")]
HRESULT Reset
(
void
);
[propget, helpstring("How many bytes were written.")]
HRESULT ByteCount
(
[out,retval] UINT64* theCount
);
}
/***********************************************************************************************
IFileSequentialStream1
***********************************************************************************************/
[
object,
uuid(8332A74E-937D-4999-86A9-1EB7ED36AEC6),
helpstring("Sequential stream which represents a file."),
local
]
interface IFileSequentialStream1 : ISequentialStream
{
[propget, helpstring("The file handle.")]
HRESULT FileHandle
(
[out,retval] HANDLE* theFileHandle
);
[propput, helpstring("The file handle.")]
HRESULT FileHandle
(
[in] HANDLE theFileHandle
);
}
/***********************************************************************************************
RclsoftwareOrgUk DendrosV2
***********************************************************************************************/
[
uuid(0D0A38ED-6BF1-4917-BE4E-F707B1F0D479),
helpstring("www.rclsoftware.org.uk Dendros v2"),
version(4)
]
library RclsoftwareOrgUkDendrosV2
{
[
uuid(A2EC4BC3-FE46-4a7b-B309-9D641E72892D)
]
coclass Dendros0200Value1
{
interface IDendros0200Value1;
}
[
uuid(B6E219A9-1A41-469e-9167-32BC34A48585)
]
coclass Dendros0200Element1
{
interface IDendros0200Element1;
}
[
uuid(CE83528E-FA6D-41e8-8836-DD4B2C868B4D)
]
coclass Dendros0200Codec1
{
interface IDendros0200Codec1;
}
[
uuid(DD03F57C-7914-4bc5-B35E-EEC70D57EB2E)
]
coclass Dendros0200Support1
{
interface IDendros0200Support1;
}
[
uuid(E8CAC8EB-DF5A-452b-8339-B2E5D32ADAB4)
]
coclass ResourceSequentialStream1
{
interface IResourceSequentialStream1;
}
[
uuid(FD57D5A8-3231-4cb1-B94E-03F7929B01CD)
]
coclass CountingSequentialStream1
{
interface ICountingSequentialStream1;
}
[
uuid(DADD0954-94B7-4eb4-AC9D-835B999644E6)
]
coclass FileSequentialStream1
{
interface IFileSequentialStream1;
}
}
/* The C++ header file needs to use the RclsoftwareOrgUk namespace. */
cpp_quote("#ifdef __cplusplus")
cpp_quote("} // namespace RclsoftwareOrgUk")
cpp_quote("#endif")