williamr@4: // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@4: // All rights reserved. williamr@4: // This component and the accompanying materials are made available williamr@4: // under the terms of "Eclipse Public License v1.0" williamr@4: // which accompanies this distribution, and is available williamr@4: // at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: // williamr@4: // Initial Contributors: williamr@4: // Nokia Corporation - initial contribution. williamr@4: // williamr@4: // Contributors: williamr@4: // williamr@4: // Description: williamr@4: // williamr@4: williamr@4: williamr@4: williamr@4: /** williamr@4: @file williamr@4: @publishedAll williamr@4: @released williamr@4: */ williamr@4: williamr@4: #include williamr@4: #include williamr@4: williamr@4: #ifndef REMCONDATABASEAWAREMEDIALIBRARYBROWSEOBSERVER_H williamr@4: #define REMCONDATABASEAWAREMEDIALIBRARYBROWSEOBSERVER_H williamr@4: williamr@4: NONSHARABLE_CLASS(MRemConDatabaseAwareMediaLibraryBrowseObserver) williamr@4: { williamr@4: public: williamr@4: /** williamr@4: This requests a list of the items present in a folder. No metadata is williamr@4: requested, that can be retrieved separately on a per item basis. williamr@4: williamr@4: The result should be returned via a call to williamr@4: MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderListing(). And williamr@4: the ordering should be as shown locally, but should list folders before williamr@4: media element items. williamr@4: williamr@4: @param aScope The scope in which the folder listing is made. williamr@4: This indicates which listing should be returned. If the scope is williamr@4: EBrowseFolder then the contents of the current browsed folder williamr@4: should be returned. If it is the ESearchResultFolder scope then williamr@4: the contents of the folder populated by the last search should be williamr@4: returned. williamr@4: williamr@4: @param aStartItem The offset into the folder listing of the first item to williamr@4: retrieve. If there is no media available at this offset the error williamr@4: KErrMediaBrowseInvalidOffset should be returned via the result call williamr@4: to MrcdamlbFolderListing(). williamr@4: williamr@4: @param aEndItem The offset into the folder listing of the final item to williamr@4: retrieve. If this is beyond the end of the folder listing then the williamr@4: items from the aStartItem offset to the end of the listing should williamr@4: be returned via the result call to MrcdamlbFolderListing(). williamr@4: */ williamr@4: virtual void MrcdamlboGetFolderListing(TRemConFolderScope aScope, williamr@4: TUint aStartItem, williamr@4: TUint aEndItem) = 0; williamr@4: williamr@4: /** williamr@4: Requests a specific item which may be a folder item or a media element williamr@4: item. williamr@4: williamr@4: If it returns KErrNone the client must return the metadata for the williamr@4: requested item through the response function either williamr@4: MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderItemResult() williamr@4: or williamr@4: MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbMediaElementItemResult() williamr@4: according to the item type which is a folder item or media element item. williamr@4: If it is unable to process this call then it can return error but not williamr@4: call the response function. williamr@4: williamr@4: @param aScope The scope in which the item is present. If the scope is williamr@4: EBrowseFolder then the item is present in the media library's williamr@4: virtual filesystem. If it is the ESearchResultFolder scope then the williamr@4: item is present in the current set of search results. williamr@4: williamr@4: @param aItemId The UID for the requested Item. williamr@4: williamr@4: @param aIter An iterator for TMediaAttributeIds containing a list of williamr@4: TMediaAttributeIds requested by the controller. It is intended for williamr@4: the media element item, so omit it if the item is a folder item. williamr@4: williamr@4: @param aMediaLibraryStateCookie The cookie which the remote device williamr@4: believes refers to the current state of the media library. If this williamr@4: does not match the current state according to the client then the williamr@4: client shall call williamr@4: MrcdamlbFolderItemResult() or MrcdamlbMediaElementItemResult() to williamr@4: return the error KErrInvalidMediaLibraryStateCookie according it williamr@4: is a folder item or a media element item. williamr@4: @return The call back result. williamr@4: - KErrNone If success. williamr@4: - The appropriate error code. williamr@4: */ williamr@4: virtual TInt MrcdamlboGetItem(TRemConFolderScope aScope, williamr@4: const TRemConItemUid& aItemId, williamr@4: TMediaAttributeIter& aIter, williamr@4: TUint16 aMediaLibraryStateCookie) = 0; williamr@4: williamr@4: /** williamr@4: This requests that the current position within the folder heirarchy is williamr@4: moved to the next folder up. williamr@4: williamr@4: The result of this operation must be returned via a call to williamr@4: MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderUpResult. williamr@4: williamr@4: @param aMediaLibraryStateCookie The cookie which the remote device williamr@4: believes refers to the current state of the media library. If this williamr@4: does not match the current state according to the client then the williamr@4: client should call williamr@4: MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderUpResult with williamr@4: the error KErrInvalidMediaLibraryStateCookie. williamr@4: */ williamr@4: virtual void MrcdamlboFolderUp(TUint16 aMediaLibraryStateCookie) = 0; williamr@4: williamr@4: /** williamr@4: This requests that the current position within the folder hierarchy is williamr@4: moved to the child folder of the current folder specified by aFolder. williamr@4: williamr@4: The result of this operation must be returned via a call to williamr@4: MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderDownResult. williamr@4: williamr@4: @param aFolder The child folder to change into. williamr@4: williamr@4: @param aMediaLibraryStateCookie The cookie which the remote device williamr@4: believes refers to the current state of the media library. If this williamr@4: does not match the current state according to the client then the williamr@4: client should call williamr@4: MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbFolderDownResult() williamr@4: with the error KErrInvalidMediaLibraryStateCookie. williamr@4: */ williamr@4: virtual void MrcdamlboFolderDown(const TRemConItemUid& aFolder, williamr@4: TUint16 aMediaLibraryStateCookie) = 0; williamr@4: williamr@4: /** williamr@4: This requests the current path. williamr@4: williamr@4: The client is responsible for appending items to the array then call williamr@4: MrcdamlbGetPathResult() when completed. Once the item is appended in the williamr@4: array the ownership of the item is taken so the client should keep the williamr@4: item valid and never destroy the item. If the client can append the items williamr@4: successfully then it should return a result via MrcdamlbGetPathResult(). williamr@4: If the client appends some items to the array but then fails to append all williamr@4: the items then it should return an error via MrcdamlbGetPathResult(). williamr@4: williamr@4: @see MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbGetPathResult() williamr@4: williamr@4: @param aPath The current path. williamr@4: Each entry in the array in one level of the path. For example the williamr@4: path /A/B/C would be provided as: williamr@4: aPath[0] 'A' williamr@4: aPath[1] 'B' williamr@4: aPath[2] 'C' williamr@4: All string are in UTF-8. williamr@4: */ williamr@4: virtual void MrcdamlboGetPath(RPointerArray& aPath) = 0; williamr@4: williamr@4: /** williamr@4: Perform a search in the current location for items williamr@4: matching the search string. williamr@4: williamr@4: @param aSearch The string to search on in UTF-8. The client can use it until williamr@4: the client has called MrcdamlbSearchResult(). williamr@4: williamr@4: @see MRemConDatabaseAwareMediaLibraryBrowse::MrcdamlbSearchResult() williamr@4: */ williamr@4: virtual void MrcdamlboSearch(const TDesC8& aSearch) = 0; williamr@4: }; williamr@4: williamr@4: williamr@4: #endif // REMCONDATABASEAWAREMEDIALIBRARYBROWSEOBSERVER_H