1 remcontrackinfocontroller.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 REMCONTRACKINFOCONTROLLER_H |
|
25 #define REMCONTRACKINFOCONTROLLER_H |
|
26 |
|
27 #include <e32base.h> |
|
28 #include <remcon/remconinterfacebase.h> |
|
29 #include <remcon/remconinterfaceif.h> |
|
30 |
|
31 class MRemConTrackInfoControllerObserver; |
|
32 class CRemConInterfaceSelector; |
|
33 |
|
34 /** |
|
35 Client-instantiable type supporting sending TrackInfo API commands. |
|
36 */ |
|
37 NONSHARABLE_CLASS(CRemConTrackInfoController) : 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 CRemConTrackInfoController, owned by the interface selector. |
|
47 */ |
|
48 IMPORT_C static CRemConTrackInfoController* NewL(CRemConInterfaceSelector& aInterfaceSelector, |
|
49 MRemConTrackInfoControllerObserver& aObserver); |
|
50 |
|
51 /** Destructor. */ |
|
52 IMPORT_C ~CRemConTrackInfoController(); |
|
53 |
|
54 public: |
|
55 /** |
|
56 Sends a 'set track name' command. |
|
57 Only one command per controller 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 aNumRemotes On success, will contain the number of remotes the |
|
61 command was sent to. |
|
62 @panic USER 23, if the length of aTrackName is greater than 58 Characters. |
|
63 */ |
|
64 IMPORT_C void SetTrackName(TRequestStatus& aStatus, const TDesC& aTrackName, TUint& aNumRemotes); |
|
65 |
|
66 /** |
|
67 The following section of code is included to allow internal back to back |
|
68 testing of this component within Symbian Software Ltd. It will only be |
|
69 compiled in specially configured test builds. It will never be available |
|
70 in any release and so should never be used outside of Symbian owned test |
|
71 code. |
|
72 */ |
|
73 #ifdef SYMBIAN_ENABLE_TRACKINFO_BACKTOBACK_TEST_FUNCT |
|
74 /** |
|
75 This method is only available in specially configured test builds and will |
|
76 not be found in any released code. |
|
77 @internalTechnology |
|
78 */ |
|
79 IMPORT_C void GetTrackName(TRequestStatus& aStatus, TUint& aNumRemotes); |
|
80 |
|
81 /** |
|
82 This method is only available in specially configured test builds and will |
|
83 not be found in any released code. |
|
84 @internalTechnology |
|
85 */ |
|
86 IMPORT_C void GetArtist(TRequestStatus& aStatus, TUint& aNumRemotes); |
|
87 |
|
88 /** |
|
89 This method is only available in specially configured test builds and will |
|
90 not be found in any released code. |
|
91 @internalTechnology |
|
92 */ |
|
93 IMPORT_C void GetTrackDuration(TRequestStatus& aStatus, TUint& aNumRemotes); |
|
94 |
|
95 private: |
|
96 /** |
|
97 This method is only available in specially configured test builds and will |
|
98 not be found in any released code. |
|
99 */ |
|
100 void HandleGetTrackNameResponse(TInt aError, const TDesC8& aData); |
|
101 |
|
102 /** |
|
103 This method is only available in specially configured test builds and will |
|
104 not be found in any released code. |
|
105 */ |
|
106 void HandleGetArtistResponse(TInt aError, const TDesC8& aData); |
|
107 |
|
108 /** |
|
109 This method is only available in specially configured test builds and will |
|
110 not be found in any released code. |
|
111 */ |
|
112 void HandleGetTrackDurationResponse(TInt aError, const TDesC8& aData); |
|
113 #endif //SYMBIAN_ENABLE_TRACKINFO_BACKTOBACK_TEST_FUNCT |
|
114 |
|
115 private: |
|
116 /** |
|
117 Constructor. |
|
118 @param aInterfaceSelector The interface selector. |
|
119 @param aObserver The observer of this interface. |
|
120 */ |
|
121 CRemConTrackInfoController(CRemConInterfaceSelector& aInterfaceSelector, |
|
122 MRemConTrackInfoControllerObserver& aObserver); |
|
123 |
|
124 private: // from CRemConInterfaceBase |
|
125 TAny* GetInterfaceIf(TUid aUid); |
|
126 |
|
127 private: // from MRemConInterfaceIf |
|
128 void MrcibNewMessage(TUint aOperationId, const TDesC8& aData); |
|
129 |
|
130 private: // unowned |
|
131 MRemConTrackInfoControllerObserver& iObserver; |
|
132 |
|
133 private: // owned |
|
134 TBuf8<KMaxName> iOutData; |
|
135 }; |
|
136 |
|
137 #endif // REMCONTRACKINFOCONTROLLER_H |