#include <GDocView.h>
Public Member Functions | |
const char * | GetClass () |
virtual bool | Open (const char *Name, const char *Cs=0) |
Open a file handler. | |
virtual bool | Save (const char *Name, const char *Cs=0) |
Save a file handler. | |
virtual bool | DoFind () |
Find window handler. | |
virtual bool | DoReplace () |
Replace window handler. | |
virtual GDocumentEnv * | GetEnv () |
Get the current environment. | |
virtual void | SetEnv (GDocumentEnv *e) |
Set the current environment. | |
virtual void | OnContent (GDocumentEnv::LoadJob *Res) |
virtual void | SetCursor (int i, bool Select, bool ForceFullUpdate=false) |
virtual int | GetCursor (bool Cursor=true) |
virtual bool | HasSelection () |
True if there is a selection. | |
virtual void | UnSelectAll () |
Unselect all the text. | |
virtual void | SelectWord (int From) |
Select the word from index 'From'. | |
virtual void | SelectAll () |
Select all the text in the control. | |
virtual char * | GetSelection () |
Get the selection as a dynamicially allocated utf-8 string. | |
virtual int | IndexAt (int x, int y) |
Returns the character index at the x,y location. | |
virtual void | PositionAt (int &x, int &y, int Index=-1) |
Index=-1 returns the x,y of the cursor, Index >=0 returns the specified x,y. | |
virtual bool | IsDirty () |
True if the document has changed. | |
virtual int | GetLines () |
Gets the number of lines of text. | |
virtual void | GetTextExtent (int &x, int &y) |
Gets the pixels required to display all the text. | |
virtual bool | Cut () |
Cuts the selection from the document and puts it on the clipboard. | |
virtual bool | Copy () |
Copies the selection from the document to the clipboard. | |
virtual bool | Paste () |
Pastes the current contents of the clipboard into the document. | |
virtual void | OnEscape (GKey &K) |
Called when the user hits the escape key. | |
virtual void | OnEnter (GKey &k) |
Called when the user hits the enter key. | |
virtual void | OnUrl (char *Url) |
Called when the user clicks a URL. | |
virtual bool | GetFormattedContent (const char *MimeType, GAutoString &Out, GArray< ContentMedia > *Media=0) |
Gets the document in format of a desired MIME type. | |
Friends | |
class | GDocumentEnv |
const char* GDocView::GetClass | ( | ) | [inline] |
The class' name. Should be overriden in child classes to return the right class name. Mostly used for debugging, but in the win32 port it is also the default WIN32 class name passed to RegisterClass() in GView::CreateClass().
Reimplemented from GLayout.
Reimplemented in GEdit, GHtml, Html2::GHtml2, GTextView3, and GTextView4.
virtual void GDocView::OnContent | ( | GDocumentEnv::LoadJob * | Res | ) | [inline, virtual] |
When the env has loaded a resource it can pass it to the doc control via this method. It MUST be thread safe. Often an environment will call this function directly from it's worker thread.
Reimplemented in Html2::GHtml2.
virtual void GDocView::SetCursor | ( | int | i, | |
bool | Select, | |||
bool | ForceFullUpdate = false | |||
) | [inline, virtual] |
Set the cursor position, to select an area, move the cursor with Select=false then set the other end of the region with Select=true.
Reimplemented in GTextView3, and GTextView4.
Referenced by GAbout::GAbout().
virtual int GDocView::GetCursor | ( | bool | Cursor = true |
) | [inline, virtual] |
Cursor=false means the other end of the selection if any. The cursor is alwasy at one end of the selection.
Reimplemented in GTextView3, and GTextView4.
virtual bool GDocView::GetFormattedContent | ( | const char * | MimeType, | |
GAutoString & | Out, | |||
GArray< ContentMedia > * | Media = 0 | |||
) | [inline, virtual] |
Gets the document in format of a desired MIME type.
MimeType | [In] The desired mime type of the content |
Out | [Out] The content in the specified mime type |
Media | [Out/Optional] Any attached media files that the content references |