csxhelp/inc/CSXHGenericContainer.h
branchRCL_3
changeset 18 cbffe13eac63
parent 0 1f04cf54edd8
equal deleted inserted replaced
17:12f60d9a73b3 18:cbffe13eac63
       
     1 /*
       
     2 * Copyright (c) 2006 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:  CCSXHGenericContainer class declaration
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef INC_CSXHGENERICCONTAINER_H_HEADER_INCLUDED_BC039735
       
    20 #define INC_CSXHGENERICCONTAINER_H_HEADER_INCLUDED_BC039735
       
    21 
       
    22 #include <coecntrl.h> // CCoeControl
       
    23 #include <eiklbo.h> // MEikListBoxObserver
       
    24 #include <aknsfld.h>
       
    25 
       
    26 // FORWARD DECLARATIONS
       
    27 class CAknSingleStyleListBox;
       
    28 class CCSXHDocument;
       
    29 class CCSXHGenericView;
       
    30 
       
    31 #ifdef FF_HELP_TUTORIAL_MERGE
       
    32 class CCSXHGenericTOC1;
       
    33 #endif
       
    34 
       
    35 // CLASS DECLARATION
       
    36 /**
       
    37 * @class CCSXHGenericContainer
       
    38 * This class provides listbox container control functionality
       
    39 */
       
    40 
       
    41 class CCSXHGenericContainer : public CCoeControl, public MEikListBoxObserver
       
    42     {
       
    43     public:
       
    44     /**
       
    45     *  @function NewL
       
    46     *  @since S60 3.2
       
    47     *  Construct a CCSXHGenericContainer
       
    48     *  and return a pointer to the created object
       
    49     *  @param aRect - TRect Object
       
    50     *         aDocument - Document Object
       
    51     *  @return a CCSXHGenericContainer Pointer
       
    52     */
       
    53 #ifdef FF_HELP_TUTORIAL_MERGE
       
    54         static CCSXHGenericContainer* NewL(const TRect& aRect,CCSXHDocument &aDocument
       
    55         ,CCSXHGenericView* aView);
       
    56 #else // !FF_HELP_TUTORIAL_MERGE
       
    57         static CCSXHGenericContainer* NewL(const TRect& aRect,CCSXHDocument &aDocument);
       
    58 #endif // FF_HELP_TUTORIAL_MERGE
       
    59     /**
       
    60     *  @function NewLC
       
    61     *  @since S60 3.2
       
    62     *  Construct a CCSXHGenericContainer first phase of two phase constuction
       
    63     *  @param aRect - TRect Object
       
    64     *         aDocument - Document Object
       
    65     */
       
    66 #ifdef FF_HELP_TUTORIAL_MERGE
       
    67         static CCSXHGenericContainer* NewLC(const TRect& aRect, CCSXHDocument &aDocument
       
    68         ,CCSXHGenericView* aView);
       
    69 #else // !FF_HELP_TUTORIAL_MERGE
       
    70         static CCSXHGenericContainer* NewLC(const TRect& aRect, CCSXHDocument &aDocument);
       
    71 #endif // FF_HELP_TUTORIAL_MERGE
       
    72     /**
       
    73     *  @function ~CCSXHGenericContainer
       
    74     *  @since S60 3.2
       
    75     *  Destroy the object and release all memory objects
       
    76     */
       
    77     ~CCSXHGenericContainer();
       
    78 
       
    79 /** 
       
    80 *  @function HandleResourceChange
       
    81 *  @since S60 3.2
       
    82 *  Handles resource changes.
       
    83 *  This function is called by framework when when e.g skin or locale is changed.
       
    84 *  @param aType resource change type
       
    85 */    	
       
    86     	void HandleResourceChange(TInt aType);
       
    87 
       
    88 /** 
       
    89 *  @function HandleResourceChangeImpl
       
    90 *  @since S60 3.2
       
    91 *  Handles resource changes.
       
    92 *  Implementation function for resource change
       
    93 *  @param aType resource change type
       
    94 */    	
       
    95     	void HandleResourceChangeImpl(TInt aType);
       
    96 
       
    97 /** 
       
    98 *  @function SetDisplayTopicL
       
    99 *  @since S60 3.2
       
   100 *  Using Selected Item, set next object for display  
       
   101 */    	
       
   102     	void SetDisplayTopicL();
       
   103 
       
   104 /** 
       
   105 *  @function GetNumberOfListItems
       
   106 *  @since S60 3.2
       
   107 *  Get the number of items present in the List
       
   108 *  @return Number of Items in the List
       
   109 */    	
       
   110     	TInt GetNumberOfListItems();
       
   111 
       
   112 /** 
       
   113 *  @function SetCurrentView
       
   114 *  @since S60 3.2
       
   115 *  Sets View Pointer
       
   116 *  @param aView - Sets View pointer which is using this Container
       
   117 */    	
       
   118     	void SetCurrentView(CCSXHGenericView* aView);
       
   119 /** 
       
   120 *  @function CheckForMSK
       
   121 *  @since S60 3.2
       
   122 *  Checks Msk flag is Enabled or not, If Enabled, Sets MSK Label
       
   123 */    	
       
   124     	void CheckForMSK();	
       
   125 /** 
       
   126 *  @function HightLightItemL
       
   127 *  @since S60 3.2
       
   128 *  Sets the selected item in the list box
       
   129 */
       
   130 		void HightLightItemL();		
       
   131 
       
   132 #ifdef FF_HELP_TUTORIAL_MERGE
       
   133         /**
       
   134         *  If the selected item is a tutorial item
       
   135         *  @since S60 3.2
       
   136         *  @param None
       
   137         *  @return A boolean value to indicate the item is tutorial or not
       
   138         *  Sets the selected item in the list box
       
   139         */
       
   140 		TBool IsShowTutorialItemSelectedL();
       
   141 #endif // FF_HELP_TUTORIAL_MERGE
       
   142 		
       
   143 
       
   144         void MakeVisible(TBool aVisible);
       
   145 
       
   146     protected: // From base classes.
       
   147 /**
       
   148  * When focus is changed, called.
       
   149  * Set focus editor(viewer).
       
   150  * @function FocusChanged
       
   151  * @since 3.2
       
   152  * @param aDrawNow used to determine whether or not
       
   153  *        redraw should occur now, or later
       
   154  */
       
   155         void FocusChanged(TDrawNow aDrawNow);			
       
   156     	
       
   157 	private:
       
   158 	
       
   159 /** 
       
   160 *  @function CCSXHGenericContainer
       
   161 *  @since S60 3.2
       
   162 *  Perform the second phase construction of a CCSXHDocument object
       
   163 *  @param aDocument - CCSXHDocument Object
       
   164 */
       
   165 #ifdef FF_HELP_TUTORIAL_MERGE
       
   166         CCSXHGenericContainer(CCSXHDocument &aDocument,CCSXHGenericView* aView);
       
   167 #else // !FF_HELP_TUTORIAL_MERGE
       
   168         CCSXHGenericContainer(CCSXHDocument &aDocument);
       
   169 #endif // FF_HELP_TUTORIAL_MERGE
       
   170 /** 
       
   171 *  @function ConstructL
       
   172 *  @since S60 3.2
       
   173 *  Perform the first phase of two phase construction
       
   174 *  @param aRect - TRect Object
       
   175 */
       
   176     	void ConstructL(const TRect& aRect);    	
       
   177 
       
   178 /** 
       
   179 *  @function CreateAndPopulateListL
       
   180 *  @since S60 3.2
       
   181 *  Creates a AVKON List & Inserts items into it.
       
   182 */
       
   183 		void CreateAndPopulateListL();	
       
   184 		
       
   185 		
       
   186 	private: 
       
   187 /** 
       
   188 *  From MEikListBoxObserver class
       
   189 *  @function HandleListBoxEventL
       
   190 *  @since S60 3.2
       
   191 *  This function handles List box Events
       
   192 *  @param aListBox 		- ListBox Pointer
       
   193 *		  aListBoxEvent - Event to be handled 	
       
   194 */
       
   195        	void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aListBoxEvent);	
       
   196 
       
   197 	private: // from CoeControl
       
   198 /** 
       
   199 *  From CoeControl class
       
   200 *  @function SizeChanged
       
   201 *  @since S60 3.2
       
   202 *  re-allocates and re-sizes components.
       
   203 */
       
   204        	void SizeChanged();
       
   205 /** 
       
   206 *  From CoeControl class
       
   207 *  @function CountComponentControls
       
   208 *  @since S60 3.2
       
   209 *  @return Number of child controls this has.  
       
   210 */       	
       
   211        	TInt CountComponentControls() const;
       
   212 
       
   213 /** 
       
   214 *  From CoeControl class
       
   215 *  @function ComponentControl
       
   216 *  @since S60 3.2
       
   217 * @param aIndex index of child controls
       
   218 * @retrun pointer to child control
       
   219 */       	
       
   220        	CCoeControl* ComponentControl(TInt aIndex) const;
       
   221 
       
   222 /** 
       
   223 *  From CoeControl class
       
   224 *  @function Draw
       
   225 *  @since S60 3.2
       
   226 *  Draw() for drawing the Background
       
   227 */       	
       
   228        	void Draw(const TRect& aRect) const;
       
   229 /** 
       
   230 *  From CoeControl class
       
   231 *  @function OfferKeyEventL
       
   232 *  @since S60 3.2
       
   233 *  Progress Key Event
       
   234 *  @param aKeyEvent the key event
       
   235 *  @param aType EEventKey | EEventKeyUp | EEventKeyDown
       
   236 *  @return EKeyWasConsumed if key event is processed,
       
   237 *         otherwise EKeyWasNotConsumed
       
   238 */       	
       
   239        	TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);	
       
   240             	
       
   241     private:	
       
   242        	CCSXHDocument& iDocument;
       
   243 	   	CAknSingleStyleListBox* iListBox;
       
   244        	CAknSearchField* iFindPane;
       
   245        	CCSXHGenericView* iView;
       
   246 
       
   247        	
       
   248 	};
       
   249 
       
   250 
       
   251 
       
   252 #endif /* INC_CSXHTOC2CONTAINER_H_HEADER_INCLUDED_BC039735 */