homescreensrv_plat/hs_content_control_api/inc/hscontentinfo.h
changeset 0 79c6a41cd166
child 3 ff572005ac23
equal deleted inserted replaced
-1:000000000000 0:79c6a41cd166
       
     1 /*
       
     2 * Copyright (c) 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 "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 #ifndef HSCONTENTINFO_H
       
    19 #define HSCONTENTINFO_H
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>
       
    23 #include <s32strm.h>
       
    24 #include <s32mem.h>
       
    25 
       
    26 // Forward declarations
       
    27 
       
    28 /**
       
    29  *  Content data
       
    30  *
       
    31  *
       
    32  *  @code
       
    33  *
       
    34  *  @endcode
       
    35  *
       
    36  *  @lib hscontentcontrol.lib
       
    37  *  @since S60 v5.0
       
    38  */
       
    39 NONSHARABLE_CLASS( CHsContentInfo ) : public CBase
       
    40     {
       
    41     public:
       
    42     /**
       
    43      * Two-phased constructor.
       
    44      */
       
    45     IMPORT_C static CHsContentInfo* NewL();
       
    46     
       
    47     /**
       
    48      * Two-phased constructor.
       
    49      */    
       
    50     IMPORT_C static CHsContentInfo* NewL( RReadStream& aStream );
       
    51     
       
    52     /**
       
    53      * Two-phased constructor.
       
    54      */    
       
    55     IMPORT_C static CHsContentInfo* NewLC();
       
    56     
       
    57     /**
       
    58      * Clone.
       
    59      */
       
    60 	IMPORT_C CHsContentInfo* CloneL();
       
    61 
       
    62     /**
       
    63      * Destructor.
       
    64      */
       
    65     ~CHsContentInfo();
       
    66 
       
    67 private:
       
    68     /**
       
    69      * Constructor
       
    70      */
       
    71     CHsContentInfo();
       
    72 
       
    73     /** Second phase constructor */
       
    74     void ConstructL();
       
    75 
       
    76 public:
       
    77     /**
       
    78      * Set Widget name. 
       
    79      *
       
    80      * @since S60 5.0
       
    81      * @param aName. Name of the widget.
       
    82      * @return Reference to this
       
    83      */
       
    84     IMPORT_C void SetNameL( const TDesC8& aName );
       
    85     
       
    86     /**
       
    87      * Set Widget name. 
       
    88      *
       
    89      * @since S60 5.0
       
    90      * @param aName. Name of the widget.
       
    91      * @return Reference to this
       
    92      */
       
    93     IMPORT_C void SetNameL( const TDesC& aName );
       
    94 
       
    95     /**
       
    96      * Set Widget's publisher Id . 
       
    97      *
       
    98      * @since S60 5.0
       
    99      * @param aPublisherId. Name of the publisher.
       
   100      * @return Reference to this
       
   101      */
       
   102     IMPORT_C void SetPublisherIdL( const TDesC& aPublisherId );
       
   103     
       
   104     /**
       
   105      * Set Widget id. 
       
   106      *
       
   107      * @since S60 5.0
       
   108      * @param aUid Static uid of the widget.
       
   109      * @return Reference to this
       
   110      */
       
   111     IMPORT_C void SetUidL( const TDesC8& aUid );
       
   112     
       
   113     /**
       
   114      * Set Widget plugin id. 
       
   115      *
       
   116      * @since S60 5.0
       
   117      * @param aId Dynamic id generated by hsps.
       
   118      * @return Reference to this
       
   119      */
       
   120     IMPORT_C void SetPluginIdL( const TDesC8& aId );
       
   121 
       
   122     /**
       
   123      * Set widget type. Possible values widget and template 
       
   124      *
       
   125      * @since S60 5.0
       
   126      * @param aType Widget type.
       
   127      */
       
   128     IMPORT_C void SetTypeL( const TDesC8& aType );
       
   129 
       
   130     /**
       
   131      * Access to widget name. 
       
   132      *
       
   133      * @since S60 5.0
       
   134      * @return Reference to name
       
   135      */
       
   136     IMPORT_C const TDesC& Name() const;
       
   137 
       
   138     /**
       
   139      * Access to widget's publisher id. 
       
   140      *
       
   141      * @since S60 5.0
       
   142      * @return Reference to publisher id
       
   143      */
       
   144     IMPORT_C const TDesC& PublisherId() const;
       
   145 
       
   146     /**
       
   147      * Access to widget uid. 
       
   148      *
       
   149      * @since S60 5.0
       
   150      * @return Uid or KNullDesC8
       
   151      */
       
   152     IMPORT_C const TDesC8& Uid() const;
       
   153     
       
   154     /**
       
   155      * Access to widget name. 
       
   156      *
       
   157      * @since S60 5.0
       
   158      * @return Reference to name
       
   159      */
       
   160     IMPORT_C HBufC8* NameAs8BitLC() const;
       
   161 
       
   162     /**
       
   163      * Access to widget plugin id. 
       
   164      *
       
   165      * @since S60 5.0
       
   166      * @return Plugin id or null if not set
       
   167      */
       
   168     IMPORT_C const TDesC8& PluginId() const;
       
   169 
       
   170     /**
       
   171      * Set widget type. Possible values widget and template 
       
   172      *
       
   173      * @since S60 5.0
       
   174      * @return Type or KNullDesC8.
       
   175      */
       
   176     IMPORT_C const TDesC8& Type() const;
       
   177 
       
   178     /**
       
   179      * Set Maximum number of widgets
       
   180      *
       
   181      * @param aMaxWidget maximum number of widgets
       
   182      */
       
   183     IMPORT_C void SetMaxWidgets( TInt aMaxWidget );
       
   184     
       
   185     /**
       
   186      * Get Maximum number of widgets
       
   187      *
       
   188      * @return number of widgets or defaule value 1
       
   189      */
       
   190     IMPORT_C TInt MaxWidgets() const;   
       
   191     
       
   192     /**
       
   193      * Externalize.
       
   194      *
       
   195      * @param aStream A stream to externalize to
       
   196      */
       
   197     IMPORT_C void ExternalizeL( RWriteStream& aStream );
       
   198     
       
   199     /**
       
   200      * Sets whether this widget can be added to the active HS page
       
   201      *
       
   202      * @since S60 5.0
       
   203      * @param aValue ETrue if can be added, EFalse otherwise
       
   204      */
       
   205     IMPORT_C void SetCanBeAdded( TBool aValue );
       
   206 
       
   207     /**
       
   208      * Queries whether this widget can be added to the active HS page
       
   209      *
       
   210      * @since S60 5.0
       
   211      * @return ETrue if can be added, EFalse otherwise
       
   212      */    
       
   213     IMPORT_C TBool CanBeAdded() const;
       
   214 
       
   215     /**
       
   216      * Sets whether this widget can be removed from the active HS page
       
   217      *
       
   218      * @since S60 5.0
       
   219      * @param aValue ETrue if can be added, EFalse otherwise
       
   220      */
       
   221     IMPORT_C void SetCanBeRemoved( TBool aValue );
       
   222 
       
   223     /**
       
   224      * Queries whether this widget can be removed from the active HS page
       
   225      *
       
   226      * @since S60 5.0
       
   227      * @return ETrue if can be removed, EFalse otherwise
       
   228      */    
       
   229     IMPORT_C TBool CanBeRemoved() const;
       
   230 
       
   231     /**
       
   232      * Sets this widget's installation time
       
   233      *
       
   234      * @since S60 5.0
       
   235      * @param aTime Installation time
       
   236      */        
       
   237     IMPORT_C void SetInstallationTime( TTime& aTime );
       
   238 
       
   239     /**
       
   240      * Gets this widget's installation time
       
   241      *
       
   242      * @since S60 5.0
       
   243      * @return Installation time
       
   244      */            
       
   245     IMPORT_C TTime InstallationTime() const;
       
   246 
       
   247     /**
       
   248      * Sets this widget's description
       
   249      *
       
   250      * @since S60 5.0
       
   251      * @param aDescription Description
       
   252      */                
       
   253     IMPORT_C void SetDescriptionL( const TDesC& aDescription );
       
   254 
       
   255     /**
       
   256      * Gets this widget's description
       
   257      *
       
   258      * @since S60 5.0
       
   259      * @return Description
       
   260      */                    
       
   261     IMPORT_C const TDesC& Description() const;
       
   262     
       
   263     /**
       
   264      * Sets this widget's icon path
       
   265      *
       
   266      * @since S60 5.0
       
   267      * @param aPath Path
       
   268      */                    
       
   269     IMPORT_C void SetIconPathL( const TDesC& aIconPath );
       
   270 
       
   271     /**
       
   272      * Gets this widget's icon path
       
   273      *
       
   274      * @since S60 5.0
       
   275      * @return Path
       
   276      */                    
       
   277     IMPORT_C const TDesC& IconPath() const;
       
   278     
       
   279     /**
       
   280      * Internalize
       
   281      * @param aStream A stream where the class is internalized
       
   282      *
       
   283      * @since S60 5.0
       
   284      */                    
       
   285     IMPORT_C void InternalizeL( RReadStream& aStream );    
       
   286 
       
   287     /**
       
   288      * Returns size of a descriptor needed to externalize the class
       
   289      *
       
   290      * @since S60 5.0
       
   291      */
       
   292     IMPORT_C TInt Size();
       
   293     
       
   294     /**
       
   295      * Set WRT widget publisher uid. 
       
   296      *
       
   297      * @since S60 5.0
       
   298      * @param aUid Publisher uid of the wrt widget.
       
   299      * @return Reference to this
       
   300      */
       
   301     IMPORT_C void SetPublisherUidL( const TDesC8& aUid );
       
   302     
       
   303     /**
       
   304      * Access to WRT widget publisher uid.
       
   305      * 
       
   306      * @since S60 5.0
       
   307      * @return PublisherUid or KNullDesC8
       
   308      */
       
   309     IMPORT_C const TDesC8& PublisherUid() const;
       
   310 
       
   311     /**
       
   312      * Sets whether this is a WRT widget
       
   313      * 
       
   314      * @since S60 5.0
       
   315      * @param aIsWrt, ETrue if is WRT
       
   316      */    
       
   317     IMPORT_C void SetIsWrt( TBool aIsWrt );
       
   318     
       
   319     /**
       
   320      * Returns whether this is a WRT widget
       
   321      * 
       
   322      * @since S60 5.0
       
   323      * @return ETrue if WRT, EFalse otherwise
       
   324      */    
       
   325     IMPORT_C TBool IsWrt() const;
       
   326 
       
   327     /**
       
   328      * Marshals Content Info data to a descriptor
       
   329      * 
       
   330      * @since S60 5.0
       
   331      * @return Descriptor containing the externalized Content Info data
       
   332      */
       
   333     IMPORT_C HBufC8* MarshalL();
       
   334 
       
   335 private: // Data
       
   336     /**
       
   337      * Widget name, Owned
       
   338      */
       
   339     HBufC* iName;
       
   340     
       
   341     /**
       
   342      * Widget uid, Owned
       
   343      */
       
   344     HBufC8* iUid;
       
   345     
       
   346     /**
       
   347      * Widget plugin id, Owned
       
   348      */
       
   349     HBufC8* iPluginId;
       
   350     
       
   351     /**
       
   352      * Widget type, Owned
       
   353      */
       
   354     HBufC8* iType;
       
   355     
       
   356     /**
       
   357      * Publisher Id, Owned
       
   358      */
       
   359     HBufC* iPublisherId;
       
   360 
       
   361     /**
       
   362      * Description, Owned
       
   363      */
       
   364     HBufC* iDescription;
       
   365 
       
   366     /**
       
   367      * Icon path, Owned
       
   368      */
       
   369     HBufC* iIconPath;
       
   370     
       
   371     /**
       
   372      * Max number of instances allowed 
       
   373      */
       
   374     TInt iMaxInstance;
       
   375 
       
   376     /**
       
   377      * Flag to determine whether this widget 
       
   378      * can be added to the active HS page.
       
   379      */
       
   380     TBool iCanBeAdded;
       
   381 
       
   382     /**
       
   383      * Flag to determine whether this widget 
       
   384      * can be removed from the active HS page.
       
   385      */    
       
   386     TBool iCanBeRemoved;
       
   387 
       
   388     /**
       
   389      * Installation time    
       
   390      */        
       
   391     TTime iInstallationTime;
       
   392     
       
   393     /**
       
   394      * WRT Widget publisher uid, Owned
       
   395      */
       
   396     HBufC8* iPublisherUid;
       
   397 	
       
   398 	/**
       
   399 	 * Flag to indicate whether this is a WRT widget
       
   400 	 */
       
   401 	TBool iIsWrt;
       
   402     };
       
   403 
       
   404 #endif // HSCONTENTINFO_H
       
   405 
       
   406 // End of file