|
1 /* |
|
2 * Copyright (c) 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: CMediaservantPlugin class definition |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_MEDIASERVANTPLUGIN_H |
|
20 #define C_MEDIASERVANTPLUGIN_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <gulicon.h> |
|
24 #include <upnpplugininterface.h> |
|
25 #include "mspropertywatcher.h" |
|
26 |
|
27 // FORWARD DECLARATIONS |
|
28 class CEikonEnv; |
|
29 class CMSEngine; |
|
30 |
|
31 /** |
|
32 * MediaServant UPnP plugin class |
|
33 * |
|
34 * @Since S60 5.1 |
|
35 */ |
|
36 class CMediaservantPlugin : public CUPnPPluginInterface, |
|
37 public MMSPropertyObserver |
|
38 { |
|
39 public: |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * |
|
43 * @since S60 5.1 |
|
44 * @param aPluginObserver observer for plugins |
|
45 * @return pointer to CMediaservantPlugin |
|
46 */ |
|
47 static CMediaservantPlugin* NewL( |
|
48 MUPnPPluginObserver* aPluginObserver); |
|
49 |
|
50 /** |
|
51 * Two-phased constructor. |
|
52 * |
|
53 * @since S60 5.1 |
|
54 * @param aPluginObserver observer for plugins |
|
55 * @return pointer to CMediaservantPlugin |
|
56 */ |
|
57 static CMediaservantPlugin* NewLC( |
|
58 MUPnPPluginObserver* aPluginObserver); |
|
59 |
|
60 /** |
|
61 * Informs to ECom that it has been destroyed. |
|
62 * |
|
63 * @since S60 5.1 |
|
64 * @param None |
|
65 * @return None |
|
66 */ |
|
67 virtual ~CMediaservantPlugin(); |
|
68 |
|
69 protected: |
|
70 |
|
71 // From base class CUPnPPluginInterface |
|
72 |
|
73 /** |
|
74 * From CUPnPPluginInterface |
|
75 * See base class definition |
|
76 */ |
|
77 const CGulIcon& GetIcon(); |
|
78 |
|
79 /** |
|
80 * From CUPnPPluginInterface |
|
81 * See base class definition |
|
82 */ |
|
83 const TDesC& GetTitle(); |
|
84 |
|
85 /** |
|
86 * From CUPnPPluginInterface |
|
87 * See base class definition |
|
88 */ |
|
89 const TDesC& GetSecondaryText(); |
|
90 |
|
91 /** |
|
92 * From CUPnPPluginInterface |
|
93 * See base class definition |
|
94 */ |
|
95 void ExecuteL(); |
|
96 |
|
97 /** |
|
98 * From CUPnPPluginInterface |
|
99 * See base class definition |
|
100 */ |
|
101 TBool RequiresUpnpConfiguration(); |
|
102 |
|
103 // From base class MMSPropertyObserver |
|
104 |
|
105 /** |
|
106 * From MMSPropertyObserver |
|
107 * See base class definition |
|
108 */ |
|
109 void PropertyChangedL( TCmService aService, |
|
110 TInt aTotalItems, |
|
111 TInt aProcessedItems, |
|
112 TInt aItemsToBeProcessed ); |
|
113 |
|
114 private: |
|
115 |
|
116 /** |
|
117 * Performs the second phase construction. |
|
118 * |
|
119 * @since S60 5.1 |
|
120 * @param aPluginObserver observer for plugins |
|
121 * @return None |
|
122 */ |
|
123 void ConstructL( MUPnPPluginObserver* aPluginObserver ); |
|
124 |
|
125 /** |
|
126 * Performs the first phase of two phase construction. |
|
127 * |
|
128 * @since S60 5.1 |
|
129 * @param aEcomArguments, Ecom arguments |
|
130 * @return None |
|
131 */ |
|
132 CMediaservantPlugin( TAny* aEcomArguments ); |
|
133 |
|
134 /** |
|
135 * Load secondary text to plugin |
|
136 * |
|
137 * @since S60 5.1 |
|
138 * @param None |
|
139 * @return None |
|
140 */ |
|
141 void LoadPluginTextL(); |
|
142 |
|
143 private: |
|
144 /** |
|
145 * Required in all plugins which implement CUPnPPluginInterface |
|
146 */ |
|
147 MUPnPPluginObserver* iPluginObserver; |
|
148 |
|
149 /** |
|
150 * Plugin primary text |
|
151 */ |
|
152 HBufC* iTitle; // owned |
|
153 /** |
|
154 * Plugin secondary text |
|
155 */ |
|
156 HBufC* iSecondaryText; // owned |
|
157 /** |
|
158 * Flag for indication that IAP setup is needed |
|
159 */ |
|
160 TBool iRequiresUpnpConf; |
|
161 /** |
|
162 * Plugin icon |
|
163 */ |
|
164 CGulIcon* iIcon; // owned |
|
165 /** |
|
166 * Resource file offset |
|
167 */ |
|
168 TInt iResFileOffset; |
|
169 /** |
|
170 * Control environment for res file handling |
|
171 */ |
|
172 CEikonEnv* iCoeEnv; |
|
173 /** |
|
174 * Progress watcher |
|
175 */ |
|
176 CMSPropertyWatcher* iMSPropertyWatcher; // owned |
|
177 /** |
|
178 * Application engine for text loading |
|
179 */ |
|
180 CMSEngine* iMSEngine; // owned |
|
181 }; |
|
182 |
|
183 |
|
184 #endif // C_MEDIASERVANTPLUGIN_H |
|
185 |