HAW_deck Class Reference

List of all members.

Public Member Functions

 HAW_deck ($title=HAW_NOTITLE, $alignment=HAW_ALIGN_LEFT, $output=HAW_OUTPUT_AUTOMATIC)
 add_text ($text)
 add_image ($image)
 add_table ($table)
 add_form ($form)
 add_link ($link)
 add_phone ($phone)
 add_linkset ($linkset)
 add_raw ($raw)
 add_plugin ($plugin)
 add_userdefined ($udef)
 add_banner ($banner, $position=HAW_BOTTOM)
 add_rule ($rule)
 add_voicerecorder ($voicerecorder)
 set_redirection ($timeout, $red_url)
 disable_cache ()
 enable_session ()
 set_charset ($charset, $unicodemaptab="")
 set_language ($language)
 set_bgcolor ($bgcolor)
 set_css ($css)
 set_css_class ($css_class)
 set_background ($background)
 set_border ($border)
 set_disp_bgcolor ($disp_bgcolor)
 set_disp_background ($background)
 set_width ($width)
 set_height ($height)
 set_size ($size)
 set_color ($color)
 set_link_color ($link_color)
 set_vlink_color ($vlink_color)
 set_face ($face)
 set_title ($title)
 set_alignment ($alignment)
 set_waphome ($waphome)
 use_simulator ($sim="http://skin.hawhaw.de/skin.css")
 use_link_brackets ($flag)
 set_voice_text ($text, $audio_src="")
 set_voice_jingle ($url)
 set_voice_help ($text, $audio_src="", $url="")
 set_voice_noinput ($text, $audio_src="", $url="")
 set_voice_nomatch ($text, $audio_src="", $url="")
 set_voice_property ($name, $value)
 set_voice_navigator ($repeat_dtmf, $repeat_voice, $forward_dtmf, $forward_voice)
 smooth_voice ()
 get_markup_language ()
 create_page ()

Detailed Description

This class is the top level class of all HAWHAW classes. Your page should consist of exactly one HAW_deck object. For WML browsers one deck with one card will be generated. For HDML browsers one deck including as much cards as necessary will generated. HTML browsers will receive a normal HTML page, PDA browsers will receive handheldfriendly HTML etc.

Do not overload HAW_deck objects! Remember that a lot of older WAP devices can not handle more than about 1400 byte of compiled data.

Examples:

$myPage = new HAW_deck();
$myPage = new HAW_deck("My WAP page");
$myPage = new HAW_deck("", HAW_ALIGN_CENTER);
$myPage = new HAW_deck("PDA edition", HAW_ALIGN_CENTER, HAW_OUTPUT_PDA);
...
$myPage->set_bgcolor("blue");
...
$myPage->add_text($myText);
...
$myPage->create_page();


Member Function Documentation

HAW_deck::HAW_deck ( title = HAW_NOTITLE,
alignment = HAW_ALIGN_LEFT,
output = HAW_OUTPUT_AUTOMATIC 
)

Constructor

Parameters:
title (optional, default: HAW_NOTITLE)
If a string is provided here, it will be displayed in the HTML title bar, respectively somewhere on the WAP display. Using a title you will normally have to spend one of your few lines on your WAP display. Consider that some WAP phones/SDK's and handheld devices don't display the title at all.
alignment (optional, default: HAW_ALIGN_LEFT)
You can enter HAW_ALIGN_CENTER or HAW_ALIGN_RIGHT to modify the alignment of the whole page.
output (optional, default: HAW_OUTPUT_AUTOMATIC)
You can override HAWHAW's automatic browser detection and force a certain output type.
Possible value are:
  • HAW_OUTPUT_AUTOMATIC (default)
  • HAW_OUTPUT_BIGSCREEN
  • HAW_OUTPUT_WAP
  • HAW_OUTPUT_HDML
  • HAW_OUTPUT_PDA
  • HAW_OUTPUT_IMODE
  • HAW_OUTPUT_MML
  • HAW_OUTPUT_VOICEXML
  • HAW_OUTPUT_XHTML
  • HAW_OUTPUT_LYNX
  • HAW_OUTPUT_DOTMOBI

With this parameter you can offer dedicated links for PC's, WAP phones, PDA's, XHTML phones etc.

HAW_deck::add_text ( text  ) 

Adds a HAW_text object to HAW_deck.

Parameters:
text Some HAW_text object.
See also:
HAW_text

HAW_deck::add_image ( image  ) 

Adds a HAW_image object to HAW_deck.

Parameters:
image Some HAW_image object.
See also:
HAW_image

HAW_deck::add_table ( table  ) 

Adds a HAW_table object to HAW_deck.

Parameters:
table Some HAW_table object.
See also:
HAW_table

