|
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 __CMDPUBLISHSYSTEMSTATE_H__ |
|
17 #define __CMDPUBLISHSYSTEMSTATE_H__ |
|
18 #include <domainmanager.h> |
|
19 #include <ssm/ssmpublishsystemstateinfo.h> |
|
20 #include "ssmdeferrablecommand.h" |
|
21 |
|
22 class TSsmCommandParameters; |
|
23 class RReadStream; |
|
24 |
|
25 /** |
|
26 Built-in command for setting the Domain Manager state |
|
27 @internalComponent |
|
28 @released |
|
29 @see RDmDomainManager |
|
30 @see TSsmPublishSystemStateInfo |
|
31 */ |
|
32 NONSHARABLE_CLASS (CCmdPublishSystemState) : public CSsmDeferrableCommand |
|
33 { |
|
34 public: |
|
35 static CCmdPublishSystemState* NewL(RReadStream& aReadStream); |
|
36 static CCmdPublishSystemState* NewL(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour, const TSsmPublishSystemStateInfo& aInfo); |
|
37 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE |
|
38 static CCmdPublishSystemState* NewL(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour, const TSsmPublishSystemStateInfo& aInfo, const TUint16 aPriority); |
|
39 #endif |
|
40 static CCmdPublishSystemState* NewL(TSsmCommandParameters& aCommandParameters); |
|
41 //Must be used only by CLE to reconstruct the command |
|
42 static CCmdPublishSystemState* NewLC(const CCmdPublishSystemState& aCmdPublishSystemState); |
|
43 ~CCmdPublishSystemState(); |
|
44 |
|
45 // from MSsmCommand |
|
46 TSsmCommandType Type() const; |
|
47 void ExternalizeL(RWriteStream& aWriteStream) const; |
|
48 void Execute(TRequestStatus& aStatus); |
|
49 void ExecuteCancel(); |
|
50 void Release(); |
|
51 inline TSsmPublishSystemStateInfo PublishSystemStateInfo() const {return iStateInfo;} |
|
52 |
|
53 protected: |
|
54 // from CActive |
|
55 void RunL(); |
|
56 void DoCancel(); |
|
57 TInt RunError(TInt aError); |
|
58 |
|
59 private: |
|
60 CCmdPublishSystemState(); |
|
61 CCmdPublishSystemState(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour, const TSsmPublishSystemStateInfo& aInfo); |
|
62 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE |
|
63 CCmdPublishSystemState(TCmdErrorSeverity aSeverity, TSsmExecutionBehaviour aExecutionBehaviour, const TSsmPublishSystemStateInfo& aInfo, const TUint16 aPriority); |
|
64 #endif |
|
65 void InternalizeL(RReadStream& aReadStream); |
|
66 void ConstructL(RReadStream& aReadStream); |
|
67 void ConstructL(TSsmCommandParameters& aCommandParameters); |
|
68 void ConstructL(); |
|
69 void ConstructL(const CCmdPublishSystemState& aCmdPublishSystemState); |
|
70 void ValidateL(); |
|
71 static TInt MaxSupportedVersion(); |
|
72 TInt ConnectAndRequestTransition(); |
|
73 |
|
74 private: |
|
75 RDmDomainManager iDomainManager; // interface to Domain manager |
|
76 TSsmPublishSystemStateInfo iStateInfo; // state info |
|
77 TInt iAttempts; // count of unsuccessful attempts |
|
78 TBool iConnected; // whether connected to service provider or not |
|
79 }; |
|
80 |
|
81 #endif // __CMDPUBLISHSYSTEMSTATE_H__ |