|
1 /* |
|
2 * Copyright (c) 2006-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: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef IRACTIVEIDLEENG_H |
|
19 #define IRACTIVEIDLEENG_H |
|
20 |
|
21 #include "iractiveidleengpubsubnotifyhandler.h" |
|
22 |
|
23 class CIRActiveIdleEngPubSub; |
|
24 class MIRActiveIdleEngNotifyHandler; |
|
25 |
|
26 /** |
|
27 * Engine component for Internet Radio Active Idle plugin. |
|
28 * |
|
29 * This class is responsible for listening to relevant P&S keys and notifying the UI code whenever the listened keys change. |
|
30 * The actual listening is done by multiple CIRActiveIdleStatusObserver objects. |
|
31 */ |
|
32 NONSHARABLE_CLASS(CIRActiveIdleEng) : public CBase, |
|
33 public MIRActiveIdleEngPubSubNotifyHandler |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Static constructor. |
|
39 * @param aObserver The observer to be notified of the changes in the keys. |
|
40 * @return The newly created CIRActiveIdleEng object. |
|
41 */ |
|
42 IMPORT_C static CIRActiveIdleEng* NewL( |
|
43 MIRActiveIdleEngNotifyHandler& aObserver ); |
|
44 |
|
45 /** |
|
46 * Destructor. |
|
47 */ |
|
48 IMPORT_C ~CIRActiveIdleEng(); |
|
49 |
|
50 /** |
|
51 * Construction finalizer. |
|
52 * Must be called after CIRActiveIdleEng::NewL. |
|
53 */ |
|
54 IMPORT_C void SecondConstructL(); |
|
55 |
|
56 protected: // From MIRActiveIdleStatusObserver |
|
57 /** |
|
58 * Invoked when an error occurred while retrieving the new |
|
59 * value of the key. |
|
60 * @param aCategory The category of the key that changed. |
|
61 * @param aKey The key that changed. |
|
62 * @param aError The error code. |
|
63 */ |
|
64 void HandlePropertyChangeErrorL( const TUid& aCategory, TUint aKey, |
|
65 TInt aError ); |
|
66 |
|
67 /** |
|
68 * Invoked when the listened key is changed. |
|
69 * @param aCategory The category of the key that changed. |
|
70 * @param aKey The key that changed. |
|
71 * @param aText The new value of the key. |
|
72 */ |
|
73 void HandlePropertyChangeL( const TUid& aCategory, TUint aKey, |
|
74 const TDesC8& aText ); |
|
75 |
|
76 /** |
|
77 * Invoked when the listened key is changed. |
|
78 * @param aCategory The category of the key that changed. |
|
79 * @param aKey The key that changed. |
|
80 * @param aValue The new value of the key. |
|
81 */ |
|
82 void HandlePropertyChangeL( const TUid& aCategory, TUint aKey, |
|
83 TInt aValue ); |
|
84 |
|
85 private: |
|
86 |
|
87 /** |
|
88 * Constructor. |
|
89 * @param aObserver The observer to be notified of the changes |
|
90 * in the keys. |
|
91 */ |
|
92 CIRActiveIdleEng( MIRActiveIdleEngNotifyHandler& aObserver ); |
|
93 |
|
94 /** |
|
95 * Second-phase constructor. |
|
96 */ |
|
97 void ConstructL(); |
|
98 |
|
99 protected: |
|
100 |
|
101 /** The observer to be notified of the changes in the listened keys. */ |
|
102 MIRActiveIdleEngNotifyHandler& iObserver; |
|
103 /** Array of status observers. */ |
|
104 RPointerArray<CIRActiveIdleEngPubSub> iPropertyObserverArray; |
|
105 |
|
106 TInt iVolume; |
|
107 |
|
108 }; |
|
109 |
|
110 #endif//IRACTIVEIDLEENG_H |