sysstatemgmt/systemstatemgr/cmd/inc/cmdsetpandskey.h
changeset 0 4e1aa6a622a0
equal deleted inserted replaced
-1:000000000000 0:4e1aa6a622a0
       
     1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // under the terms of "Eclipse Public License v1.0"
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 //
       
    15 
       
    16 #ifndef __CMDSETPANDSKEY_H__
       
    17 #define __CMDSETPANDSKEY_H__
       
    18 
       
    19 #include "ssmcommandbase.h"
       
    20 
       
    21 class RReadStream;
       
    22 class TSsmCommandParameters;
       
    23 
       
    24 /**
       
    25 Built-in command to set a publish and subscribe key.
       
    26 @internalComponent
       
    27 @released
       
    28 */
       
    29 NONSHARABLE_CLASS (CCmdSetPAndSKey) : public CSsmCommandBase
       
    30 	{
       
    31 public:
       
    32 	static CCmdSetPAndSKey* NewL(TCmdErrorSeverity aSeverity, const TUid& aCategory, TUint aKey, TInt aValue);
       
    33 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
    34 	static CCmdSetPAndSKey* NewL(TCmdErrorSeverity aSeverity, const TUid& aCategory, TUint aKey, TInt aValue, const TUint16 aPriority);
       
    35 #endif
       
    36 	static CCmdSetPAndSKey* NewL(RReadStream& aReadStream);
       
    37 	static CCmdSetPAndSKey* NewL(TSsmCommandParameters& aCommandParameters);
       
    38 	//Must be used only by CLE to reconstruct the command
       
    39 	static CCmdSetPAndSKey* NewLC(const CCmdSetPAndSKey& aCmdSetPAndSKey);
       
    40 	
       
    41 	~CCmdSetPAndSKey();
       
    42 
       
    43 	// from MSsmCommand
       
    44 	void Execute(TRequestStatus& aStatus);
       
    45 	void Release();		
       
    46 	void ExecuteCancel();
       
    47 	TSsmCommandType Type() const;
       
    48 	void ExternalizeL(RWriteStream& aWriteStream) const;
       
    49 	inline TUid Category() const { return iCategory;}
       
    50 	inline TUint Key() const { return iKey;}
       
    51 	inline TInt Value() const { return iValue;}
       
    52 
       
    53 protected:
       
    54 	// from CActive
       
    55 	void RunL();
       
    56 	void DoCancel();
       
    57 	TInt RunError(TInt aError);
       
    58 
       
    59 private:
       
    60 	CCmdSetPAndSKey();
       
    61 	CCmdSetPAndSKey(TCmdErrorSeverity aSeverity, const TUid& aCategory, TUint aKey, TInt aValue);
       
    62 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
    63 	CCmdSetPAndSKey(TCmdErrorSeverity aSeverity, const TUid& aCategory, TUint aKey, TInt aValue, const TUint16 aPriority);
       
    64 #endif
       
    65 	void ConstructL(RReadStream& aReadStream);
       
    66 	void ConstructL(TSsmCommandParameters& aCommandParameters);
       
    67 	void ConstructL(const CCmdSetPAndSKey& aCmdSetPAndSKey);
       
    68 	void InternalizeL(RReadStream& aReadStream);
       
    69 	static TInt MaxSupportedVersion();
       
    70 
       
    71 private:
       
    72 	TUid iCategory;
       
    73 	TUint iKey;
       
    74 	TInt iValue;
       
    75 	};
       
    76 
       
    77 #endif // __CMDSETPANDSKEY_H__