1 // Copyright (c) 2008-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 "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
25 #include <remconmediabrowsetypes.h>
27 #ifndef REMCONDATABASEAWAREMEDIALIBRARYBROWSEOBSERVER_H
28 #define REMCONDATABASEAWAREMEDIALIBRARYBROWSEOBSERVER_H
30 NONSHARABLE_CLASS(MRemConDatabaseAwareMediaLibraryBrowseObserver)
34 This requests a list of the items present in a folder. No metadata is
35 requested, that can be retrieved separately on a per item basis.
37 The result should be returned via a call to
38 MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderListing(). And
39 the ordering should be as shown locally, but should list folders before
42 @param aScope The scope in which the folder listing is made.
43 This indicates which listing should be returned. If the scope is
44 EBrowseFolder then the contents of the current browsed folder
45 should be returned. If it is the ESearchResultFolder scope then
46 the contents of the folder populated by the last search should be
49 @param aStartItem The offset into the folder listing of the first item to
50 retrieve. If there is no media available at this offset the error
51 KErrMediaBrowseInvalidOffset should be returned via the result call
52 to MrcdamlbFolderListing().
54 @param aEndItem The offset into the folder listing of the final item to
55 retrieve. If this is beyond the end of the folder listing then the
56 items from the aStartItem offset to the end of the listing should
57 be returned via the result call to MrcdamlbFolderListing().
59 virtual void MrcdamlboGetFolderListing(TRemConFolderScope aScope,
64 Requests a specific item which may be a folder item or a media element
67 If it returns KErrNone the client must return the metadata for the
68 requested item through the response function either
69 MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderItemResult()
71 MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbMediaElementItemResult()
72 according to the item type which is a folder item or media element item.
73 If it is unable to process this call then it can return error but not
74 call the response function.
76 @param aScope The scope in which the item is present. If the scope is
77 EBrowseFolder then the item is present in the media library's
78 virtual filesystem. If it is the ESearchResultFolder scope then the
79 item is present in the current set of search results.
81 @param aItemId The UID for the requested Item.
83 @param aIter An iterator for TMediaAttributeIds containing a list of
84 TMediaAttributeIds requested by the controller. It is intended for
85 the media element item, so omit it if the item is a folder item.
87 @param aMediaLibraryStateCookie The cookie which the remote device
88 believes refers to the current state of the media library. If this
89 does not match the current state according to the client then the
91 MrcdamlbFolderItemResult() or MrcdamlbMediaElementItemResult() to
92 return the error KErrInvalidMediaLibraryStateCookie according it
93 is a folder item or a media element item.
94 @return The call back result.
95 - KErrNone If success.
96 - The appropriate error code.
98 virtual TInt MrcdamlboGetItem(TRemConFolderScope aScope,
99 const TRemConItemUid& aItemId,
100 TMediaAttributeIter& aIter,
101 TUint16 aMediaLibraryStateCookie) = 0;
104 This requests that the current position within the folder heirarchy is
105 moved to the next folder up.
107 The result of this operation must be returned via a call to
108 MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderUpResult.
110 @param aMediaLibraryStateCookie The cookie which the remote device
111 believes refers to the current state of the media library. If this
112 does not match the current state according to the client then the
114 MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderUpResult with
115 the error KErrInvalidMediaLibraryStateCookie.
117 virtual void MrcdamlboFolderUp(TUint16 aMediaLibraryStateCookie) = 0;
120 This requests that the current position within the folder hierarchy is
121 moved to the child folder of the current folder specified by aFolder.
123 The result of this operation must be returned via a call to
124 MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderDownResult.
126 @param aFolder The child folder to change into.
128 @param aMediaLibraryStateCookie The cookie which the remote device
129 believes refers to the current state of the media library. If this
130 does not match the current state according to the client then the
132 MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderDownResult()
133 with the error KErrInvalidMediaLibraryStateCookie.
135 virtual void MrcdamlboFolderDown(const TRemConItemUid& aFolder,
136 TUint16 aMediaLibraryStateCookie) = 0;
139 This requests the current path.
141 The client is responsible for appending items to the array then call
142 MrcdamlbGetPathResult() when completed. Once the item is appended in the
143 array the ownership of the item is taken so the client should keep the
144 item valid and never destroy the item. If the client can append the items
145 successfully then it should return a result via MrcdamlbGetPathResult().
146 If the client appends some items to the array but then fails to append all
147 the items then it should return an error via MrcdamlbGetPathResult().
149 @see MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbGetPathResult()
151 @param aPath The current path.
152 Each entry in the array in one level of the path. For example the
153 path /A/B/C would be provided as:
157 All string are in UTF-8.
159 virtual void MrcdamlboGetPath(RPointerArray<HBufC8>& aPath) = 0;
162 Perform a search in the current location for items
163 matching the search string.
165 @param aSearch The string to search on in UTF-8. The client can use it until
166 the client has called MrcdamlbSearchResult().
168 @see MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbSearchResult()
170 virtual void MrcdamlboSearch(const TDesC8& aSearch) = 0;
174 #endif // REMCONDATABASEAWAREMEDIALIBRARYBROWSEOBSERVER_H