|
1 /* |
|
2 * Copyright (c) 2002-2008 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: CCFPublishContextAction class declaration. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef C_CFPUBLISHCONTEXTACTION_H |
|
21 #define C_CFPUBLISHCONTEXTACTION_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <e32std.h> |
|
26 |
|
27 #include "cfscriptaction.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CCFContextObject; |
|
31 class MCFExtendedContextInterface; |
|
32 class MCFOperationServices; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 /** |
|
37 * Implements PublishContext action. |
|
38 * Instance of this class is created for every publishContext action in scripts. |
|
39 * |
|
40 * @lib BasicOperationsPlugIn |
|
41 * @since Series 60 5.0 |
|
42 */ |
|
43 NONSHARABLE_CLASS( CCFPublishContextAction ): public CCFScriptAction |
|
44 { |
|
45 public: // Constructors and destructor |
|
46 /** |
|
47 * Creates a new CCFPublishContextAction. |
|
48 * @param aServices is a reference to script operation services. |
|
49 * @param aContextObject is a new TContextObject that will be stored. |
|
50 * Ownership is transferred to CCFPublishContextAction object. |
|
51 * @param aAutoDefine Context is automatically defined if not found. |
|
52 */ |
|
53 static CCFPublishContextAction* NewL( MCFOperationServices& aServices, |
|
54 CCFContextObject* aContextObject, |
|
55 TBool aAutoDefine ); |
|
56 |
|
57 /** |
|
58 * Creates a new CCFPublishContextAction, leaves it into CleanupStack. |
|
59 * @param aServices is a reference to script operation services. |
|
60 * @param aContextObject is a new TContextObject that will be stored. |
|
61 * Ownership is transferred to CCFPublishContextAction object. |
|
62 * @param aAutoDefine Context is automatically defined if not found. |
|
63 */ |
|
64 static CCFPublishContextAction* NewLC( MCFOperationServices& aServices, |
|
65 CCFContextObject* aContextObject, |
|
66 TBool aAutoDefine ); |
|
67 |
|
68 /** |
|
69 * Destructor. |
|
70 */ |
|
71 ~CCFPublishContextAction(); |
|
72 |
|
73 public: // New functions |
|
74 |
|
75 /** |
|
76 * Publishes new context into ContextFramework. |
|
77 * @see CCFScriptAction |
|
78 */ |
|
79 void ActL(); |
|
80 |
|
81 // @see CCFScriptAction |
|
82 TInt GetSecurityPolicy( TSecurityPolicy& aPolicy ); |
|
83 |
|
84 protected: // New functions |
|
85 |
|
86 /** |
|
87 * C++ default constructor. |
|
88 */ |
|
89 CCFPublishContextAction( MCFOperationServices& aServices, |
|
90 MCFExtendedContextInterface& aCF, |
|
91 CCFContextObject* aContextObject, |
|
92 TBool aAutoDefine ); |
|
93 |
|
94 /** |
|
95 * By default Symbian 2nd phase constructor is private. |
|
96 */ |
|
97 void ConstructL(); |
|
98 |
|
99 private: // Data |
|
100 |
|
101 // Context interface. |
|
102 MCFExtendedContextInterface& iCF; |
|
103 |
|
104 // Context published by this action. |
|
105 CCFContextObject* iContextObject; |
|
106 |
|
107 // Define context automatically if not found |
|
108 TBool iAutoDefine; |
|
109 }; |
|
110 |
|
111 #endif // C_CFPUBLISHCONTEXTACTION_H |