|
1 /* |
|
2 * Copyright (c) 2010 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: Cps command buffer |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_CAICPSCOMMANDBUFFER_H |
|
20 #define C_CAICPSCOMMANDBUFFER_H |
|
21 |
|
22 // System includes |
|
23 #include <e32base.h> |
|
24 |
|
25 // User includes |
|
26 #include <aicpscommandbuffer.h> |
|
27 |
|
28 // Forward declarations |
|
29 class CLiwGenericParamList; |
|
30 class CLiwServiceHandler; |
|
31 class CLiwCriteriaItem; |
|
32 class CAiCpsExecuteParam; |
|
33 class MLiwInterface; |
|
34 |
|
35 /** |
|
36 * AI Cps command buffer |
|
37 * |
|
38 * @ingroup group_aifw |
|
39 * @lib aifw |
|
40 * @since S60 v5.2 |
|
41 */ |
|
42 NONSHARABLE_CLASS( CAiCpsCommandBuffer ) : public CBase, |
|
43 public MAiCpsCommandBuffer |
|
44 { |
|
45 public: |
|
46 // constructors and destructor |
|
47 |
|
48 /** |
|
49 * Two-phased constructors. |
|
50 */ |
|
51 static CAiCpsCommandBuffer* NewL(); |
|
52 static CAiCpsCommandBuffer* NewLC(); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 ~CAiCpsCommandBuffer(); |
|
58 |
|
59 private: |
|
60 // constructors |
|
61 |
|
62 /** |
|
63 * C++ default constructor |
|
64 */ |
|
65 CAiCpsCommandBuffer(); |
|
66 |
|
67 /** |
|
68 * 2nd phase constructor |
|
69 */ |
|
70 void ConstructL(); |
|
71 |
|
72 public: |
|
73 // new function |
|
74 |
|
75 /** |
|
76 * Flushes command buffer |
|
77 * |
|
78 * @since S60 v5.2 |
|
79 */ |
|
80 void Flush(); |
|
81 |
|
82 /** |
|
83 * Gets the CPS interface |
|
84 * |
|
85 * @since S60 5.2 |
|
86 */ |
|
87 void GetCPSInterfaceL(); |
|
88 |
|
89 private: |
|
90 // from MAiCpsCommandBuffer |
|
91 |
|
92 /** |
|
93 * @see MAiCpsCommandBuffer |
|
94 */ |
|
95 void AddCommand( const TDesC& aPluginId, const TDesC& aType, |
|
96 CLiwDefaultMap* aFilter, const TDesC8& aAction); |
|
97 |
|
98 /** |
|
99 * @see MAiCpsCommandBuffer |
|
100 */ |
|
101 CLiwServiceHandler* ServiceHandler() const; |
|
102 |
|
103 /** |
|
104 * @see MAiCpsCommandBuffer |
|
105 */ |
|
106 MLiwInterface* CpsInterface() const; |
|
107 |
|
108 private: |
|
109 // new functions |
|
110 |
|
111 /** |
|
112 * Detach the CPS interface |
|
113 * |
|
114 * @since S60 5.2 |
|
115 */ |
|
116 void DetachL(); |
|
117 |
|
118 /** |
|
119 * Adds a CPS command execute commnad for a spcific Plugin |
|
120 * Note: aType and Filter will overwrite the previous value |
|
121 * |
|
122 * @since S60 5.2 |
|
123 * @param aPluginId plugin id. |
|
124 * @param aType type of the cps registry. |
|
125 * @param aFilter filter values. |
|
126 * @param aAction action trigger. |
|
127 */ |
|
128 void DoAddCommandL(const TDesC& aPluginId,const TDesC& aType, |
|
129 CLiwDefaultMap* aFilter, const TDesC8& aAction ); |
|
130 |
|
131 /** |
|
132 * Flush all the CPS execute commands.. |
|
133 * |
|
134 * @since S60 5.2 |
|
135 */ |
|
136 void DoFlushL(); |
|
137 |
|
138 private: |
|
139 // data |
|
140 /** |
|
141 * SAPI service handler. |
|
142 * Owned. |
|
143 */ |
|
144 CLiwServiceHandler* iServiceHandler; |
|
145 |
|
146 /** |
|
147 * CPS SAPI service. |
|
148 * Owned. |
|
149 */ |
|
150 CLiwCriteriaItem* iCpsService; |
|
151 |
|
152 /** |
|
153 * Provides hsps services. |
|
154 * Owned. |
|
155 */ |
|
156 MLiwInterface* iCpsInterface; |
|
157 |
|
158 /** |
|
159 * Plugins execute parameter array |
|
160 * Owned. |
|
161 */ |
|
162 RPointerArray<CAiCpsExecuteParam> iPlugins; |
|
163 |
|
164 private: |
|
165 #ifdef _AIFW_UNIT_TEST |
|
166 friend class UT_AiCpsCommandBuffer; |
|
167 #endif |
|
168 }; |
|
169 |
|
170 #endif // C_CAICPSCOMMANDBUFFER_H |
|
171 |
|
172 // End of file |
|
173 |