|
1 /** |
|
2 * Copyright (c) 2007-2009 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef __CMDCREATESWP_H__ |
|
21 #define __CMDCREATESWP_H__ |
|
22 |
|
23 #include <ssm/ssmswp.h> |
|
24 |
|
25 #include "ssmcommandbase.h" |
|
26 |
|
27 class RSsmStateManager; |
|
28 class TSsmCommandParameters; |
|
29 class RReadStream; |
|
30 |
|
31 /** |
|
32 Built-in command for creating a system-wide property |
|
33 @internalComponent |
|
34 @released |
|
35 @see RSsmStateManager |
|
36 @see TSsmSwp |
|
37 */ |
|
38 NONSHARABLE_CLASS (CCmdCreateSwp) : public CSsmCommandBase |
|
39 { |
|
40 public: |
|
41 static CCmdCreateSwp* NewL(RReadStream& aReadStream); |
|
42 static CCmdCreateSwp* NewL(TCmdErrorSeverity aSeverity, const TSsmSwp& aSwpInfo, const TDesC& aFilename); |
|
43 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE |
|
44 static CCmdCreateSwp* NewL(TCmdErrorSeverity aSeverity, const TSsmSwp& aSwpInfo, const TDesC& aFilename, const TUint16 aPriority); |
|
45 #endif |
|
46 static CCmdCreateSwp* NewL(TSsmCommandParameters& aCommandParameters); |
|
47 //Must be used only by CLE to reconstruct the command |
|
48 static CCmdCreateSwp* NewLC(const CCmdCreateSwp& aCmdCreateSwp); |
|
49 ~CCmdCreateSwp(); |
|
50 |
|
51 // from MSsmCommand |
|
52 TSsmCommandType Type() const; |
|
53 void ExternalizeL(RWriteStream& aWriteStream) const; |
|
54 void Execute(TRequestStatus& aStatus); |
|
55 void ExecuteCancel(); |
|
56 void Release(); |
|
57 inline TSsmSwp SsmSwpInfo() const {return iSwpInfo;} |
|
58 inline const TDesC& FileName() const {return iFileName;} |
|
59 |
|
60 protected: |
|
61 // from CActive |
|
62 void RunL(); |
|
63 void DoCancel(); |
|
64 TInt RunError(TInt aError); |
|
65 |
|
66 private: |
|
67 CCmdCreateSwp(); |
|
68 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE |
|
69 CCmdCreateSwp(TCmdErrorSeverity aSeverity, const TSsmSwp& aSwpInfo, const TUint16 aPriority); |
|
70 #endif |
|
71 CCmdCreateSwp(TCmdErrorSeverity aSeverity, const TSsmSwp& aSwpInfo); |
|
72 void InternalizeL(RReadStream& aReadStream); |
|
73 void ConstructL(const TDesC& aFileName); |
|
74 void ConstructL(RReadStream& aReadStream); |
|
75 void ConstructL(TSsmCommandParameters& aCommandParameters); |
|
76 void ConstructL(const CCmdCreateSwp& aCmdCreateSwp); |
|
77 void ValidateL(); |
|
78 static TInt MaxSupportedVersion(); |
|
79 |
|
80 private: |
|
81 RSsmStateManager iSsm; // interface to State Management Server |
|
82 TSsmSwp iSwpInfo; // property info |
|
83 RBuf iFileName; // policy file |
|
84 }; |
|
85 |
|
86 #endif // __CMDCREATESWP_H__ |