1 // Copyright (c) 2007-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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
24 #ifndef REMCONMEDIAINFORMATIONTARGET_H
25 #define REMCONMEDIAINFORMATIONTARGET_H
28 #include <remcon/remconinterfacebase.h>
29 #include <remcon/remconinterfaceif.h>
30 #include <remcon/mediainformation.h>
31 #include <remconmediainformationtargetobserver.h>
33 class CRemConInterfaceSelector;
35 NONSHARABLE_CLASS(CRemConMediaInformationQueuedMessage): public CBase
38 static CRemConMediaInformationQueuedMessage* NewL(const TDesC8& aData);
39 ~CRemConMediaInformationQueuedMessage();
43 CRemConMediaInformationQueuedMessage();
44 void ConstructL(const TDesC8& aData);
52 Client-instantiable type supporting sending media information.
54 NONSHARABLE_CLASS(CRemConMediaInformationTarget) : public CRemConInterfaceBase,
55 public MRemConInterfaceIf
61 @param aInterfaceSelector The interface selector. The client must have
62 created one of these first.
63 @param aObserver The observer of this interface.
64 @return A new CRemConMediaInformationTarget, owned by the interface selector.
66 IMPORT_C static CRemConMediaInformationTarget* NewL(CRemConInterfaceSelector& aInterfaceSelector,
67 MRemConMediaInformationTargetObserver& aObserver);
70 IMPORT_C ~CRemConMediaInformationTarget();
73 /** Called by the client in response to a MrcmitoGetCurrentlyPlayingMetadata() call.
74 Each call provides one of the attribute values requested.
75 This is repeatedly called until all attributes requested have been supplied and then followed by Completed().
76 @param aAttribute The ID of the attribute supplied.
77 @param aValue A reference to a descriptor containing the attribute data.
78 This must be valid until Completed() has been called.
79 @see MRemConMediaInformationTargetObserver::MrcmitoGetCurrentlyPlayingMetadata()
80 @see CRemConMediaInformationTarget::Completed()
82 IMPORT_C TInt AttributeValue( TMediaAttributeId aAttributeId, TDesC8& aAttributeData);
84 /** Signal that all attributes requested by MrcmitoGetCurrentlyPlayingMetadata() have been supplied
85 using the AttributeValue() method.
86 @see MRemConMediaInformationTargetObserver::MrcmitoGetCurrentlyPlayingMetadata()
87 @see CRemConMediaInformationTarget::AttributeValue()
89 IMPORT_C void Completed();
94 @param aInterfaceSelector The interface selector.
95 @param aObserver The observer of this interface.
97 CRemConMediaInformationTarget(CRemConInterfaceSelector& aInterfaceSelector,
98 MRemConMediaInformationTargetObserver& aObserver);
102 private: // from CRemConInterfaceBase
103 TAny* GetInterfaceIf(TUid aUid);
105 private: // from MRemConInterfaceIf
106 void MrcibNewMessage(TUint aOperationId, const TDesC8& aData);
109 void SendError(TInt aError);
110 void ProcessMessage(const TDesC8& aData);
112 static int NextMessageCb(TAny* aThis);
113 void DoNextMessage();
115 MRemConMediaInformationTargetObserver& iObserver;
118 RRemConGetElementAttributesResponse iResponse;
120 RArray<TMediaAttributeId> iMediaAttributeIDs;
121 TMediaAttributeIter iAttributeIterator;
123 TSglQue<CRemConMediaInformationQueuedMessage> iMsgQueue;
125 CAsyncCallBack* iNextMessageCallBack;
128 #endif // REMCONMEDIAINFORMATIONTARGET_H