|
1 /* |
|
2 * Copyright (c) 2008-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: Plugin used by Music content publisher to publish data and actions |
|
15 * to Home Screen/Matrix Menu/Any component requiring them. |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef IRMCPPLUGIN_H |
|
21 #define IRMCPPLUGIN_H |
|
22 |
|
23 #include "mcpplugin.h" |
|
24 #include "mcppluginobserver.h" |
|
25 #include "iractiveidleengnotifyhandler.h" |
|
26 |
|
27 class CIRActiveIdleEng; |
|
28 |
|
29 class CIRMetaData; |
|
30 #define KMAXLENGTH 256 |
|
31 |
|
32 |
|
33 /** |
|
34 * IR Content Publisher plugin is publishes data and actions for |
|
35 * Home screen and Matrix menu. |
|
36 * |
|
37 * The plugin uses existing Active idle engine for getting information from VRA. |
|
38 * |
|
39 * The plugin is currently loaded by Music Content Publisher. |
|
40 */ |
|
41 NONSHARABLE_CLASS( CIRMCPPlugin ) : public CMCPPlugin, |
|
42 public MIRActiveIdleEngNotifyHandler |
|
43 { |
|
44 public: |
|
45 /** |
|
46 * Two-phase constructor. |
|
47 * |
|
48 * @param aObserver The plugin observer providing also the publishing API |
|
49 * @return A pointer to new instance of CIRMCPPlugin |
|
50 */ |
|
51 static CIRMCPPlugin* NewL( MMCPPluginObserver* aObserver ); |
|
52 |
|
53 /** |
|
54 * Destructor. |
|
55 */ |
|
56 ~CIRMCPPlugin(); |
|
57 |
|
58 // from base class CMCPPlugin |
|
59 void Deactivate(); |
|
60 |
|
61 // from base class MIRActiveIdleEngNotifyHandler |
|
62 void HandleChannelChangeL(); |
|
63 void HandleMetaDataReceivedL( const CIRMetaData& aMetaData ); |
|
64 void HandleVolumeChangeL( const TInt aVolume ); |
|
65 void HandlePlayStopL( TIRStopPlayState aState ); |
|
66 void HandleApplicationRunningStateChangeL( const TIRPSApplicationRunningState aRunningState ); |
|
67 void HandleBufferingStateL(TIRBufferingState aState ); |
|
68 |
|
69 private: |
|
70 |
|
71 /** |
|
72 * Installs (publishes) a given VR Action Handler command to given destination. |
|
73 * |
|
74 * @param aCommand The command to be installed to given destination. |
|
75 * @param aDestination The destination where the given command is installed. |
|
76 */ |
|
77 void InstallIRCommandActionL( const TDesC& aCommand, TMCPTriggerDestination aDestination ); |
|
78 |
|
79 /** |
|
80 * Activates the plugin and publishes the actions and information accordingly. |
|
81 */ |
|
82 void ActivateL(); |
|
83 |
|
84 |
|
85 |
|
86 /** |
|
87 * Publishes the actions and information of last played station. |
|
88 */ |
|
89 void PublishLastPlayedWidgetItemsL(); |
|
90 |
|
91 |
|
92 |
|
93 private: |
|
94 /** |
|
95 * C++ constructor. |
|
96 * |
|
97 * @param aObserver The plugin observer providing also the publishing API |
|
98 */ |
|
99 CIRMCPPlugin( MMCPPluginObserver* aObserver ); |
|
100 |
|
101 /** |
|
102 * Second-phase constructor. |
|
103 */ |
|
104 void ConstructL(); |
|
105 |
|
106 /** |
|
107 * Searches and adds the plugin's resource file to the environment. |
|
108 */ |
|
109 void InitializeResourceLoadingL(); |
|
110 |
|
111 private: |
|
112 /** |
|
113 * The observer providing the publishing API. |
|
114 * Not owned. |
|
115 */ |
|
116 MMCPPluginObserver* iObserver; |
|
117 |
|
118 /** |
|
119 * Active idle engine used for reading VRA states. |
|
120 * Owned. |
|
121 */ |
|
122 CIRActiveIdleEng* iEngine; |
|
123 |
|
124 /** |
|
125 * Last played text. |
|
126 * Owned. |
|
127 */ |
|
128 HBufC* iLastPlayedText; |
|
129 |
|
130 /** |
|
131 * State indicator, the plugin can be active or inactive. |
|
132 */ |
|
133 TBool iActive; |
|
134 |
|
135 /** resource offset. */ |
|
136 TInt iResourceOffset; |
|
137 |
|
138 /** |
|
139 * Radio Text overrides PS name, and we have both available. |
|
140 * So we need to keep track which one is being currently published. |
|
141 */ |
|
142 TBool iShowingRDSRadioText; |
|
143 |
|
144 //Added by Snigdha |
|
145 |
|
146 /** |
|
147 * Current meta data information. |
|
148 * Owned. |
|
149 */ |
|
150 CIRMetaData* iMetaData; |
|
151 |
|
152 // Meta data info |
|
153 TBuf <KMAXLENGTH> iChannelName; |
|
154 TInt iPresetIndex; |
|
155 |
|
156 /** Internet Radio application running state */ |
|
157 TIRPSApplicationRunningState iRunningState; |
|
158 |
|
159 TInt iPlayingState; |
|
160 |
|
161 /** |
|
162 * Last played text. |
|
163 * Owned. |
|
164 */ |
|
165 HBufC* iBufferingText; |
|
166 |
|
167 |
|
168 }; |
|
169 |
|
170 #endif /* IRMCPPLUGIN_H */ |