browserui/browser/FeedsInc/FeedsTopicView.h
branchRCL_3
changeset 64 6385c4c93049
parent 63 4baee4f15982
child 65 8e6fa1719340
equal deleted inserted replaced
63:4baee4f15982 64:6385c4c93049
     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 feed's topics.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef FEEDS_TOPIC_VIEW_H
       
    20 #define FEEDS_TOPIC_VIEW_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include "BrowserAppViewBase.h"
       
    25 
       
    26 #include "FeedsTopicContainer.h"
       
    27 #include <AknToolbarObserver.h>
       
    28 
       
    29 // CONSTANTS
       
    30 
       
    31 // MACROS
       
    32 
       
    33 // DATA TYPES
       
    34 
       
    35 // FUNCTION PROTOTYPES
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class MApiProvider;
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 
       
    43 /**
       
    44 *  A view to browse a feed's topics.
       
    45 *  @lib FeedsEngine.lib
       
    46 *  @since 3.0
       
    47 */
       
    48 class CFeedsTopicView: public CBrowserViewBase,
       
    49                        public MAknToolbarObserver
       
    50     {
       
    51     public:
       
    52         /**
       
    53         * Two-phased constructor.
       
    54         */
       
    55         static CFeedsTopicView* NewL( MApiProvider& aApiProvider,	TRect& aRect );
       
    56         
       
    57         /**
       
    58         * Destructor.
       
    59         */        
       
    60         virtual ~CFeedsTopicView();
       
    61 
       
    62 	public:     // From CBrowserViewBase
       
    63         
       
    64         /**
       
    65         * Return command set id, to be displayed.
       
    66         * @return The command set's resource id.
       
    67         */
       
    68         TInt CommandSetResourceIdL();
       
    69 
       
    70 		/**
       
    71 		* Set command set lsk,rsk,msk dynamically via pointers.
       
    72 		* Derived classes should implement, though it can be empty.
       
    73 		* If it does nothing, empty softkeys will be assigned
       
    74 		* @since 5.0
       
    75 		*/
       
    76 		void CommandSetResourceDynL(TSKPair& /*lsk*/, TSKPair& /*rsk*/, TSKPair& /*msk*/) {};
       
    77 			        
       
    78         /**
       
    79         * @see CAknView
       
    80         */
       
    81 		void HandleClientRectChange();
       
    82 
       
    83 	public: // From CAknView
       
    84         /**
       
    85         * Returns the id of the view.
       
    86         *
       
    87         * @since ?
       
    88         * @return the id.
       
    89         */
       
    90 		virtual TUid Id() const;
       
    91 
       
    92         /**
       
    93         * Processes commands.
       
    94         *
       
    95         * @since ?
       
    96         * @param aCommand the command to process.
       
    97         * @return void.
       
    98         */
       
    99 		virtual void HandleCommandL(TInt aCommand);
       
   100 
       
   101 
       
   102     protected: // From CAknView
       
   103         /**
       
   104         * Called when the view is activated.
       
   105         *
       
   106         * @since ?
       
   107         * @param aPrevViewId the id of the prev view.
       
   108         * @param aCustomMessageId The activation message id.
       
   109         * @param aCustomMessage Activation params.
       
   110         * @return void.
       
   111         */
       
   112 		virtual void DoActivateL(const TVwsViewId& aPrevViewId, TUid aCustomMessageId, 
       
   113                 const TDesC8& aCustomMessage);
       
   114     
       
   115         /**
       
   116         * Called when the view is deactivated.
       
   117         *
       
   118         * @since ?
       
   119         * @return void.
       
   120         */
       
   121 		virtual void DoDeactivate();
       
   122 
       
   123         /**
       
   124         * Disables unrelated menu options.
       
   125         *
       
   126         * @since ?
       
   127         * @param aResourceId  The resource id of the menu.
       
   128         * @param aMenuPane The menu.
       
   129         * @return void.
       
   130         */
       
   131 		virtual void DynInitMenuPaneL(TInt aResourceId, CEikMenuPane* aMenuPane);
       
   132 
       
   133     public: // MAknToolbarObserver
       
   134         /**
       
   135         * Called when toolbar events occur
       
   136         *
       
   137         * @since 5.0
       
   138         * @return void
       
   139         */
       
   140         void OfferToolbarEventL( TInt aCommand ) { HandleCommandL(aCommand); }
       
   141 
       
   142     public: // New Methods
       
   143         
       
   144         /**
       
   145         * Sets the current feed
       
   146         *
       
   147         * @since 3.0
       
   148         * @param aFeed The new feed.
       
   149         * @param aIndex The inital items to select.
       
   150         * @return Void
       
   151         */
       
   152         void SetCurrentFeedL(const CFeedsEntity& aFeed, TInt aIndex);
       
   153 
       
   154         /**
       
   155         * Sets the initial item once the view is activated.
       
   156         *
       
   157         * @since 3.1
       
   158         * @param aItemIndex The index of the inital item.
       
   159         * @return void
       
   160         */
       
   161         void SetInitialItem(TInt aItemIndex);
       
   162 
       
   163         /**
       
   164         * Update the toolbar buttons' state
       
   165         *
       
   166         * @since 5.0
       
   167         * @return void
       
   168         */
       
   169         void UpdateToolbarButtonsState();
       
   170         
       
   171     private:  // New Methods
       
   172         /**
       
   173         * C++ default constructor.
       
   174         */
       
   175         CFeedsTopicView( MApiProvider& aApiProvider );
       
   176         
       
   177         /**
       
   178         * By default Symbian 2nd phase constructor is private.
       
   179         */
       
   180         void ConstructL(TRect& aRect);
       
   181 
       
   182 
       
   183     public:  // Friends
       
   184         friend class CTopicContainer;
       
   185         
       
   186         
       
   187     private:
       
   188 		CFeedsTopicContainer*  iContainer;
       
   189         TBool             iContainerOnStack;
       
   190         TInt              iInitialItem;
       
   191         TBool             iPenEnabled;
       
   192     };
       
   193 
       
   194 #endif      // FEEDS_TOPIC_VIEW_H
       
   195             
       
   196 // End of File
       
   197