stifui/stifui/inc/TestCaseOutputContainer.h
branchRCL_3
changeset 14 404ad6c9bc20
parent 13 87e9ebfbe96a
child 18 454d022d514b
equal deleted inserted replaced
13:87e9ebfbe96a 14:404ad6c9bc20
     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 CTestOutputListBoxModel class
       
    15 * declaration.
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef TESTCASEOUTPUTCONTAINER_H
       
    20 #define TESTCASEOUTPUTCONTAINER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <coecntrl.h>
       
    24 #include <eiklbo.h>
       
    25 #include <bamdesca.h>   // MDesCArray
       
    26 
       
    27 // #include "RRefArray.h"  
       
    28 #include <stifinternal/RRefArray.h>
       
    29 
       
    30 
       
    31 // Define *.mbm file name.
       
    32 _LIT(KMbmFileName, "\\Resource\\Apps\\Stifui.mbm");
       
    33 
       
    34 // FORWARD DECLARATIONS
       
    35 class CEikTextListBox;
       
    36 class CAknSingleGraphicStyleListBox;
       
    37 class CDesC16ArrayFlat;
       
    38 class CStartedTestCase;
       
    39 
       
    40 class CUIStore;
       
    41 
       
    42 // CLASS DECLARATION
       
    43 
       
    44 class CTestOutputListBoxModel : public CBase, public MDesCArray
       
    45     {
       
    46     public:
       
    47         /**
       
    48         * Destructor.
       
    49         */
       
    50         ~CTestOutputListBoxModel();
       
    51         
       
    52         /**
       
    53         * Two-phased constructor.
       
    54         * @param aStartedTestCase Pointer to started test case.
       
    55         * @return Pointer to created list box model.
       
    56         */
       
    57         static CTestOutputListBoxModel* NewL(CStartedTestCase* aStartedTestCase);
       
    58 
       
    59     public: // Functions from base classes
       
    60     
       
    61         /**
       
    62         * Returns the number of descriptor elements in the array.
       
    63         * @return The number of descriptor elements.
       
    64         */
       
    65         TInt MdcaCount() const;
       
    66         
       
    67         /**
       
    68         * Indexes into a descriptor array.
       
    69         * @param aIndex The position of the descriptor element within the
       
    70         *               array. The position is relative to zero; i.e. zero
       
    71         *               implies the first descriptor element in the array. 
       
    72         *               This value must be non-negative and less than the 
       
    73         *               number of descriptors currently within the array 
       
    74         *               otherwise the operator panics with 
       
    75         *               EArrayIndexOutOfRange. 
       
    76         * @return A non-modifiable pointer descriptor representing the 
       
    77         *         descriptor element located at position aIndex within 
       
    78         *         the array.
       
    79         */
       
    80         TPtrC MdcaPoint(TInt aIndex) const;
       
    81 
       
    82     private:
       
    83         /**
       
    84         * Symbian OS two phased constructor.
       
    85         * Completes the construction of the object.
       
    86         */
       
    87         void ConstructL();
       
    88 
       
    89     private: //data
       
    90         CStartedTestCase* iStartedTestCase;
       
    91         HBufC*            iBuffer;
       
    92 
       
    93     };
       
    94 
       
    95 /**
       
    96 *  CTestCaseOutputContainer  container control class.
       
    97 *  
       
    98 */
       
    99 class CTestCaseOutputContainer : public CCoeControl, public MEikListBoxObserver /* MCoeControlObserver */
       
   100     {
       
   101     public: // Constructors and destructor
       
   102         
       
   103         /**
       
   104         * Symbian OS default constructor.
       
   105         * @param aRect Frame rectangle for container.
       
   106         */
       
   107         //void ConstructL(const TRect& aRect, TInt aExecutedTestCaseCount );
       
   108         void ConstructL(const TRect& aRect, CStartedTestCase* aStartedTestCase );
       
   109 
       
   110         /**
       
   111         * Destructor.
       
   112         */
       
   113         ~CTestCaseOutputContainer();
       
   114 
       
   115     public: // New functions
       
   116         /**
       
   117         * Handles addition of item to list box.
       
   118         */
       
   119         void OutputUpdateL();
       
   120 
       
   121     private:
       
   122 
       
   123     public: // Functions from base classes
       
   124 
       
   125     private: // Functions from base classes
       
   126     
       
   127         /**
       
   128         * From CoeControl,SizeChanged.
       
   129         * Called by framework when the view size is changed.
       
   130         */
       
   131         void SizeChanged();
       
   132 
       
   133         /**
       
   134         * From CoeControl,CountComponentControls.
       
   135         * Gets a count of the component controls of this list box control.
       
   136         * This information is used for DrawNow().
       
   137         */
       
   138         TInt CountComponentControls() const;
       
   139 
       
   140         /**
       
   141         * From CCoeControl,ComponentControl.
       
   142         * Gets a pointer to the specified component control.
       
   143         * @param aIndex Index of the component control to look up.
       
   144         * @return The control at aIndex.
       
   145         */
       
   146         CCoeControl* ComponentControl(TInt aIndex) const;
       
   147 
       
   148         /**
       
   149         * From CCoeControl,Draw.
       
   150         * Draw a control, called by window server.
       
   151         * @param aRect The region of the control to be redrawn. Co-ordinates
       
   152         *              are relative to the control's origin (top left corner).
       
   153         */
       
   154         void Draw(const TRect& aRect) const;
       
   155        
       
   156         /**
       
   157         * Handles list box events.
       
   158         * @param aListBox The originating list box. 
       
   159         * @param aEventType A code for the event. Further information may be
       
   160         *                   obtained by accessing the list box itself.
       
   161         */
       
   162         void HandleListBoxEventL(CEikListBox* aListBox,TListBoxEvent aEventType);
       
   163 
       
   164         /**
       
   165         * From CCoeControl,OfferKeyEventL
       
   166         * Handles key events.
       
   167         * @param aKeyEvent The key event.
       
   168         * @param aType The type of key event.
       
   169         * @return Indicates whether or not the key event was used 
       
   170         *         by this control.
       
   171         */
       
   172 		TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
       
   173         
       
   174     private: //data
       
   175         
       
   176         CEikTextListBox*            iListBox;
       
   177         CTestOutputListBoxModel*    iListBoxModel;
       
   178         CUIStore*                   iUIStore;
       
   179 
       
   180     };
       
   181 
       
   182 #endif // TESTCASEOUTPUTCONTAINER_H
       
   183 
       
   184 // End of File