ClipBoard< SmartUtil::tstring > Class Template Reference

clipboard operations. More...

Inherits ClipBoardBase.

List of all members.

Public Types

enum  ClipBoardFormat
 Types of clipboard format. More...

Public Member Functions

SmartUtil::tstring getClipBoardData (const Widget *owner) const
 Retrieves clipboard data from the clipboard (assumes clipboard format is string).
bool isClipBoardFormatAvailable (ClipBoardFormat format)
 Checks to see if the queried clipboard format is available.
void setClipBoardData (const SmartUtil::tstring &str, const Widget *owner)
 Sets clipboard data to given string.

Static Public Member Functions

static ClipBoard & instance ()
 Returns the actual instance of the object.


Detailed Description

template<>
class SmartWin::ClipBoard< SmartUtil::tstring >

clipboard operations.

At the moment SmartWin only supports SmartUtil::tstring clipboard operations.
More clipboard formats will be supported in later version.
Every clipboard class is a Singleton to make access easy.
Just remember that if you stuff things into the clipboard then access it again later as the type you stuffed it in as!


Member Enumeration Documentation

enum ClipBoardFormat [inherited]

Types of clipboard format.

Basically just maps to the defines from winuser.h which is prefixed with CF_ in front of the name


Member Function Documentation

SmartUtil::tstring getClipBoardData ( const Widget owner  )  const

Retrieves clipboard data from the clipboard (assumes clipboard format is string).

When accessing the clipboard we need to "send a rquest" from a specific window.
The "owner" parameter defines this window.
If you try to access the clipboard you will get an empty string ("") returned if the clipboard is either empty or if the clipboard data was of the wrong format.

static ClipBoard& instance (  )  [static]

Returns the actual instance of the object.

Every clipboard specialized class is a singleton, partially too be easily accessible but also to ensure serial access to the object.
SmartWin uses "instance" all through the library to access the instance object of singleton classes, use this function to retrieve the instance object.

bool isClipBoardFormatAvailable ( ClipBoardFormat  format  )  [inherited]

Checks to see if the queried clipboard format is available.

Returns true if the queried clipboard format is available, otherwise false.

void setClipBoardData ( const SmartUtil::tstring &  str,
const Widget owner 
)

Sets clipboard data to given string.

Takes a "parent" window which will "own" the clipboard and a SmartUtil::tstring which will be stuffed into the clipboard and made
accessible for other applications as CF_TEXT or your own application.
Just remember that if you use this specialized instance of the clipboard class you must access the clipboard again (through getClipBoardData)
through the same specialization (SmartUtil::tstring specialization).

Back to SmartWin website
SourceForge.net Logo