browserui/browser/FeedsInc/FeedsFolderView.h
changeset 51 48e827313edd
parent 37 481242ead638
child 53 f427d27b98d8
equal deleted inserted replaced
37:481242ead638 51:48e827313edd
     1 /*
       
     2 * Copyright (c) 2005-2008 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 the License "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:  A view to browse a user's list of feeds.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef FEEDS_FOLDER_VIEW_H
       
    20 #define FEEDS_FOLDER_VIEW_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include "BrowserAppViewBase.h"
       
    25 #include "FeedsFolderContainer.h"
       
    26 #include <AknToolbarObserver.h>
       
    27 
       
    28 // CONSTANTS
       
    29 
       
    30 // MACROS
       
    31 
       
    32 // DATA TYPES
       
    33 
       
    34 // FUNCTION PROTOTYPES
       
    35 
       
    36 // FORWARD DECLARATIONS
       
    37 class MApiProvider;
       
    38 
       
    39 // CLASS DECLARATION
       
    40 
       
    41 /**
       
    42 *  A view to browse a user's list of feeds.
       
    43 *  @lib FeedsEngine.lib
       
    44 *  @since 3.0
       
    45 */
       
    46 class CFeedsFolderView: public CBrowserViewBase,
       
    47                         public MAknToolbarObserver
       
    48     {
       
    49     public:
       
    50         /**
       
    51         * Two-phased constructor.
       
    52         */
       
    53         static CFeedsFolderView* NewL( MApiProvider& aApiProvider, TRect& aRect );
       
    54         
       
    55         /**
       
    56         * Destructor.
       
    57         */        
       
    58         virtual ~CFeedsFolderView();
       
    59 
       
    60 	public:     // From CBrowserViewBase
       
    61         
       
    62         /**
       
    63         * Return command set id, to be displayed.
       
    64         * @return The command set's resource id.
       
    65         */
       
    66         TInt CommandSetResourceIdL();
       
    67 
       
    68 		/**
       
    69 		* Set command set lsk,rsk,msk dynamically via pointers.
       
    70 		* Derived classes should implement, though it can be empty.
       
    71 		* If it does nothing, empty softkeys will be assigned
       
    72 		* @since 5.0
       
    73 		*/
       
    74 		void CommandSetResourceDynL(TSKPair& /*lsk*/, TSKPair& /*rsk*/, TSKPair& /*msk*/) {};
       
    75 			        
       
    76         /**
       
    77         * @see CAknView
       
    78         */
       
    79 		void HandleClientRectChange();
       
    80 
       
    81 	public: // From CAknView
       
    82         /**
       
    83         * Returns the id of the view.
       
    84         *
       
    85         * @since ?
       
    86         * @return the id.
       
    87         */
       
    88 		virtual TUid Id() const;
       
    89 
       
    90         /**
       
    91         * Processes commands.
       
    92         *
       
    93         * @since ?
       
    94         * @param aCommand the command to process.
       
    95         * @return void.
       
    96         */
       
    97 		virtual void HandleCommandL(TInt aCommand);
       
    98 
       
    99 
       
   100     protected: // From CAknView
       
   101         /**
       
   102         * Called when the view is activated.
       
   103         *
       
   104         * @since ?
       
   105         * @param aPrevViewId the id of the prev view.
       
   106         * @param aCustomMessageId The activation message id.
       
   107         * @param aCustomMessage Activation params.
       
   108         * @return void.
       
   109         */
       
   110 		virtual void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, 
       
   111                 const TDesC8& aCustomMessage);
       
   112     
       
   113         /**
       
   114         * Called when the view is deactivated.
       
   115         *
       
   116         * @since ?
       
   117         * @return void.
       
   118         */
       
   119 		virtual void DoDeactivate();
       
   120 
       
   121         /**
       
   122         * Disables unrelated menu options.
       
   123         *
       
   124         * @since ?
       
   125         * @param aResourceId  The resource id of the menu.
       
   126         * @param aMenuPane The menu.
       
   127         * @return void.
       
   128         */
       
   129 		virtual void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
       
   130 
       
   131     public: // MAknToolbarObserver
       
   132         /**
       
   133         * Called when toolbar events occur
       
   134         *
       
   135         * @since 5.0
       
   136         * @return void
       
   137         */
       
   138         void OfferToolbarEventL( TInt aCommand ) { HandleCommandL(aCommand); }
       
   139 
       
   140 
       
   141     public: // New Methods
       
   142         /**
       
   143         * Updates the options softkey to reflect the command set.
       
   144         *
       
   145         * @since 3.0
       
   146         * @param aCommandSet The new "command set".
       
   147         * @return void.
       
   148         */
       
   149         void UpdateCbaL(TInt aCommandSet);
       
   150 
       
   151         
       
   152         /**
       
   153         * Called to notify the view the that root folder has changed.
       
   154         *
       
   155         * @since 3.1
       
   156         * @param aRootFolder The new root folder.
       
   157         * @return Void.
       
   158         */
       
   159         void RootFolderChangedL(const CFeedsEntity& aRootFolder);
       
   160 
       
   161         /**
       
   162         * Changes the current folder.
       
   163         *
       
   164         * @since 3.1
       
   165         * @param aFolder The new current folder.
       
   166         * @param aResetSelection If ETrue the current selection is set to the first item.
       
   167         * @return void.
       
   168         */
       
   169         void SetCurrentFolder(const CFeedsEntity& aFolder, TBool aResetSelection = EFalse);
       
   170 
       
   171         /**
       
   172         * Calculate the unread count based on delta.
       
   173         *
       
   174         * @since 3.1
       
   175         * @return the calculated value.
       
   176         */
       
   177         TInt UnreadCountChangedL( TInt aUnreadCountDelta );
       
   178 
       
   179         /**
       
   180         * Set the unread count.
       
   181         *
       
   182         * @since 3.1
       
   183         * @return void.
       
   184         */
       
   185         void SetUnreadCountL( TInt aUnreadCount );
       
   186 
       
   187 
       
   188     public:  // Friends
       
   189         friend class CFeedsFolderContainer;
       
   190         
       
   191         
       
   192     private:
       
   193         /**
       
   194         * C++ default constructor.
       
   195         */
       
   196         CFeedsFolderView( MApiProvider& aApiProvider );
       
   197         
       
   198         /**
       
   199         * By default Symbian 2nd phase constructor is private.
       
   200         */
       
   201         void ConstructL(TRect& aRect);
       
   202 
       
   203         /**
       
   204         * Check for any Marked Feeds Folders
       
   205         * @since 3.2
       
   206         * @return ETrue if any feeds folders are currently marked
       
   207         *  otherwise, return EFalse
       
   208         */        
       
   209         TBool AnyFoldersMarked();
       
   210         
       
   211         /**
       
   212         * Check for any Marked items in Feeds view
       
   213         * @since 3.2
       
   214         * @return ETrue anything is marked otherwise returns EFalse
       
   215         */        
       
   216         TBool AnyMarkedItems();
       
   217         
       
   218         /**
       
   219         * Check if current item is marked
       
   220         * @since 5.0
       
   221         * @return ETrue if current item is marked, otherwise returns EFalse
       
   222         */
       
   223         TBool IsCurrentItemMarked();
       
   224 
       
   225 
       
   226 
       
   227        
       
   228     private:
       
   229         const CFeedsEntity*  iRootFolder;
       
   230 		CFeedsFolderContainer*   iContainer;
       
   231         TBool               iContainerOnStack;
       
   232         TInt                iInitialItem;
       
   233         TBool               iPenEnabled;
       
   234     };
       
   235 
       
   236 #endif      // FEEDS_FOLDER_VIEW_H
       
   237             
       
   238 // End of File
       
   239 
       
   240