|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @publishedAll |
|
19 @released |
|
20 */ |
|
21 |
|
22 #ifndef REMCONABSVOLCONTROLLER_H |
|
23 #define REMCONABSVOLCONTROLLER_H |
|
24 |
|
25 #include <e32base.h> |
|
26 #include <remcon/remconinterfacebase.h> |
|
27 #include <remcon/remconinterfaceif.h> |
|
28 |
|
29 class MRemConAbsVolControllerObserver; |
|
30 class CRemConInterfaceSelector; |
|
31 |
|
32 /** |
|
33 Client-instantiable type supporting sending AbsVol API responses. |
|
34 */ |
|
35 NONSHARABLE_CLASS(CRemConAbsVolController) : public CRemConInterfaceBase, |
|
36 public MRemConInterfaceIf |
|
37 { |
|
38 public: |
|
39 /** |
|
40 Factory function. |
|
41 @param aInterfaceSelector The interface selector. The client must have |
|
42 created one of these first. |
|
43 @param aObserver The observer of this interface. |
|
44 @return A new CRemConAbsVolController, owned by the interface selector. |
|
45 */ |
|
46 IMPORT_C static CRemConAbsVolController* NewL(CRemConInterfaceSelector& aInterfaceSelector, |
|
47 MRemConAbsVolControllerObserver& aObserver); |
|
48 |
|
49 /** Destructor. */ |
|
50 IMPORT_C ~CRemConAbsVolController(); |
|
51 |
|
52 public: |
|
53 /** |
|
54 Sends a 'get absolute volume' command. The absolute volume will be |
|
55 returned in response(s) via the observer interface. |
|
56 Only one command per controller session can be outstanding at any one time. |
|
57 @param aStatus Used by RemCon to indicate completion of the send request. |
|
58 @param aNumRemotes The number of remotes to which the command was sent. |
|
59 */ |
|
60 IMPORT_C void GetAbsoluteVolume(TRequestStatus& aStatus, TUint& aNumRemotes); |
|
61 |
|
62 /** |
|
63 Sends a 'set absolute volume' command. The volume is set to aAbsVol, on a |
|
64 range of zero to aMaxVol. Any responses will be returned via the observer |
|
65 interface. |
|
66 Only one command per controller session can be outstanding at any one time. |
|
67 @param aStatus Used by RemCon to indicate completion of the send request. |
|
68 @param aAbsVol The relative volume. |
|
69 @param aMaxVol The maximum against which aAbsVol is relative. |
|
70 @param aNumRemotes The number of remotes to which the command was sent. |
|
71 */ |
|
72 IMPORT_C void SetAbsoluteVolume(TRequestStatus& aStatus, TUint aAbsVol, TUint aMaxVol, TUint& aNumRemotes); |
|
73 |
|
74 private: |
|
75 /** |
|
76 Constructor. |
|
77 @param aInterfaceSelector The interface selector. |
|
78 @param aObserver The observer of this interface. |
|
79 */ |
|
80 CRemConAbsVolController(CRemConInterfaceSelector& aInterfaceSelector, |
|
81 MRemConAbsVolControllerObserver& aObserver); |
|
82 |
|
83 private: // from CRemConInterfaceBase |
|
84 TAny* GetInterfaceIf(TUid aUid); |
|
85 |
|
86 private: // from MRemConInterfaceIf |
|
87 void MrcibNewMessage(TUint aOperationId, const TDesC8& aData); |
|
88 |
|
89 private: // unowned |
|
90 MRemConAbsVolControllerObserver& iObserver; |
|
91 |
|
92 private: // owned |
|
93 static const TUint KMaxOperationDataSize = 0x20; |
|
94 TBuf8<KMaxOperationDataSize> iOutData; |
|
95 }; |
|
96 |
|
97 #endif // REMCONABSVOLCONTROLLER_H |