Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

Clipboard Class Reference

This Clipboard class handles placing Unicode data on the clipboard in RTF, Unicode, HTML formats. More...

#include <clipboard.h>

List of all members.

Public Methods

 Clipboard ()
virtual ~Clipboard ()
void freeGlobalMem ()
 frees up the Global memory allocated for use of the clipboard.

void shiftUp ()
 emulates the shift-key going up.

void paste ()
 emulates a CTRL-V sequence to enact a Paste.

void copyToClipboard (const HWND& hwndOwner, PWCHAR pchar)
 copies the appropiate format to the clipboard.

void setFormats (bool _Unicode, bool _Rtf, bool _Html, int fontsize)
 sets information about which format to use & the appropiate font size.


Private Types

enum  {
  LOTSOFTEXT = 524
}
enum  {
  MAX_SIZE = 524
}

Private Methods

void my_strcpy (char* ptr, PTCHAR text, UINT size)
 utility functions copies from one buffer to the other base on size, NOT null-termination.

void makeHtml (PWCHAR pchar, PTCHAR text, const int fs)
 formulates HTML format for the clipboard. More...

void makeRtf (PWCHAR pchar, PTCHAR text, const int fs)
 formulates RTF format for the clipboard.

const UINT makeUnicode (PWCHAR pchar, PTCHAR text)
 formulates Unicode format for the clipboard. More...

void getFontName (string& fName)
 retrieves the current default font name from the registery.


Private Attributes

HGLOBAL hHtml
 handles to global memory for each of the 3 formats.

HGLOBAL hRtf
HGLOBAL hUnicode
bool Unicode
 which clipboard format to use.

bool Rtf
bool Html
int fs
 Font size; this information comes from the user interface window.


Member Enumeration Documentation

anonymous enum [private]
 

Enumeration values:
LOTSOFTEXT  

anonymous enum [private]
 

Enumeration values:
MAX_SIZE  


Constructor & Destructor Documentation

Clipboard ( )
 

~Clipboard ( ) [virtual]
 


Member Function Documentation

void copyToClipboard ( const HWND & hwndOwner,
PWCHAR pchar )
 

void freeGlobalMem ( )
 

void getFontName ( string & fName ) [private]
 

void makeHtml ( PWCHAR pchar,
PTCHAR text,
const int fs ) [private]
 

When placing the HTML format on the clipboard, you have to know 4 byte counts: 1) from position 0 to the end of the fragment (the byte prior to the one in #2) 2) from the '<' in <html> to the '>' in 3) from the byte after the previous byte in #2 to the byte prior to the byte in #4 4) from the '<' in to the '>' in </html>

void makeRtf ( PWCHAR pchar,
PTCHAR text,
const int fs ) [private]
 

const UINT makeUnicode ( PWCHAR pchar,
PTCHAR text ) [private]
 

when placing Unicode on the clipboard it has to be lowbyte followed by highbyte -- both bytes being 0 signifies the end

void my_strcpy ( char * ptr,
PTCHAR text,
UINT size ) [private]
 

void paste ( )
 

void setFormats ( bool _Unicode,
bool _Rtf,
bool _Html,
int fontsize )
 

void shiftUp ( )
 


Member Data Documentation

bool Html [private]
 

bool Rtf [private]
 

bool Unicode [private]
 

int fs [private]
 

HGLOBAL hHtml [private]
 

HGLOBAL hRtf [private]
 

HGLOBAL hUnicode [private]
 


The documentation for this class was generated from the following files:
Generated at Tue Jan 30 17:03:29 2001 for UniGeez by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000