photosgallery/viewframework/views/viewbase/inc/glxtoolbarcontroller.h
branchRCL_3
changeset 60 5b3385a43d68
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/photosgallery/viewframework/views/viewbase/inc/glxtoolbarcontroller.h	Wed Sep 01 12:33:26 2010 +0100
@@ -0,0 +1,117 @@
+/*
+* Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). 
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:    Media item list observer interface 
+*
+*/
+
+
+
+
+#ifndef GLXTOOLBARCONTROLLER_H
+#define GLXTOOLBARCONTROLLER_H
+
+#include <mglxmedialistobserver.h>
+#include <akntoolbar.h>             // For Toolbar
+
+
+NONSHARABLE_CLASS( CGlxToolbarController ): public CBase, public MGlxMediaListObserver
+    {
+public:
+    /*
+     * function NewL
+     */
+    static CGlxToolbarController* NewL ();
+    
+    /*
+     * Adds object of CGlxToolbar to observe medialist
+     * @param aList Reference of MGlxMediaList 
+     */
+    void AddToObserverL(MGlxMediaList& aList, CAknToolbar* aToolbar);
+    
+    /*
+     * Removes object of CGlxToolbar from medialist observer
+     * @param aList Reference of MGlxMediaList
+     */
+    void RemoveFromObserver (MGlxMediaList& aList);
+    
+    /**
+     * Sets toolbar status.This is called after adding CGlxToolbarController
+     * to medialist observer, if there is no HandleAttributeAvailable callback.
+     * (This is done to activate toolbar when attributes are already available in cache)
+     * @param aList Pointer to MGlxMediaList
+     */
+    void SetStatusOnViewActivationL( MGlxMediaList* aList );
+     
+    /*
+     * Sets the toolbar status on every attribute available callback. 
+     * If attributes not available, but there are items, then this call is forced
+     * by SetStatusOnViewActivationL from MediaListViewBase
+     * @param aList Pointer og MGlxMediaList
+     */
+    void SetStatusL( MGlxMediaList* aList );
+  
+    /*
+     * Destructor
+     */
+    ~CGlxToolbarController();
+   
+public: //From MGlxMediaListObserver  
+    void HandleItemAddedL(TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList);
+    void HandleMediaL(TInt aListIndex, MGlxMediaList* aList);
+    void HandleItemRemovedL(TInt aStartIndex, TInt aEndIndex, MGlxMediaList* aList);
+    void HandleItemModifiedL(const RArray<TInt>& aItemIndexes, MGlxMediaList* aList);
+    void HandleAttributesAvailableL(TInt aItemIndex, const RArray<TMPXAttribute>& aAttributes,
+            MGlxMediaList* aList);
+    void HandleFocusChangedL(NGlxListDefs::TFocusChangeType aType, TInt aNewIndex, 
+            TInt aOldIndex, MGlxMediaList* aList);
+    void HandleItemSelectedL(TInt aIndex, TBool aSelected, MGlxMediaList* aList);
+    void HandleMessageL(const CMPXMessage& aMessage, MGlxMediaList* aList);
+    void HandlePopulatedL( MGlxMediaList* aList );
+    
+private:
+    /*
+     * Default Constructor
+     */
+    CGlxToolbarController();
+    
+    /* Enables or disables latching on the toolbar button.
+     * Used in Marking mode.
+     * @param aCommandId The Command on toolbar that needs to be latched/unlatched.
+     * aLatched ETrue if the command button needs to be latched. 
+     */
+    void EnableLatch( TInt aCommandId, TInt aLatched );
+
+    /*
+     * Set toolbar items dimmed.
+     * @param aDimmed Flag for the toolbar items to be dimmed.
+     */
+    void SetToolbarItemsDimmed(TBool aDimmed);
+     
+    /**
+     * To check whether OneClickUpload is supported by the Shareonline 
+     * application. 
+     * NOTE: OneClickUpload is a feature of ShareOnline 4.3 and above. Hence this function
+     * ensures that the upload command works only if this version of ShareOnline is 
+     * available in the build. Else, Upload will not work! 
+     */
+    void CheckShareonlineVersionL();
+    
+private:    
+    CAknToolbar* iToolbar;
+    TBool iAttributeAvailable;
+    };
+
+#endif /*GLXTOOLBARCONTROLLER_H*/
+
+