photosgallery/viewframework/views/viewbase/inc/glxtoolbarcontroller.h
changeset 0 4e91876724a2
child 18 bcb43dc84c44
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 GLXTOOLBARCONTROLLER_H
       
    22 #define GLXTOOLBARCONTROLLER_H
       
    23 
       
    24 #include <mglxmedialistobserver.h>
       
    25 #include <akntoolbar.h>             // For Toolbar
       
    26 
       
    27 
       
    28 NONSHARABLE_CLASS( CGlxToolbarController ): public CBase, public MGlxMediaListObserver
       
    29     {
       
    30 public:
       
    31     /*
       
    32      * function NewL
       
    33      */
       
    34     static CGlxToolbarController* NewL ();
       
    35     
       
    36     /*
       
    37      * Adds object of CGlxToolbar to observe medialist
       
    38      * @param aList Reference of MGlxMediaList 
       
    39      */
       
    40     void AddToObserverL(MGlxMediaList& aList, CAknToolbar* aToolbar);
       
    41     
       
    42     /*
       
    43      * Removes object of CGlxToolbar from medialist observer
       
    44      * @param aList Reference of MGlxMediaList
       
    45      */
       
    46     void RemoveFromObserver (MGlxMediaList& aList);
       
    47     
       
    48     /**
       
    49      * Sets toolbar status.This is called after adding CGlxToolbarController
       
    50      * to medialist observer, if there is no HandleAttributeAvailable callback.
       
    51      * (This is done to activate toolbar when attributes are already available in cache)
       
    52      * @param aList Pointer to MGlxMediaList
       
    53      */
       
    54     void SetStatusOnViewActivationL( MGlxMediaList* aList );
       
    55      
       
    56     /*
       
    57      * Sets the toolbar status on every attribute available callback. 
       
    58      * If attributes not available, but there are items, then this call is forced
       
    59      * by SetStatusOnViewActivationL from MediaListViewBase
       
    60      * @param aList Pointer og MGlxMediaList
       
    61      */
       
    62     void SetStatusL( MGlxMediaList* aList );
       
    63   
       
    64     /*
       
    65      * Destructor
       
    66      */
       
    67     ~CGlxToolbarController();
       
    68    
       
    69 public: //From MGlxMediaListObserver  
       
    70     void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList);
       
    71     void HandleMediaL(TInt aListIndex, MGlxMediaList* aList);
       
    72     void HandleItemRemovedL(TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList);
       
    73     void HandleItemModifiedL(const RArray<TInt>& aItemIndexes, MGlxMediaList* aList);
       
    74     void HandleAttributesAvailableL(TInt aItemIndex, const RArray<TMPXAttribute>& aAttributes,
       
    75             MGlxMediaList* aList);
       
    76     void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, TInt aNewIndex, 
       
    77             TInt aOldIndex, MGlxMediaList* aList);
       
    78     void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList);
       
    79     void HandleMessageL(const CMPXMessage& aMessage, MGlxMediaList* aList);
       
    80     
       
    81 private:
       
    82     /*
       
    83      * Default Constructor
       
    84      */
       
    85     CGlxToolbarController();
       
    86     
       
    87     /* Enables or disables latching on the toolbar button.
       
    88      * Used in Marking mode.
       
    89      * @param aCommandId The Command on toolbar that needs to be latched/unlatched.
       
    90      * aLatched ETrue if the command button needs to be latched. 
       
    91      */
       
    92     void EnableLatch( TInt aCommandId, TInt aLatched );
       
    93             
       
    94    /*
       
    95 	* check the current view
       
    96 	*/
       
    97 	TBool IsFullScreenView();       
       
    98 private:    
       
    99     CAknToolbar* iToolbar;
       
   100     TBool iAttributeAvailable;
       
   101     };
       
   102 
       
   103 #endif /*GLXTOOLBARCONTROLLER_H*/
       
   104 
       
   105