|
1 /* |
|
2 * Copyright (c) 2005-2006 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Browsing adapter between RemCon an MPX Framework. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef BTRCCBROWSINGADAPTER_H_ |
|
20 #define BTRCCBROWSINGADAPTER_H_ |
|
21 |
|
22 // INCLUDES |
|
23 #include <remcondatabaseawaremedialibrarybrowseobserver.h> |
|
24 #include <remcondatabaseawarenowplayingbrowseobserver.h> |
|
25 #include <remcondatabaseawaremediabrowsetarget.h> |
|
26 #include <mpxcollectionutility.h> |
|
27 #include <mpxcollectionpath.h> |
|
28 |
|
29 // DATA TYPES |
|
30 |
|
31 // FORWARD DECLARATIONS |
|
32 class CRemConInterfaceSelector; |
|
33 |
|
34 // CLASS DECLARATION |
|
35 |
|
36 |
|
37 NONSHARABLE_CLASS(CBTRCCBrowsingAdapter) : |
|
38 public MRemConDatabaseAwareMediaLibraryBrowseObserver, |
|
39 public MRemConDatabaseAwareNowPlayingBrowseObserver, |
|
40 public MMPXCollectionObserver |
|
41 { |
|
42 public: // Constructors and destructor |
|
43 /** |
|
44 * Two-phased constructor. |
|
45 * |
|
46 */ |
|
47 static CBTRCCBrowsingAdapter* NewL(CRemConInterfaceSelector& aInterfaceSelector); |
|
48 |
|
49 /** |
|
50 * Destructor. |
|
51 */ |
|
52 virtual ~CBTRCCBrowsingAdapter(); |
|
53 |
|
54 |
|
55 private: |
|
56 /** |
|
57 * C++ default constructor. |
|
58 */ |
|
59 CBTRCCBrowsingAdapter(); |
|
60 |
|
61 /** |
|
62 * Symbian 2nd phase constructor. |
|
63 */ |
|
64 void ConstructL(CRemConInterfaceSelector& aInterfaceSelector); |
|
65 |
|
66 private: // From MRemConDatabaseAwareMediaLibraryBrowseObserver |
|
67 void MrcdamlboGetFolderListing(TRemConFolderScope aScope, TUint aStartItem, TUint aEndItem); |
|
68 TInt MrcdamlboGetItem(TRemConFolderScope aScope, |
|
69 const TRemConItemUid& aItemId, |
|
70 TMediaAttributeIter& aIter, |
|
71 TUint16 aMediaLibraryStateCookie); |
|
72 void MrcdamlboFolderUp(TUint16 aMediaLibraryStateCookie); |
|
73 void MrcdamlboFolderDown(const TRemConItemUid& aFolder, TUint16 aMediaLibraryStateCookie); |
|
74 void MrcdamlboGetPath(RPointerArray<HBufC8>& aPath); |
|
75 void MrcdamlboSearch(const TDesC8& aSearch); |
|
76 |
|
77 private: // From MRemConDatabaseAwareNowPlayingBrowseObserver |
|
78 void MrcdanpboGetFolderListing(TUint aStartItem, TUint aEndItem); |
|
79 TInt MrcdanpboGetItem(const TRemConItemUid& aItemId, TMediaAttributeIter& aIter, TUint16 aMediaLibraryStateCookie); |
|
80 |
|
81 private: // From MMPXCollectionObserver |
|
82 void HandleCollectionMessage(CMPXMessage* aMsg, TInt /*aErr*/); |
|
83 void HandleOpenL(const CMPXMedia& aEntries, TInt aIndex,TBool aComplete,TInt aError); |
|
84 void HandleOpenL(const CMPXCollectionPlaylist& aPlaylist,TInt aError); |
|
85 void HandleCommandComplete(CMPXCommand* /*aCommandResult*/, TInt /*aError*/); |
|
86 |
|
87 private: // From MMPXCollectionMediaObserver |
|
88 void HandleCollectionMediaL(const CMPXMedia& aMedia, TInt aError); |
|
89 |
|
90 private: |
|
91 void SubscribeL(); |
|
92 |
|
93 private: |
|
94 enum TMediaLOpcode |
|
95 { |
|
96 EMediaLOpIdle, |
|
97 EMediaLOpFolderListing |
|
98 }; |
|
99 |
|
100 enum TOpenLOpcode |
|
101 { |
|
102 EOpenLOpIdle, |
|
103 EOpenLOpOpen |
|
104 }; |
|
105 |
|
106 private: // Data |
|
107 CRemConDatabaseAwareMediaBrowseTarget* iMediaBrowseTarget; |
|
108 MRemConDatabaseAwareMediaLibraryBrowse* iMlInterface; |
|
109 MRemConDatabaseAwareNowPlayingBrowse* iNpInterface; |
|
110 |
|
111 MMPXCollectionUtility* iCollectionUtility; |
|
112 |
|
113 TUint16 iCookie; |
|
114 TMediaLOpcode iCurrentMediaLOp; // current MediaL operation |
|
115 TOpenLOpcode iCurrentOpenLOp; // current OpenL operation |
|
116 }; |
|
117 |
|
118 #endif /* BTRCCBROWSINGADAPTER_H_ */ |