|
1 /* |
|
2 * Copyright (c) 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: Inline implementation of collection plugin constructor/destructor |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 // ======================= INLINE MEMBER FUNCTIONS ============================ |
|
20 #include <mpxtaskqueue.h> |
|
21 |
|
22 // ---------------------------------------------------------------------------- |
|
23 // Two-phased constructor. |
|
24 // ---------------------------------------------------------------------------- |
|
25 // |
|
26 inline CMPXCollectionPlugin* CMPXCollectionPlugin::NewL( |
|
27 const TUid& aUid, |
|
28 MMPXCollectionPluginObserver& aObs) |
|
29 { |
|
30 CMPXCollectionPlugin* self = reinterpret_cast<CMPXCollectionPlugin*>( |
|
31 REComSession::CreateImplementationL(aUid, |
|
32 _FOFF(CMPXCollectionPlugin,iDtorKey))); |
|
33 CleanupStack::PushL(self); |
|
34 self->InitializeL(); |
|
35 CleanupStack::Pop(self); |
|
36 self->iObs = &aObs; |
|
37 self->iUid = aUid; |
|
38 return self; |
|
39 } |
|
40 |
|
41 // ---------------------------------------------------------------------------- |
|
42 // plugin destruction |
|
43 // ---------------------------------------------------------------------------- |
|
44 // |
|
45 inline CMPXCollectionPlugin::~CMPXCollectionPlugin() |
|
46 { |
|
47 delete iTaskQueue; |
|
48 REComSession::DestroyedImplementation(iDtorKey); |
|
49 } |
|
50 |
|
51 // ---------------------------------------------------------------------------- |
|
52 // Set observer of current request |
|
53 // ---------------------------------------------------------------------------- |
|
54 // |
|
55 inline void CMPXCollectionPlugin::SetObserver(MMPXCollectionPluginObserver& aObs) |
|
56 { |
|
57 iObs = &aObs; |
|
58 } |
|
59 |
|
60 // ---------------------------------------------------------------------------- |
|
61 // Returns implemenation uid of the plugin |
|
62 // ---------------------------------------------------------------------------- |
|
63 // |
|
64 inline const TUid& CMPXCollectionPlugin::Uid() |
|
65 { |
|
66 return iUid; |
|
67 } |
|
68 |
|
69 // ---------------------------------------------------------------------------- |
|
70 // Returns current async task in the task queue |
|
71 // ---------------------------------------------------------------------------- |
|
72 // |
|
73 inline TInt CMPXCollectionPlugin::Task() |
|
74 { |
|
75 return iTaskQueue->Task(); |
|
76 } |
|
77 |
|
78 // ---------------------------------------------------------------------------- |
|
79 // Set observer of current request |
|
80 // ---------------------------------------------------------------------------- |
|
81 // |
|
82 inline void CMPXCollectionPlugin::AddTaskL( |
|
83 TInt aTask, |
|
84 TAny* aCallback, |
|
85 MMPXTaskQueueObserver* aHandler, |
|
86 TInt aParamData/*=0*/, |
|
87 CBufBase* aBuf/*=NULL*/, |
|
88 TAny* aPtrData/*=NULL*/, |
|
89 CBase* aCObject1/*=NULL*/, |
|
90 CBase* aCObject2/*=NULL*/) |
|
91 { |
|
92 iTaskQueue->AddTaskL(aTask, aCallback, aHandler, aParamData, |
|
93 aBuf, aPtrData, aCObject1, aCObject2); |
|
94 } |
|
95 |
|
96 // ---------------------------------------------------------------------------- |
|
97 // Set observer of current request |
|
98 // ---------------------------------------------------------------------------- |
|
99 // |
|
100 inline void CMPXCollectionPlugin::CompleteTask() |
|
101 { |
|
102 iTaskQueue->CompleteTask(); |
|
103 } |
|
104 |
|
105 // ---------------------------------------------------------------------------- |
|
106 // CMPXCollectionPlugin::CompleteAllTasks |
|
107 // ---------------------------------------------------------------------------- |
|
108 // |
|
109 inline void CMPXCollectionPlugin::CompleteAllTasks( |
|
110 TInt aError) |
|
111 { |
|
112 iTaskQueue->CompleteAllTasks(aError); |
|
113 } |
|
114 |
|
115 // ---------------------------------------------------------------------------- |
|
116 // Set observer of current request |
|
117 // ---------------------------------------------------------------------------- |
|
118 // |
|
119 inline void CMPXCollectionPlugin::RemoveTask(TAny* aCallback) |
|
120 { |
|
121 iTaskQueue->RemoveTask(aCallback); |
|
122 } |
|
123 |
|
124 // ---------------------------------------------------------------------------- |
|
125 // Initialize the data memeber |
|
126 // ---------------------------------------------------------------------------- |
|
127 // |
|
128 inline void CMPXCollectionPlugin::InitializeL() |
|
129 { |
|
130 iTaskQueue = CMPXActiveTaskQueue::NewL(); |
|
131 } |
|
132 |
|
133 // ---------------------------------------------------------------------------- |
|
134 // Returns callback of current active task |
|
135 // ---------------------------------------------------------------------------- |
|
136 // |
|
137 inline MMPXCollectionEngineObserver* CMPXCollectionPlugin::Callback() |
|
138 { |
|
139 return iCallback; |
|
140 } |
|
141 |
|
142 // ---------------------------------------------------------------------------- |
|
143 // Set call back when current active task completed. NULL if there is |
|
144 // no active task for this plugin |
|
145 // ---------------------------------------------------------------------------- |
|
146 // |
|
147 inline void CMPXCollectionPlugin::SetCallback( |
|
148 MMPXCollectionEngineObserver* aCallback) |
|
149 { |
|
150 iCallback = aCallback; |
|
151 } |
|
152 // End of file |