Public Member Functions | |
Clipboard (const String &cName="") | |
Constructor. | |
~Clipboard () | |
Destructor. | |
bool | Lock () |
Locks the clipboard. | |
void | Unlock () |
Unlocks the clipboard. | |
void | Clear () |
Clears the clipboard. | |
void | Commit () |
Adds the data to the clipboard. | |
Message * | GetData () |
Returns the data that was added to the clipboard. | |
Classes | |
class | Private |
internal More... |
Clipboard cClipboard; //we lock the clipboard and then we clear the data's contents cClipboard.Lock(); cClipboard.Clear(); //we get the clipboard message and then we add a string to it under "text/plain" Message *pcData = cClipboard.GetData(); pcData->AddString( "text/plain", *pcBuffer ); //we committ our changes and then we unlock the clipboard cClipboard.Commit(); cClipboard.Unlock();
const char *pzBuffer; int nError; Clipboard cClipboard; //lock the clipboard and get the data from the clipboard cClipboard.Lock(); Message *pcData = cClipboard.GetData(); //the data that is in the clipboard is plain text, so you find a string in the message that is "text/plain" //nError will be 0 there isn't any strings in the message under the name "text/plain" //The string "text/plain" will likely change to something a little more generic to allow more than just strings to be clipped. nError = pcData->FindString( "text/plain", &pzBuffer ); //add some error checking if( nError == 0 ) { //we found the data, so you can do whatever with the data }
m_pcMonitorEvent = new os::Event(); m_pcMonitorEvent->SetToRemote( "os/System/ClipboardHasChanged", -1 ); m_pcMonitorEvent->SetMonitorEnabled( true, this ( your handler), MSG_CLIP_CHANGED (the code you will receive a message under) );
Clipboard::Clipboard | ( | const String & | cName = "" |
) |
cName | - The name of the clipboard. If you pass a null string or just call the contructor the name that will be __system_clipboard__ |
Clipboard::~Clipboard | ( | ) |
bool Clipboard::Lock | ( | ) |
If you Lock something then you must Unlock it.
void Clipboard::Unlock | ( | ) |
If you Lock something then you must Unlock it.
void Clipboard::Clear | ( | ) |
Before doing anything with the clipboard, you should Lock it.
If you Lock something then you must Unlock it.
void Clipboard::Commit | ( | ) |
You cannot use the Clipboard class outside of an application object, because the event is sent to the current application object.
Before doing anything with the clipboard, you should lock it.
If you Lock something then you must Unlock it.
Message * Clipboard::GetData | ( | ) |
You cannot use the Clipboard class outside of an application object, because the event is sent to the current application object.
Before doing anything with the clipboard, you should lock it.
If you Lock something then you must Unlock it.