uifw/AvKon/tsrc/bc/bctestdom3.2/bctestdomnotifier/inc/PslnModel.h
changeset 21 558113899881
parent 14 3320e4e6e8bb
child 22 75713bee6484
child 33 b3425bf29f82
equal deleted inserted replaced
14:3320e4e6e8bb 21:558113899881
     1 /*
       
     2 * Copyright (c) 2004-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 "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:  Model class for Psln application.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef C_PSLNMODEL_H
       
    20 #define C_PSLNMODEL_H
       
    21 
       
    22 #include <downloadedcontenthandler.h>
       
    23 #include <AknServerApp.h>
       
    24 #include <aknssrvclient.h>
       
    25 #include <Babitflags.h>
       
    26 
       
    27 // Screen saver plugin capabilities
       
    28 enum TScPluginCaps
       
    29     {
       
    30     // Plugin has no special capabilities
       
    31     EScpCapsNone = 0x00,
       
    32     // Plugin implements the configure function
       
    33     EScpCapsConfigure = 0x01,
       
    34     // Plugin wants to be notified when selected as the active screensaver
       
    35     EScpCapsSelectionNotification = 0x02,
       
    36     // Plugin wants to be notified when preview command is selected
       
    37     EScpCapsPreviewNotification = 0x04
       
    38     };
       
    39 // Determines the type of skin list.
       
    40 enum TPslnSkinNameType
       
    41     {
       
    42     // list name
       
    43     EPslnSkinNameTypeList = 0,
       
    44     // title name
       
    45     EPslnSkinNameTypeTitle
       
    46     };
       
    47     
       
    48 // What kind of scren saver activation it is.
       
    49 enum TPslnScreenSaverActivation
       
    50     {
       
    51     // Preview is activated.
       
    52     EPslnScreenSaverPreviewActivation = 0,
       
    53     // Preview is deactivated, and "real" screen saver is activated,
       
    54     EPslnScreenSaverPreviewDeactivation,
       
    55     // Real screen saver is activated straight away.
       
    56     EPslnScreenSaverActivation
       
    57     };
       
    58     
       
    59 // Defines actions for a transtion effects
       
    60 enum TPslnTransitionEffectAction
       
    61     {
       
    62     // Used only for enum range validation 
       
    63     EPslnTransitionEffectDummyFirst = -1,
       
    64     
       
    65     // -- begin of real values --
       
    66     
       
    67     // Start theme preview transtion effect
       
    68     EPslnTransitionEffectStartPreview,    
       
    69     // Start theme activation transtion effect
       
    70     EPslnTransitionEffectStartThemeActivation,
       
    71     // Stop the current transition effect
       
    72     EPslnTransitionEffectStop,
       
    73     
       
    74     // -- end of real values --
       
    75     
       
    76     // Used only for enum range validation 
       
    77     EPslnTransitionEffectDummyLast
       
    78     };
       
    79 
       
    80 class MAknsSkinChangeObserver;
       
    81 class MPslnScreenSaverECOMObserver;
       
    82 class CEikonEnv;
       
    83 class CPslnSkinStore;
       
    84 class CRepository;
       
    85 class CPslnSkinEntry;
       
    86 class CPslnSkinNameEntry;
       
    87 class TAknsPkgID;
       
    88 class CPslnWallpaperUtilsLoader;
       
    89 class CPslnEcomListener;
       
    90 class CPslnBrowserLaunchLoader;
       
    91 
       
    92 // Maximum number of characters in Screen saver txt.
       
    93 const TInt KPslnMaxLengthOfScreenSaverText = 15;
       
    94 
       
    95 // CLASS DEFINITIONS
       
    96 
       
    97 // Inner class for skin name entry.
       
    98 class TPslnSkinNameEntry
       
    99     {
       
   100     public:
       
   101         // Package ID.
       
   102         TAknsPkgID iPid;
       
   103         // Skin list name.
       
   104         HBufC* iListName;
       
   105         // Skin title name.
       
   106         HBufC* iTitleName;
       
   107     };
       
   108 
       
   109 // Auxiliary class for screen saver info.
       
   110 class CPslnScreenSaverInfo : public CBase
       
   111     {
       
   112     public:
       
   113 
       
   114         // Symbian OS two-phased constructor.
       
   115         static CPslnScreenSaverInfo* NewL() 
       
   116             {
       
   117             CPslnScreenSaverInfo* self = new (ELeave) CPslnScreenSaverInfo;
       
   118             CleanupStack::PushL( self );
       
   119             self->ConstructL();
       
   120             CleanupStack::Pop( self );
       
   121             return self;
       
   122             };
       
   123 
       
   124         // Destructor.
       
   125          ~CPslnScreenSaverInfo()
       
   126              {
       
   127              delete iScreenSaverTxt;
       
   128              iScreenSaverTxt = NULL;
       
   129              delete iFileName;
       
   130              iFileName = NULL;
       
   131              }
       
   132     private:
       
   133 
       
   134         // Symbian OS second phase constructor.
       
   135         void ConstructL()
       
   136             {
       
   137             iScreenSaverTxt = HBufC::NewL( KPslnMaxLengthOfScreenSaverText );
       
   138             iFileName = HBufC::NewL( KMaxFileName );
       
   139             };
       
   140 
       
   141         // C++ default constructor.
       
   142         CPslnScreenSaverInfo() 
       
   143             {
       
   144             iScreenSaverType = 1; // magic, default value
       
   145             };
       
   146 
       
   147     public:
       
   148         // Filename for screensaver, if applicable.
       
   149         HBufC* iFileName;
       
   150         // Text, if any, shown in the screensaver.
       
   151         HBufC* iScreenSaverTxt;
       
   152         // Type of screen saver.
       
   153         TInt iScreenSaverType;
       
   154     };
       
   155 
       
   156 /**
       
   157 * CPslnModel is the model class of Psln app.
       
   158 * It provides functions to get and set setting values.
       
   159 */
       
   160 NONSHARABLE_CLASS( CPslnModel ): 
       
   161     public CBase, 
       
   162     public MDownloadedContentHandler, 
       
   163     public MAknServerAppExitObserver
       
   164     {
       
   165     public:
       
   166 
       
   167         /**
       
   168         * Two-phased constructor.
       
   169         * @param aObserver observer for skin changes.
       
   170         * @return new instance of CPslnModel.
       
   171         */
       
   172         IMPORT_C static CPslnModel* NewL( MAknsSkinChangeObserver* aObserver );
       
   173 
       
   174         /**
       
   175         * Deprecated.
       
   176         * @return NULL.
       
   177         */
       
   178         IMPORT_C static CPslnModel* NewL();
       
   179 
       
   180         /**
       
   181         * Destructor
       
   182         */
       
   183         IMPORT_C ~CPslnModel();
       
   184 
       
   185         /**
       
   186         * Deprecated.
       
   187         */
       
   188         IMPORT_C TBool ActivateSkinL( const TDesC8& aPreviewType,
       
   189             const TInt aActiveSkinIndex );
       
   190 
       
   191         /**
       
   192         * Activates screen saver as set by user.
       
   193         * @param aItemIndex screensaver to activate.
       
   194         * @param aActivationType screensaver activation type 
       
   195         *       (activation/deactivation/preview).
       
   196         * @return error code, or KErrNone on success.
       
   197         */
       
   198         IMPORT_C TInt ActivateScreenSaver( 
       
   199             const TInt aItemIndex,
       
   200             TPslnScreenSaverActivation aActivationType );
       
   201 
       
   202         /**
       
   203         * Disables skin notify changes.
       
   204         *
       
   205         * Creates and pushes internal class CPslnActivationGuard to the
       
   206         * stack. When CPslnActivationGuard is constructed, SkinSrvSession's 
       
   207         * DisableSkinChangeNotify is called, and thus skin notify changes are 
       
   208         * disabled. When CPslnActivationGuard is popped from stack, 
       
   209         * SkinSrvSession's EnableSkinChangeNotify is called automatically and thus,
       
   210         * skin notify changes are again active. 
       
   211         */
       
   212         IMPORT_C void GuardActivationLC();
       
   213 
       
   214         /**
       
   215         * Starts skin download.
       
   216         */
       
   217         IMPORT_C void DownloadSkinL();
       
   218 
       
   219         /**
       
   220         * Sets Idle Wallpaper.
       
   221         * @param aImagePath Path and filename of new wallpaper.
       
   222         * @return error code, or KErrNone on success.
       
   223         */
       
   224         IMPORT_C TInt SetBackgroundImagePath( const TDesC& aImagePath );
       
   225 
       
   226         /**
       
   227         * Invokes screensaver plugins PluginFunction for e.g. configuring
       
   228         * the screensaver.
       
   229         * @param aIndex screensaver index to use.
       
   230         * @param aFunction screensaver function to call.
       
   231         */
       
   232         IMPORT_C void InvokeSSPluginFunctionL( 
       
   233             TInt aIndex, 
       
   234             TScPluginCaps aFunction );
       
   235 
       
   236         /**
       
   237         * Updates skins from server, UI skins list, and screensaver array.
       
   238         */
       
   239         IMPORT_C void PerformCompleteUpdateL();
       
   240 
       
   241         /**
       
   242         * Creates screen saver array.
       
   243         */
       
   244         IMPORT_C void LoadScreensaverArrayL();
       
   245 
       
   246         /**
       
   247         * Gets the visible skin by its UI index.
       
   248         * Ownership is not transferred.
       
   249         * @param aIndex skin index.
       
   250         * @return pointer to skin entry.
       
   251         */
       
   252         IMPORT_C CPslnSkinEntry* VisibleSkin( const TInt aIndex );
       
   253 
       
   254         /**
       
   255         * Gets the name of the skin.
       
   256         * @param aIndex skin index to use.
       
   257         * @param aSkinName localized skin name.
       
   258         * @param aType which skin name to fetch (list/title name).
       
   259         */
       
   260         IMPORT_C void GetSkinNameByIndex( const TInt aIndex, TDes& aSkinName, 
       
   261             const TPslnSkinNameType aType ) const;
       
   262 
       
   263         /**
       
   264         * Checks whether the current (or given) skin is active.
       
   265         * @param aSkinIndex skin index to use.
       
   266         * @return ETrue is given skin index is currently active skin.
       
   267         */
       
   268         IMPORT_C TBool IsActiveSkinSelected ( 
       
   269             TInt aSkinIndex = KErrNotFound ) const;
       
   270 
       
   271         /**
       
   272         * Deprecated since 5.0.
       
   273         */
       
   274         IMPORT_C TAknSkinSrvSkinPackageLocation LocationOfSkin( const TInt aIndex );
       
   275 
       
   276         /**
       
   277         * Returns skin index of active skin.
       
   278         * @return skin index of active skin.
       
   279         */
       
   280         IMPORT_C TInt ActiveSkinIndex() const;
       
   281 
       
   282         /**
       
   283         * Returns skin index of currently highlighted skin.
       
   284         * @return skin index of highlighted skin.
       
   285         */
       
   286         IMPORT_C TInt CurrentSelectedSkinIndex() const;
       
   287 
       
   288         /**
       
   289         * Returns number of found skins.
       
   290         * @return number of found skins.
       
   291         */
       
   292         IMPORT_C TInt NumberOfSkins() const;
       
   293 
       
   294         /**
       
   295         * Returns screensaver name array.
       
   296         * @return screensaver name array.
       
   297         */
       
   298         IMPORT_C const MDesC16Array& ScreensaverNames() const;
       
   299 
       
   300         /**
       
   301         * Checks if selected screensaver has the requested capability
       
   302         * @param aIndex index of screensaver in screensaver array.
       
   303         * @param aCapability requested capability.
       
   304         * @return ETrue if screensaver has the capability, EFalse otherwise.
       
   305         */
       
   306         IMPORT_C TBool ScreensaverHasCapability(
       
   307             const TInt aIndex,
       
   308             const TScPluginCaps aCapability ) const;
       
   309 
       
   310         /**
       
   311         * Returns protection type of skin.
       
   312         * @param aIndex skin index to use.
       
   313         * @return protection type of skin.
       
   314         */
       
   315         IMPORT_C TAknsSkinSrvSkinProtectionType ProtectionOfSkin(
       
   316             const TInt aIndex );
       
   317 
       
   318         /**
       
   319         * Checks if the skin can be activated.
       
   320         * @param aItemIndex skin index to use.
       
   321         * @return ETrue, if skin can be activated.
       
   322         */
       
   323         IMPORT_C TBool IsValidForActivation( const TInt aItemIndex );
       
   324 
       
   325         /**
       
   326         * Checks if the skin can be previewed.
       
   327         * @param aItemIndex skin index to use.
       
   328         * @return ETrue, if skin can be previewed.
       
   329         */
       
   330         IMPORT_C TBool IsValidForPreview( const TInt aItemIndex );
       
   331 
       
   332         /**
       
   333         * Sets the given skin index as currently highlighted one.
       
   334         * @param aCurrentSkinIndex skin index.
       
   335         */
       
   336         IMPORT_C void SetCurrentSelectedSkinIndex(
       
   337             const TInt aCurrentSkinIndex );
       
   338 
       
   339         /**
       
   340         * Deprecated.
       
   341         */
       
   342         IMPORT_C TInt SetCurrentPropertyType( const TInt aProperty,
       
   343             const TInt aCurItemIndex );
       
   344 
       
   345         /**
       
   346         * Gets currently active index of given property.
       
   347         * @param aProperty property type - either wallpaper or screensaver.
       
   348         * @return index of currently active property, or error code.
       
   349         */
       
   350         IMPORT_C TInt CurrentPropertyIndex( const TInt aProperty );
       
   351 
       
   352         /**
       
   353         * Enables (or disables) notifications from ECOM framework.
       
   354         * When ECOM state is changed, PslnModel will check that it's 
       
   355         * screensaver list is up to date. Changes in the list are 
       
   356         * indicated to observer class.
       
   357         * @param aActive if ETrue, notifications are subscribed, otherwise
       
   358         *                subscription is terminated.
       
   359         * @param aObserver observer for notifications.
       
   360         */
       
   361         IMPORT_C void EnableScreenSaverNotifications( 
       
   362             const TBool& aActive, 
       
   363             MPslnScreenSaverECOMObserver& aObserver );
       
   364 
       
   365         /**
       
   366         * Deprecated.
       
   367         */
       
   368         IMPORT_C TBool ActivateSkinL(
       
   369             const TDesC8& aPreviewType,
       
   370             const TInt aActiveSkinIndex, 
       
   371             const TBool& aActivateFromPreview );
       
   372             
       
   373         /**
       
   374         * Activates the entire skin.
       
   375         * @since 3.2
       
   376         * @param aActiveSkinIndex skin index of active skin.
       
   377         * @return ETrue, if skin activation is successful.
       
   378         */    
       
   379         IMPORT_C TBool ActivateSkinL( const TInt aActiveSkinIndex );            
       
   380 
       
   381         /**
       
   382         * Gets currently active index of given property. 
       
   383         * This is leaving version of CurrentPropertyIndex (see above).
       
   384         * @param aProperty property type - either wallpaper or screensaver.
       
   385         * @return index of currently active property, or error code.
       
   386         */
       
   387         IMPORT_C TInt CurrentPropertyIndexL( const TInt aProperty );
       
   388 
       
   389         /**
       
   390         * Sets transition effects enabled/disabled as given in the parameter.
       
   391         * @param aEffectValue used as bitmask. Value of zero enables all effects, 
       
   392         *                     and value of KMaxTInt disables all effects.
       
   393         *                     All other values are considered as invalid.
       
   394         * @return KErrArgument if aEffectValue is not zero or KMaxTInt.
       
   395         *         Otherwise return value is what is given out by CRepository::Set().
       
   396         * 
       
   397         * @since 3.2
       
   398         */
       
   399         IMPORT_C TInt SetTransitionEffectsL( const TInt aEffectValue );
       
   400 
       
   401         /**
       
   402         * Gets current transition effect value.
       
   403         * @return in error cases returns KErrNotFound, 
       
   404         *         otherwise returns current repository value.
       
   405         *        
       
   406         * @since 3.2
       
   407         */
       
   408         IMPORT_C TInt GetTransitionEffectStateL();
       
   409 
       
   410         /**
       
   411         * Checks if the screensaver is installed on memory card.
       
   412         * @param aScreensaverIndex screensaver index
       
   413         * @return ETrue, if screensaver is installed to the memory card.
       
   414         * 
       
   415         * @since 3.2
       
   416         */
       
   417         IMPORT_C TBool IsScreenSaverOnMemoryCard( const TInt aIndex ) const;
       
   418 
       
   419         /**
       
   420         * Sets a given property (wallpaper or screensaver) as active.
       
   421         * @param aProperty property type - either wallpaper or screensaver.
       
   422         * @param aCurItemIndex item index that is currently active.
       
   423         * @return KErrNone always.
       
   424         *
       
   425         * @since 3.2
       
   426         */
       
   427         IMPORT_C void SetCurrentPropertyTypeL( const TInt aProperty,
       
   428             const TInt aCurItemIndex );
       
   429 
       
   430         /**
       
   431         * Checks if a skin with given index is on memory card,
       
   432         * @param aIndex skin index from application.
       
   433         * @return ETrue if skin is on memory card, EFalse otherwise.
       
   434         *
       
   435         * @since 5.0
       
   436         */
       
   437         IMPORT_C TBool IsThemeOnMemoryCard( const TInt& aIndex );
       
   438 
       
   439         /**
       
   440         * Checks if a skin with given index is on mass drive,
       
   441         * @param aIndex skin index from application.
       
   442         * @return ETrue if skin is on memory card, EFalse otherwise.
       
   443         *
       
   444         * @since 5.0
       
   445         */
       
   446         IMPORT_C TBool IsThemeOnMassDrive( const TInt& aIndex );
       
   447 
       
   448         /**
       
   449         * Checks if the screensaver is installed on mass drive.
       
   450         * @param aScreensaverIndex screensaver index
       
   451         * @return ETrue, if screensaver is installed to the mass drive.
       
   452         * 
       
   453         * @since 5.0
       
   454         */
       
   455         IMPORT_C TBool IsScreenSaverOnMassDrive( const TInt& aIndex ) const;
       
   456 
       
   457         /**
       
   458         * Returns skin server session.
       
   459         * @return skin server session.
       
   460         * 
       
   461         * @since 3.2
       
   462         */
       
   463         IMPORT_C RAknsSrvSession SkinSrvSession() const;
       
   464 
       
   465         /**
       
   466         * Starts or stops transition effects.
       
   467         * 
       
   468         * @param aAction specifies actions for transition effects. 
       
   469         * The value can be one of the values defined in TPslnTransitionEffectAction.
       
   470         * @since 3.2
       
   471         */
       
   472         IMPORT_C void TransEffect(TInt aAction) const;
       
   473 
       
   474     private:
       
   475 
       
   476         /**
       
   477         * Gets the separately localized name of the skin, if any.
       
   478         * @param aPID package ID to use.
       
   479         * @param aSkinName localized skin name.
       
   480         * @param aType which skin name to fetch (list/title name).
       
   481         * @return ETrue, if localized skin name was found.
       
   482         */
       
   483         TBool GetSeparatelyLocalizedSkinName(
       
   484             const TAknsPkgID aPID, TDes& aSkinName,
       
   485             const TPslnSkinNameType aType ) const;
       
   486 
       
   487         /**
       
   488         * From MDownloadedContentHandler.
       
   489         *
       
   490         * Handle downloaded content that has been saved to a file, 
       
   491         * and return ETrue if it was handled successfully.
       
   492         * @param aFileName File name with path.
       
   493         * @param aParamList Generic parameter list.
       
   494         * @param aContinue Output parameter: It must be ETrue if the caller wants 
       
   495         *                  Browser not to terminate after the content is handled.
       
   496         * @return ETrue if the implementer has processed the content. If it is 
       
   497         *                  EFalse, BrowserLauncher opens that content in an 
       
   498         *                  appropriate viewer application.
       
   499         */
       
   500         TBool HandleContentL(
       
   501             const TDesC& aFilename,
       
   502             const CAiwGenericParamList& aParamList,
       
   503             TBool& aContinue );
       
   504 
       
   505         /**
       
   506         * From MDownloadedContentHandler.
       
   507         * Reserved for future use.
       
   508         * @param aAnyParam reserved for future use.
       
   509         * @return reserved for future use.
       
   510         */
       
   511         virtual TAny* DownloadedContentHandlerReserved1( TAny* aAnyParam );
       
   512 
       
   513         /**
       
   514         * Default C++ contructor
       
   515         */
       
   516         CPslnModel();
       
   517 
       
   518         /**
       
   519         * Symbian default constructor
       
   520         */
       
   521         void ConstructL( MAknsSkinChangeObserver* aObserver );
       
   522 
       
   523         /**
       
   524         * Loads the separately localized skin names resource.
       
   525         */
       
   526         void LoadSkinNamesResourceL();
       
   527 
       
   528         /**
       
   529         * Finds screensavers from the given path and appends them to the
       
   530         * screensaver list.
       
   531         * @return ETrue if screensavers were found, EFalse otherwise.
       
   532         */
       
   533         TBool FindAndAppendScreensaversL();
       
   534 
       
   535         /**
       
   536         * Updates the skin information from the server and
       
   537         * the list of visible skins.
       
   538         */
       
   539         void UpdateFromServerL();
       
   540 
       
   541         /**
       
   542         * Updates the list of visible skins.
       
   543         */
       
   544         void UpdateVisibleSkinListL();
       
   545 
       
   546         /**
       
   547         * Activates skin that is currently selected.
       
   548         */
       
   549         void SetActiveSkinL();
       
   550 
       
   551         /**
       
   552         * Launches query dialog for screensaver name.
       
   553         * @return EFalse, if user cancelled the query.
       
   554         */
       
   555         TBool QueryAndSetScreensaverTextL();
       
   556 
       
   557         /**
       
   558         * From MAknServerAppExitObserver.
       
   559         */
       
   560         void HandleServerAppExit( TInt aReason );
       
   561 
       
   562         /* Gets full name of skin. */
       
   563         const TDesC& GetSkinFullName( const TInt aItemIndex );
       
   564     
       
   565         /* Gets the name of the skin. */
       
   566         void GetSkinNameByPID( const TAknsPkgID aPID, TDes& aSkinName,
       
   567             const TPslnSkinNameType aType ) const;
       
   568 
       
   569         /* Activates default skin. */
       
   570         void ActivateDefaultSkinL();
       
   571 
       
   572         /* Gets default text for text screensaver. */
       
   573         void GetDefaultTextToScreensaverL( TDes& aDisplayText );
       
   574 
       
   575         /* Gets wallpaper item index. */
       
   576         TInt GetWallPaperItemIndex();
       
   577 
       
   578         /* Gets wallpaper item index. */
       
   579         TInt GetScreenSaverItemIndexL();
       
   580 
       
   581         /* Loads AknsWallpaperUtils to memory. */
       
   582         void LoadWallpaperUtilsL();
       
   583 
       
   584         /* Strips file path information from screensaver UID. */
       
   585         TPtrC GetRealScreenSaverUid( const TInt aIndex );
       
   586 
       
   587         /* Leaving version of ActivateScreenSaver. */
       
   588         void ActivateScreenSaverL( 
       
   589             const TInt aItemIndex, 
       
   590             TPslnScreenSaverActivation aActivationType );
       
   591 
       
   592         /* Loads browser launcher dll to memory. */
       
   593         void LoadBrowserLaunchL();        
       
   594 
       
   595     private: // Data
       
   596 
       
   597         /*
       
   598         * Skin store.
       
   599         * Own.
       
   600         */
       
   601         CPslnSkinStore* iSkinStore;
       
   602 
       
   603         /*
       
   604         * Array of visible skins.
       
   605         * Own.
       
   606         */
       
   607         RPointerArray<CPslnSkinNameEntry>* iVisibleSkinArr;
       
   608 
       
   609         /*
       
   610         * Skin server session.
       
   611         */
       
   612         RAknsSrvSession iSkinSrvSession;
       
   613 
       
   614         /*
       
   615         * CenRep object for skin keys.
       
   616         * Own.
       
   617         */
       
   618         CRepository* iSkinsRepository;
       
   619 
       
   620         /*
       
   621         * CenRep object for screen saver keys.
       
   622         * Own.
       
   623         */
       
   624         CRepository* iScreenSaverRepository;
       
   625 
       
   626         /*
       
   627         * CenRep object for themes application keys.
       
   628         * Own.
       
   629         */
       
   630         CRepository* iThemesAppRepository;
       
   631 
       
   632         /*
       
   633         * Pointer to eikon environment. Stored to avoid repeated fetches.
       
   634         * Not own.
       
   635         */
       
   636         CEikonEnv* iEikEnv;
       
   637 
       
   638         /*
       
   639         * Currently highlighted skin index.
       
   640         */
       
   641         TInt iCurrentSkinIndex;
       
   642 
       
   643         /*
       
   644         * Active skin index.
       
   645         */
       
   646         TInt iActiveSkinIndex;
       
   647 
       
   648         /*
       
   649         * Array of skin names.
       
   650         */
       
   651         RArray<TPslnSkinNameEntry> iSkinNames;
       
   652 
       
   653         /*
       
   654         * Array of screensaver filenames.
       
   655         * Own.
       
   656         */
       
   657         CDesC16ArrayFlat* iScreensaverFilenameArr;
       
   658 
       
   659         /*
       
   660         * Array of screensaver names.
       
   661         * Own.
       
   662         */
       
   663         CDesC16ArrayFlat* iScreensaverNameArr;
       
   664 
       
   665         /*
       
   666         * Array of screensaver capabilities.
       
   667         */
       
   668         RArray<TInt> iScreensaverCapsArr;
       
   669 
       
   670         /*
       
   671         * Active screensaver information.
       
   672         * Own.
       
   673         */
       
   674         CPslnScreenSaverInfo* iScreenSaverInfo;
       
   675 
       
   676         /*
       
   677         * A handle to a dynamically loadable DLL.
       
   678         */
       
   679         RLibrary iWallpaperDll;
       
   680 
       
   681         /*
       
   682         * Loads Wallpaper Utils DLL dynamically to memory.
       
   683         * Allows use of the DLL through this pointer, but only for
       
   684         * methods implemented within the wrapper.
       
   685         * Own.
       
   686         */
       
   687         CPslnWallpaperUtilsLoader* iWallpaperSetter;
       
   688 
       
   689         /**
       
   690          * Listens to ECOM for screensaver plugin changes.
       
   691          * Own.
       
   692          */
       
   693         CPslnEcomListener* iScreenSaverListener;
       
   694 
       
   695         /*
       
   696         * A handle to a dynamically loadable DLL.
       
   697         */
       
   698         RLibrary iBrowserLaunchDll;
       
   699 
       
   700         /*
       
   701         * Loads Wallpaper Utils DLL dynamically to memory.
       
   702         * Allows use of the DLL through this pointer, but only for
       
   703         * methods implemented within the wrapper.
       
   704         * Own.
       
   705         */
       
   706         CPslnBrowserLaunchLoader* iBrowserLauncher;
       
   707 
       
   708         /*
       
   709         * Internal state of the class.
       
   710         */
       
   711         enum TPslnModelState
       
   712             {
       
   713             // initial state
       
   714             EPslnModelStateInitial = 0x00000000,
       
   715             // wallpaper dll has been loaded
       
   716             EPslnModelStateWallpaperDllLoaded = 0x00000001,
       
   717             // has the default enable CR key for transition effects been read
       
   718             EPslnModelStateTransitionEnableCRKeyRead = 0x00000002,
       
   719             // is skin being previewed
       
   720             EPslnModelStateSkinPreviewed = 0x00000004,
       
   721             // browser launch dll has been loaded
       
   722             EPslnModelStateBrowserLaunchDllLoaded = 0x00000008,
       
   723             // localized skin names have been loaded
       
   724             EPslnModelStateSkinNamesLoaded = 0x00000010
       
   725             };
       
   726         TBitFlags iInternalState;
       
   727 
       
   728         /**
       
   729         * Default mask for enable transition effects.
       
   730         */
       
   731         TInt iEffectsDefaultEnableMask;
       
   732     };
       
   733 
       
   734 #endif // C_PSLNMODEL_H
       
   735 
       
   736 // End of File