webengine/widgetregistry/Server/inc/WidgetRegistrySession.h
changeset 0 dd21522fd290
child 25 0ed94ceaa377
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2006, 2008 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:  This file contains the header file of the
       
    15 *                CWidgetRegistryServerSession class.
       
    16 *
       
    17 *                This class implements the CWidgetRegistryServerSession class.
       
    18 *
       
    19 */
       
    20 
       
    21 #ifndef WIDGETREGISTRYSESSION_H
       
    22 #define WIDGETREGISTRYSESSION_H
       
    23 
       
    24 // INCLUDES
       
    25 #include "WidgetRegistryData.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 
       
    29 class CWidgetRegistryServer;
       
    30 class CWidgetData;
       
    31 class CWidgetRegistry;
       
    32 class RWriteStream;
       
    33 
       
    34 class CWidgetRegistryServerSession : public CSession2
       
    35     {
       
    36 public:
       
    37     /**
       
    38     * Returns singleton of factory.
       
    39     * @since 3.1
       
    40     * @param aServer WidgetRegistry server
       
    41     * @return CWidgetRegistryServerSession object
       
    42     */
       
    43     static CWidgetRegistryServerSession* NewL(
       
    44         CWidgetRegistryServer& aServer,
       
    45         const RMessage2& aMessage );
       
    46 
       
    47     /**
       
    48     * Destructor.
       
    49     * @since 3.1
       
    50     */
       
    51     ~CWidgetRegistryServerSession();
       
    52 
       
    53     /**
       
    54     * Called by the CServer framework.
       
    55     * @since 3.1
       
    56     * @return none
       
    57     */
       
    58     void CreateL();
       
    59     
       
    60     static void ResetAndDestroy(TAny *aPtr)
       
    61         {
       
    62             static_cast<RWidgetInfoArray *>(aPtr)->ResetAndDestroy();
       
    63         }
       
    64     
       
    65 
       
    66 private:
       
    67     /**
       
    68     * C++ constructor.
       
    69     * @since 3.1
       
    70     */
       
    71     CWidgetRegistryServerSession();
       
    72 
       
    73     /**
       
    74     * 2-phased constructor.
       
    75     * @since 3.1
       
    76     * @param aServer WidgetRegistry server
       
    77     * @param aMessage message from client
       
    78     * @return none
       
    79     */
       
    80     void ConstructL( CWidgetRegistryServer& aServer,
       
    81         const RMessage2& aMessage );
       
    82 
       
    83 private:
       
    84     /**
       
    85     * From CSession2, handles messages from client
       
    86     * @since 3.1
       
    87     * @param aMessage message from client
       
    88     * @return none
       
    89     */
       
    90     void ServiceL( const RMessage2& aMessage );
       
    91 
       
    92     /**
       
    93     * From CSession2, handles leaves from ServiceL()
       
    94     * @since 3.2
       
    95     * @param aMessage message from client
       
    96     * @param aError
       
    97     * @return none
       
    98     */
       
    99     void ServiceError(const RMessage2& aMessage,TInt aError);
       
   100 
       
   101 private: // Op Codes
       
   102     /**
       
   103     * Register widget
       
   104     * @since 3.1
       
   105     * @param aMessage message from client
       
   106     * @return Error code
       
   107     */
       
   108     TInt OpRegisterWidgetL( const RMessage2& aMessage );
       
   109 
       
   110     /**
       
   111     * Whether widget exists or not for a given UId
       
   112     * @since 3.1
       
   113     * @param aMessage message from client
       
   114     * @return boolean value whether widget exists or not
       
   115     */
       
   116     TBool OpWidgetExists( const RMessage2& aMessage );
       
   117 
       
   118     /**
       
   119     * Checks if the UId is in the range allocated for widgets
       
   120     * @since 3.1
       
   121     * @param aMessage message from client
       
   122     * @return true if the given UId falls within the range allocated
       
   123     * for widgets otherwise false
       
   124     */
       
   125     TBool OpIsWidget( const RMessage2& aMessage );
       
   126 
       
   127     /**
       
   128     * Checks if widget is running
       
   129     * @since 3.1
       
   130     * @param aMessage message from client
       
   131     * @return true if widget is running otherwise false
       
   132     */
       
   133     TBool OpIsWidgetRunning( const RMessage2& aMessage );
       
   134 
       
   135     /**
       
   136     * Checks if widget sapi access is prompted, promptless or denied
       
   137     * @since 5.0
       
   138     * @param aMessage message from client
       
   139     * @return TInt as state
       
   140     */
       
   141     TInt OpWidgetSapiAccessState(const RMessage2& aMessage );
       
   142 
       
   143     /**
       
   144     * Checks if widget is in mini view
       
   145     * @since 
       
   146     * @param aMessage message from client
       
   147     * @return true if widget is miniview otherwise false
       
   148     */
       
   149     TBool OpIsWidgetInMiniView(const RMessage2& aMessage );
       
   150 
       
   151      /**
       
   152     * Checks if widget is started  in full view
       
   153     * @since 
       
   154     * @param aMessage message from client
       
   155     * @return true if widget is started in fullview otherwise false
       
   156     */
       
   157     TBool OpIsWidgetInFullView(const RMessage2& aMessage );
       
   158 
       
   159     /**
       
   160     * Checks if mini view will be prompted for platform access
       
   161     * @since 5.0
       
   162     * @param aMessage message from client
       
   163     * @return true if prompt is needed
       
   164     */
       
   165     TBool OpIsWidgetPromptNeeded(const RMessage2& aMessage );
       
   166 
       
   167     /**
       
   168     * Count of the widgets installed
       
   169     * @since 3.1
       
   170     * @param aMessage message from client
       
   171     * @return number of widgets installed
       
   172     */
       
   173     TInt OpWidgetCount( const RMessage2& aMessage );
       
   174 
       
   175     /**
       
   176     * Get array of installed widgets.
       
   177     * @since 3.1
       
   178     * @param aMessage message from client
       
   179     * @return count of installed widgets
       
   180     */
       
   181     TInt OpInstalledWidgetsPhase1L( const RMessage2& aMessage );
       
   182 
       
   183     /**
       
   184     * Get array of installed widgets.
       
   185     * @since 3.1
       
   186     * @param aMessage message from client
       
   187     * @return count of installed widgets
       
   188     */
       
   189     TInt OpInstalledWidgetsPhase2L( const RMessage2& aMessage );
       
   190 
       
   191     /**
       
   192     * Get array of running widgets.
       
   193     * @since 3.1
       
   194     * @param aMessage message from client
       
   195     * @return count of running widgets
       
   196     */
       
   197     TInt OpRunningWidgetsPhase1L( const RMessage2& aMessage );
       
   198 
       
   199     /**
       
   200     * Get array of running widgets.
       
   201     * @since 3.1
       
   202     * @param aMessage message from client
       
   203     * @return count of running widgets
       
   204     */
       
   205     TInt OpRunningWidgetsPhase2L( const RMessage2& aMessage );
       
   206 
       
   207     /**
       
   208     * Get widget bundle Id.
       
   209     * @since 3.1
       
   210     * @param aMessage message from client
       
   211     * @return length of widget bundle Id
       
   212     */
       
   213     TInt OpGetWidgetBundleId( const RMessage2& aMessage );
       
   214 
       
   215     /**
       
   216     * Get widget info.plist key string value.
       
   217     * @since 3.1
       
   218     * @param aMessage message from client
       
   219     * @return error code
       
   220     */
       
   221     TInt OpGetWidgetPropertyValueL( const RMessage2& aMessage );
       
   222 
       
   223     /**
       
   224     * Get widget bundle display name.
       
   225     * @since 3.1
       
   226     * @param aMessage message from client
       
   227     * @return length of widget bundle display name
       
   228     */
       
   229     TInt OpGetWidgetBundleName( const RMessage2& aMessage );
       
   230 
       
   231     /**
       
   232     * Get widget path.
       
   233     * @since 3.1
       
   234     * @param aMessage message from client
       
   235     * @return length of widget path
       
   236     */
       
   237     TInt OpGetWidgetPath( const RMessage2& aMessage );
       
   238 
       
   239     /**
       
   240     * Get widget UId of the widget with the given bundle Id.
       
   241     * @since 3.1
       
   242     * @param aMessage message from client
       
   243     * @return UId
       
   244     */
       
   245     TInt OpGetWidgetUid( const RMessage2& aMessage );
       
   246 
       
   247     /**
       
   248     * widget UId of the widget with the given url.
       
   249     * @since 3.1
       
   250     * @param aMessage message from client
       
   251     * @return UId
       
   252     */
       
   253     TInt OpGetWidgetUidForUrl( const RMessage2& aMessage );
       
   254 
       
   255     /**
       
   256     * Register the widget.
       
   257     * @since 3.1
       
   258     * @param aMessage message from client
       
   259     * @return Error code
       
   260     */
       
   261     TInt OpDeRegisterWidgetL( const RMessage2& aMessage );
       
   262 
       
   263     /**
       
   264     * next available UId
       
   265     * @since 3.1
       
   266     * @param aMessage message from client
       
   267     * @return next available UId
       
   268     */
       
   269     TInt OpGetAvailableUidL( const RMessage2& aMessage );
       
   270 
       
   271     /**
       
   272     * Set/Reset active status of the widget
       
   273     * @since 3.1
       
   274     * @param aMessage message from client
       
   275     * @return none
       
   276     */
       
   277     void OpSetActive( const RMessage2& aMessage );
       
   278 
       
   279     /**
       
   280     * Set/Reset active status of the widget
       
   281     * @since 3.1
       
   282     * @param aMessage message from client
       
   283     * @return none
       
   284     */
       
   285     void OpSetMiniView( const RMessage2& aMessage );
       
   286 
       
   287     /**
       
   288     * Set/Reset active status of the widget
       
   289     * @since 3.1
       
   290     * @param aMessage message from client
       
   291     * @return none
       
   292     */
       
   293     void OpSetFullView( const RMessage2& aMessage );
       
   294 
       
   295     /**
       
   296     * Set/Reset prompt required for miniview platform access
       
   297     * @since 5.0
       
   298     * @param aMessage message from client
       
   299     * @return none
       
   300     */
       
   301     void OpSetPromptNeeded( const RMessage2& aMessage );
       
   302 
       
   303     /**
       
   304     * Disconnect from client
       
   305     * @since 3.1
       
   306     * @param aMessage message from client
       
   307     * @return Error code
       
   308     */
       
   309     TInt OpDisconnect( const RMessage2& aMessage );
       
   310 
       
   311     /**
       
   312     * Get lproj name.
       
   313     * @since 3.1
       
   314     * @param aMessage message from client
       
   315     * @return length of lproj name
       
   316     */
       
   317     TInt OpGetLprojNameL( const RMessage2& aMessage );
       
   318 
       
   319     /**
       
   320     * Get Security PolicyId
       
   321     * @since 5.0
       
   322     * @param aMessage message from client
       
   323     * @return Security PolicyId
       
   324     */
       
   325     TInt OpSecurityPolicyId( const RMessage2& aMessage );
       
   326 
       
   327     /**
       
   328     * Get WidgetRegistry server object as reference
       
   329     * @since 3.1
       
   330     * @return WidgetRegistry server object
       
   331     */
       
   332     CWidgetRegistryServer& WidgetRegistryServer();
       
   333 
       
   334     /**
       
   335     * Write data to aStream
       
   336     * @since 3.1
       
   337     * @return none
       
   338     */
       
   339     void ExternalizeL(
       
   340         RWriteStream& aStream, RWidgetInfoArray& aWidgetInfoArr );
       
   341 
       
   342     /**
       
   343     * Creates heap descriptor which holds contents of RWidgetInfoArray
       
   344     * @since 3.1
       
   345     * @return heap descriptor
       
   346     */
       
   347     HBufC8* MarshalDataL( RWidgetInfoArray& aWidgetInfoArr );
       
   348 
       
   349     /**
       
   350     * delete each item in RWidgetInfoArray
       
   351     * @since 3.1
       
   352     * @return none
       
   353     */
       
   354     void ResetWidgetInfo( RWidgetInfoArray& aWidgetInfoArr );
       
   355 
       
   356 private:
       
   357     RFs                     iRfs;// file session, owned
       
   358     static CWidgetRegistry* iWidgetRegistry;// widget registry object, owned
       
   359     };
       
   360 
       
   361 #endif