| author | William Roberts <williamr@symbian.org> | 
| Tue, 16 Mar 2010 16:12:26 +0000 | |
| branch | Symbian2 | 
| changeset 2 | 2fe1408b6811 | 
| parent 1 | 666f914201fb | 
| child 4 | 837f303aceeb | 
| permissions | -rw-r--r-- | 
| williamr@2 | 1 | /* | 
| williamr@2 | 2 | * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). | 
| williamr@2 | 3 | * All rights reserved. | 
| williamr@2 | 4 | * This component and the accompanying materials are made available | 
| williamr@2 | 5 | * 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 | 6 | * which accompanies this distribution, and is available | 
| williamr@2 | 7 | * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". | 
| williamr@2 | 8 | * | 
| williamr@2 | 9 | * Initial Contributors: | 
| williamr@2 | 10 | * Nokia Corporation - initial contribution. | 
| williamr@2 | 11 | * | 
| williamr@2 | 12 | * Contributors: | 
| williamr@2 | 13 | * | 
| williamr@2 | 14 | * Description: | 
| williamr@2 | 15 | * | 
| williamr@2 | 16 | */ | 
| williamr@2 | 17 | |
| williamr@2 | 18 | |
| williamr@2 | 19 | #ifndef MCLFCONTENTLISTINGENGINE_H | 
| williamr@2 | 20 | #define MCLFCONTENTLISTINGENGINE_H | 
| williamr@2 | 21 | |
| williamr@2 | 22 | // INCLUDES | 
| williamr@2 | 23 | #include <CLFContentListing.h> | 
| williamr@2 | 24 | #include <e32std.h> | 
| williamr@2 | 25 | |
| williamr@2 | 26 | // FORWARD DECLARATIONS | 
| williamr@2 | 27 | class MCLFContentListingEngineExt; | 
| williamr@2 | 28 | class MCLFChangedItemObserver; | 
| williamr@2 | 29 | class MCLFItemListModel; | 
| williamr@2 | 30 | class MCLFOperationObserver; | 
| williamr@2 | 31 | class TResourceReader; | 
| williamr@2 | 32 | class MCLFProcessObserver; | 
| williamr@2 | 33 | |
| williamr@2 | 34 | // CLASS DECLARATION | 
| williamr@2 | 35 | |
| williamr@2 | 36 | /** | 
| williamr@2 | 37 | * Content Listing Engine. | 
| williamr@2 | 38 | * With Content Listing Engine, client can create item list models, | 
| williamr@2 | 39 | * add an observer to get notifications of changed items and | 
| williamr@2 | 40 | * send update notifications to server. | 
| williamr@2 | 41 | * Client can create an instance this class with ContentListingFactory.<br><br> | 
| williamr@2 | 42 | * Usage: | 
| williamr@2 | 43 | * | 
| williamr@2 | 44 | * @code | 
| williamr@2 | 45 | * | 
| williamr@2 | 46 | * // Create a new instance with Content Listing Factory | 
| williamr@2 | 47 | * MCLFContentListingEngine* engine = | 
| williamr@2 | 48 | * ContentListingFactory::NewContentListingEngineLC(); | 
| williamr@2 | 49 | * | 
| williamr@2 | 50 | * // Add changed item observer | 
| williamr@2 | 51 | * engine->AddChangedItemObserverL( *myObserver ); | 
| williamr@2 | 52 | * | 
| williamr@2 | 53 | * // Send update notification when item is changed. | 
| williamr@2 | 54 | * engine->UpdateItemsL(); | 
| williamr@2 | 55 | * | 
| williamr@2 | 56 | * // Remember to remove the observer, when it is deleted | 
| williamr@2 | 57 | * engine->RemoveChangedItemObserver( *myObserver ); | 
| williamr@2 | 58 | * | 
| williamr@2 | 59 | * @endcode | 
| williamr@2 | 60 | * | 
| williamr@2 | 61 | * @lib ContentListingFramework.lib | 
| williamr@2 | 62 | * @since S60 3.1 | 
| williamr@2 | 63 | */ | 
| williamr@2 | 64 | class MCLFContentListingEngine | 
| williamr@2 | 65 |     {
 | 
| williamr@2 | 66 | public: // Constructors and destructor | 
| williamr@2 | 67 | |
| williamr@2 | 68 | /** | 
| williamr@2 | 69 | * Destructor. | 
| williamr@2 | 70 | */ | 
| williamr@2 | 71 |         virtual ~MCLFContentListingEngine() {}
 | 
| williamr@2 | 72 | |
| williamr@2 | 73 | public: // New functions | 
| williamr@2 | 74 | |
| williamr@2 | 75 | /** | 
| williamr@2 | 76 | * Create a new instance of the Item List Model. | 
| williamr@2 | 77 | * @since S60 3.1 | 
| williamr@2 | 78 | * @param aObserver Reference to an Operation Observer | 
| williamr@2 | 79 | * @return New instance of the Item List Model. | 
| williamr@2 | 80 | * Ownership is transfered to the client application. | 
| williamr@2 | 81 | */ | 
| williamr@2 | 82 | virtual MCLFItemListModel* CreateListModelLC( | 
| williamr@2 | 83 | MCLFOperationObserver& aObserver ) = 0; | 
| williamr@2 | 84 | |
| williamr@2 | 85 | /** | 
| williamr@2 | 86 | * Create a new instance of Item List Model from the application | 
| williamr@2 | 87 | * resource. | 
| williamr@2 | 88 | * @since S60 3.1 | 
| williamr@2 | 89 | * @param aObserver Reference to an Operation Observer. | 
| williamr@2 | 90 | * @param aResource Resource reader to list model resource. | 
| williamr@2 | 91 | * Use resource struct CLF_LIST_MODEL. See | 
| williamr@2 | 92 | * CLFContentListing.rh | 
| williamr@2 | 93 | * @return New instance of Item List Model. | 
| williamr@2 | 94 | * Ownership is transfered to the client application. | 
| williamr@2 | 95 | */ | 
| williamr@2 | 96 | virtual MCLFItemListModel* CreateListModelLC( | 
| williamr@2 | 97 | MCLFOperationObserver& aObserver, | 
| williamr@2 | 98 | TResourceReader& aResource ) = 0; | 
| williamr@2 | 99 | |
| williamr@2 | 100 | /** | 
| williamr@2 | 101 | * Add a changed item observer to the Engine. | 
| williamr@2 | 102 | * Changed item observer will notify you when items are changed, added | 
| williamr@2 | 103 | * or removed. Remember to remove the observer before you delete | 
| williamr@2 | 104 | * observer object. | 
| williamr@2 | 105 | * @since S60 3.1 | 
| williamr@2 | 106 | * @param aObserver Changed item observer to be added | 
| williamr@2 | 107 | */ | 
| williamr@2 | 108 | virtual void AddChangedItemObserverL( | 
| williamr@2 | 109 | MCLFChangedItemObserver& aObserver ) = 0; | 
| williamr@2 | 110 | |
| williamr@2 | 111 | /** | 
| williamr@2 | 112 | * Remove a changed item observer from the Engine. | 
| williamr@2 | 113 | * @since S60 3.1 | 
| williamr@2 | 114 | * @param aObserver Changed item observer to be removed | 
| williamr@2 | 115 | */ | 
| williamr@2 | 116 | virtual void RemoveChangedItemObserver( | 
| williamr@2 | 117 | MCLFChangedItemObserver& aObserver ) = 0; | 
| williamr@2 | 118 | |
| williamr@2 | 119 | /** | 
| williamr@2 | 120 | * Add CLF process observer. | 
| williamr@2 | 121 | * Remember to remove the observer before delete the observer object. | 
| williamr@2 | 122 | * @since S60 3.1 | 
| williamr@2 | 123 | * @param aObserver Process observer to be added | 
| williamr@2 | 124 | */ | 
| williamr@2 | 125 | virtual void AddCLFProcessObserverL( | 
| williamr@2 | 126 | MCLFProcessObserver& aObserver ) = 0; | 
| williamr@2 | 127 | |
| williamr@2 | 128 | /** | 
| williamr@2 | 129 | * Remove CLF process observer. | 
| williamr@2 | 130 | * @since S60 3.1 | 
| williamr@2 | 131 | * @param aObserver Process observer to be removed | 
| williamr@2 | 132 | */ | 
| williamr@2 | 133 | virtual void RemoveCLFProcessObserver( | 
| williamr@2 | 134 | MCLFProcessObserver& aObserver ) = 0; | 
| williamr@2 | 135 | |
| williamr@2 | 136 | /** | 
| williamr@2 | 137 | * Send item update notification. | 
| williamr@2 | 138 | * Client must use this method when media item(s) is changed or deleted. | 
| williamr@2 | 139 | * This method call will request the CLF server to update its list | 
| williamr@2 | 140 | * of items. Unneccesary update notifications should be avoided because | 
| williamr@2 | 141 | * they generate load to the system! | 
| williamr@2 | 142 | * @since S60 3.1 | 
| williamr@2 | 143 | */ | 
| williamr@2 | 144 | virtual void UpdateItemsL() = 0; | 
| williamr@2 | 145 | |
| williamr@2 | 146 | /** | 
| williamr@2 | 147 | * Send item update notification. | 
| williamr@2 | 148 | * Client must use this method when media item(s) is changed or deleted. | 
| williamr@2 | 149 | * This method call will request the CLF server to update items that are | 
| williamr@2 | 150 | * defined in the TArray. | 
| williamr@2 | 151 | * @since S60 3.1 | 
| williamr@2 | 152 | * @param aItemIDArray List of Item IDs of modified items | 
| williamr@2 | 153 | */ | 
| williamr@2 | 154 | virtual void UpdateItemsL( | 
| williamr@2 | 155 | const TArray<TCLFItemId>& aItemIDArray ) = 0; | 
| williamr@2 | 156 | |
| williamr@2 | 157 | /** | 
| williamr@2 | 158 | * Send item update notification. | 
| williamr@2 | 159 | * Client must use this method when media item(s) is changed or deleted. | 
| williamr@2 | 160 | * @param aSemanticId Sematic ID is transfered to server plugins | 
| williamr@2 | 161 | * @param aOpaqueData Opaque data is transfered to server plugins | 
| williamr@2 | 162 | * @since S60 3.1 | 
| williamr@2 | 163 | */ | 
| williamr@2 | 164 | virtual void UpdateItemsL( | 
| williamr@2 | 165 | TInt aSemanticId, | 
| williamr@2 | 166 | const TDesC8& aOpaqueData ) = 0; | 
| williamr@2 | 167 | |
| williamr@2 | 168 | private: // Extension interface | 
| williamr@2 | 169 | |
| williamr@2 | 170 | /** | 
| williamr@2 | 171 | * This member is internal and not intended for use. | 
| williamr@2 | 172 | */ | 
| williamr@2 | 173 |         virtual MCLFContentListingEngineExt* Extension() { return NULL; }
 | 
| williamr@2 | 174 | |
| williamr@2 | 175 | }; | 
| williamr@2 | 176 | |
| williamr@2 | 177 | #endif // MCLFCONTENTLISTINGENGINE_H | 
| williamr@2 | 178 | |
| williamr@2 | 179 | // End of File |