Description


Include file: xwebview.h

Overview

XWebView is a high-level control which gives you the functionality of a web-browser. It uses the the WebExplorer-display capabilitys so you can use the EMail and News services too.

To use the control in your application:

  1. derive a class from XWebView
  2. override the functions you need (eg. HandleError())
  3. call Load() with the needed URL
  4. done

Functions

XWebView

Parameters

XWindow * owner the owner window
XRect * rect rectangle
USHORT id the window-ID

Remarks

Constructs a web-control

GetExtMap

Parameters

char * extension file-extension
XString * MIME buffer for the type of MIME
SHORT& format buffer for format, on result you may receive:
WEB_FORMAT_BINARY
WEB_FORMAT_7BIT
WEB_FORMAT_8BIT

Return-Value

BOOL result

Remarks

Get an association of a file-extension with a MIME-type

GetViewer

Parameters

char * MIME type of MIME
XString * program buffer which will hold the registered program.

Return-Value

BOOL result

Remarks

Get a viewer for a specific MIME-type

SetExtMap

Parameters

char * extension file-extension
char * MIME type of MIME
SHORT format format:
WEB_FORMAT_BINARY
WEB_FORMAT_7BIT
WEB_FORMAT_8BIT

Return-Value

BOOL result

Remarks

Associate a file-extension with a MIME-type

SetViewer

Parameters

char * MIME type of MIME
char * program program to register.

Return-Value

BOOL result

Remarks

Register a viewer for a specific MIME-type

GetPointer

Parameters

LONG pointerType the pointer to request:
WEB_POINTER_NORMAL
WEB_POINTER_WAIT
WEB_POINTER_ANCHOR
WEB_POINTER_UNKNOWN

Return-Value

OOL_POINTERHNDLE handle of the pointer.

Remarks

Get a pointer.

SetPointer

Parameters

OOL_POINTERHANDLE handle of the pointer to set
LONG pointerType the pointer to set:
WEB_POINTER_NORMAL
WEB_POINTER_WAIT
WEB_POINTER_ANCHOR
WEB_POINTER_UNKNOWN

Return-Value

BOOL success

Remarks

Get a pointer.

GetAnchorState

Parameters

char * anchor name of the anchor
LONG& state buffer for the state to the anchor, you may receive:
WEB_ANCHOR_DEFAULT
WEB_ANCHOR_VISITED

Return-Value

BOOL result

Remarks

Get the state of an anchor.

GetDocAnchor

Parameters

XString * buffer buffer to hold data.

Return-Value

BOOL result

Remarks

Get the anchor of the document.

SetAnchorState

Parameters

char * anchor name of the anchor
LONG state state to set:
WEB_ANCHOR_DEFAULT
WEB_ANCHOR_VISITED

Return-Value

BOOL result

Remarks

Set the state of an anchor.

GetLastError

Return-Value

LONG result

Remarks

Get the last error-code.

GetLastLoadError

Return-Value

LONG result

Remarks

Get for the lasterror which occures when data was loaded.

HandleError

Parameters

ULONG errorCode char * errorMessage

Remarks

Override this function to get information on runtime-errors

LoadProgress

Parameters

ULONG state, possible values are: WEB_CONNECT WEB_WAIT WEB_LOADDATA WEB_RENDER

Remarks

Override this function to get information of progress of loading data

LoadResult

Parameters

ULONG result, possible values are: WEB_SUCCESS WEB_ERROR WEB_CANCELLED

Remarks

Override this function to get information of the success of loading data.

IsLoading

Return-Value

BOOL result

Remarks

Get if the control is loading data.

Load

Parameters

char * url full qualified URL
BOOL reload TRUE=do not use cached data, FALSE=use cache

Return-Value

LONG result

Remarks

Load data from the internet/intranet

SaveToFile

Parameters

char * url full qualified URL
char * file full qualified path + filename
BOOL reload TRUE=do not use cached data
FALSE=use cache

Return-Value

LONG result

Remarks

Load data and save it to a file

StopLoading

Remarks

Stops loading data.

ButtonPressed

Parameters

SHORT buttonNumber
SHORT xPosition in window-coordinates
SHORT yPosition in window-coordinates

Remarks

Override this function to get information when a mouse-button was pressed.

GetDocTitle

Parameters

XString * buffer buffer to hold data.

Return-Value

BOOL result

Remarks

Get the title of the document.

GetPos

Parameters

XPoint * in window-cordinates
XPoint * buffer bufer wich will hold the document-coordinates

Return-Value

LONG result

Remarks

Calculate document-coordinates from window-coordinates (e.g. mouse-position).

Search

Parameters

char* string string to find.
XPoint * start point in document-coordinates to start
XPoint * buffer buffer which will hold coordinates of the result
BOOL forward TRUE=search forward, FALSE=backward

Return-Value

BOOL result

Remarks

Search a string in the document.

SetOptions

Parameters

char * emailAddress your email address
char * newsServer the news-server to use

Remarks

Setup options for EMail and News services.


This document was generated by Jens von Pilgrim's Autodoc