web_plat/widget_registry_api/inc/WidgetRegistryClient.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation 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 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef WIDGETREGISTRYCLIENT_H
       
    20 #define WIDGETREGISTRYCLIENT_H
       
    21 
       
    22 #include <WidgetRegistryData.h>
       
    23 #include <WidgetPropertyValue.h>
       
    24 
       
    25 // Forward declaration
       
    26 class RWriteStream;
       
    27 
       
    28 class RWidgetRegistryClientSession : public RSessionBase
       
    29     {
       
    30 public: // API
       
    31     /**
       
    32     * Constructor
       
    33     */
       
    34     IMPORT_C RWidgetRegistryClientSession();
       
    35 
       
    36     /**
       
    37     * Connect to widgetregistry server
       
    38     */
       
    39     IMPORT_C TInt Connect();
       
    40 
       
    41     /**
       
    42     * Returns the version
       
    43     */
       
    44     IMPORT_C TVersion Version() const;
       
    45 
       
    46     /**
       
    47     * Disconnect from widgetregistry server
       
    48     */
       
    49     IMPORT_C TInt Disconnect();
       
    50 
       
    51     /**
       
    52     * Returns true if the Uid falls within the range specified for widgets.
       
    53     */
       
    54     IMPORT_C TBool IsWidget( const TUid& aUid );
       
    55 
       
    56     /**
       
    57     * Returns true if the widget is installed
       
    58     */
       
    59     IMPORT_C TBool WidgetExistsL( const TDesC& aBundleId );
       
    60 
       
    61     /**
       
    62     * Returns true if the widget is running.
       
    63     */
       
    64     IMPORT_C TBool IsWidgetRunning( const TUid& aUid );
       
    65 
       
    66     /**
       
    67     * Returns count of widgets installed.
       
    68     */
       
    69     IMPORT_C TInt WidgetCount( TInt& aCount );
       
    70 
       
    71     /**
       
    72     * Returns path of the widget with a particular UId
       
    73     */
       
    74     IMPORT_C void GetWidgetPath( const TUid& aUid, TDes& aWidgetPath );
       
    75 
       
    76     /**
       
    77     * Returns uid of the widget with a particular bundle identifier
       
    78     */
       
    79     IMPORT_C TInt GetWidgetUidL( const TDesC& aBundleId );
       
    80 
       
    81     /**
       
    82     * Returns UId of the widget with a particular Url
       
    83     */
       
    84     IMPORT_C TInt GetWidgetUidForUrl( const TDesC& aUrl );
       
    85 
       
    86     /**
       
    87     * Get next availble uid
       
    88     */
       
    89     IMPORT_C TUid GetAvailableUidL( TUint aDriveLetter );
       
    90 
       
    91     /**
       
    92     * Returns bundle Id of the widget with a particular UId
       
    93     */
       
    94     IMPORT_C void GetWidgetBundleId( const TUid& aUid, TDes& aWidgetBundleId );
       
    95 
       
    96     /**
       
    97     * Returns bundle name of the widget with a particular UId
       
    98     */
       
    99     IMPORT_C void GetWidgetBundleName( const TUid& aUid, TDes& aWidgetBundleName );
       
   100 
       
   101     /**
       
   102     * Gets property value for a widget by UId, leaves on error
       
   103     */
       
   104     IMPORT_C CWidgetPropertyValue* GetWidgetPropertyValueL(
       
   105         const TUid& aUid,
       
   106         TWidgetPropertyId aPropertyId );
       
   107 
       
   108     /**
       
   109     * Returns widget info for all the installed widgets.
       
   110     */
       
   111     IMPORT_C TInt InstalledWidgetsL( RWidgetInfoArray& aWidgetInfoArr );
       
   112 
       
   113     /**
       
   114     * Returns widget info for all the running widgets.
       
   115     */
       
   116     IMPORT_C TInt RunningWidgetsL( RWidgetInfoArray& aWidgetInfoArr );
       
   117 
       
   118     /**
       
   119     * Registers the widget
       
   120     */
       
   121     IMPORT_C void RegisterWidgetL(
       
   122         const RPointerArray<CWidgetPropertyValue>&  aPropertyValues );
       
   123 
       
   124     /**
       
   125     * Deregister the widget
       
   126     */
       
   127     IMPORT_C void DeRegisterWidgetL( const TUid& aUid );
       
   128 
       
   129     /**
       
   130     * Set/Reset active status of the widget
       
   131     */
       
   132     IMPORT_C void SetActive( const TUid& aUid, TInt aStatus );
       
   133 
       
   134     /**
       
   135     * Get the language project name which is the directory to
       
   136     * hold localized resources
       
   137     */
       
   138     IMPORT_C void GetLprojName( TDes& aLprojName );
       
   139 
       
   140     /**
       
   141     * Returns security policyId.
       
   142     */
       
   143     IMPORT_C TInt SecurityPolicyId();
       
   144 	
       
   145     /**
       
   146     * Returns if widget sapi access is prompted, promptless or denied.
       
   147     */
       
   148     IMPORT_C TInt WidgetSapiAccessState( const TUid& aUid );
       
   149 
       
   150     /**
       
   151     * Returns true if the widget is in MiniView.
       
   152     */
       
   153     IMPORT_C TBool IsWidgetInMiniView( const TUid& aUid );
       
   154 
       
   155     /**
       
   156     * Returns true if the widget is in FullView.
       
   157     */
       
   158     IMPORT_C TBool IsWidgetInFullView( const TUid& aUid );
       
   159 
       
   160     /**
       
   161     * Returns true if the blanket permission is granted
       
   162     */
       
   163     IMPORT_C TBool IsBlanketPermGranted( const TUid& aUid );
       
   164 	
       
   165     /**
       
   166     * Set/Reset Mini view launched status of widget
       
   167     */
       
   168     IMPORT_C void SetMiniViewL(const TUid& aUid, TInt aStatus );
       
   169 
       
   170     /**
       
   171     * Set/Reset Full view  status of widget
       
   172     */
       
   173     IMPORT_C void SetFullViewL(const TUid& aUid, TInt aStatus );
       
   174 
       
   175     /**
       
   176     * Set/Reset blaket permission for widgets
       
   177     */
       
   178     IMPORT_C void SetBlanketPermissionL(const TUid& aUid, TInt aStatus );
       
   179 
       
   180 private:
       
   181     /**
       
   182     * Creates and returns heap descriptor which holds contents of
       
   183     * RWidgetDataArray or CWidgetInfo based on the datatype passed
       
   184     */
       
   185     CBufFlat* MarshalPropertyValuesL(
       
   186         const RPointerArray<CWidgetPropertyValue>& aPropertyValues ) const;
       
   187 
       
   188     /**
       
   189     * Read data from aStream
       
   190     */
       
   191     void DeserializeWidgetInfoL(
       
   192         RReadStream& aStream, RWidgetInfoArray& aWidgetInfoArr, TInt aCount );
       
   193 
       
   194 
       
   195 private:
       
   196     TIpcArgs iMesgArgs;
       
   197     };
       
   198 
       
   199 #endif