customization/ThemesAdapter/inc/ThemesList.h
changeset 0 3ce708148e4d
equal deleted inserted replaced
-1:000000000000 0:3ce708148e4d
       
     1 /*
       
     2 * Copyright (c) 2002 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:  DM Themes List
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __ThemesList_H__
       
    21 #define __ThemesList_H__
       
    22 
       
    23 // ------------------------------------------------------------------------------------------------
       
    24 // Includes
       
    25 // ------------------------------------------------------------------------------------------------
       
    26 #include <e32base.h>
       
    27 #include <smldmadapter.h>
       
    28 #include <SWInstApi.h>
       
    29 #include <AknsSrvClient.h>
       
    30 
       
    31 
       
    32 class CAknsSrvSkinInformationPkg;
       
    33 class CThemeItem;
       
    34 class CDesC8Array;
       
    35 
       
    36 // ------------------------------------------------------------------------------------------------
       
    37 // CThemesList
       
    38 // ------------------------------------------------------------------------------------------------
       
    39 class CThemesList : public CBase
       
    40 	{
       
    41 public:
       
    42 	static CThemesList* NewL( );
       
    43 	static CThemesList* NewLC( );
       
    44 
       
    45 	virtual ~CThemesList();
       
    46 
       
    47 	// Other
       
    48 	
       
    49 	MSmlDmAdapter::TError GetInstalledPIDListL( const CArrayFix<TSmlDmMappingInfo>& aPreviousList, CDesC8ArrayFlat& themes, CDesC8Array& aNewThemes );
       
    50 	MSmlDmAdapter::TError GetThemeIdL( const TDesC8& aPID, CBufBase& aResult );
       
    51 	MSmlDmAdapter::TError GetThemeNameL( const TDesC8& aPID, CBufBase& aResult );
       
    52 	MSmlDmAdapter::TError GetThemeVersionL( const TDesC8& aPID, CBufBase& aResult );
       
    53 
       
    54 	MSmlDmAdapter::TError GetActiveThemeL( CBufBase& aResult );
       
    55 	MSmlDmAdapter::TError SetActiveThemeL( const TDesC8& aPID );
       
    56 
       
    57 	MSmlDmAdapter::TError SetInstallOptionsL( const TDesC8& aOptions );
       
    58 	MSmlDmAdapter::TError InstallThemeL( const TDesC& aFileName, TDes8& aSisPkgUid, TDes8& aThemePkgId );
       
    59 
       
    60 	MSmlDmAdapter::TError DeleteThemeL( const TDesC8& aThemeId, const TUid& aPkgUid, HBufC8* luid);
       
    61 
       
    62 protected:
       
    63 
       
    64 private:
       
    65 	CThemesList( );
       
    66 	void ConstructL( );
       
    67 
       
    68 	void CheckUpdatesL();
       
    69 	void LoadSkinsL();
       
    70 	CAknsSrvSkinInformationPkg* FindThemeL( const TDesC8& aPID );
       
    71 	void GetDefaultInstallOptions( SwiUI::TInstallOptions& aOptions );
       
    72 
       
    73 	TAknSkinSrvSkinPackageLocation LocationFromPath( const TDesC& aPath );
       
    74 
       
    75 	CDesC8Array* InstalledPackagesL( );
       
    76 	CDesC8Array* InstalledThemesL( );
       
    77 	CDesC8Array* FindNewItemsL( const CDesC8Array& aItemsOrg, const CDesC8Array& aItemsNew );
       
    78 
       
    79 private:
       
    80 
       
    81 	TBool iDirty;
       
    82     RAknsSrvSession iAknsSrv;
       
    83     CArrayPtr<CAknsSrvSkinInformationPkg>* iSkins;
       
    84 
       
    85 	RArray<CThemeItem> iThemeItems;
       
    86 
       
    87 	SwiUI::TInstallOptions iInstallOptions;
       
    88 	};
       
    89 
       
    90 // ------------------------------------------------------------------------------------------------
       
    91 // CThemeItem
       
    92 // ------------------------------------------------------------------------------------------------
       
    93 class CThemeItem : public CBase
       
    94 	{
       
    95 public:
       
    96 	static CThemeItem* NewL( MSmlDmCallback* aDmCallback );
       
    97 	static CThemeItem* NewLC( MSmlDmCallback* aDmCallback );
       
    98 
       
    99 	virtual ~CThemeItem();
       
   100 
       
   101 	// Other
       
   102 	MSmlDmAdapter::TError GetDMNameL( CBufBase& aResult );
       
   103 	MSmlDmAdapter::TError GetIdL( CBufBase& aResult );
       
   104 	MSmlDmAdapter::TError GetNameL( CBufBase& aResult );
       
   105 	MSmlDmAdapter::TError GetVersionL( CBufBase& aResult );
       
   106 
       
   107 protected:
       
   108 
       
   109 private:
       
   110 	CThemeItem( );
       
   111 	void ConstructL( );
       
   112 
       
   113 private:
       
   114 	HBufC8* iDMName;
       
   115     CAknsSrvSkinInformationPkg* iSkinInfo;
       
   116 	};
       
   117 
       
   118 #endif // __ThemesList_H__