stifui/avkon/stifui/inc/Container.h
branchRCL_3
changeset 18 48060abbbeaf
parent 17 d40e813b23c0
child 19 b3cee849fa46
equal deleted inserted replaced
17:d40e813b23c0 18:48060abbbeaf
     1 /*
       
     2 * Copyright (c) 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: This file contains CTestCaseListBoxModel class
       
    15 * declaration
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef CCONTAINER_H
       
    20 #define CCONTAINER_H
       
    21 
       
    22 #include <e32std.h>
       
    23 // Define *.mbm file name.
       
    24 _LIT(KListMbmFileName, "\\Resource\\Apps\\Stifui.mbm");
       
    25 
       
    26 // INCLUDES
       
    27 #include "View.h"
       
    28 
       
    29 #include <coecntrl.h>
       
    30 #include <eiklbo.h>     //  MEikListBoxObserver
       
    31 #include <bamdesca.h>   //  MDesCArray
       
    32 #include <aknsfld.h>
       
    33 
       
    34 //#include "RRefArray.h"        
       
    35 //#include "UIEngine.h"         
       
    36 //#include "UIStoreIf.h"        
       
    37 //#include "UIStoreContainer.h" 
       
    38 
       
    39 #include <stifinternal/RRefArray.h>
       
    40 #include <stifinternal/UIEngine.h>
       
    41 #include <stifinternal/UIStoreIf.h>
       
    42 #include <stifinternal/UIStoreContainer.h>
       
    43    
       
    44 // FORWARD DECLARATIONS
       
    45 class CEikTextListBox;
       
    46 class CDesC16Array;
       
    47 
       
    48 //class CTestSetInsertMenuView;
       
    49 class CEikColumnListBox;
       
    50 class CStartedTestCase;
       
    51 
       
    52 class CUIStoreHandler;
       
    53 class CUIStore;
       
    54 class CUIStoreIf;
       
    55 class CUIEngineContainer;
       
    56 class CUIEngine;
       
    57 
       
    58 // CLASS DECLARATION
       
    59 
       
    60 class CTestCaseListBoxModel : public CBase, public MDesCArray
       
    61     {
       
    62     public:
       
    63         /**
       
    64         * Destructor.
       
    65         */
       
    66         ~CTestCaseListBoxModel();
       
    67         
       
    68         /**
       
    69         * Two-phased constructor.
       
    70         * @param aTestCasesInView Array of test cases in view.
       
    71         * @return Pointer to created list box model.
       
    72         */
       
    73         static CTestCaseListBoxModel* NewL(
       
    74             RPointerArray<CTestInfo>* aTestCasesInView);
       
    75 
       
    76     public: // Functions from base classes
       
    77     
       
    78         /**
       
    79         * Returns the number of descriptor elements in the array.
       
    80         * @return The number of descriptor elements.
       
    81         */
       
    82         virtual TInt MdcaCount() const;
       
    83         
       
    84         /**
       
    85         * Indexes into a descriptor array.
       
    86         * @param aIndex The position of the descriptor element within the
       
    87         *               array. The position is relative to zero; i.e. zero
       
    88         *               implies the first descriptor element in the array. 
       
    89         *               This value must be non-negative and less than the 
       
    90         *               number of descriptors currently within the array 
       
    91         *               otherwise the operator panics with 
       
    92         *               EArrayIndexOutOfRange. 
       
    93         * @return A non-modifiable pointer descriptor representing the 
       
    94         *         descriptor element located at position aIndex within 
       
    95         *         the array.
       
    96         */
       
    97         virtual TPtrC MdcaPoint( TInt aIndex ) const;
       
    98     protected:
       
    99         /**
       
   100         * Symbian OS two phased constructor.
       
   101         * Completes the construction of the object.
       
   102         */
       
   103         void ConstructL();
       
   104     
       
   105     protected: //data
       
   106         RPointerArray<CTestInfo>*   iTestCasesInView;
       
   107         HBufC*                      iBuffer;
       
   108         
       
   109     private: //data
       
   110         
       
   111     };
       
   112     
       
   113 /**
       
   114 *  CContainer  container control class.
       
   115 *  
       
   116 */
       
   117 class CContainer : public CCoeControl
       
   118     {
       
   119     public: // Constructors and destructor
       
   120         
       
   121         /**
       
   122         * Symbian OS default constructor.
       
   123         * @param aRect Frame rectangle for container.
       
   124         */
       
   125         void ConstructL();
       
   126 
       
   127         /**
       
   128         * Destructor.
       
   129         */
       
   130         ~CContainer();
       
   131 
       
   132     public: // New functions
       
   133     
       
   134         /**
       
   135         * Show only testcases which are defined is specified module.
       
   136         * @param aModuleName Module which test cases are shown.
       
   137         */
       
   138         virtual void FilterCasesByModuleL(TName aModuleName);
       
   139         
       
   140         /**
       
   141         * Show only testcases which are defined in specified test case file.
       
   142         * @param aTestCaseFileName Test cases file name.
       
   143         */
       
   144         virtual void FilterCasesByTCFileNameL(TFileName aTestCaseFileName);
       
   145         
       
   146         /**
       
   147         * Remove possible filtering of test cases -> show all test cases.
       
   148         */
       
   149         virtual void NoFilteringL();
       
   150         
       
   151         /**
       
   152         * Returns pointers to selected test cases.
       
   153         * @param aSelectedTestCases Currently selected test case.
       
   154         */
       
   155         virtual void SelectedTestCases(RPointerArray<CTestInfo>& aSelectedTestCases);
       
   156 
       
   157         /**
       
   158         * Returns pointers to currently (in list box) selected test cases info.
       
   159         * @return Currently selected test case info.
       
   160         */
       
   161         virtual CTestInfo* SelectedTestCaseInfo();
       
   162         
       
   163         /**
       
   164         * Returns pointers to selected test cases info.
       
   165         * @param aIndex test case index
       
   166         * @return Currently selected test case info.
       
   167         */
       
   168         virtual CTestInfo* TestCaseInfo( TInt aIndex );
       
   169         
       
   170         /**
       
   171         * Sets graphic icon using listbox as CEikColumnListBox.
       
   172         * @param aListBox Pointer to list box.
       
   173         */
       
   174         virtual void SetGraphicIconL( CEikColumnListBox* aListBox );
       
   175 
       
   176         /**
       
   177         * Appends graphics data.
       
   178         * @param aIcons Pointer array of icons.
       
   179         */
       
   180         virtual void GraphicIconL( CArrayPtr<CGulIcon>* aIcons );
       
   181         
       
   182         /**
       
   183         * Gets the index number of the current item in the view.
       
   184         * @return Index number of the current item.
       
   185         */
       
   186         virtual TInt CurrentItemIndex();
       
   187         
       
   188         /**
       
   189         * Sets the current item.
       
   190         * @param aIndex Index of the item to make current.
       
   191         */
       
   192         virtual void SetCurrentItemIndex(TInt aCurrentTestCase);
       
   193 		
       
   194 		/**
       
   195 		* Inline function for getting pointer to list box.
       
   196 		* @return Pointer to list box.
       
   197 		*/
       
   198 		virtual inline CEikListBox* ListBox() { return (CEikListBox*)iListBox; };
       
   199 		
       
   200 		
       
   201 		
       
   202 		/**
       
   203 		* Processes user commands.
       
   204 		* @param aCommand ID of the command to respond to.
       
   205 		*/
       
   206 		virtual void ProcessCommandL( TInt  aCommand );
       
   207 		
       
   208 		/**
       
   209 		* Processes user commands.
       
   210 		* @param aCommand ID of the command to respond to.
       
   211 		*/
       
   212 		virtual void SelectionListProcessCommandL( TInt  aCommand );
       
   213 		
       
   214 		/**
       
   215 		* Handles mark commands.
       
   216 		* @param aCommand ID of the command to respond to.
       
   217 		*/
       
   218 		virtual void HandleMarkCommandL( TInt aCommand );
       
   219 		
       
   220 		
       
   221 		
       
   222     public: // Functions from base classes
       
   223 
       
   224     private: // Functions from base classes
       
   225 
       
   226         /**
       
   227         * From CoeControl,SizeChanged.
       
   228         * Called by framework when the view size is changed.
       
   229         */
       
   230         virtual void SizeChanged();
       
   231 
       
   232 
       
   233 
       
   234 
       
   235         /**
       
   236         * From CoeControl,CountComponentControls.
       
   237         * Gets a count of the component controls of this list box control.
       
   238         * This information is used for DrawNow().
       
   239         */
       
   240         virtual TInt CountComponentControls() const;
       
   241 
       
   242         /**
       
   243         * From CCoeControl,ComponentControl.
       
   244         * Gets a pointer to the specified component control.
       
   245         * @param aIndex Index of the component control to look up.
       
   246         * @return The control at aIndex.
       
   247         */
       
   248         virtual CCoeControl* ComponentControl(TInt aIndex) const;
       
   249 
       
   250 
       
   251 
       
   252         /**
       
   253         * From CCoeControl,Draw.
       
   254         * Draw a control, called by window server.
       
   255         * @param aRect The region of the control to be redrawn. Co-ordinates
       
   256         *              are relative to the control's origin (top left corner).
       
   257         */
       
   258         virtual void Draw(const TRect& aRect) const;
       
   259         
       
   260     protected: //data
       
   261         
       
   262         CView*                          iParentView;
       
   263         CEikColumnListBox*              iListBox;
       
   264         //CEikTextListBox*                iListBox;
       
   265         CTestCaseListBoxModel*          iListBoxModel;
       
   266         RPointerArray<CTestInfo>        iTestCasesInView;
       
   267         CUIStore*                       iUIStore;
       
   268                         
       
   269     private: //data
       
   270         
       
   271     };
       
   272 
       
   273 #endif // CTestSetInsertMenuContainer_H
       
   274 
       
   275 // End of File