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@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.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 |
@file
|
williamr@2
|
18 |
@publishedAll
|
williamr@2
|
19 |
@released
|
williamr@2
|
20 |
*/
|
williamr@2
|
21 |
|
williamr@2
|
22 |
#ifndef REMCONABSVOLTARGET_H
|
williamr@2
|
23 |
#define REMCONABSVOLTARGET_H
|
williamr@2
|
24 |
|
williamr@2
|
25 |
#include <e32base.h>
|
williamr@2
|
26 |
#include <remcon/remconinterfacebase.h>
|
williamr@2
|
27 |
#include <remcon/remconinterfaceif.h>
|
williamr@2
|
28 |
|
williamr@2
|
29 |
class MRemConAbsVolTargetObserver;
|
williamr@2
|
30 |
class CRemConInterfaceSelector;
|
williamr@2
|
31 |
|
williamr@2
|
32 |
/**
|
williamr@2
|
33 |
Client-instantiable type supporting sending AbsVol API responses.
|
williamr@2
|
34 |
*/
|
williamr@2
|
35 |
NONSHARABLE_CLASS(CRemConAbsVolTarget) : public CRemConInterfaceBase,
|
williamr@2
|
36 |
public MRemConInterfaceIf
|
williamr@2
|
37 |
{
|
williamr@2
|
38 |
public:
|
williamr@2
|
39 |
/**
|
williamr@2
|
40 |
Factory function.
|
williamr@2
|
41 |
@param aInterfaceSelector The interface selector. The client must have
|
williamr@2
|
42 |
created one of these first.
|
williamr@2
|
43 |
@param aObserver The observer of this interface.
|
williamr@2
|
44 |
@return A new CRemConAbsVolTarget, owned by the interface selector.
|
williamr@2
|
45 |
*/
|
williamr@2
|
46 |
IMPORT_C static CRemConAbsVolTarget* NewL(CRemConInterfaceSelector& aInterfaceSelector,
|
williamr@2
|
47 |
MRemConAbsVolTargetObserver& aObserver);
|
williamr@2
|
48 |
|
williamr@2
|
49 |
/** Destructor. */
|
williamr@2
|
50 |
IMPORT_C ~CRemConAbsVolTarget();
|
williamr@2
|
51 |
|
williamr@2
|
52 |
public:
|
williamr@2
|
53 |
/**
|
williamr@2
|
54 |
Sends a response to a 'get absolute volume' command.
|
williamr@2
|
55 |
Only one response per target session can be outstanding at any one time.
|
williamr@2
|
56 |
@param aStatus Used by RemCon to indicate completion of the send request.
|
williamr@2
|
57 |
@param aAbsVol The volume, on a scale of 0 to aMaxVol.
|
williamr@2
|
58 |
@param aMaxVol The maximum volume, to which aAbsVol is relative.
|
williamr@2
|
59 |
@param aError The response error.
|
williamr@2
|
60 |
*/
|
williamr@2
|
61 |
IMPORT_C void GetAbsoluteVolumeResponse(TRequestStatus& aStatus,
|
williamr@2
|
62 |
TUint aAbsVol,
|
williamr@2
|
63 |
TUint aMaxVol,
|
williamr@2
|
64 |
TInt aError);
|
williamr@2
|
65 |
|
williamr@2
|
66 |
/**
|
williamr@2
|
67 |
Sends a response to a 'set absolute volume' command.
|
williamr@2
|
68 |
Only one response per target session can be outstanding at any one time.
|
williamr@2
|
69 |
@param aStatus Used by RemCon to indicate completion of the request.
|
williamr@2
|
70 |
@param aError The response error.
|
williamr@2
|
71 |
*/
|
williamr@2
|
72 |
IMPORT_C void SetAbsoluteVolumeResponse(TRequestStatus& aStatus,
|
williamr@2
|
73 |
TInt aError);
|
williamr@2
|
74 |
|
williamr@2
|
75 |
private:
|
williamr@2
|
76 |
/**
|
williamr@2
|
77 |
Constructor.
|
williamr@2
|
78 |
@param aInterfaceSelector The interface selector.
|
williamr@2
|
79 |
@param aObserver The observer of this interface.
|
williamr@2
|
80 |
*/
|
williamr@2
|
81 |
CRemConAbsVolTarget(CRemConInterfaceSelector& aInterfaceSelector,
|
williamr@2
|
82 |
MRemConAbsVolTargetObserver& aObserver);
|
williamr@2
|
83 |
|
williamr@2
|
84 |
private: // from CRemConInterfaceBase
|
williamr@2
|
85 |
TAny* GetInterfaceIf(TUid aUid);
|
williamr@2
|
86 |
|
williamr@2
|
87 |
private: // from MRemConInterfaceIf
|
williamr@2
|
88 |
void MrcibNewMessage(TUint aOperationId, const TDesC8& aData);
|
williamr@2
|
89 |
|
williamr@2
|
90 |
private: // unowned
|
williamr@2
|
91 |
MRemConAbsVolTargetObserver& iObserver;
|
williamr@2
|
92 |
|
williamr@2
|
93 |
private: // owned
|
williamr@2
|
94 |
// For operation-specific data.
|
williamr@2
|
95 |
static const TUint KMaxOperationDataSize = 0x20;
|
williamr@2
|
96 |
TBuf8<KMaxOperationDataSize> iOutData;
|
williamr@2
|
97 |
|
williamr@2
|
98 |
// not used by this class, but required for calling RRemCon::Send ...
|
williamr@2
|
99 |
TUint iNumRemotes;
|
williamr@2
|
100 |
|
williamr@2
|
101 |
};
|
williamr@2
|
102 |
|
williamr@2
|
103 |
#endif // REMCONABSVOLTARGET_H
|