photosgallery/viewframework/medialists/inc/mglxmedialistobserver.h
changeset 0 4e91876724a2
equal deleted inserted replaced
-1:000000000000 0:4e91876724a2
       
     1 /*
       
     2 * Copyright (c) 2008-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:    Media item list observer interface 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 #ifndef M_GLXMEDIALISTOBSERVER_H
       
    22 #define M_GLXMEDIALISTOBSERVER_H
       
    23 
       
    24 #include <mpxcommand.h>
       
    25 #include <mpxmessage2.h>
       
    26 #include <mpxattribute.h>
       
    27 #include <glxlistdefs.h>
       
    28 
       
    29 #include "glxthumbnailinfo.h"
       
    30 
       
    31 // Forward declaration
       
    32 class MGlxMediaList;
       
    33 
       
    34 /*! 
       
    35   @class MGlxMediaListObserver
       
    36   
       
    37   @discussion Observes for changes in media list
       
    38               MPX-specific
       
    39   */
       
    40 class MGlxMediaListObserver
       
    41     {
       
    42 public:
       
    43 
       
    44     /**
       
    45      * Notification that media items were added to the list
       
    46      *
       
    47      * @param aStartIndex First item that was added (inserted)
       
    48      * @param aEndIndex Last item that was added (inserted)
       
    49      * @param aList List that this callback relates to 
       
    50      */
       
    51     virtual void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex,
       
    52                                   MGlxMediaList* aList) = 0;
       
    53 
       
    54     /**
       
    55      * Notification that media object is now available for an item 
       
    56      *
       
    57      * @param Index of the item 
       
    58      * @param aList List that this callback relates to 
       
    59      */
       
    60     virtual void HandleMediaL(TInt aListIndex, MGlxMediaList* aList) = 0;
       
    61 
       
    62     /**
       
    63      * Notification that media items were removed from the list
       
    64      *
       
    65      * @param aStartIndex First item that was removed 
       
    66      * @param aEndIndex Last item that was removed
       
    67      * @param aList List that this callback relates to 
       
    68      */
       
    69     virtual void HandleItemRemovedL(TInt aStartIndex, TInt aEndIndex,
       
    70                                     MGlxMediaList* aList) = 0;
       
    71 
       
    72     /**
       
    73      * Notification that media items were changed
       
    74      *
       
    75      * @param aItemIndexes Indexes of items that were changed
       
    76      * @param aList List that this callback relates to 
       
    77      */
       
    78     virtual void HandleItemModifiedL(const RArray<TInt>& aItemIndexes, 
       
    79                                      MGlxMediaList* aList) = 0;
       
    80 
       
    81     /**
       
    82      * Notification that attributes are available
       
    83      *
       
    84      * @param aItemIndex Index of the item for which attributes are available
       
    85      * @param aAttributes Array of attributes that have become available
       
    86      * @param aList List that this callback relates to 
       
    87      */
       
    88     virtual void HandleAttributesAvailableL(TInt aItemIndex, 
       
    89                                             const RArray<TMPXAttribute>& aAttributes, 
       
    90                                             MGlxMediaList* aList) = 0;
       
    91 
       
    92     /**
       
    93      * Notification that focus has moved
       
    94      *
       
    95      * @param aType the direction of the focus change
       
    96      * @param aNewIndex the new index after the focus change
       
    97      * @param aOldIndex the old index before the focus change
       
    98      * @param aList List that this callback relates to
       
    99      */
       
   100     virtual void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, 
       
   101                                      TInt aNewIndex, TInt aOldIndex, 
       
   102                                      MGlxMediaList* aList) = 0;
       
   103 
       
   104     /**
       
   105      * Notification that an item has been selected/deselected
       
   106      *
       
   107      * @param aIndex Index of the item that has been selected/deselected
       
   108      * @param aSelected Boolean to indicate selection/deselection
       
   109      * @param aList List that the selection relates to
       
   110      */
       
   111     virtual void HandleItemSelectedL(TInt aIndex, TBool aSelected, 
       
   112                                      MGlxMediaList* aList) = 0;
       
   113 
       
   114     /**
       
   115      * Notification from the collection
       
   116      * E.g. Items added/modified/deleted and progress notifications
       
   117      *
       
   118      * @param aMessage Message notification from the collection
       
   119      * @param aList List that the notification relates to
       
   120      */
       
   121     virtual void HandleMessageL(const CMPXMessage& aMessage, 
       
   122                                 MGlxMediaList* aList) = 0;
       
   123 
       
   124     /**
       
   125      * Notification of an error from the collection
       
   126      *
       
   127      * @param aError Error code
       
   128      */
       
   129     virtual void HandleError(TInt aError) { (void)aError; };
       
   130 
       
   131     /**
       
   132      * Handle completion of a asynchronous command
       
   133      * @todo: All clients should implement this callback
       
   134      *
       
   135      * @param aSessionId session id of the client that issued the command
       
   136      * @param aCommandResult result of the command, NULL if error
       
   137      * @param aError error code
       
   138      * @param aList List that the notification relates to 
       
   139      */
       
   140     virtual void HandleCommandCompleteL(TAny* /*aSessionId*/, 
       
   141                                         CMPXCommand* /*aCommandResult*/, 
       
   142                                         TInt /*aError*/, 
       
   143                                         MGlxMediaList* /*aList*/) {};
       
   144 
       
   145     /**
       
   146      * Handle media list population.
       
   147      *
       
   148      * @param aList List that the notification relates to 
       
   149      */                                   
       
   150     virtual void HandlePopulatedL(MGlxMediaList* /*aList*/) {};
       
   151     };
       
   152 
       
   153 #endif // M_GLXMEDIALISTOBSERVER_H
       
   154