1 remcontrackinfotarget.h |
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 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". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 |
|
17 |
|
18 /** |
|
19 @file |
|
20 @publishedAll |
|
21 @released |
|
22 */ |
|
23 |
|
24 #ifndef REMCONTRACKINFOTARGET_H |
|
25 #define REMCONTRACKINFOTARGET_H |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <remcon/remconinterfacebase.h> |
|
29 #include <remcon/remconinterfaceif.h> |
|
30 |
|
31 class MRemConTrackInfoTargetObserver; |
|
32 class CRemConInterfaceSelector; |
|
33 |
|
34 /** |
|
35 Client-instantiable type supporting sending TrackInfo API responses. |
|
36 */ |
|
37 NONSHARABLE_CLASS(CRemConTrackInfoTarget) : public CRemConInterfaceBase, |
|
38 public MRemConInterfaceIf |
|
39 { |
|
40 public: |
|
41 /** |
|
42 Factory function. |
|
43 @param aInterfaceSelector The interface selector. The client must have |
|
44 created one of these first. |
|
45 @param aObserver The observer of this interface. |
|
46 @return A new CRemConTrackInfoTarget, owned by the interface selector. |
|
47 */ |
|
48 IMPORT_C static CRemConTrackInfoTarget* NewL(CRemConInterfaceSelector& aInterfaceSelector, |
|
49 MRemConTrackInfoTargetObserver& aObserver); |
|
50 |
|
51 /** Destructor. */ |
|
52 IMPORT_C ~CRemConTrackInfoTarget(); |
|
53 |
|
54 public: |
|
55 /** |
|
56 Sends a response to a 'get track name' command. |
|
57 Only one response per target session can be outstanding at any one time. |
|
58 @param aStatus Used by RemCon to indicate completion of the send request. |
|
59 @param aTrackName The track name. |
|
60 @param aError The response error. |
|
61 @panic USER 23, if the length of aTrackName is greater than 58 Characters. |
|
62 */ |
|
63 IMPORT_C void GetTrackNameResponse(TRequestStatus& aStatus, |
|
64 const TDesC& aTrackName, |
|
65 TInt aError); |
|
66 |
|
67 /** |
|
68 Sends a response to a 'get artist' command. |
|
69 Only one response per target session can be outstanding at any one time. |
|
70 @param aStatus Used by RemCon to indicate completion of the send request. |
|
71 @param aArtist The artist. |
|
72 @param aError The response error. |
|
73 @panic USER 23, if the length of aArtist is greater than 58 Characters. |
|
74 */ |
|
75 IMPORT_C void GetArtistResponse(TRequestStatus& aStatus, |
|
76 const TDesC& aArtist, |
|
77 TInt aError); |
|
78 |
|
79 /** |
|
80 Sends a response to a 'get track duration' command. |
|
81 Only one response per target session can be outstanding at any one time. |
|
82 @param aStatus Used by RemCon to indicate completion of the send request. |
|
83 @param aDuration The duration. |
|
84 @param aError The response error. |
|
85 */ |
|
86 IMPORT_C void GetTrackDurationResponse(TRequestStatus& aStatus, |
|
87 const TTime& aDuration, |
|
88 TInt aError); |
|
89 |
|
90 /** |
|
91 The following section of code is included to allow internal back to back |
|
92 testing of this component within Symbian Software Ltd. It will only be |
|
93 compiled in specially configured test builds. It will never be available |
|
94 in any release and so should never be used outside of Symbian owned test |
|
95 code. |
|
96 */ |
|
97 #ifdef SYMBIAN_ENABLE_TRACKINFO_BACKTOBACK_TEST_FUNCT |
|
98 /** |
|
99 This method is only available in specially configured test builds and will |
|
100 not be found in any released code. |
|
101 @internalTechnology |
|
102 */ |
|
103 IMPORT_C void SetTrackNameResponse(TRequestStatus& aStatus, |
|
104 TInt aError); |
|
105 |
|
106 private: |
|
107 /** |
|
108 This method is only available in specially configured test builds and will |
|
109 not be found in any released code. |
|
110 */ |
|
111 void HandleSetTrackName(const TDesC8& aData); |
|
112 #endif //SYMBIAN_ENABLE_TRACKINFO_BACKTOBACK_TEST_FUNCT |
|
113 |
|
114 private: |
|
115 /** |
|
116 Constructor. |
|
117 @param aInterfaceSelector The interface selector. |
|
118 @param aObserver The observer of this interface. |
|
119 */ |
|
120 CRemConTrackInfoTarget(CRemConInterfaceSelector& aInterfaceSelector, |
|
121 MRemConTrackInfoTargetObserver& aObserver); |
|
122 |
|
123 private: // from CRemConInterfaceBase |
|
124 TAny* GetInterfaceIf(TUid aUid); |
|
125 |
|
126 private: // from MRemConInterfaceIf |
|
127 void MrcibNewMessage(TUint aOperationId, const TDesC8& aData); |
|
128 |
|
129 private: // unowned |
|
130 MRemConTrackInfoTargetObserver& iObserver; |
|
131 |
|
132 private: // owned |
|
133 // For operation-specific data. |
|
134 TBuf8<KMaxName> iOutData; |
|
135 |
|
136 // not used by this class, but required for calling RRemCon::Send ... |
|
137 TUint iNumRemotes; |
|
138 |
|
139 }; |
|
140 |
|
141 #endif // REMCONTRACKINFOTARGET_H |