|
API Guide Home (Online version only) |
![]() |
Definition in file HtmlLib68K.h.
Include dependency graph for HtmlLib68K.h:

Go to the source code of this file.
| #define htmlDirDown 0x04 |
Definition at line 215 of file HtmlLib68K.h.
| #define htmlDirLeft 0x01 |
Definition at line 212 of file HtmlLib68K.h.
| #define htmlDirRight 0x02 |
Definition at line 213 of file HtmlLib68K.h.
| #define htmlDirUp 0x03 |
Definition at line 214 of file HtmlLib68K.h.
| #define htmlErrCantOpen (htmlErrorClass | 6) |
Definition at line 54 of file HtmlLib68K.h.
| #define htmlErrInUse (htmlErrorClass | 1) |
Definition at line 49 of file HtmlLib68K.h.
| #define htmlErrInvalidParam (htmlErrorClass | 3) |
Definition at line 51 of file HtmlLib68K.h.
| #define htmlErrNotFound (htmlErrorClass | 4) |
Definition at line 52 of file HtmlLib68K.h.
| #define htmlErrNotInitialized (htmlErrorClass | 5) |
Definition at line 53 of file HtmlLib68K.h.
| #define htmlErrorClass (appErrorClass) |
Definition at line 39 of file HtmlLib68K.h.
| #define htmlErrOutOfMemory (htmlErrorClass | 2) |
Definition at line 50 of file HtmlLib68K.h.
| #define htmlFaithfulDisplayMode 0x02 |
Definition at line 187 of file HtmlLib68K.h.
| #define htmlHandheldDisplayMode 0x01 |
Definition at line 186 of file HtmlLib68K.h.
| #define htmlHttpMethodGet 0x00000001 |
Definition at line 204 of file HtmlLib68K.h.
| #define htmlHttpMethodPost 0x00000002 |
Definition at line 205 of file HtmlLib68K.h.
| #define HtmlLibDBType 'libr' |
Definition at line 64 of file HtmlLib68K.h.
| #define HtmlLibID 'AsHL' |
Definition at line 63 of file HtmlLib68K.h.
| #define HtmlLibName "HtmlLibrary" |
Definition at line 65 of file HtmlLib68K.h.
| #define htmlLibProgressEvent (0x7000) |
Definition at line 57 of file HtmlLib68K.h.
| #define htmlNoPageScrollbarMode 0x02 |
Definition at line 223 of file HtmlLib68K.h.
| #define htmlNormalScrollbarMode 0x01 |
Definition at line 222 of file HtmlLib68K.h.
| #define htmlProgressBusy 0x0002 |
Definition at line 195 of file HtmlLib68K.h.
| #define htmlProgressDone 0x0001 |
Definition at line 194 of file HtmlLib68K.h.
| #define htmlProgressError 0x0004 |
Definition at line 197 of file HtmlLib68K.h.
| #define htmlProgressOutOfMemory 0x0003 |
Definition at line 196 of file HtmlLib68K.h.
| #define htmlTargetElement 0x04 |
Definition at line 87 of file HtmlLib68K.h.
| #define htmlTargetEmbed 0x02 |
Definition at line 85 of file HtmlLib68K.h.
| #define htmlTargetIFrame 0x03 |
Definition at line 86 of file HtmlLib68K.h.
| #define htmlTargetImage 0x01 |
Definition at line 84 of file HtmlLib68K.h.
| #define htmlTargetInputButton 0x0c |
Definition at line 95 of file HtmlLib68K.h.
| #define htmlTargetInputCheckbox 0x07 |
Definition at line 90 of file HtmlLib68K.h.
| #define htmlTargetInputFile 0x0b |
Definition at line 94 of file HtmlLib68K.h.
| #define htmlTargetInputPassword 0x06 |
Definition at line 89 of file HtmlLib68K.h.
| #define htmlTargetInputRadio 0x08 |
Definition at line 91 of file HtmlLib68K.h.
| #define htmlTargetInputReset 0x0a |
Definition at line 93 of file HtmlLib68K.h.
| #define htmlTargetInputSelect 0x0e |
Definition at line 97 of file HtmlLib68K.h.
| #define htmlTargetInputSubmit 0x09 |
Definition at line 92 of file HtmlLib68K.h.
| #define htmlTargetInputText 0x05 |
Definition at line 88 of file HtmlLib68K.h.
| #define htmlTargetInputTextarea 0x0d |
Definition at line 96 of file HtmlLib68K.h.
| typedef void DeleteObjectProc(UInt16 index) |
| typedef UInt8 HtmlDisplayMode |
Definition at line 76 of file HtmlLib68K.h.
| typedef UInt16 HtmlFocusTargetType |
Definition at line 99 of file HtmlLib68K.h.
| typedef void HtmlLibInclusionCallback(MemHandle htmlLibH, Char *url, void *cbData) |
Should be defined and set as the function to be called when rendering a page requires additional content.
HtmlLib calls this callback function with the appropriate arguments (where the url is the url of the additional content the library requires).
Definition at line 124 of file HtmlLib68K.h.
| typedef void HtmlLibLinkSelCallback(MemHandle htmlLibH, Char *url, void *cbData) |
Should be defined (to handle a link selection) and set as the function to be called when a link (url) is selected.
Definition at line 110 of file HtmlLib68K.h.
| typedef Boolean HtmlLibScanPhoneNumberCallback(MemHandle htmlLibH, Char *buffer, Int32 length, Int32 *patternStart, Int32 *patternEnd) |
Should be defined and set as the function to be called when it's necessary to determine if a string of numbers contains a phone number.
Here, buffer contains the string of numbers that are being checked, and this is passed in by the library when the library calls this function. Length is the buffer's length, also passed in by the library. The last two arguments (patternStart and patternEnd) should get set in this callback function if the string of numbers passed in is determined to be a phone number (and thus the return value of the function is to be true). Now, patternStart is the place in the buffer that the phone number starts, and patternEnd is the place in the buffer that the pattern ends. For example, if the entire contents of the buffer passed in happened to be a phone number, then the start would be 0 and the end would be "length - 1", and the return value would be true. However, if what was passed in was not determined to be a phone number, then the return value of the callback function should be false, and the last two arguments do not need to be set.
Definition at line 117 of file HtmlLib68K.h.
| typedef void HtmlLibSubmitFormCallback(MemHandle htmlLibH, Char *url, HtmlSubmitFormMethod method, Char *query, void *cbData) |
HtmlLib calls this callback function with the appropriate arguments. The following is an example (included in the sample code):
void HtmlSubmitFormCallback(MemHandle htmlLibH, Char *url, HtmlSubmitFormMethod method, Char *query, void *cbData) { FrmCustomAlert(SubmitFormAlert, url, (method == htmlHttpMethodPost ? "Post" : "Get"), query); }
Definition at line 144 of file HtmlLib68K.h.
| typedef UInt16 HtmlProgressStatus |
Definition at line 77 of file HtmlLib68K.h.
| typedef Int8 HtmlScrollbarMode |
Definition at line 80 of file HtmlLib68K.h.
| typedef Int8 HtmlScrollDirection |
Definition at line 79 of file HtmlLib68K.h.
| typedef UInt32 HtmlSubmitFormMethod |
Definition at line 78 of file HtmlLib68K.h.
| void HtmlLibAbortRenderData | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH | |||
| ) |
This function aborts rendering of the current content.
| refNum | IN: the library reference number | |
| contentH | IN: Memory Handle of the current content, returned by HtmlLibCreateContentObject |
| Err HtmlLibAddImageData | ( | UInt16 | refnum, | |
| MemHandle | contentH, | |||
| Char * | url, | |||
| Char * | mimeType, | |||
| void * | data, | |||
| Int32 | dataLen | |||
| ) |
This function adds images to HtmlLib. (You can use this to respond to Inclusion callback - please see section 2.1 Image Rendering).
| refNum | IN: the library reference number | |
| contentH | IN: Memory Handle returned by HtmlLibCreateContentObject | |
| url | IN: url of the image | |
| mimeType | IN: mime type of the image (for example, "image/jpeg") | |
| data | IN: image data | |
| dataLen | IN: image data size |
| Err HtmlLibAddTextData | ( | UInt16 | refnum, | |
| MemHandle | contentH, | |||
| Char * | url, | |||
| Char * | mimeType, | |||
| Char * | charset, | |||
| void * | data, | |||
| Int32 | dataLen | |||
| ) |
This function adds text data to the content data object created by HtmlLibCreateContentObject. Application should call HtmlLibRenderData when it has finished adding text data, for the data to be rendered.
| refNum | IN: the library reference number | |
| contentH | IN: Memory Handle returned by HtmlLibCreateContentObject | |
| url | IN: url of the page you are adding to (unique, to make sure nothing is written over) | |
| mimeType | IN: mime type of the text (such as "text/plain", "text/html") | |
| charset | IN: the character set (such as "us-ascii") | |
| data | IN: a reference to the text data to be added | |
| dataLen | IN: length of the data |
| Boolean HtmlLibCanScroll | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH, | |||
| HtmlScrollDirection | direction | |||
| ) |
This function lets you know whether scrolling is possible in the indicated direction.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| direction | IN: htmlDirLeft, htmlDirRight, htmlDirUp, htmlDirDown |
| void HtmlLibClearScreen | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH | |||
| ) |
This function clears the rendering screen. It must be called before content object is destroyed.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize |
Standard library close routine.
| refun | IN: the library reference number |
| MemHandle HtmlLibCreateContentObject | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH | |||
| ) |
Creates a content object (structure in memory that contains content to be rendered).
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize |
| void HtmlLibDestroyContentObject | ( | UInt16 | refnum, | |
| MemHandle | contentH | |||
| ) |
This function destroys the content data object created by HtmlLibCreateContentObject.
| refNum | IN: the library reference number | |
| contentH | IN: Memory Handle returned by HtmlLibCreateContentObject |
| void HtmlLibFinalize | ( | UInt16 | refnum, | |
| MemHandle | htmllibH | |||
| ) |
Finalizes the library when you are done using it
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize |
Applications should call this function to find a given text string on the page. Page will automatically scroll to show search result.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| searchString | IN: the given text string we are looking for on the page | |
| wrapSearch | IN: true if you would like to wrap search |
| Boolean HtmlLibGetTargetInfo | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH, | |||
| HtmlLibFocusTargetInfo * | htmlTargetInfo | |||
| ) |
Applications should use this function to retrieve the current selected text. Caller application must free the pointer returned in selectedText using MemPtrFree.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| selectedText | IN: the selected text that we are retrieving |
This function obtains the current scroll position in pixels from the top of the page.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| valueP | IN: at function's return, this contains the position in pixels from the top of the page |
Html Library initialization function. Initializes the library, after the library has been loaded.
| refNum | IN: the library reference number | |
| bounds | IN: the screen area the library will draw the rendered content (bounds within 160 x 160 grid) | |
| errP | IN: error code if library fails to initialize. The error code can be one of (htmlErrInUse, htmlErrOutOfMemory, htmlErrInvalidParam, htmlErrInUse, htmlErrCantOpen) |
| MemHandle HtmlLibInitializeWithHeapSize | ( | UInt16 | refnum, | |
| RectangleType | bounds, | |||
| Err * | errP, | |||
| UInt32 | heapMinSize, | |||
| UInt32 | heapDesiredSize, | |||
| UInt32 * | heapActualSizeP | |||
| ) |
Applications should call this function to notify HTML library of a UI event (any event that your application gets that the library should handle, such as a screen tap, or a key press). It is worth noting that you may create your own events and call this function for the library to handle it. By the same token, you can filter which events to pass to this function - you do not have to pass through every event.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| eventP | IN: the event you would like the library to handle |
Standard library open routine.
| refun | IN: the library reference number |
Applications should call this function to allow HTML library to process content and draw to screen.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| stayTime | IN: maximum time (in milliseconds) for HTML library to do processing. (At least 1300 is recommend.) |
| void HtmlLibRedrawScreen | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH | |||
| ) |
This redraws the HtmlLib rendering screen (for example, when application receives a frmUpdate event).
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize |
| void HtmlLibRenderData | ( | UInt16 | refnum, | |
| MemHandle | contentH | |||
| ) |
Applications should call this function after adding text data by HtmlLibAddTextData (or image data by HtmlLibAddImageData, see section 2.1 Image Rendering) to have HTML library start rendering the content.
| refNum | IN: the library reference number | |
| contentH | IN: Memory Handle returned by HtmlLibCreateContentObject that contains the text data to be rendered |
This function reinitializes the focus to point to nothing.
| refNum | IN: the library reference number | |
| htmlLibH | IN: htmlLib handle |
| void HtmlLibResizeScreen | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH, | |||
| RectangleType | newBounds | |||
| ) |
Resize the screen area.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| newBounds | IN: the new bounds of the screen area (bounds within 160 x 160 grid) |
This function will control the size of the font used by HtmlLib.
| refNum | IN: the library reference number | |
| htmlLibH | IN: htmlLib handle | |
| value | IN: true if you would like bigger font (bigger font corresponds to the Large font option in Blazer), and false otherwise (false would correspond to the Small font option in Blazer). |
| void HtmlLibSetDisplayMode | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH, | |||
| HtmlDisplayMode | mode | |||
| ) |
Sets the display mode (faithful rendering, which corresponds to Blazer's Wide Page Mode, or handheld wrapped, which corresponds to Blazer's Optimized Mode).
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| mode | IN: display mode (htmlFaithfulDisplayMode or htmlHandheldDisplayMode) |
This function sets the focus according to the condition flags passed in.
| refNum | IN: the library reference number | |
| htmlLibH | IN: htmlLib handle | |
| flag | - Enables (true) or Disables (false) focus handling | |
| reset_focus | - if flag is true: if reset_focus is true, then the code tries to set the next focus onto the next target in the event focus walk chain. If false, it again sets the focus to the current event target. |
| void HtmlLibSetFormWidgetProc | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH, | |||
| HtmlLibFormWidgetProc * | proc | |||
| ) |
This function sets the function pointers of some necessary form widget creation/deletion routines. The following is sufficient for most purposes (and included in the sample application):
static HtmlLibFormWidgetProc *widgetProc = NULL; widgetProc = MemPtrNew(sizeof(HtmlLibFormWidgetProc)); if (widgetProc) { //functions defined in sample code widgetProc->newControlProc = RendererNewControlProc; widgetProc->newFieldProc = RendererNewFieldProc; widgetProc->newListProc = RendererNewListProc; widgetProc->deleteObjectProc = RendererDeleteObjectProc; } HtmlLibSetFormWidgetProc(refNum, htmlLibH, widgetProc);
A standard example of the necessary form widget creation/deletion routines are provided below, and can be found in the sample code.
static Boolean RendererNewControlProc(UInt16 ID, UInt16 style, const Char *textP, Coord x, Coord y, Coord width, Coord height, UInt16 font, UInt8 group, Boolean leftAnchor) { ControlType *ctlP; FormType *formP = FrmGetActiveForm(); ctlP = CtlNewControl((void**)&formP, ID, style, textP, x, y, width, height, font, group, leftAnchor); if (ctlP) { return true; } return false; } static Boolean RendererNewFieldProc(UInt16 id, Coord x, Coord y, Coord width, Coord height, UInt16 font, UInt32 maxChars, UInt16 editable, UInt16 underlined, UInt16 singleLine, UInt16 dynamicSize, UInt16 justification, UInt16 autoShift, UInt16 hasScrollBar, UInt16 numeric) { FieldType *fieldP; FormType *formP = FrmGetActiveForm(); fieldP = FldNewField((void**)&formP, id, x, y, width, height, (FontID)font, maxChars, (Boolean)editable, (Boolean)underlined, (Boolean)singleLine, (Boolean)dynamicSize, (JustificationType)justification, (Boolean)autoShift, (Boolean)hasScrollBar, (Boolean)numeric); if (fieldP) { return true; } return false; } static Err RendererNewListProc(UInt16 id, Coord x, Coord y, Coord width, Coord height, UInt16 font, Int16 visibleItems, Int16 triggerId) { FormType *formP = FrmGetActiveForm(); return LstNewList((void**)&formP, id, x, y, width, height, font, visibleItems, triggerId); } static void RendererDeleteObjectProc(UInt16 index) { FormType *formP = FrmGetActiveForm(); FrmRemoveObject(&formP, index); }
| refNum | IN: HTML library reference number | |
| htmlLibH | IN: htmlLib handle | |
| proc | IN: function pointers of form widget creation/deletion routines. |
| void HtmlLibSetInclusionCallback | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH, | |||
| HtmlLibInclusionCallback * | callback, | |||
| void * | cbData | |||
| ) |
Specify the function that you want the library to call when rendering a page requires additional content (an image that hasn't been added, an external style sheet, etc).
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| callback | IN: a pointer to the function you want called when rendering a page that requires additional content. | |
| cbData | I/O: the library does nothing with this parameter except pass it on as one of the arguments to your callback function. To not take advantage of this feature, just pass in NULL. |
| void HtmlLibSetLinkSelectionCallback | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH, | |||
| HtmlLibLinkSelCallback * | callback, | |||
| void * | cbData | |||
| ) |
Specify the function that you want the library to call when a link is followed.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| callback | IN: a pointer to the function you want called when a link is followed. | |
| cbData | I/O: the library does nothing with this parameter except pass it on as one of the arguments to your callback function. To not take advantage of this feature, just pass in NULL. |
| void HtmlLibSetScanPhoneNumberCallback | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH, | |||
| HtmlLibScanPhoneNumberCallback * | callback | |||
| ) |
Specify the function that you want the library to call to determine whether some string of numbers contains a phone number.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| callback | IN: a pointer to the function that HtmlLib will call to determine whether a string of numbers is a phone number, and should be handled as such. |
| Err HtmlLibSetScrollbarMode | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH, | |||
| HtmlScrollbarMode | mode | |||
| ) |
This function sets the page's scrollbar mode, without affecting the scrollbars of a textarea. A reason to use htmlNoPageScrollbarMode and not htmlNormalScrollbarMode is if you would like to use your own scrollbars, and use HtmlLib(Set/Get)VScrollPosition to do so.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| mode | IN: scrollbar mode (htmlNormalScrollbarMode to enable scrolling or htmlNoPageScrollbarMode for no scrolling) |
This function passes an array of scrollbars to HtmlLib. Html library will not display any scrollbar if application does not call this function (scrollbars cannot be added dynamically). Application is recommended to pass no less than 4 (or at the very least 2) scrollbars, and up to 9 scrollbars. For example (after defining RenderScroll0ScrollBar and RenderScroll1ScrollBar):
UInt16 scrollbars[2] = {RenderScroll0ScrollBar, RenderScroll1ScrollBar}; HtmlLibSetScrollbars(gRefNum, gHtmlLibH, scrollbars, 2);
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| scrollbars | IN: array of scrollbars | |
| size | IN: size of the array of scrollbars |
| void HtmlLibSetSubmitFormCallback | ( | UInt16 | refnum, | |
| MemHandle | htmlLibH, | |||
| HtmlLibSubmitFormCallback * | callback, | |||
| void * | cbData | |||
| ) |
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| callback | IN: a pointer to the function you want called when a "submit" is activated | |
| cbData | I/O: the library does nothing with this parameter except pass it on as one of the arguments to your callback function. To not take advantage of this feature, just pass in NULL. |
HtmlLib calls this callback function with the appropriate arguments.
This function sets the current scroll position in pixels from the top of the page. If the total page height of the current page is less than this, this scrolls the page to the bottom.
| refNum | IN: the library reference number | |
| htmlLibH | IN: the memory handle returned by HtmlLibInitialize | |
| newPosition | IN: the position in pixels from the top of the page |
Standard library sleep routine.
| refun | IN: the library reference number |
Standard library wake routine.
| refun | IN: the library reference number |
| Top | Palm Developer Network © 2004-2008, Palm, Inc. All rights reserved. Generated on Fri Jun 13 10:07:34 2008 for Palm API Guide |