sysstatemgmt/systemstatemgr/cmd/inc/cmdloadsup.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 __CMDLOADSUP_H__
       
    17 #define __CMDLOADSUP_H__
       
    18 
       
    19 #include <ssm/ssmsupinfo.h>
       
    20 #include <ssm/ssmsuscli.h>
       
    21 #include "ssmdeferrablecommand.h"
       
    22 
       
    23 class TSsmCommandParameters;
       
    24 class RReadStream;
       
    25 
       
    26 /**
       
    27 Built-in command for loading the SSMA Utility Plugin
       
    28 @internalComponent
       
    29 @released
       
    30 @see RSsmSusCli
       
    31 @see TSsmSupInfo
       
    32 */
       
    33 NONSHARABLE_CLASS (CCmdLoadSup) : public CSsmDeferrableCommand
       
    34 	{
       
    35 public: 
       
    36 	static CCmdLoadSup* NewL(RReadStream& aReadStream);
       
    37 	static CCmdLoadSup* NewL(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour, TInt16 aRetries, const TSsmSupInfo& aInfo);
       
    38 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
    39 	static CCmdLoadSup* NewL(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour, TInt16 aRetries, const TSsmSupInfo& aInfo, const TUint16 aPriority);
       
    40 #endif
       
    41 	static CCmdLoadSup* NewL(TSsmCommandParameters& aCommandParameters);
       
    42 	//Must be used only by CLE to reconstruct the command
       
    43 	static CCmdLoadSup* NewLC(const CCmdLoadSup& aCmdLoadSup);
       
    44 	~CCmdLoadSup();
       
    45 
       
    46 	// from MSsmCommand
       
    47 	TSsmCommandType Type() const;
       
    48 	void ExternalizeL(RWriteStream& aWriteStream) const;
       
    49 	void Execute(TRequestStatus& aStatus);
       
    50 	void ExecuteCancel();
       
    51 	void Release();
       
    52 	inline TInt16 Retries() const {return iRetries;}
       
    53 	inline TSsmSupInfo SsmSupInfo() const {return iSupInfo;}
       
    54 	
       
    55 protected:
       
    56 	// from CActive
       
    57 	void RunL();
       
    58 	void DoCancel();
       
    59 	TInt RunError(TInt aError);
       
    60 
       
    61 private:	
       
    62 	CCmdLoadSup();
       
    63 	CCmdLoadSup(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour, TInt16 aRetries);
       
    64 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE
       
    65 	CCmdLoadSup(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour, TInt16 aRetries, const TUint16 aPriority);
       
    66 #endif
       
    67 	void InternalizeL(RReadStream& aReadStream);
       
    68 	void ConstructL(RReadStream& aReadStream);
       
    69 	void ConstructL(TSsmCommandParameters& aCommandParameters);
       
    70 	void ConstructL(const TSsmSupInfo& aInfo);
       
    71 	void ConstructL(const CCmdLoadSup& aCmdLoadSup);
       
    72 	void ValidateL();
       
    73 	static TInt MaxSupportedVersion();
       
    74 	TInt ConnectAndLoadSup();
       
    75 
       
    76 private:
       
    77 	RSsmSusCli iSusCli;					// interface to SSMA Utility Server
       
    78 	TSsmSupInfo iSupInfo;				// plugin info
       
    79  	TPckgC<TSsmSupInfo>* iSupInfoBuf;	// descriptor wrapper for plugin info
       
    80  	TInt16 iRetries;					// number of retries
       
    81 	TInt16 iAttempts;					// count of unsuccessful attempts
       
    82 	TBool iConnected;					// whether connected to service provider or not
       
    83 	};
       
    84 
       
    85 #endif // __CMDLOADSUP_H__