PrevNextUpHome SophiaFramework UNIVERSE 5.3
SFBClipboard
Wrapper Class for the IClipboard interface.
#include <SFBClipboard.h.hpp>
class SFBClipboard : public SFBBase;
SFMTYPEDEFWRAPPER(SFBClipboard)

Inheritance diagram

 Inheritance diagram of SFBClipboardClass

Version

BREW 2.0 BREW 2.1 BREW 3.1 BREW 4.0
O O O O

Reference

BREW API IClipboard

Menber

Public Functions
SFCError ClearData( ACharConstPtr format )
Remove all data in specified format from the clipboard.
SFCError ClearData( SFXAnsiStringConstRef format )
Remove all data in specified format from the clipboard.
SFCError Empty( Void )
Remove all data in all formats from the clipboard.
Bool EnumInit( Void )
Initialize the enumeration context for the formats in the clipboard.
Bool EnumNext( CBItemInfo* itemInfo )
Return the next available/registered clipboard format.
SFCError GetData( ACharConstPtr format , VoidPtr data , SInt32Ptr size )
Copy clipboard data for the specified clipboard format to the destination buffer.
SFCError GetData( ACharConstPtr format , SFXBufferPtr data )
Copy clipboard data for the specified clipboard format to the destination buffer.
SFCError GetData( SFXAnsiStringConstRef format , VoidPtr data , SInt32Ptr size )
Copy clipboard data for the specified clipboard format to the destination buffer.
SFCError GetData( SFXAnsiStringConstRef format , SFXBufferPtr data )
Copy clipboard data for the specified clipboard format to the destination buffer.
UInt32 GetSequence( Void )
Return the sequence number of the clipboard.
UInt32 MaxFreeBlock( UInt32Ptr total = null , UInt32Ptr used = null )
Return the maximum free block size. Fills pointers to the total size (in bytes) and total used size (in bytes) of the clipboard.
static
SFBClipboardSmp
NewInstance( SFCErrorPtr exception = null )
Create a new SFBClipboard instance.
static
SFBClipboardSmp
NewInstance( AEECLSID id , SFCErrorPtr exception = null )
Create a new SFBClipboard instance.
SFCError SetData( ACharConstPtr format , VoidPtr data , SInt32 size )
Set the data for a clipboard format.
SFCError SetData( ACharConstPtr format , SFXBufferPtr data )
Set the data for a clipboard format.
SFCError SetData( SFXAnsiStringConstRef format , VoidPtr data , SInt32 size )
Set the data for a clipboard format.
SFCError SetData( SFXAnsiStringConstRef format , SFXBufferPtr data )
Set the data for a clipboard format.
Protected Functions
static
SFBBaseSmp
FactoryByCreate( AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface.
static
SFBBaseSmp
FactoryByQuery( SFBQuerySmpConstRef query , AEECLSID id , SFCErrorPtr exception = null ) (inherits from SFBBase)
Create the instance for the specified ClassID's interface using the SFBQuery instance.

SFBClipboard::ClearData
Remove all data in specified format from the clipboard.
[ public ]
SFCError ClearData(
    ACharConstPtr format   // format name
);
[ public ]
SFCError ClearData(
    SFXAnsiStringConstRef format   // format name
);

Reference

SFBClipboard::SetData


SFBClipboard::Empty
Remove all data in all formats from the clipboard.
[ public ]
SFCError Empty(Void);

Reference

BREW API ICLIPBOARD_Empty


SFBClipboard::EnumInit
Initialize the enumeration context for the formats in the clipboard.
[ public ]
Bool EnumInit(Void);

Reference

BREW API ICLIPBOARD_EnumInit | SFBClipboard::EnumNext


SFBClipboard::EnumNext
Return the next available/registered clipboard format.
[ public ]
Bool EnumNext(
    CBItemInfo* itemInfo   
);

Parameters

itemInfo

Pointer to item information to fill. Before calling this function, the members pszName and nNameLen members of the pci parameter (that is, CBItemInfo struct) must be set properly. On return, pszName will contain the name of the format and nDataSize will contain the actual size of the data. On input: itemInfo -> pszName must be a valid pointer capable of holding a string. itemInfo -> nNameLen specifies the size (in bytes) that the pointer itemInfo -> pszName can hold. On Return: itemInfo -> pszName contains the format name. itemInfo -> nDataLen contains the size of the data in the clipboard for this format.

Reference

BREW API ICLIPBOARD_EnumNext | SFBClipboard::EnumInit


SFBClipboard::GetData
Copy clipboard data for the specified clipboard format to the destination buffer.
[ public ]
SFCError GetData(
    ACharConstPtr format   // name of the format
    VoidPtr data           // pointer to destination data buffer
    SInt32Ptr size         // input size of destination buffer and output size copied
);
[ public ]
SFCError GetData(
    ACharConstPtr format   // name of the format
    SFXBufferPtr data      // pointer to destination data buffer.
                           // size is automatically set to output size copied
);
[ public ]
SFCError GetData(
    SFXAnsiStringConstRef format   // name of the format
    VoidPtr data                   // pointer to destination data buffer
    SInt32Ptr size                 // input size of destination buffer and output size copied
);
[ public ]
SFCError GetData(
    SFXAnsiStringConstRef format   // name of the format
    SFXBufferPtr data              // pointer to destination data buffer.
                                   // size is automatically set to output size copied
);

Instruction

Warning: Buffer size is limited to the maximum value of SInt32.

Reference

BREW API ICLIPBOARD_GetData | SFBClipboard::SetData


SFBClipboard::GetSequence
Return the sequence number of the clipboard.
[ public ]
UInt32 GetSequence(Void);

Description

This function is provided to allow the caller to determine if the clipboard has been updated. Updates to the clipboard include the addition of data. The sequence number is only counted up on data addition. Data removal has no effect on the sequence number. The sequence number resets when BREW exits; that is, when the handset is power-cycled.

Reference

BREW API ICLIPBOARD_GetSequence


SFBClipboard::MaxFreeBlock
Return the maximum free block size. Fills pointers to the total size (in bytes) and total used size (in bytes) of the clipboard.
[ public ]
UInt32 MaxFreeBlock(
    UInt32Ptr total = null   // pointer to fill with total size in bytes of the clipboard memory (if non-null)
    UInt32Ptr used = null    // pointer to fill with total space used in clipboard (if non-null)
);

Reference

BREW API ICLIPBOARD_MaxFreeBlock


SFBClipboard::NewInstance
Create a new SFBClipboard instance.
[ public, static ]
SFBClipboardSmp NewInstance(
    SFCErrorPtr exception = null   // Error
);
[ public, static ]
SFBClipboardSmp NewInstance(
    AEECLSID id                    // Class ID
    SFCErrorPtr exception = null   // Error
);

SFBClipboard::SetData
Set the data for a clipboard format.
[ public ]
SFCError SetData(
    ACharConstPtr format   // format name
    VoidPtr data           // data pointer
    SInt32 size            // size of data object
);
[ public ]
SFCError SetData(
    ACharConstPtr format   // format name
    SFXBufferPtr data      // when null, null and 0 are sent as parameter
);
[ public ]
SFCError SetData(
    SFXAnsiStringConstRef format   // format name
    VoidPtr data                   // data pointer
    SInt32 size                    // size of data object
);
[ public ]
SFCError SetData(
    SFXAnsiStringConstRef format   // format name
    SFXBufferPtr data              // when null, null and 0 are sent as parameter
);

Description

Because clipboard data can live beyond the life of an application, this function allocates new memory and copies the contents into a new buffer.

[Note] Note
Passing a null pointer or a size of 0 frees existing clipboard data. The clipboard can contain only single data for a certain format name. Data already associated with the format is released.

Reference

BREW API ICLIPBOARD_SetData | SFBClipboard::GetData