org.symbian.tools.wrttools/libraries/core/widget.js
changeset 216 914d053d42b1
child 224 b408478166d3
equal deleted inserted replaced
215:c9394af976fe 216:914d053d42b1
       
     1 /**
       
     2  * Copyright (c) 2009-2010 Symbian Foundation and/or its subsidiary(-ies).
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the License "Eclipse Public License v1.0"
       
     6  * which accompanies this distribution, and is available
       
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8  *
       
     9  * Initial Contributors:
       
    10  * Symbian Foundation - initial contribution.
       
    11  * Contributors:
       
    12  */
       
    13 
       
    14 /**
       
    15  * Property widget
       
    16  * @type Widget
       
    17  * @memberOf Window
       
    18  */
       
    19 Window.prototype.widget = new Widget();
       
    20 
       
    21 /**
       
    22  * Property device
       
    23  * @type Device
       
    24  * @memberOf Window
       
    25  */
       
    26 Window.prototype.device = new Device();
       
    27 
       
    28 /**
       
    29  * Property menu
       
    30  * @type Menu
       
    31  * @memberOf Window
       
    32  */
       
    33 Window.prototype.menu = new Menu();
       
    34 
       
    35 function Widget() {};
       
    36 Widget.prototype = new Object();
       
    37 Widget.prototype.widget = new Widget();
       
    38 
       
    39 /**
       
    40  * identifier is a read-only property of the widget object. 
       
    41  * It is the unique string identifier that identifies a widget 
       
    42  * after it has been installed into a device. The string returned 
       
    43  * is the value of the Identifier key defined in the widget 
       
    44  * property list file (info.plist).
       
    45  */
       
    46 Widget.prototype.identifier = "";
       
    47 
       
    48 /**
       
    49  * isrotationsupported is a read-only property that returns a 
       
    50  * Boolean value determining if the device supports landscape and 
       
    51  * portrait screen orientations. If the value is true, the 
       
    52  * device supports both landscape and portrait screen orientations.
       
    53  */
       
    54 Widget.prototype.isrotationsupported = new Boolean();
       
    55 
       
    56 /**
       
    57  * Allows the definition of a function to be called
       
    58  * when a Widget.is displayed
       
    59  * @param {Void}
       
    60  *     onshow()
       
    61  * @return {Void}
       
    62  */
       
    63 Widget.prototype.onshow = new Object();
       
    64 
       
    65 /**
       
    66  * Allows the definition of a function to be called
       
    67  * when a Widget.sent into the background (hidden)
       
    68  * @param {Void}
       
    69  *     onhide()
       
    70  * @return {Void}
       
    71  */
       
    72 Widget.prototype.onhide = new Object();
       
    73 	
       
    74 /**
       
    75  * Launches the browser with the specified url
       
    76  * @param {String} url
       
    77  *     openURL()
       
    78  * @return {Void}
       
    79  */
       
    80 Widget.prototype.openURL = function(url){};
       
    81 	
       
    82 /**
       
    83  * Returns previously stored preference associated with the specified key
       
    84  * @param {String} Key preference value to be fetch
       
    85  *     preferenceForKey()
       
    86  * @return {String} Value
       
    87  */
       
    88 Widget.prototype.preferenceForKey = function(key) {return "";};
       
    89 	
       
    90 	
       
    91 /**
       
    92  * Stores the key associated with the specified preference
       
    93  * @param {String} Preference value to be stored
       
    94  * @param {String} Key Preference value associated to
       
    95  *     setPreferenceForKey()
       
    96  * @return {Void}
       
    97  */
       
    98 Widget.prototype.setPreferenceForKey = function(preference, key){};
       
    99 	
       
   100 /**
       
   101  * Toggle between Tabbed navigation mode or Cursor mode
       
   102  * @param {Boolean} Value
       
   103  *     setNavigationEnabled()
       
   104  * @return {Void}
       
   105  */
       
   106 Widget.prototype.setNavigationEnabled = function(navigationMode) {};
       
   107 
       
   108 /**
       
   109  * Toggle between Tabbed navigation mode or Cursor mode
       
   110  * @param {Boolean} Value
       
   111  *     setNavigationType()
       
   112  * @return {Void}
       
   113  */
       
   114 Widget.prototype.setNavigationType = function(navigationMode) {};
       
   115 	
       
   116 /**
       
   117  * Open S0-Application identified by UID along with the specified params
       
   118  * @param {Integer} Uid hexadecimal value to a specified application
       
   119  * @param {String} Value
       
   120  *     openApplication()
       
   121  * @return {Void}
       
   122  */
       
   123 Widget.prototype.openApplication = function(Uid, param) {};
       
   124 	
       
   125 /**
       
   126  * Prepares the Widget.to do transition to specified transitionState
       
   127  * @param {String} Value Transition state
       
   128  *     prepareForTransition()
       
   129  * @return {Void}
       
   130  */
       
   131 Widget.prototype.prepareForTransition = function(transitionMode){};
       
   132 	
       
   133 /**
       
   134  * Does the animation to make the transition between the specified transitionState
       
   135  * @param {Void}
       
   136  *     performTransition()
       
   137  * @return {Void}
       
   138  */
       
   139 Widget.prototype.performTransition = function(){};
       
   140 	
       
   141 /**
       
   142  * Set the preferred screen orientation to landscape.
       
   143  * The display will flip if the phone display orientation
       
   144  * is portrait and the phone supports landscape mode.
       
   145  * @param {Void}
       
   146  *     setDisplayLandscape()
       
   147  * @return {Void}
       
   148  */
       
   149 Widget.prototype.setDisplayLandscape = function(){};
       
   150 	
       
   151 /**
       
   152  * Set the preferred screen orientation to portrait.
       
   153  * The display will flip if the phone display orientation
       
   154  * is landscape and the phone supports portrait mode.
       
   155  * @param {Void}
       
   156  *     setDisplayPortrait()
       
   157  * @return {Void}
       
   158  */
       
   159 Widget.prototype.setDisplayPortrait = function(){};
       
   160 
       
   161 /**
       
   162  * device object. entry point to device service API (SAPI)
       
   163  */
       
   164 function Device() {}
       
   165 Device.prototype = new Object();
       
   166 Device.prototype.device = new Device();
       
   167 
       
   168 /**
       
   169  * device API public method
       
   170  * 
       
   171  * @method
       
   172  * @param {string} provider Name of service provider, eg, "Service.Calendar"
       
   173  * @param {string} Interface Name of interface, eg, "IDataSource"
       
   174  * @return {Object} service object  
       
   175  */
       
   176 Device.prototype.getServiceObject = function(provider, Interface) {
       
   177 	return new Object();
       
   178 };