|
1 /* |
|
2 * Copyright (c) 2007 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: MPX back stepping utility singleton |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef CMPXBACKSTEPPINGUTILITYIMP_H |
|
20 #define CMPXBACKSTEPPINGUTILITYIMP_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <e32base.h> |
|
24 #include <mpxbacksteppingutility.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class MLiwInterface; |
|
28 class CLiwGenericParamList; |
|
29 class CLiwServiceHandler; |
|
30 |
|
31 // CLASS DECLARATION |
|
32 |
|
33 /** |
|
34 * Music Player common utility class |
|
35 * |
|
36 * @lib mpxbacksteppingutility.lib |
|
37 * @since S60 v3.2 |
|
38 */ |
|
39 NONSHARABLE_CLASS( CMPXBackSteppingUtilityImp ) |
|
40 : public CBase |
|
41 , public MMPXBackSteppingUtility |
|
42 { |
|
43 public: |
|
44 |
|
45 /** |
|
46 * Retrieve a back stepping utility of this thread. All clients in this thread |
|
47 * shares the same utility (singleton) |
|
48 * Call Close() when this object is not needed anymore. |
|
49 * |
|
50 * @since 3.2 |
|
51 * @return Pointer to backstepping utility. Ownership not transferred. |
|
52 */ |
|
53 static MMPXBackSteppingUtility* UtilityL(); |
|
54 |
|
55 /** |
|
56 * This method must be called when this object can be freed. This object |
|
57 * will be destroyed when no one is using it. |
|
58 * |
|
59 * @since 3.2 |
|
60 */ |
|
61 void Close(); |
|
62 |
|
63 /** |
|
64 * Forwards activation event |
|
65 * |
|
66 * @since S60 v3.2 |
|
67 * @param aState state of application like view ids |
|
68 * @param aEnter indicate if it is entry/exit activation |
|
69 * @return result code retutned by BS Service interface |
|
70 * @leave leaves from HandleResultL are propagated |
|
71 */ |
|
72 TInt ForwardActivationEventL( |
|
73 const TDesC8& aState, |
|
74 const TBool aEnter ); |
|
75 |
|
76 /** |
|
77 * Handles back command |
|
78 * |
|
79 * @since S60 v3.2 |
|
80 * @param aState state of application like view ids |
|
81 * @return result code retutned by BS Service interface |
|
82 * @leave leaves from HandleResultL are propagated |
|
83 */ |
|
84 TInt HandleBackCommandL( const TDesC8& aState ); |
|
85 |
|
86 /** |
|
87 * Initializes BS Service |
|
88 * @param aUid client application UID |
|
89 * @leave KErrNotSupported or KErrArgument |
|
90 * (if arguments passed to BS Service are incorrect |
|
91 * or could not initialize BS) |
|
92 * KErrNotFound (if there was no return value) |
|
93 */ |
|
94 void InitializeL( const TUid aUid ); |
|
95 |
|
96 private: |
|
97 |
|
98 /** |
|
99 * C++ constructor |
|
100 */ |
|
101 CMPXBackSteppingUtilityImp(); |
|
102 |
|
103 /** |
|
104 * Destuctor |
|
105 */ |
|
106 virtual ~CMPXBackSteppingUtilityImp(); |
|
107 |
|
108 /** |
|
109 * 2nd phase constructor |
|
110 */ |
|
111 void ConstructL(); |
|
112 |
|
113 /** |
|
114 * Two phased contructor |
|
115 */ |
|
116 static CMPXBackSteppingUtilityImp* NewL(); |
|
117 static CMPXBackSteppingUtilityImp* NewLC(); |
|
118 |
|
119 /** |
|
120 * Store utility to TLS. |
|
121 * |
|
122 * @param aUtility Utility object. Ownership not transferred. |
|
123 */ |
|
124 static void StoreUtility( MMPXBackSteppingUtility* aUtility ); |
|
125 |
|
126 /** |
|
127 * Handles the result of a LIW command |
|
128 * @return result code retutned by BS Service interface |
|
129 * @leave KErrNotSupported or KErrArgument |
|
130 * (if arguments passed to BS Service are incorrect) |
|
131 * KErrNotFound (if there was no return value) |
|
132 */ |
|
133 TInt HandleResultL(); |
|
134 |
|
135 private: // data |
|
136 |
|
137 /** |
|
138 * Reference count. |
|
139 */ |
|
140 TInt iRefCount; |
|
141 |
|
142 /** |
|
143 * AIW Service Handler |
|
144 * Own. |
|
145 */ |
|
146 CLiwServiceHandler* iServiceHandler; |
|
147 |
|
148 /** |
|
149 * BS Service interface returned by LIW |
|
150 * Own. |
|
151 */ |
|
152 MLiwInterface* iBSInterface; |
|
153 |
|
154 /** |
|
155 * In param list |
|
156 * Not own. |
|
157 */ |
|
158 CLiwGenericParamList* iInParamList; |
|
159 |
|
160 /** |
|
161 * Out param list |
|
162 * Not own. |
|
163 */ |
|
164 CLiwGenericParamList* iOutParamList; |
|
165 |
|
166 }; |
|
167 |
|
168 #endif // CMPXBACKSTEPPINGUTILITYIMP_H |
|
169 |
|
170 // End of File |