mds_pub/content_listing_framework_api/inc/MCLFContentListingEngine.h
changeset 0 c53acadfccc6
equal deleted inserted replaced
-1:000000000000 0:c53acadfccc6
       
     1 /*
       
     2 * Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MCLFCONTENTLISTINGENGINE_H
       
    20 #define MCLFCONTENTLISTINGENGINE_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <CLFContentListing.h>
       
    24 #include <e32std.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class MCLFContentListingEngineExt;
       
    28 class MCLFChangedItemObserver;
       
    29 class MCLFItemListModel;
       
    30 class MCLFOperationObserver;
       
    31 class TResourceReader;
       
    32 class MCLFProcessObserver;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    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>
       
    42 *  Usage:
       
    43 *
       
    44 *  @code
       
    45 *
       
    46 *  // Create a new instance with Content Listing Factory
       
    47 *  MCLFContentListingEngine* engine =
       
    48 *                    ContentListingFactory::NewContentListingEngineLC();
       
    49 *
       
    50 *  // Add changed item observer
       
    51 *  engine->AddChangedItemObserverL( *myObserver );
       
    52 *
       
    53 *  // Send update notification when item is changed.
       
    54 *  engine->UpdateItemsL();
       
    55 *
       
    56 *  // Remember to remove the observer, when it is deleted
       
    57 *  engine->RemoveChangedItemObserver( *myObserver );
       
    58 *
       
    59 *  @endcode
       
    60 *
       
    61 *  @lib ContentListingFramework.lib
       
    62 *  @since S60 3.1
       
    63 */
       
    64 class MCLFContentListingEngine
       
    65     {
       
    66     public: // Constructors and destructor
       
    67 
       
    68         /**
       
    69         * Destructor.
       
    70         */
       
    71         virtual ~MCLFContentListingEngine() {}
       
    72 
       
    73     public: // New functions
       
    74 
       
    75         /**
       
    76         * Create a new instance of the Item List Model.
       
    77         * @since S60 3.1
       
    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.
       
    81         */
       
    82         virtual MCLFItemListModel* CreateListModelLC(
       
    83                         MCLFOperationObserver& aObserver ) = 0;
       
    84 
       
    85         /**
       
    86         * Create a new instance of Item List Model from the application
       
    87         * resource.
       
    88         * @since S60 3.1
       
    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.
       
    95         */
       
    96         virtual MCLFItemListModel* CreateListModelLC(
       
    97                         MCLFOperationObserver& aObserver,
       
    98                         TResourceReader& aResource ) = 0;
       
    99 
       
   100         /**
       
   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
       
   104         * observer object.
       
   105         * @since S60 3.1
       
   106         * @param aObserver Changed item observer to be added
       
   107         */
       
   108         virtual void AddChangedItemObserverL(
       
   109                         MCLFChangedItemObserver& aObserver ) = 0;
       
   110 
       
   111         /**
       
   112         * Remove a changed item observer from the Engine.
       
   113         * @since S60 3.1
       
   114         * @param aObserver Changed item observer to be removed
       
   115         */
       
   116         virtual void RemoveChangedItemObserver(
       
   117                         MCLFChangedItemObserver& aObserver ) = 0;
       
   118 
       
   119         /**
       
   120         * Add CLF process observer.
       
   121         * Remember to remove the observer before delete the observer object.
       
   122         * @since S60 3.1
       
   123         * @param aObserver Process observer to be added
       
   124         */
       
   125         virtual void AddCLFProcessObserverL(
       
   126                         MCLFProcessObserver& aObserver ) = 0;
       
   127 
       
   128         /**
       
   129         * Remove CLF process observer.
       
   130         * @since S60 3.1
       
   131         * @param aObserver Process observer to be removed
       
   132         */
       
   133         virtual void RemoveCLFProcessObserver(
       
   134                         MCLFProcessObserver& aObserver ) = 0;
       
   135 
       
   136         /**
       
   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!
       
   142         * @since S60 3.1
       
   143         */
       
   144         virtual void UpdateItemsL() = 0;
       
   145 
       
   146         /**
       
   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.
       
   151         * @since S60 3.1
       
   152         * @param aItemIDArray List of Item IDs of modified items
       
   153         */
       
   154         virtual void UpdateItemsL(
       
   155                         const TArray<TCLFItemId>& aItemIDArray ) = 0;
       
   156 
       
   157         /**
       
   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
       
   162         * @since S60 3.1
       
   163         */
       
   164         virtual void UpdateItemsL(
       
   165                         TInt aSemanticId,
       
   166                         const TDesC8& aOpaqueData ) = 0;
       
   167 
       
   168     private: // Extension interface
       
   169 
       
   170         /**
       
   171         * This member is internal and not intended for use.
       
   172         */
       
   173         virtual MCLFContentListingEngineExt* Extension() { return NULL; }
       
   174 
       
   175     };
       
   176 
       
   177 #endif      // MCLFCONTENTLISTINGENGINE_H
       
   178 
       
   179 // End of File