2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
19 #ifndef MCLFCONTENTLISTINGENGINE_H
20 #define MCLFCONTENTLISTINGENGINE_H
23 #include <CLFContentListing.h>
26 // FORWARD DECLARATIONS
27 class MCLFContentListingEngineExt;
28 class MCLFChangedItemObserver;
29 class MCLFItemListModel;
30 class MCLFOperationObserver;
31 class TResourceReader;
32 class MCLFProcessObserver;
37 * Content Listing Engine.
38 * With Content Listing Engine, client can create item list models,
39 * add an observer to get notifications of changed items and
40 * send update notifications to server.
41 * Client can create an instance this class with ContentListingFactory.<br><br>
46 * // Create a new instance with Content Listing Factory
47 * MCLFContentListingEngine* engine =
48 * ContentListingFactory::NewContentListingEngineLC();
50 * // Add changed item observer
51 * engine->AddChangedItemObserverL( *myObserver );
53 * // Send update notification when item is changed.
54 * engine->UpdateItemsL();
56 * // Remember to remove the observer, when it is deleted
57 * engine->RemoveChangedItemObserver( *myObserver );
61 * @lib ContentListingFramework.lib
64 class MCLFContentListingEngine
66 public: // Constructors and destructor
71 virtual ~MCLFContentListingEngine() {}
73 public: // New functions
76 * Create a new instance of the Item List Model.
78 * @param aObserver Reference to an Operation Observer
79 * @return New instance of the Item List Model.
80 * Ownership is transfered to the client application.
82 virtual MCLFItemListModel* CreateListModelLC(
83 MCLFOperationObserver& aObserver ) = 0;
86 * Create a new instance of Item List Model from the application
89 * @param aObserver Reference to an Operation Observer.
90 * @param aResource Resource reader to list model resource.
91 * Use resource struct CLF_LIST_MODEL. See
92 * CLFContentListing.rh
93 * @return New instance of Item List Model.
94 * Ownership is transfered to the client application.
96 virtual MCLFItemListModel* CreateListModelLC(
97 MCLFOperationObserver& aObserver,
98 TResourceReader& aResource ) = 0;
101 * Add a changed item observer to the Engine.
102 * Changed item observer will notify you when items are changed, added
103 * or removed. Remember to remove the observer before you delete
106 * @param aObserver Changed item observer to be added
108 virtual void AddChangedItemObserverL(
109 MCLFChangedItemObserver& aObserver ) = 0;
112 * Remove a changed item observer from the Engine.
114 * @param aObserver Changed item observer to be removed
116 virtual void RemoveChangedItemObserver(
117 MCLFChangedItemObserver& aObserver ) = 0;
120 * Add CLF process observer.
121 * Remember to remove the observer before delete the observer object.
123 * @param aObserver Process observer to be added
125 virtual void AddCLFProcessObserverL(
126 MCLFProcessObserver& aObserver ) = 0;
129 * Remove CLF process observer.
131 * @param aObserver Process observer to be removed
133 virtual void RemoveCLFProcessObserver(
134 MCLFProcessObserver& aObserver ) = 0;
137 * Send item update notification.
138 * Client must use this method when media item(s) is changed or deleted.
139 * This method call will request the CLF server to update its list
140 * of items. Unneccesary update notifications should be avoided because
141 * they generate load to the system!
144 virtual void UpdateItemsL() = 0;
147 * Send item update notification.
148 * Client must use this method when media item(s) is changed or deleted.
149 * This method call will request the CLF server to update items that are
150 * defined in the TArray.
152 * @param aItemIDArray List of Item IDs of modified items
154 virtual void UpdateItemsL(
155 const TArray<TCLFItemId>& aItemIDArray ) = 0;
158 * Send item update notification.
159 * Client must use this method when media item(s) is changed or deleted.
160 * @param aSemanticId Sematic ID is transfered to server plugins
161 * @param aOpaqueData Opaque data is transfered to server plugins
164 virtual void UpdateItemsL(
166 const TDesC8& aOpaqueData ) = 0;
168 private: // Extension interface
171 * This member is internal and not intended for use.
173 virtual MCLFContentListingEngineExt* Extension() { return NULL; }
177 #endif // MCLFCONTENTLISTINGENGINE_H