HAW_deck::add_form ( form  ) 

Adds a HAW_form object to HAW_deck.

Parameters:
form Some HAW_form object.
See also:
HAW_form

HAW_deck::add_link ( link  ) 

Adds a HAW_link object to HAW_deck.

Parameters:
link Some HAW_link object.
See also:
HAW_link

HAW_deck::add_phone ( phone  ) 

Adds a HAW_phone object to HAW_deck.

Parameters:
phone Some HAW_phone object.
See also:
HAW_phone

HAW_deck::add_linkset ( linkset  ) 

Adds a HAW_linkset object to HAW_deck.

Parameters:
linkset Some HAW_linkset object.
See also:
HAW_linkset

HAW_deck::add_raw ( raw  ) 

Adds a HAW_raw object to HAW_deck.

Parameters:
raw Some HAW_raw object.
See also:
HAW_raw

HAW_deck::add_plugin ( plugin  ) 

Adds some HAWHAW plugin to HAW_deck.

Parameters:
plugin Some user-defined plugin object.
    A HAWHAW plugin class definition should look like this:

      class HAW_plugin_foo // some class name of your choice
      {
        var $bar;   // some class variable declarations of your choice

        function HAW_plugin_foo(...)
        {
          # some constructor code (if required)
        }

        function set_bar($bar)
        {
          # as many user-defined functions as you need
        }

        # this member function is called by HAWHAW and MUST NOT be changed!
        function get_elementtype()
        {
          return HAW_PLUGIN;
        }

        function create($deck)
        {
          # this member function is called by HAWHAW and MUST be present!
          # it is in the programmers responsibility what kind of markup is created here!
          # you have access to all HAW_deck properties by evaluating $deck
        }
      };

      Usage: ...
             require_once("hawhaw.inc);
             require_once("HAW_plugin_foo.php");
             ...       
             $myClass = new HAW_plugin_foo("Cool output");
             $myClass->set_coolstuff($ringtone, $sms, $userlocation);
             $myDeck->add_plugin($myClass);
             ...
    

HAW_deck::add_userdefined ( udef  ) 

Adds some user-defined HAWHAW object to HAW_deck.

Parameters:
udef Some user-defined object.
Deprecated:
use HAW_deck::add_plugin() instead

HAW_deck::add_banner ( banner,
position = HAW_BOTTOM 
)

Adds a HAW_banner object to HAW_deck.
Note: Has no effect on WML/handheld pages.

Parameters:
banner Some HAW_banner object.
position (optional)
HAW_TOP: above HAW_deck
HAW_BOTTOM: beneath HAW_deck (default)
See also:
HAW_banner

HAW_deck::add_rule ( rule  ) 

Adds a HAW_rule object to HAW_deck.

Parameters:
rule Some HAW_rule object.
See also:
HAW_rule

HAW_deck::add_voicerecorder ( voicerecorder  ) 

Adds a HAW_voicerecorder object to HAW_deck.

Parameters:
voicerecorder Some HAW_voicerecorder object.
See also:
HAW_voicerecorder

HAW_deck::set_redirection ( timeout,
red_url 
)

Redirects automatically after timeout to another URL.
Note: This feature can not be supported for HDML browsers, due to HDML's missing timer functionality. If you intend to serve HDML users, you should consider this by creating an additional link to red_url.

Parameters:
timeout Some timeout value in seconds.
red_url Some URL string.

HAW_deck::disable_cache (  ) 

Disables deck caching in the users client.
Note: Use this object function, if you intend to provide changing content under the same URL.

HAW_deck::enable_session (  ) 

Enables mobile specific session support.
Note: Session handling for mobile devices is a little bit tricky. Cookies sometimes are not supported by devices/gateways and transient session ID's are to be considered as potential security issue. It is up to the programmer to decide which way to go by setting the according control flags in php.ini.
This function is helpful in case that trans_sid session handling applies:
As XML does not allow unescaped '&' characters, the arg-separator has to be modified. And as WML/VoiceXML defines tags which are not defined in HTML, the PHP predefined url_rewriter tags have to be adapted.
Important: This function has be called before any session handling is done! Due to some bugs in previous PHP versions, it is highly recommended to use PHP version 4.1.1 or higher.

HAW_deck::set_charset ( charset,
unicodemaptab = "" 
)

Sets a given character set.
Note: For the iso-8859-1 character set all characters with value greater 127 are automatically transformed into a "&#dec;" sequence (unicode). For all other character sets a specific cross mapping table is required for the conversion into unicode. Usage of unicode cross mapping tables is optional for non-iso-8859-1 character sets. Mapping tables are available at: http://www.unicode.org/Public/MAPPINGS/

Parameters:
charset Character set used.
Default: utf-8 (until hawhaw.inc V5.19: iso-8859-1)
unicodemaptab (optional)
Cross mapping table from country specific character coding to unicode (default: no mapping to unicode activated).
With this parameter you specify where HAWHAW will find the conversion table with the mapping rules. It is recommended to store the cross mapping table in the same directory where hawhaw.inc is located.
format: [PATH][Filename].[EXT] e.g. "../GB2312.TXT"

HAW_deck::set_language ( language  ) 

Sets a given language.
Note: Specifies the main language of the deck, as e.g. english, german, japanese or whatever. Language declaration is highly recommended in order to provide barrierfree content and as is required to validate a deck as Bobby AAA approved!

Parameters:
language Language code according ISO 639, e.g. "en", "de", etc.

HAW_deck::set_bgcolor ( bgcolor  ) 

Sets the window background color for a HTML (big-screen browser) page. Has no effect on WML/handheld pages.

Parameters:
bgcolor See HTML specification for possible values (e.g. "#CCFFFF", "red", ...).

HAW_deck::set_css ( css  ) 

Sets a css file for css-enabled browsers.

Parameters:
css file with css (cascading style sheets) declarations.

HAW_deck::set_css_class ( css_class  ) 

Sets a css class for this object in a (X)HTML page.

Parameters:
css_class CSS class to be defined in the deck's central CSS file

HAW_deck::set_background ( background  ) 

Sets a window wallpaper for a HTML (big-screen browser) page. Has no effect on WML/handheld pages.

Parameters:
background e.g. "backgrnd.gif"

HAW_deck::set_border ( border  ) 

Sets the thickness of the HTML display frame. Has no effect on WML/handheld pages.

Parameters:
border Thickness is pixels (default: 8)

HAW_deck::set_disp_bgcolor ( disp_bgcolor  ) 

Sets the display background color for a (X)HTML page. Has no effect on WML pages.

Parameters:
disp_bgcolor See HTML specification for possible values (e.g. "#CCFFFF", "red", ...).

HAW_deck::set_disp_background ( background  ) 

Sets a display wallpaper for a (X)HTML page. Has no effect on WML pages.

Parameters:
background e.g. "backgrnd.gif"

HAW_deck::set_width ( width  ) 

Sets the display width for a HTML page. Has no effect on WML/handheld pages.

Parameters:
width See HTML specification for possible values (e.g. "200px", "50%", ...).

HAW_deck::set_height ( height  ) 

Sets the display height for a HTML page. Has no effect on WML/handheld pages.

Parameters:
height See HTML specification for possible values (e.g. "200px", "50%", ...).

HAW_deck::set_size ( size  ) 

Sets the font size for all characters in a (X)HTML page. Has no effect on WML pages.

Parameters:
size See HTML specification for possible values (e.g. "12pt", ...).

HAW_deck::set_color ( color  ) 

Sets the color for all characters in a (X)HTML page. Has no effect on WML pages. Nevertheless, HAW_text objects can overwrite this value by defining their own color attributes.

Parameters:
color See HTML specification for possible values (e.g. "#CCFFFF", "red", ...).
See also:
HAW_text

HAW_deck::set_link_color ( link_color  ) 

Sets the color of links in a (X)HTML page. Has no effect on WML pages.

Parameters:
link_color See HTML specification for possible values (e.g. "#CCFFFF", "red", ...).

HAW_deck::set_vlink_color ( vlink_color  ) 

Sets the color of visited links in a (X)HTML page. Has no effect on WML pages.

Parameters:
vlink_color See HTML specification for possible values (e.g. "#CCFFFF", "red", ...).

HAW_deck::set_face ( face  ) 

Sets the font for all characters in a (X)HTML page. Has no effect on WML pages.

Parameters:
face See HTML specification for possible values (e.g. "Avalon", "Wide Latin").

HAW_deck::set_title ( title  ) 

Sets the deck title (see also HAW_deck constructor).

Parameters:
title deck title

HAW_deck::set_alignment ( alignment  ) 

Sets the text alignment for the whole deck.

Parameters:
alignment text alignment
HAW_ALIGN_LEFT (default)
HAW_ALIGN_CENTER
HAW_ALIGN_RIGHT

HAW_deck::set_waphome ( waphome  ) 

Sets the URL of a website, a bigscreen-browsing user is invited to visit via WAP.
Note: On bigscreen browsers a small copyright link to the HAWHAW information page will be created automatically by HAWHAW. The information page invites the user to visit your site with a WAP phone. Therefore by default your hostname and your refering script will be part of this copyright link. You can modify this value, e.g. if your application leads the user across different pages, but you want to make visible the entry page only.

Parameters:
waphome Some URL string.

HAW_deck::use_simulator ( sim = "http://skin.hawhaw.de/skin.css"  ) 

Activates or deactivated the device simulator on bigscreen browsers.
Note: If no sim parameter is provided, the HAWHAW default skin is used. HAWHAW output can be displayed in any kind of user-defined skin. See CSS file of the HAWHAW default skin for more info.

Parameters:
sim HAW_SIM_NONE | HAW_SIM_CLASSIC | URL of CSS file, where skin is defined (optional)

HAW_deck::use_link_brackets ( flag  ) 

Defines whether links are shown within square brackets or not.

Parameters:
flag true (default) | false

HAW_deck::set_voice_text ( text,
audio_src = "" 
)

Sets deck-related text to be spoken by voice browsers.

Parameters:
text Some introducing text that will be spoken before any other dialog or text output is started.
audio_src Some audio file (e.g. *.wav file) to play (optional).

HAW_deck::set_voice_jingle ( url  ) 

Play jingle before link <label>s are spoken.
Note: Voice users can not distinguish between plain text and link text. Playing a short jingle before each link will make voice navigation easier.

Parameters:
url Some wav-file.

HAW_deck::set_voice_help ( text,
audio_src = "",
url = "" 
)

Sets help text for voice browsers.

Parameters:
text Some helpful information concerning this deck.
audio_src Some audio file (e.g. *.wav file) to play (optional).
url Some other voice deck to go to (optional).

HAW_deck::set_voice_noinput ( text,
audio_src = "",
url = "" 
)

Sets noinput text for voice browsers.

Parameters:
text Some text to inform the user that no input has been received.
audio_src Some audio file (e.g. *.wav file) to play (optional).
url Some other voice deck to go to (optional).

HAW_deck::set_voice_nomatch ( text,
audio_src = "",
url = "" 
)

Sets nomatch text for voice browsers.

Parameters:
text Some text to complain that user input was not recognized.
audio_src Some audio file (e.g. *.wav file) to play (optional).
url Some other voice deck to go to (optional).

HAW_deck::set_voice_property ( name,
value 
)

Sets a name/value property pair for VoiceXML decks.
Attention: This function should be used by experienced VoiceXML developers only! name/value combinations which are not compliant to the VoiceXML standard or are not supported by the voice platform, will throw an semantic error and terminate voice output. Please refer to the W3C VoiceXML Recommendation (chapter 6.3) for detailled info about valid name/value combinations.

Parameters:
name Name of property (e.g. "bargein", "timeout", etc.)
value Value of property (e.g. "false", "10s", etc.)

HAW_deck::set_voice_navigator ( repeat_dtmf,
repeat_voice,
forward_dtmf,
forward_voice 
)

Defines a DTMF/voice grammar to repeat or skip voice output.
This function enables voice users to repeat or skip voice output which has been created by means of HAW_text objects. For both repeat and forward at least one trigger criteria (DTMF or voice) has to be defined. HAW_text objects where user navigation should apply have to call set_voice_navigation().

Parameters:
repeat_dtmf DTMF key that triggers the repetition of the current output (e.g. "1", "2", "", etc.)
repeat_voice What the user has to say to repeat the current output (e.g. "repeat", "")
forward_dtmf DTMF key that terminates the current output (e.g. "0", "*", "", etc.)
forward_voice What the user has to say to continue with the next output (e.g. "forward", "")
See also:
HAW_text

HAW_deck::smooth_voice (  ) 

Smooth contiguous text sections.
Note: This function affects VoiceXML output only.
Voice decks often are assembled by some HAW_text objects. Each HAW_text object creates a VoiceXML <block> element. On some voice browsers this results in an interruptive speech synthesis. This function coalesces directly neighbored HAW_text objects to one single HAW_text object and thus results in a smoothed voice perception.

HAW_deck::get_markup_language (  ) 

Get markup language evaluated for the detected browser.

Returns:
  • HAW_HTML (HTML)
  • HAW_WML (WML)
  • HAW_HDML (HDML)
  • HAW_VXML (VoiceXML)

    Example:
    ...
    $myDeck = new HAW_deck();
    if ($myDeck->get_markup_language() == HAW_VXML) {
    # some VoiceXML stuff
    }
    else {
    # some visual stuff
    }

HAW_deck::create_page (  ) 

Creates the page in the according markup language. Depending on the clients browser type, HTML (pure HTML, handheldfriendly HTML, XHTML, i-mode cHTML, MML), WML, HDML or VoiceXML is thrown out.


The documentation for this class was generated from the following file:
Generated on Mon Dec 6 21:51:55 2010 for HAWHAW PHP by  doxygen 1.5.1