williamr@2: /* williamr@2: * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * 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 williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef MCLFCONTENTLISTINGENGINE_H williamr@2: #define MCLFCONTENTLISTINGENGINE_H williamr@2: williamr@2: // INCLUDES williamr@2: #include williamr@2: #include williamr@2: williamr@2: // FORWARD DECLARATIONS williamr@2: class MCLFContentListingEngineExt; williamr@2: class MCLFChangedItemObserver; williamr@2: class MCLFItemListModel; williamr@2: class MCLFOperationObserver; williamr@2: class TResourceReader; williamr@2: class MCLFProcessObserver; williamr@2: williamr@2: // CLASS DECLARATION williamr@2: williamr@2: /** williamr@2: * Content Listing Engine. williamr@2: * With Content Listing Engine, client can create item list models, williamr@2: * add an observer to get notifications of changed items and williamr@2: * send update notifications to server. williamr@2: * Client can create an instance this class with ContentListingFactory.

williamr@2: * Usage: williamr@2: * williamr@2: * @code williamr@2: * williamr@2: * // Create a new instance with Content Listing Factory williamr@2: * MCLFContentListingEngine* engine = williamr@2: * ContentListingFactory::NewContentListingEngineLC(); williamr@2: * williamr@2: * // Add changed item observer williamr@2: * engine->AddChangedItemObserverL( *myObserver ); williamr@2: * williamr@2: * // Send update notification when item is changed. williamr@2: * engine->UpdateItemsL(); williamr@2: * williamr@2: * // Remember to remove the observer, when it is deleted williamr@2: * engine->RemoveChangedItemObserver( *myObserver ); williamr@2: * williamr@2: * @endcode williamr@2: * williamr@2: * @lib ContentListingFramework.lib williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: class MCLFContentListingEngine williamr@2: { williamr@2: public: // Constructors and destructor williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: virtual ~MCLFContentListingEngine() {} williamr@2: williamr@2: public: // New functions williamr@2: williamr@2: /** williamr@2: * Create a new instance of the Item List Model. williamr@2: * @since S60 3.1 williamr@2: * @param aObserver Reference to an Operation Observer williamr@2: * @return New instance of the Item List Model. williamr@2: * Ownership is transfered to the client application. williamr@2: */ williamr@2: virtual MCLFItemListModel* CreateListModelLC( williamr@2: MCLFOperationObserver& aObserver ) = 0; williamr@2: williamr@2: /** williamr@2: * Create a new instance of Item List Model from the application williamr@2: * resource. williamr@2: * @since S60 3.1 williamr@2: * @param aObserver Reference to an Operation Observer. williamr@2: * @param aResource Resource reader to list model resource. williamr@2: * Use resource struct CLF_LIST_MODEL. See williamr@2: * CLFContentListing.rh williamr@2: * @return New instance of Item List Model. williamr@2: * Ownership is transfered to the client application. williamr@2: */ williamr@2: virtual MCLFItemListModel* CreateListModelLC( williamr@2: MCLFOperationObserver& aObserver, williamr@2: TResourceReader& aResource ) = 0; williamr@2: williamr@2: /** williamr@2: * Add a changed item observer to the Engine. williamr@2: * Changed item observer will notify you when items are changed, added williamr@2: * or removed. Remember to remove the observer before you delete williamr@2: * observer object. williamr@2: * @since S60 3.1 williamr@2: * @param aObserver Changed item observer to be added williamr@2: */ williamr@2: virtual void AddChangedItemObserverL( williamr@2: MCLFChangedItemObserver& aObserver ) = 0; williamr@2: williamr@2: /** williamr@2: * Remove a changed item observer from the Engine. williamr@2: * @since S60 3.1 williamr@2: * @param aObserver Changed item observer to be removed williamr@2: */ williamr@2: virtual void RemoveChangedItemObserver( williamr@2: MCLFChangedItemObserver& aObserver ) = 0; williamr@2: williamr@2: /** williamr@2: * Add CLF process observer. williamr@2: * Remember to remove the observer before delete the observer object. williamr@2: * @since S60 3.1 williamr@2: * @param aObserver Process observer to be added williamr@2: */ williamr@2: virtual void AddCLFProcessObserverL( williamr@2: MCLFProcessObserver& aObserver ) = 0; williamr@2: williamr@2: /** williamr@2: * Remove CLF process observer. williamr@2: * @since S60 3.1 williamr@2: * @param aObserver Process observer to be removed williamr@2: */ williamr@2: virtual void RemoveCLFProcessObserver( williamr@2: MCLFProcessObserver& aObserver ) = 0; williamr@2: williamr@2: /** williamr@2: * Send item update notification. williamr@2: * Client must use this method when media item(s) is changed or deleted. williamr@2: * This method call will request the CLF server to update its list williamr@2: * of items. Unneccesary update notifications should be avoided because williamr@2: * they generate load to the system! williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: virtual void UpdateItemsL() = 0; williamr@2: williamr@2: /** williamr@2: * Send item update notification. williamr@2: * Client must use this method when media item(s) is changed or deleted. williamr@2: * This method call will request the CLF server to update items that are williamr@2: * defined in the TArray. williamr@2: * @since S60 3.1 williamr@2: * @param aItemIDArray List of Item IDs of modified items williamr@2: */ williamr@2: virtual void UpdateItemsL( williamr@2: const TArray& aItemIDArray ) = 0; williamr@2: williamr@2: /** williamr@2: * Send item update notification. williamr@2: * Client must use this method when media item(s) is changed or deleted. williamr@2: * @param aSemanticId Sematic ID is transfered to server plugins williamr@2: * @param aOpaqueData Opaque data is transfered to server plugins williamr@2: * @since S60 3.1 williamr@2: */ williamr@2: virtual void UpdateItemsL( williamr@2: TInt aSemanticId, williamr@2: const TDesC8& aOpaqueData ) = 0; williamr@2: williamr@2: private: // Extension interface williamr@2: williamr@2: /** williamr@2: * This member is internal and not intended for use. williamr@2: */ williamr@2: virtual MCLFContentListingEngineExt* Extension() { return NULL; } williamr@2: williamr@2: }; williamr@2: williamr@2: #endif // MCLFCONTENTLISTINGENGINE_H williamr@2: williamr@2: // End of File