psln/pslnengine/inc/PslnModel.h
changeset 37 89c890c70182
parent 34 6b5204869ed5
child 45 667edd0b8678
equal deleted inserted replaced
34:6b5204869ed5 37:89c890c70182
     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 <AknsSrvClient.h>
       
    23 #include <babitflags.h>
       
    24 #include <cenrepnotifyhandler.h>
       
    25 
       
    26 // Screen saver plugin capabilities
       
    27 enum TScPluginCaps
       
    28     {
       
    29     // Plugin has no special capabilities
       
    30     EScpCapsNone = 0x00,
       
    31     // Plugin implements the configure function
       
    32     EScpCapsConfigure = 0x01,
       
    33     // Plugin wants to be notified when selected as the active screensaver
       
    34     EScpCapsSelectionNotification = 0x02,
       
    35     // Plugin wants to be notified when preview command is selected
       
    36     EScpCapsPreviewNotification = 0x04
       
    37     };
       
    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 class CCenRepNotifyHandler;
       
    92 
       
    93 // Maximum number of characters in Screen saver txt.
       
    94 const TInt KPslnMaxLengthOfScreenSaverText = 15;
       
    95 
       
    96 // CLASS DEFINITIONS
       
    97 
       
    98 // Inner class for skin name entry.
       
    99 class TPslnSkinNameEntry
       
   100     {
       
   101     public:
       
   102         // Package ID.
       
   103         TAknsPkgID iPid;
       
   104         // Skin list name.
       
   105         HBufC* iListName;
       
   106         // Skin title name.
       
   107         HBufC* iTitleName;
       
   108     };
       
   109 
       
   110 // Auxiliary class for screen saver info.
       
   111 class CPslnScreenSaverInfo : public CBase
       
   112     {
       
   113     public:
       
   114 
       
   115         // Symbian OS two-phased constructor.
       
   116         static CPslnScreenSaverInfo* NewL() 
       
   117             {
       
   118             CPslnScreenSaverInfo* self = new (ELeave) CPslnScreenSaverInfo;
       
   119             CleanupStack::PushL( self );
       
   120             self->ConstructL();
       
   121             CleanupStack::Pop( self );
       
   122             return self;
       
   123             };
       
   124 
       
   125         // Destructor.
       
   126          ~CPslnScreenSaverInfo()
       
   127              {
       
   128              delete iScreenSaverTxt;
       
   129              iScreenSaverTxt = NULL;
       
   130              delete iFileName;
       
   131              iFileName = NULL;
       
   132              }
       
   133     private:
       
   134 
       
   135         // Symbian OS second phase constructor.
       
   136         void ConstructL()
       
   137             {
       
   138             iScreenSaverTxt = HBufC::NewL( KPslnMaxLengthOfScreenSaverText );
       
   139             iFileName = HBufC::NewL( KMaxFileName );
       
   140             };
       
   141 
       
   142         // C++ default constructor.
       
   143         CPslnScreenSaverInfo() 
       
   144             {
       
   145             iScreenSaverType = 1; // magic, default value
       
   146             };
       
   147 
       
   148     public:
       
   149         // Filename for screensaver, if applicable.
       
   150         HBufC* iFileName;
       
   151         // Text, if any, shown in the screensaver.
       
   152         HBufC* iScreenSaverTxt;
       
   153         // Type of screen saver.
       
   154         TInt iScreenSaverType;
       
   155     };
       
   156 
       
   157 /**
       
   158 * CPslnModel is the model class of Psln app.
       
   159 * It provides functions to get and set setting values.
       
   160 */
       
   161 NONSHARABLE_CLASS( CPslnModel ): 
       
   162     public CBase, 
       
   163     public MCenRepNotifyHandlerCallback
       
   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         * Checks if the skin support animated background.
       
   334         * @param aItemIndex skin index to use.
       
   335         * @return ETrue, if skin support animation background.
       
   336         */
       
   337         IMPORT_C TBool IsSupportAnimBg( TInt aItemIndex );
       
   338 
       
   339         /**
       
   340         * Sets the given skin index as currently highlighted one.
       
   341         * @param aCurrentSkinIndex skin index.
       
   342         */
       
   343         IMPORT_C void SetCurrentSelectedSkinIndex(
       
   344             const TInt aCurrentSkinIndex );
       
   345 
       
   346         /**
       
   347         * Deprecated.
       
   348         */
       
   349         IMPORT_C TInt SetCurrentPropertyType( const TInt aProperty,
       
   350             const TInt aCurItemIndex );
       
   351 
       
   352         /**
       
   353         * Gets currently active index of given property.
       
   354         * @param aProperty property type - either wallpaper or screensaver.
       
   355         * @return index of currently active property, or error code.
       
   356         */
       
   357         IMPORT_C TInt CurrentPropertyIndex( const TInt aProperty );
       
   358 
       
   359         /**
       
   360         * Enables (or disables) notifications from ECOM framework.
       
   361         * When ECOM state is changed, PslnModel will check that it's 
       
   362         * screensaver list is up to date. Changes in the list are 
       
   363         * indicated to observer class.
       
   364         * @param aActive if ETrue, notifications are subscribed, otherwise
       
   365         *                subscription is terminated.
       
   366         * @param aObserver observer for notifications.
       
   367         */
       
   368         IMPORT_C void EnableScreenSaverNotifications( 
       
   369             const TBool& aActive, 
       
   370             MPslnScreenSaverECOMObserver& aObserver );
       
   371 
       
   372         /**
       
   373         * Deprecated.
       
   374         */
       
   375         IMPORT_C TBool ActivateSkinL(
       
   376             const TDesC8& aPreviewType,
       
   377             const TInt aActiveSkinIndex, 
       
   378             const TBool& aActivateFromPreview );
       
   379             
       
   380         /**
       
   381         * Activates the entire skin.
       
   382         * @since 3.2
       
   383         * @param aActiveSkinIndex skin index of active skin.
       
   384         * @return ETrue, if skin activation is successful.
       
   385         */    
       
   386         IMPORT_C TBool ActivateSkinL( const TInt aActiveSkinIndex );            
       
   387 
       
   388         /**
       
   389         * Gets currently active index of given property. 
       
   390         * This is leaving version of CurrentPropertyIndex (see above).
       
   391         * @param aProperty property type - either wallpaper or screensaver.
       
   392         * @return index of currently active property, or error code.
       
   393         */
       
   394         IMPORT_C TInt CurrentPropertyIndexL( const TInt aProperty );
       
   395 
       
   396         /**
       
   397         * Sets transition effects enabled/disabled as given in the parameter.
       
   398         * @param aEffectValue used as bitmask. Value of zero enables all effects, 
       
   399         *                     and value of KMaxTInt disables all effects.
       
   400         *                     All other values are considered as invalid.
       
   401         * @return KErrArgument if aEffectValue is not zero or KMaxTInt.
       
   402         *         Otherwise return value is what is given out by CRepository::Set().
       
   403         * 
       
   404         * @since 3.2
       
   405         */
       
   406         IMPORT_C TInt SetTransitionEffectsL( const TInt aEffectValue );
       
   407 
       
   408         /**
       
   409         * Gets current transition effect value.
       
   410         * @return in error cases returns KErrNotFound, 
       
   411         *         otherwise returns current repository value.
       
   412         *        
       
   413         * @since 3.2
       
   414         */
       
   415         IMPORT_C TInt GetTransitionEffectStateL();
       
   416 
       
   417         /**
       
   418         * Checks if the screensaver is installed on memory card.
       
   419         * @param aScreensaverIndex screensaver index
       
   420         * @return ETrue, if screensaver is installed to the memory card.
       
   421         * 
       
   422         * @since 3.2
       
   423         */
       
   424         IMPORT_C TBool IsScreenSaverOnMemoryCard( const TInt aIndex ) const;
       
   425 
       
   426         /**
       
   427         * Sets a given property (wallpaper or screensaver) as active.
       
   428         * @param aProperty property type - either wallpaper or screensaver.
       
   429         * @param aCurItemIndex item index that is currently active.
       
   430         * @return KErrNone always.
       
   431         *
       
   432         * @since 3.2
       
   433         */
       
   434         IMPORT_C void SetCurrentPropertyTypeL( const TInt aProperty,
       
   435             const TInt aCurItemIndex );
       
   436 
       
   437         /**
       
   438         * Checks if a skin with given index is on memory card,
       
   439         * @param aIndex skin index from application.
       
   440         * @return ETrue if skin is on memory card, EFalse otherwise.
       
   441         *
       
   442         * @since 5.0
       
   443         */
       
   444         IMPORT_C TBool IsThemeOnMemoryCard( const TInt& aIndex );
       
   445 
       
   446         /**
       
   447         * Checks if a skin with given index is on mass drive,
       
   448         * @param aIndex skin index from application.
       
   449         * @return ETrue if skin is on memory card, EFalse otherwise.
       
   450         *
       
   451         * @since 5.0
       
   452         */
       
   453         IMPORT_C TBool IsThemeOnMassDrive( const TInt& aIndex );
       
   454 
       
   455         /**
       
   456         * Checks if the screensaver is installed on mass drive.
       
   457         * @param aScreensaverIndex screensaver index
       
   458         * @return ETrue, if screensaver is installed to the mass drive.
       
   459         * 
       
   460         * @since 5.0
       
   461         */
       
   462         IMPORT_C TBool IsScreenSaverOnMassDrive( const TInt& aIndex ) const;
       
   463 
       
   464         /**
       
   465         * Returns skin server session.
       
   466         * @return skin server session.
       
   467         * 
       
   468         * @since 3.2
       
   469         */
       
   470         IMPORT_C RAknsSrvSession SkinSrvSession() const;
       
   471 
       
   472         /**
       
   473         * Starts or stops transition effects.
       
   474         * 
       
   475         * @param aAction specifies actions for transition effects. 
       
   476         * The value can be one of the values defined in TPslnTransitionEffectAction.
       
   477         * @since 3.2
       
   478         */
       
   479         IMPORT_C void TransEffect(TInt aAction) const;
       
   480 
       
   481         /**
       
   482         * Set current screensaver to default screensaver.
       
   483         */
       
   484         IMPORT_C void SetScreenSaverToDefault();
       
   485         
       
   486 		/**
       
   487         * Set Animated Background state
       
   488 		* @param aValue specifies actions for animation background. 
       
   489         * 0 mean enable animation effect, KMaxTInt means disable all animation effect.
       
   490         * @since 9.2
       
   491         */
       
   492         IMPORT_C TInt SetAnimBackground( TInt aValue );
       
   493 		
       
   494 		/**
       
   495         * Get Animated Background state.
       
   496 		*
       
   497 		* @return 0, if animation is enable; KMaxTInt if animation is disable.
       
   498         * @since 9.2
       
   499         */
       
   500         IMPORT_C TInt AnimBackgroundState() const;        
       
   501 
       
   502         
       
   503     private:
       
   504 
       
   505         /**
       
   506         * Gets the separately localized name of the skin, if any.
       
   507         * @param aPID package ID to use.
       
   508         * @param aSkinName localized skin name.
       
   509         * @param aType which skin name to fetch (list/title name).
       
   510         * @return ETrue, if localized skin name was found.
       
   511         */
       
   512         TBool GetSeparatelyLocalizedSkinName(
       
   513             const TAknsPkgID aPID, TDes& aSkinName,
       
   514             const TPslnSkinNameType aType ) const;
       
   515 
       
   516 
       
   517         /**
       
   518         * Default C++ contructor
       
   519         */
       
   520         CPslnModel();
       
   521 
       
   522         /**
       
   523         * Symbian default constructor
       
   524         */
       
   525         void ConstructL( MAknsSkinChangeObserver* aObserver );
       
   526 
       
   527         /**
       
   528         * Loads the separately localized skin names resource.
       
   529         */
       
   530         void LoadSkinNamesResourceL();
       
   531 
       
   532         /**
       
   533         * Finds screensavers from the given path and appends them to the
       
   534         * screensaver list.
       
   535         * @return ETrue if screensavers were found, EFalse otherwise.
       
   536         */
       
   537         TBool FindAndAppendScreensaversL();
       
   538 
       
   539         /**
       
   540         * Updates the skin information from the server and
       
   541         * the list of visible skins.
       
   542         */
       
   543         void UpdateFromServerL();
       
   544 
       
   545         /**
       
   546         * Updates the list of visible skins.
       
   547         */
       
   548         void UpdateVisibleSkinListL();
       
   549 
       
   550         /**
       
   551         * Activates skin that is currently selected.
       
   552         */
       
   553         void SetActiveSkinL();
       
   554 
       
   555         /**
       
   556         * Launches query dialog for screensaver name.
       
   557         * @return EFalse, if user cancelled the query.
       
   558         */
       
   559         TBool QueryAndSetScreensaverTextL();
       
   560 
       
   561         /* Gets full name of skin. */
       
   562         const TDesC& GetSkinFullName( const TInt aItemIndex );
       
   563     
       
   564         /* Gets the name of the skin. */
       
   565         void GetSkinNameByPID( const TAknsPkgID aPID, TDes& aSkinName,
       
   566             const TPslnSkinNameType aType ) const;
       
   567 
       
   568         /* Activates default skin. */
       
   569         void ActivateDefaultSkinL();
       
   570 
       
   571         /* Gets default text for text screensaver. */
       
   572         void GetDefaultTextToScreensaverL( TDes& aDisplayText );
       
   573 
       
   574         /* Gets wallpaper item index. */
       
   575         TInt GetWallPaperItemIndex();
       
   576 
       
   577         /* Gets wallpaper item index. */
       
   578         TInt GetScreenSaverItemIndexL();
       
   579         
       
   580         /* Find the aFileName in iScreensaverFilenameArr, and return the index */
       
   581         TInt GetScreenSaverIndexByFileName(const TDesC &aFileName) const;
       
   582         
       
   583         /* Get screen saver object type from index */
       
   584         TInt GetScreensaverTypeByIndex(TInt aIndex);
       
   585 
       
   586         /* Loads AknsWallpaperUtils to memory. */
       
   587         void LoadWallpaperUtilsL();
       
   588 
       
   589         /* Strips file path information from screensaver UID. */
       
   590         TPtrC GetRealScreenSaverUid( const TInt aIndex );
       
   591 
       
   592         /* Leaving version of ActivateScreenSaver. */
       
   593         void ActivateScreenSaverL( 
       
   594             const TInt aItemIndex, 
       
   595             TPslnScreenSaverActivation aActivationType );
       
   596 
       
   597         /* Loads browser launcher dll to memory. */
       
   598         void LoadBrowserLaunchL();        
       
   599 
       
   600         /**
       
   601         * Checks the status of the skin file.
       
   602         * @param aIndex skin index from application.
       
   603         * @return ETrue if skin file is exist and can be accessed.
       
   604         *   EFalse if an error occured or didn't exist.
       
   605         */
       
   606         TBool SkinFileExist( const TInt& aIndex  );
       
   607         
       
   608         /**
       
   609         * From MCenRepNotifyHandlerCallback.
       
   610         */
       
   611         void HandleNotifyInt(TUint32 aId, TInt aNewValue);
       
   612         
       
   613         /* Gets transition effect value and initialize CenRep notify handler. */
       
   614         void InitTransitionEffectVauleL();
       
   615         
       
   616         /* if KPslnSupportScreenSaverSelectionNone is supported return true, or false */
       
   617         TBool IsSupportScreenSaverNoneOption() const;
       
   618         
       
   619     private: // Data
       
   620 
       
   621         /*
       
   622         * Skin store.
       
   623         * Own.
       
   624         */
       
   625         CPslnSkinStore* iSkinStore;
       
   626 
       
   627         /*
       
   628         * Array of visible skins.
       
   629         * Own.
       
   630         */
       
   631         RPointerArray<CPslnSkinNameEntry>* iVisibleSkinArr;
       
   632 
       
   633         /*
       
   634         * Skin server session.
       
   635         */
       
   636         RAknsSrvSession iSkinSrvSession;
       
   637 
       
   638         /*
       
   639         * CenRep object for skin keys.
       
   640         * Own.
       
   641         */
       
   642         CRepository* iSkinsRepository;
       
   643 
       
   644         /*
       
   645         * CenRep object for screen saver keys.
       
   646         * Own.
       
   647         */
       
   648         CRepository* iScreenSaverRepository;
       
   649 
       
   650         /*
       
   651         * CenRep object for themes application keys.
       
   652         * Own.
       
   653         */
       
   654         CRepository* iThemesAppRepository;
       
   655 
       
   656         /*
       
   657         * Pointer to eikon environment. Stored to avoid repeated fetches.
       
   658         * Not own.
       
   659         */
       
   660         CEikonEnv* iEikEnv;
       
   661 
       
   662         /*
       
   663         * Currently highlighted skin index.
       
   664         */
       
   665         TInt iCurrentSkinIndex;
       
   666 
       
   667         /*
       
   668         * Active skin index.
       
   669         */
       
   670         TInt iActiveSkinIndex;
       
   671 
       
   672         /*
       
   673         * Array of skin names.
       
   674         */
       
   675         RArray<TPslnSkinNameEntry> iSkinNames;
       
   676 
       
   677         /*
       
   678         * Array of screensaver filenames.
       
   679         * Own.
       
   680         */
       
   681         CDesC16ArrayFlat* iScreensaverFilenameArr;
       
   682 
       
   683         /*
       
   684         * Array of screensaver names.
       
   685         * Own.
       
   686         */
       
   687         CDesC16ArrayFlat* iScreensaverNameArr;
       
   688 
       
   689         /*
       
   690         * Array of screensaver capabilities.
       
   691         */
       
   692         RArray<TInt> iScreensaverCapsArr;
       
   693 
       
   694         /*
       
   695         * Active screensaver information.
       
   696         * Own.
       
   697         */
       
   698         CPslnScreenSaverInfo* iScreenSaverInfo;
       
   699 
       
   700         /*
       
   701         * A handle to a dynamically loadable DLL.
       
   702         */
       
   703         RLibrary iWallpaperDll;
       
   704 
       
   705         /*
       
   706         * Loads Wallpaper Utils DLL dynamically to memory.
       
   707         * Allows use of the DLL through this pointer, but only for
       
   708         * methods implemented within the wrapper.
       
   709         * Own.
       
   710         */
       
   711         CPslnWallpaperUtilsLoader* iWallpaperSetter;
       
   712 
       
   713         /**
       
   714          * Listens to ECOM for screensaver plugin changes.
       
   715          * Own.
       
   716          */
       
   717         CPslnEcomListener* iScreenSaverListener;
       
   718 
       
   719         /*
       
   720         * A handle to a dynamically loadable DLL.
       
   721         */
       
   722         RLibrary iBrowserLaunchDll;
       
   723 
       
   724         /*
       
   725         * Loads Wallpaper Utils DLL dynamically to memory.
       
   726         * Allows use of the DLL through this pointer, but only for
       
   727         * methods implemented within the wrapper.
       
   728         * Own.
       
   729         */
       
   730         CPslnBrowserLaunchLoader* iBrowserLauncher;
       
   731 
       
   732         /*
       
   733         * Internal state of the class.
       
   734         */
       
   735         enum TPslnModelState
       
   736             {
       
   737             // initial state
       
   738             EPslnModelStateInitial = 0x00000000,
       
   739             // wallpaper dll has been loaded
       
   740             EPslnModelStateWallpaperDllLoaded = 0x00000001,
       
   741             // has the default enable CR key for transition effects been read
       
   742             EPslnModelStateTransitionEnableCRKeyRead = 0x00000002,
       
   743             // is skin being previewed
       
   744             EPslnModelStateSkinPreviewed = 0x00000004,
       
   745             // browser launch dll has been loaded
       
   746             EPslnModelStateBrowserLaunchDllLoaded = 0x00000008,
       
   747             // localized skin names have been loaded
       
   748             EPslnModelStateSkinNamesLoaded = 0x00000010
       
   749             };
       
   750         TBitFlags iInternalState;
       
   751 
       
   752         /**
       
   753         * Default mask for enable transition effects.
       
   754         */
       
   755         TInt iEffectsDefaultEnableMask;
       
   756         
       
   757         /**
       
   758         * Transition effect setting value.
       
   759         */
       
   760         TInt iTransitionEffectValue;
       
   761         
       
   762         /**
       
   763         * A pointer to Central Repository notification handling.
       
   764         * Used to monitor the change of KThemesTransitionEffects.
       
   765         * Own.
       
   766         */
       
   767         CCenRepNotifyHandler *iThemesAppCenRepNotifyHandler;
       
   768     };
       
   769 
       
   770 #endif // C_PSLNMODEL_H
       
   771 
       
   772 // End of File