Html2::GHtml2 Class Reference

#include <GHtml2.h>

Inheritance diagram for Html2::GHtml2:

GDocView GLayout GView

List of all members.

Public Member Functions

char * GetClass ()
bool GetFormattedContent (char *MimeType, GAutoString &Out, GArray< GDocView::ContentMedia > *Media=0)
 Gets the document in format of a desired MIME type.
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.
int OnHitTest (int x, int y)
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.
void OnContent (GDocumentEnv::LoadJob *Res)


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 GHtml2::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 GHtml2::Name method.

Retreive any selected content through GHtml2::GetSelection.


Member Function Documentation

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

Returns:
the Class' name for debugging

Reimplemented from GDocView.

void GHtml2::OnContent ( GDocumentEnv::LoadJob *  Res  )  [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 from GDocView.

References GArray< Type >::Add(), GView::Lock(), GView::PostEvent(), and GView::Unlock().

int GHtml2::OnHitTest ( int  x,
int  y 
)

Return the type of cursor that should be visible when the mouse is at x,y e.g. LCUR_Normal

Reimplemented from GView.

int GHtml2::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 GHtml2::OnPulse (  ) 


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

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