webengine/widgetregistry/Server/inc/WidgetEntry.h
changeset 0 dd21522fd290
child 25 0ed94ceaa377
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2006 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 CWidgetEntry class.
       
    15 *
       
    16 *                This class implements the CWidgetEntry class.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef WIDGETENTRY_H
       
    22 #define WIDGETENTRY_H
       
    23 
       
    24 // INCLUDES
       
    25 #include "WidgetPropertyValue.h"
       
    26 #include "WidgetRegistryXml.h"
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class RFileWriteStream;
       
    30 class RFileReadStream;
       
    31 
       
    32 
       
    33 /**
       
    34 *
       
    35 *  This class holds all information related to a widget
       
    36 *
       
    37 *  @since 3.1
       
    38 */
       
    39 class CWidgetEntry : public CBase
       
    40     {
       
    41 
       
    42 public: // constructors and destructor
       
    43 
       
    44     /**
       
    45      * Two phase constructor
       
    46      * @return none
       
    47      * @since 3.1
       
    48      **/
       
    49     static CWidgetEntry* NewL();
       
    50 
       
    51      /**
       
    52      * Two phase constructor
       
    53      * @return none
       
    54      * @since 5.0
       
    55      **/
       
    56     static CWidgetEntry* NewL( RPointerArray<CWidgetPropertyValue>** aProps );
       
    57 
       
    58     /**
       
    59      * Destructor
       
    60      * @return none
       
    61      * @since 3.1
       
    62      **/
       
    63     ~CWidgetEntry();
       
    64 
       
    65 public:
       
    66 
       
    67     /** Read the widget binary info from file stream into memory
       
    68     * @return none
       
    69     * @since 3.1
       
    70     **/
       
    71     void InternalizeBinaryL( RReadStream& aReadStream );
       
    72 
       
    73     /** Read the widget XML info from file stream into memory
       
    74     * @return none
       
    75     * @since 5.0
       
    76     **/
       
    77     void InternalizeXmlL( RFs& aFileSession,
       
    78                           xmlDocPtr aDoc,
       
    79                           xmlNode* n,
       
    80                           CWidgetRegistryXml* aXmlProcessor );
       
    81 
       
    82     /**
       
    83      * Write the widget binary info into file stream
       
    84      * @return none
       
    85      * @since 3.1
       
    86      **/
       
    87     void ExternalizeBinaryL( RWriteStream& aWriteStream );
       
    88 
       
    89     /**
       
    90      * Write the widget XML info into file stream
       
    91      * @return none
       
    92      * @since 5.0
       
    93      **/
       
    94     void ExternalizeXmlL( RWriteStream& aWriteStream,
       
    95                           CWidgetRegistryXml* aXmlProcessor,
       
    96                           RFs& aFileSession);
       
    97 
       
    98     inline CWidgetPropertyValue& operator[] ( TInt id )
       
    99         {
       
   100         return *(iPropertyValues[id]);
       
   101         }
       
   102 
       
   103     /**
       
   104      * Is widget running (active)?
       
   105      * @return active status
       
   106      * @since 3.1
       
   107      **/
       
   108     TInt ActiveL();
       
   109 
       
   110     /**
       
   111      * Does widget have sapi access
       
   112      * after accepting security prompt, promptless or no access
       
   113      * @return sapi access  status
       
   114      * @since 5.0
       
   115      **/
       
   116     TInt SapiAccessState();
       
   117 
       
   118     /**
       
   119      * Set running status.
       
   120      * @return none
       
   121      * @since 3.1
       
   122      **/
       
   123     inline void SetActive( TInt aStatus ) { iActive = aStatus; }
       
   124 
       
   125     /**
       
   126     * Set MiniView .
       
   127     * @return none
       
   128     * @since 5.0
       
   129     **/
       
   130     inline void SetMiniView( TInt aStatus ) { iMiniView = aStatus; }
       
   131 
       
   132     /**
       
   133      * Set running in full view status.
       
   134      * @return none
       
   135      * @since 
       
   136      **/
       
   137     inline void SetFullView( TInt aStatus ) { iFullView = aStatus; }
       
   138 
       
   139     /**
       
   140     * Set running in full view status.
       
   141     * @return none
       
   142     * @since 
       
   143     **/
       
   144    inline void SetBlanketPermission ( TInt aStatus ) { iBlanketPermGranted = aStatus; 
       
   145                                                            *(iPropertyValues[EBlanketPermGranted]) = iBlanketPermGranted;
       
   146                                                          }
       
   147 
       
   148     /**
       
   149     * Is widget in MiniView
       
   150     * @return MiniView status
       
   151     * @since
       
   152     **/
       
   153     inline TInt GetMiniViewState(){ return iMiniView;}
       
   154 
       
   155     /**
       
   156     * Is widget in MiniView
       
   157     * @return MiniView status
       
   158     * @since
       
   159     **/
       
   160     inline TInt GetFullViewState(){ return iFullView;}
       
   161 
       
   162     /**
       
   163     * Has widget got blanket permission granted
       
   164     * @return blanket permission status
       
   165     * @since
       
   166     **/
       
   167     inline TInt GetBlanketPermGranted(){ return iBlanketPermGranted;}
       
   168 
       
   169     /**
       
   170      * Property value array accessor.
       
   171      * @return none
       
   172      * @since 5.0
       
   173      **/
       
   174     inline RPointerArray<CWidgetPropertyValue>* Properties()
       
   175       { return &iPropertyValues; }
       
   176 
       
   177 protected:
       
   178     /**
       
   179      * Constructor
       
   180      */
       
   181     CWidgetEntry();
       
   182 
       
   183     /**
       
   184      * 2-phase constructor
       
   185      */
       
   186     void ConstructL();
       
   187 
       
   188 protected:
       
   189     RPointerArray<CWidgetPropertyValue>  iPropertyValues;
       
   190 
       
   191     TInt iNetworkAccess; // bool, 1 if widget wants network access
       
   192     // info.plist EAllowNetworkAccess and part of EAllowFullAccess
       
   193 
       
   194     TInt iActive; // bool, 1 if widget is executing
       
   195 
       
   196    	TInt iMiniView; // bool, 1 if launched in miniview
       
   197 
       
   198 	TInt iFullView; // bool, 1 if launched in fullview
       
   199     TInt iBlanketPermGranted; // bool, 1 if platform service access needs to be prompted
       
   200     
       
   201     };
       
   202 
       
   203 typedef RPointerArray<CWidgetEntry> RWidgetArray;
       
   204 
       
   205 #endif // WIDGETENTRY_H