|
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 __SSMCOMMANDBASE_H__ |
|
17 #define __SSMCOMMANDBASE_H__ |
|
18 |
|
19 #include <e32base.h> |
|
20 #include <ssm/ssmcommand.h> |
|
21 |
|
22 #define __COMPARE_VERSION(version, expectedVersion) ((version <= expectedVersion) && (version > 0)) |
|
23 |
|
24 class CSsmCommandUtilProvider; |
|
25 |
|
26 /** Abstract base class for all commands. |
|
27 @internalComponent |
|
28 @released |
|
29 */ |
|
30 NONSHARABLE_CLASS(CSsmCommandBase) : public CActive, public MSsmCommand |
|
31 { |
|
32 public: |
|
33 ~CSsmCommandBase(); |
|
34 |
|
35 void SetUtilProvider(CSsmCommandUtilProvider& aUtilProvider); |
|
36 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE |
|
37 TUint16 Priority() const; |
|
38 void SetCommandResourceFileNameL(const TDesC& aFileName); |
|
39 const TDesC& GetCommandResourceFileName() const; |
|
40 TInt GetCommandResourceFileNameLength() const; |
|
41 #endif |
|
42 |
|
43 // from MSsmCommand |
|
44 TBool IsDeferred() const; |
|
45 TCmdErrorSeverity Severity() const; |
|
46 TInt CompletionStatus() const; |
|
47 void RegisterCompletionObserver(TRequestStatus& aStatus); |
|
48 void RegisterCompletionObserverCancel(); |
|
49 TSsmExecutionBehaviour ExecutionBehaviour() const; |
|
50 TBool EvaluateCondition(MSsmConditionalCallback* aCallback, CResourceFile* aResourceFile); |
|
51 void SetConditionalInformation(TInt aConditionalInformation); |
|
52 TInt ConditionalInformation() const; |
|
53 |
|
54 protected: |
|
55 CSsmCommandBase(); |
|
56 CSsmCommandBase(TCmdErrorSeverity aSeverity); |
|
57 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE |
|
58 CSsmCommandBase(TCmdErrorSeverity aSeverity, const TUint16 aPriority); |
|
59 #endif |
|
60 |
|
61 void CompleteRequest(TRequestStatus& aStatus, TInt aReason); |
|
62 virtual void CompleteExecuteRequest(TInt aReason); |
|
63 |
|
64 protected: |
|
65 TRequestStatus* iExecuteRequest; |
|
66 TCmdErrorSeverity iSeverity; |
|
67 CSsmCommandUtilProvider* iUtilProvider; // Not owning |
|
68 TInt iConditionalResourceId; |
|
69 #ifdef SYMBIAN_SSM_FLEXIBLE_MERGE |
|
70 // the priority of the command, indicating the order of execution in the list |
|
71 TUint16 iPriority; |
|
72 RBuf iCmdResourceFileName; |
|
73 #endif |
|
74 }; |
|
75 |
|
76 #endif // __SSMCOMMANDBASE_H__ |