williamr@2
|
1 |
// Copyright (c) 2007-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 REMCONMEDIAINFORMATIONTARGET_H
|
williamr@2
|
23 |
#define REMCONMEDIAINFORMATIONTARGET_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 |
#include <remconmediainformationtargetobserver.h>
|
williamr@2
|
29 |
|
williamr@2
|
30 |
class CRemConInterfaceSelector;
|
williamr@4
|
31 |
class RRemConGetElementAttributesResponse;
|
williamr@2
|
32 |
|
williamr@2
|
33 |
NONSHARABLE_CLASS(CRemConMediaInformationQueuedMessage): public CBase
|
williamr@2
|
34 |
{
|
williamr@2
|
35 |
public:
|
williamr@2
|
36 |
static CRemConMediaInformationQueuedMessage* NewL(const TDesC8& aData);
|
williamr@2
|
37 |
~CRemConMediaInformationQueuedMessage();
|
williamr@2
|
38 |
|
williamr@2
|
39 |
const TDesC8& Data();
|
williamr@2
|
40 |
private:
|
williamr@2
|
41 |
CRemConMediaInformationQueuedMessage();
|
williamr@2
|
42 |
void ConstructL(const TDesC8& aData);
|
williamr@2
|
43 |
public:
|
williamr@2
|
44 |
TSglQueLink iLink;
|
williamr@2
|
45 |
private:
|
williamr@2
|
46 |
RBuf8 iData;
|
williamr@2
|
47 |
};
|
williamr@2
|
48 |
|
williamr@2
|
49 |
/**
|
williamr@2
|
50 |
Client-instantiable type supporting sending media information.
|
williamr@2
|
51 |
*/
|
williamr@2
|
52 |
NONSHARABLE_CLASS(CRemConMediaInformationTarget) : public CRemConInterfaceBase,
|
williamr@2
|
53 |
public MRemConInterfaceIf
|
williamr@2
|
54 |
{
|
williamr@2
|
55 |
public:
|
williamr@2
|
56 |
|
williamr@2
|
57 |
/**
|
williamr@2
|
58 |
Factory function.
|
williamr@2
|
59 |
@param aInterfaceSelector The interface selector. The client must have
|
williamr@2
|
60 |
created one of these first.
|
williamr@2
|
61 |
@param aObserver The observer of this interface.
|
williamr@2
|
62 |
@return A new CRemConMediaInformationTarget, owned by the interface selector.
|
williamr@2
|
63 |
*/
|
williamr@2
|
64 |
IMPORT_C static CRemConMediaInformationTarget* NewL(CRemConInterfaceSelector& aInterfaceSelector,
|
williamr@2
|
65 |
MRemConMediaInformationTargetObserver& aObserver);
|
williamr@2
|
66 |
|
williamr@2
|
67 |
/** Destructor */
|
williamr@2
|
68 |
IMPORT_C ~CRemConMediaInformationTarget();
|
williamr@2
|
69 |
|
williamr@2
|
70 |
public:
|
williamr@2
|
71 |
/** Called by the client in response to a MrcmitoGetCurrentlyPlayingMetadata() call.
|
williamr@2
|
72 |
Each call provides one of the attribute values requested.
|
williamr@2
|
73 |
This is repeatedly called until all attributes requested have been supplied and then followed by Completed().
|
williamr@2
|
74 |
@param aAttribute The ID of the attribute supplied.
|
williamr@2
|
75 |
@param aValue A reference to a descriptor containing the attribute data.
|
williamr@2
|
76 |
This must be valid until Completed() has been called.
|
williamr@2
|
77 |
@see MRemConMediaInformationTargetObserver::MrcmitoGetCurrentlyPlayingMetadata()
|
williamr@2
|
78 |
@see CRemConMediaInformationTarget::Completed()
|
williamr@2
|
79 |
*/
|
williamr@2
|
80 |
IMPORT_C TInt AttributeValue( TMediaAttributeId aAttributeId, TDesC8& aAttributeData);
|
williamr@2
|
81 |
|
williamr@2
|
82 |
/** Signal that all attributes requested by MrcmitoGetCurrentlyPlayingMetadata() have been supplied
|
williamr@2
|
83 |
using the AttributeValue() method.
|
williamr@2
|
84 |
@see MRemConMediaInformationTargetObserver::MrcmitoGetCurrentlyPlayingMetadata()
|
williamr@2
|
85 |
@see CRemConMediaInformationTarget::AttributeValue()
|
williamr@2
|
86 |
*/
|
williamr@2
|
87 |
IMPORT_C void Completed();
|
williamr@2
|
88 |
|
williamr@2
|
89 |
private:
|
williamr@2
|
90 |
/**
|
williamr@2
|
91 |
Constructor.
|
williamr@2
|
92 |
@param aInterfaceSelector The interface selector.
|
williamr@2
|
93 |
@param aObserver The observer of this interface.
|
williamr@2
|
94 |
*/
|
williamr@2
|
95 |
CRemConMediaInformationTarget(CRemConInterfaceSelector& aInterfaceSelector,
|
williamr@2
|
96 |
MRemConMediaInformationTargetObserver& aObserver);
|
williamr@2
|
97 |
|
williamr@2
|
98 |
void ConstructL();
|
williamr@2
|
99 |
|
williamr@2
|
100 |
private: // from CRemConInterfaceBase
|
williamr@2
|
101 |
TAny* GetInterfaceIf(TUid aUid);
|
williamr@2
|
102 |
|
williamr@2
|
103 |
private: // from MRemConInterfaceIf
|
williamr@2
|
104 |
void MrcibNewMessage(TUint aOperationId, const TDesC8& aData);
|
williamr@2
|
105 |
|
williamr@2
|
106 |
private: // utility
|
williamr@2
|
107 |
void SendError(TInt aError);
|
williamr@2
|
108 |
void ProcessMessage(const TDesC8& aData);
|
williamr@2
|
109 |
|
williamr@2
|
110 |
static int NextMessageCb(TAny* aThis);
|
williamr@2
|
111 |
void DoNextMessage();
|
williamr@2
|
112 |
private: // unowned
|
williamr@2
|
113 |
MRemConMediaInformationTargetObserver& iObserver;
|
williamr@2
|
114 |
|
williamr@2
|
115 |
private: // owned
|
williamr@4
|
116 |
RRemConGetElementAttributesResponse* iResponse;
|
williamr@2
|
117 |
|
williamr@2
|
118 |
RArray<TMediaAttributeId> iMediaAttributeIDs;
|
williamr@2
|
119 |
TMediaAttributeIter iAttributeIterator;
|
williamr@2
|
120 |
TBool iInProgress;
|
williamr@2
|
121 |
TSglQue<CRemConMediaInformationQueuedMessage> iMsgQueue;
|
williamr@2
|
122 |
|
williamr@2
|
123 |
CAsyncCallBack* iNextMessageCallBack;
|
williamr@2
|
124 |
};
|
williamr@2
|
125 |
|
williamr@2
|
126 |
#endif // REMCONMEDIAINFORMATIONTARGET_H
|