customization/ScreenSaverAdapter/inc/ScreenSaverAdapter.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 Screensaver Adapter
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __NSMLScreenSaverAdapter_H__
       
    21 #define __NSMLScreenSaverAdapter_H__
       
    22 
       
    23 
       
    24 #include "TARMDmAdapter.h"
       
    25 
       
    26 
       
    27 const TUint KNSmlDMScreenSaverAdapterImplUid = 0x1020782E;
       
    28 
       
    29 // the DDF version must be changed if any changes in DDF structure ( built in DDFStructureL() function )
       
    30 _LIT8( KNSmlSCDDFVersion, "1.0" ); 
       
    31 
       
    32 _LIT8( KNSmlSCTextPlain, "text/plain" );
       
    33 
       
    34 _LIT8( KNSmlCustomizationNodeName, "Customization" );
       
    35 _LIT8( KNSmlSCDescription, "The interior object holds all customization objects" );
       
    36 
       
    37 _LIT8( KNSmlSCScreenSavers, "ScreenSavers" );
       
    38 _LIT8( KNSmlSCScreenSaversNodeDescription, "ScreenSavers is a common parent node for nodes managing screen savers");
       
    39 
       
    40 _LIT8( KNSmlSCAvailableScreenSaversNodeName, "AvailableScreenSavers" );
       
    41 _LIT8( KNSmlSCAvailableScreenSaversNodeDescription, "This node holds the available screen saver placeholders");
       
    42 
       
    43 _LIT8( KNSmlSCActiveScNodeName, "ActiveSc" );
       
    44 _LIT8( KNSmlSCActiveScNodeDescription, "This node is a link to the currently active screen saver");
       
    45 
       
    46 _LIT8( KNSmlSCDynamicDescription, "This is a placeholder to screen saver ID identifying a screen saver");
       
    47 
       
    48 _LIT8( KNSmlSCDataNodeName, "Data" );
       
    49 _LIT8( KNSmlSCDataNodeDescription, "Replace command will install a screen saver that's in the data field of the command");
       
    50 
       
    51 _LIT8( KNSmlSCIDNodeName, "ID" );
       
    52 _LIT8( KNSmlSCIDNodeDescription, "This leaf node holds the ID of the screen saver");
       
    53 
       
    54 _LIT8( KNSmlSCNameNodeName, "Name" );
       
    55 _LIT8( KNSmlSCNameNodeDescription, "This leaf node holds the name of the screen saver");
       
    56 
       
    57 _LIT8( KNSmlSCDescriptionNodeName, "Description" );
       
    58 _LIT8( KNSmlSCDescriptionNodeDescription, "This leaf node holds the description of the screen saver");
       
    59 
       
    60 _LIT8( KNSmlSCCustomPropertyNodeName, "CustomProperty" );
       
    61 _LIT8( KNSmlSCCustomPropertyNodeDescription, "This leaf node holds the custom property value of the screen saver");
       
    62 
       
    63 _LIT8( KNSmlSCVersionNodeName, "Version" );
       
    64 _LIT8( KNSmlSCVersionNodeDescription, "This leaf node holds the version of the screen saver");
       
    65 
       
    66 _LIT8( KNSmlSCInstallOptionsNodeName, "InstallOptions" );
       
    67 _LIT8( KNSmlSCInstallOptionsNodeDescription, "Holds the install options for next install");
       
    68 
       
    69 _LIT8( KNSmlSCActiveScRef, "Customization/ScreenSavers/AvailableScreenSavers/" );
       
    70 
       
    71 _LIT8( KSlash, "/" );
       
    72 
       
    73 
       
    74 class CScreenSaverList;
       
    75 
       
    76 // ------------------------------------------------------------------------------------------------
       
    77 // CNSmlDmEmailAdapter 
       
    78 // ------------------------------------------------------------------------------------------------
       
    79 class CScreenSaverAdapter : public CTARMDmAdapter
       
    80 	{
       
    81 public:
       
    82 	static CScreenSaverAdapter* NewL(MSmlDmCallback* aDmCallback );
       
    83 	static CScreenSaverAdapter* NewLC(MSmlDmCallback* aDmCallback );
       
    84 
       
    85 	virtual ~CScreenSaverAdapter();
       
    86 
       
    87 	// Implementation of MSmlDmAdapter interface
       
    88 	// =========================================
       
    89 	void DDFVersionL( CBufBase& aVersion );
       
    90 	void DDFStructureL( MSmlDmDDFObject& aDDF );
       
    91 	
       
    92 	void _UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aObject, const TDesC8& aType, TInt aStatusRef );
       
    93 	void _UpdateLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef );
       
    94 	void _DeleteObjectL( const TDesC8& aURI, const TDesC8& aLUID, TInt aStatusRef );
       
    95 	void _FetchLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef );
       
    96 	void _FetchLeafObjectSizeL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, TInt aResultsRef, TInt aStatusRef );
       
    97 	void _ChildURIListL( const TDesC8& aURI, const TDesC8& aLUID, const CArrayFix<TSmlDmMappingInfo>& aPreviousURISegmentList, TInt aResultsRef, TInt aStatusRef );
       
    98 	
       
    99 	void _AddNodeObjectL( const TDesC8& aURI, const TDesC8& aParentLUID, TInt aStatusRef );
       
   100 	void _ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aArgument, const TDesC8& aType, TInt aStatusRef );
       
   101 	void _ExecuteCommandL( const TDesC8& aURI, const TDesC8& aLUID, RWriteStream*& aStream, const TDesC8& aType, TInt aStatusRef );
       
   102 	void _CopyCommandL( const TDesC8& aTargetURI, const TDesC8& aTargetLUID, const TDesC8& aSourceURI, const TDesC8& aSourceLUID, const TDesC8& aType, TInt aStatusRef );
       
   103 
       
   104 	void StartAtomicL();
       
   105 	void CommitAtomicL();
       
   106 	void RollbackAtomicL();
       
   107 	TBool StreamingSupport( TInt& aItemSize );
       
   108 #ifdef __TARM_SYMBIAN_CONVERGENCY	
       
   109 		virtual void StreamCommittedL( RWriteStream& aStream );
       
   110 #else
       
   111 		virtual void StreamCommittedL();
       
   112 #endif	
       
   113 	void CompleteOutstandingCmdsL();
       
   114 
       
   115 	// PolicyCheck, resource name
       
   116 //#ifdef __SAP_POLICY_MANAGEMENT	
       
   117 	TPtrC8 PolicyRequestResourceL( const TDesC8& aURI );
       
   118 //#endif
       
   119 
       
   120 protected:
       
   121 	// Other
       
   122 	void GetLeafObjectL( const TDesC8& aURI, const TDesC8& aLUID, const TDesC8& aType, CBufBase& aResult, TError& aRet );
       
   123 
       
   124 private:
       
   125 	void ConstructL( );
       
   126 	CScreenSaverAdapter( MSmlDmCallback* aDmCallback );
       
   127 
       
   128 	enum TNodeId
       
   129 		{
       
   130 		ENodeUnknown,
       
   131 
       
   132 		ENodeCustomization,
       
   133 		ENodeScreenSavers,
       
   134 
       
   135 		ENodeAvailableScreenSavers,
       
   136 		ENodeActiveSc,
       
   137 
       
   138 		ENodeAvailableScreenSaversX,
       
   139 
       
   140 		ENodeData,
       
   141 		ENodeID,
       
   142 		ENodeName,
       
   143 		ENodeDescription,
       
   144 		ENodeCustomProperty,
       
   145 		ENodeVersion,
       
   146 		ENodeInstallOptions,
       
   147 
       
   148 		ENodeLast
       
   149 		};
       
   150 
       
   151 	TNodeId NodeId( const TDesC8& aURI );
       
   152 
       
   153 	void FillNodeInfoL( MSmlDmDDFObject& aNode,TSmlDmAccessTypes aAccTypes,MSmlDmDDFObject::TOccurence aOccurrence, MSmlDmDDFObject::TScope aScope, MSmlDmDDFObject::TDFFormat aFormat,const TDesC8& aDescription );
       
   154 	TBool IsImage(const TDesC8& aMime) ;
       
   155 
       
   156 
       
   157 	void InstalledPackagesL( RArray< TUid >& aUids );
       
   158 //	void InstalledScreenSaversL( RArray< TUid >& aUids );
       
   159 	void InstalledScreenSaversL( CDesCArray& aIds );
       
   160 
       
   161 private:
       
   162 
       
   163 	MSmlDmCallback* iCallBack;
       
   164 	CScreenSaverList* iScreenSavers;
       
   165 	TBool iScreensaverOff;
       
   166 
       
   167 };
       
   168 
       
   169 #endif // __NSMLScreenSaverAdapter_H__