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