org.symbian.tools.wrttools.doc.WRTKit/html/WRTKit_High_level_view_of_the_WRTKit-GUID-a3abe57e-9a71-4f94-923a-b84ccd1b0905.html
author Eugene Ostroukhov <eugeneo@symbian.org>
Wed, 28 Jul 2010 09:27:51 -0700
changeset 455 5da55957c779
parent 230 7848c135d915
permissions -rw-r--r--
Bluetooth support was refactored on top of a new frameworks
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
230
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     1
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     2
<html lang="en" xml:lang="en">
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     3
<head>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     4
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     5
<meta name="copyright" content="(C) Copyright 2005" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     6
<meta name="DC.rights.owner" content="(C) Copyright 2005" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     7
<meta content="concept" name="DC.Type" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     8
<meta name="DC.Title" content="High level view of the WRTKit" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
     9
<meta scheme="URI" name="DC.Relation" content="WRTKit_Developing_widgets_using_the_WRTKit-GUID-a321db96-0a01-4e55-b24b-96905f40cb5c.html" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    10
<meta content="XHTML" name="DC.Format" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    11
<meta content="GUID-A3ABE57E-9A71-4F94-923A-B84CCD1B0905" name="DC.Identifier" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    12
<meta content="en" name="DC.Language" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    13
<link href="commonltr.css" type="text/css" rel="stylesheet" />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    14
<title>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    15
High level view of the WRTKit</title>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    16
</head>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    17
<body id="GUID-A3ABE57E-9A71-4F94-923A-B84CCD1B0905"><a name="GUID-A3ABE57E-9A71-4F94-923A-B84CCD1B0905"><!-- --></a>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    18
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    19
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    20
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    21
    <h1 class="topictitle1">
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    22
High level view of the WRTKit</h1>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    23
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    24
    <div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    25
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    26
        <p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    27
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    28
            User interfaces in the WRTKit are based on the concepts of "views" and "controls".
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    29
            A control is a user interface element that the user can view or interact with,
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    30
            e.g. buttons, checkboxes, textfields, etc. Views are containers for controls and
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    31
            deal with the layout of controls on the screen in such a way that the user can
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    32
            interact with them in an easy way. Views are conceptually similar to windows in
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    33
            PC applications, but on a mobile device views typically fill the entire screen
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    34
            and only one view can thus be visible at any given time. The WRTKit allows views
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    35
            and controls to be interacted with in both the tab and pointer navigation modes
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    36
            and the navigation mode can even be switched at runtime.
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    37
        </p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    38
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    39
        <div class="fignone" id="GUID-A3ABE57E-9A71-4F94-923A-B84CCD1B0905__GUID-65170EDF-EF04-48AB-A414-1581157DAFA5"><a name="GUID-A3ABE57E-9A71-4F94-923A-B84CCD1B0905__GUID-65170EDF-EF04-48AB-A414-1581157DAFA5"><!-- --></a><span class="figcap">Figure 1. 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    40
WRTKit-based widget user interface</span>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    41
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    42
            
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    43
            <br /><img src="RSS_Reader_Main_Screenshot_3.png" /><br />
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    44
        </div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    45
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    46
        <p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    47
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    48
            The WRTKit is an object oriented user interface toolkit, which means that views 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    49
            and controls are implemented as JavaScript classes that are instantiated to 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    50
            objects when they are needed. In order to create a view with two buttons, for 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    51
            example, a developer writes JavaScript code that instantiates one view 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    52
            object and two button objects, and then calls a method in the view object asking 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    53
            it to add the buttons to itself. Being object oriented, the created WRTKit 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    54
            objects fully maintain their own state and take care of drawing themselves 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    55
            properly on the screen in all situations. So for example if one of the buttons 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    56
            is focused, the button modifies its own looks so that it appears focused 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    57
            on the screen. Because the objects know their own state, they can be queried for 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    58
            properties as needed. E.g. a textfield can be asked what text it currently
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    59
            contains, a button can be asked if it is enabled, and so on.
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    60
        </p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    61
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    62
        <p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    63
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    64
            Controls in the WRTKit have captions that can be used to show what the control 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    65
            does. E.g. a textfield that is meant to be used to enter a password could have a 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    66
            caption "Password". Captions are optional but should be used unless there is a 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    67
            very good reason not to. The only controls that do not have captions are 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    68
            buttons, since they have a text on the face of the button that accomplishes the 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    69
            same thing.
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    70
        </p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    71
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    72
        <p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    73
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    74
            WRTKit user interfaces are managed by a class that is aptly named "UIManager". 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    75
            Every widget that uses the WRTKit for its user interface creates a single 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    76
            instance of this class and then uses that UIManager instance to command views to 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    77
            be displayed. The UIManager takes care of all the heavy lifting that is necessary 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    78
            to bring a new view to the screen. The UIManager also handles other user 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    79
            interface duties such as management of notification popup dialogs and view 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    80
            scrollbars.
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    81
        </p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    82
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    83
        <p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    84
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    85
            Controls and views can notify the outside world when some event occurrs, e.g. 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    86
            when a button is pressed or someone toggles a checkbox. The WRTKit follows the 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    87
            so called "observer pattern" in its implementation of event notifications. This 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    88
            simply means that a control or view can be asked to call a particular JavaScript 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    89
            function (which is the "observer" or "listener") when an specific type of event 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    90
            occurrs. The WRTKit allows a control or view to have any number of concurrently 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    91
            registered listeners and listeners can either ask to be notified of only a 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    92
            particular type of event or about all events.
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    93
        </p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    94
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    95
        <p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    96
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    97
            The WRTKit library is physically a set of JavaScript, CSS and image files that 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    98
            are located within a directory called "WRTKit". That directory is copied into 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
    99
            the root directory of widgets that wish to use the library. A widget only needs 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   100
            to include a single JavaScript file ("WRTKit/WRTKit.js") from the directory in 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   101
            order to include and initialize the full WRTKit for use in the widget. Once the 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   102
            WRTKit has been added to the widget and initialized, the widget can start using 
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   103
            the JavaScript classes that the library defines.
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   104
        </p>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   105
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   106
    </div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   107
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   108
<div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   109
<div class="familylinks">
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   110
<div class="parentlink"><strong>Parent topic:</strong> <a href="WRTKit_Developing_widgets_using_the_WRTKit-GUID-a321db96-0a01-4e55-b24b-96905f40cb5c.html">Developing widgets using the WRTKit</a></div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   111
</div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   112
</div>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   113
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   114
</body>
7848c135d915 Fixed 2046 - WRTKit Help. Renamed package for consistency.
tasneems@symbian.org
parents:
diff changeset
   115
</html>