GHtml Class Reference

#include <GHtml.h>

Inheritance diagram for GHtml:

GDocView GLayout GView

List of all members.

Public Member Functions

char * GetClass ()
GTag * GetTagByPos (int x, int y, int *Index)
 Get the tag at an x,y location.
GdcPt2 Layout ()
 Layout content and return size.
bool Copy ()
 Copy the selection to the clipboard.
bool HasSelection ()
 Returns true if there is a selection.
void UnSelectAll ()
 Unselect all the text in the control.
void SelectAll ()
 Select all the text in the control (not impl).
char * GetSelection ()
 Return the selection in a dynamically allocated string.
bool Name (char *s)
 Sets the HTML content of the control.
char * Name ()
 Returns the HTML content.
bool NameW (char16 *s)
 Sets the HTML content of the control.
char16NameW ()
 Returns the HTML content.
void OnPaint (GSurface *pDC)
 Called to paint the onscreen representation of the view.
void OnMouseClick (GMouse &m)
 The mouse was clicked over this view.
void OnMouseMove (GMouse &m)
 The mouse moves over the control.
void OnMouseWheel (double Lines)
 The mouse wheel was scrolled.
bool OnKey (GKey &k)
 A key was pressed while this view has focus.
int OnNotify (GViewI *c, int f)
 Called when a child view or view with it's SetNotify() set to this window changes.
void OnPosChange ()
 Called when the view position changes.
void OnPulse ()
 Called every so often by the timer system.
int OnEvent (GMessage *Msg)
 Handles the incoming events.

Detailed Description

A lightwight scripting safe HTML control. It has limited CSS support, renders most tables, even when nested. You can provide support for loading external images by implementing the GDocumentEnv::GetImageUri method of the GDocumentEnv interface and passing it into GHtml::SetEnv. All attempts to open URL's are passed into GDocumentEnv::OnNavigate method of the environment if set. Likewise any content inside active scripting tags, e.g. <? ?> will be striped out of the document and passed to GDocumentEnv::OnDynamicContent, which should return the relevant HTML that the script resolves to. A reasonable default implementation of the GDocumentEnv interface is the GDefaultDocumentEnv object.

You can set the content of the control through the GHtml::Name method.

Retreive any selected content through GHtml::GetSelection.

Member Function Documentation

char* GHtml::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().

the Class' name for debugging

Reimplemented from GDocView.

int GHtml::OnNotify ( GViewI *  Ctrl,
int  Flags 

Called when a child view or view with it's SetNotify() set to this window changes.

The event by default will bubble up to the GWindow at the top of the window heirarchy visiting each GView on the way. If it reaches a GView that processes it then the event stops propergating up the heirarchy.

Reimplemented from GLayout.

References IDC_VSCROLL, and GView::Invalidate().

void GHtml::OnPulse (  ) 

The documentation for this class was generated from the following files:

Generated on Wed Dec 1 15:41:03 2010 for Lgi by  doxygen