taskswitcher/testapplications/generator/generator/common/inc/helloworldbasicappview.h
changeset 117 c63ee96dbe5f
equal deleted inserted replaced
115:3ab5c078b490 117:c63ee96dbe5f
       
     1 /*
       
     2 * ==============================================================================
       
     3 *  Name        : helloworldbasicappview.h
       
     4 *  Part of     : Helloworldbasic
       
     5 *  Interface   :
       
     6 *  Description :
       
     7 *  Version     :
       
     8 *
       
     9 *  Copyright (c) 2005-2006 Nokia Corporation.
       
    10 *  This material, including documentation and any related
       
    11 *  computer programs, is protected by copyright controlled by
       
    12 *  Nokia Corporation.
       
    13 * ==============================================================================
       
    14 */
       
    15 
       
    16 #ifndef __HELLOWORLDBASICAPPVIEW_H__
       
    17 #define __HELLOWORLDBASICAPPVIEW_H__
       
    18 
       
    19 // INCLUDES
       
    20 #include <coecntrl.h>
       
    21 
       
    22 // CLASS DECLARATION
       
    23 class CHelloWorldBasicAppView : public CCoeControl
       
    24     {
       
    25     public: // New methods
       
    26 
       
    27         /**
       
    28         * NewL.
       
    29         * Two-phased constructor.
       
    30         * Create a CHelloWorldBasicAppView object, which will draw itself to aRect.
       
    31         * @param aRect The rectangle this view will be drawn to.
       
    32         * @return a pointer to the created instance of CHelloWorldBasicAppView.
       
    33         */
       
    34         static CHelloWorldBasicAppView* NewL( const TRect& aRect );
       
    35 
       
    36         /**
       
    37         * NewLC.
       
    38         * Two-phased constructor.
       
    39         * Create a CHelloWorldBasicAppView object, which will draw itself
       
    40         * to aRect.
       
    41         * @param aRect Rectangle this view will be drawn to.
       
    42         * @return A pointer to the created instance of CHelloWorldBasicAppView.
       
    43         */
       
    44         static CHelloWorldBasicAppView* NewLC( const TRect& aRect );
       
    45 
       
    46         /**
       
    47         * ~CHelloWorldBasicAppView
       
    48         * Virtual Destructor.
       
    49         */
       
    50         virtual ~CHelloWorldBasicAppView();
       
    51 
       
    52        /**
       
    53         * GetText
       
    54         * @return modifiable reference to the descriptor, which stores
       
    55         *   user-given text
       
    56         */
       
    57         TDes& GetText();
       
    58 
       
    59     public:  // Functions from base classes
       
    60 
       
    61         /**
       
    62         * From CCoeControl, Draw
       
    63         * Draw this CHelloWorldBasicAppView to the screen.
       
    64         * If the user has given a text, it is also printed to the center of
       
    65         * the screen.
       
    66         * @param aRect the rectangle of this view that needs updating
       
    67         */
       
    68         void Draw( const TRect& aRect ) const;
       
    69 
       
    70         /**
       
    71         * From CoeControl, SizeChanged.
       
    72         * Called by framework when the view size is changed.
       
    73         */
       
    74         virtual void SizeChanged();
       
    75 
       
    76     private: // Constructors
       
    77 
       
    78         /**
       
    79         * ConstructL
       
    80         * 2nd phase constructor.
       
    81         * Perform the second phase construction of a
       
    82         * CHelloWorldBasicAppView object.
       
    83         * @param aRect The rectangle this view will be drawn to.
       
    84         */
       
    85         void ConstructL(const TRect& aRect);
       
    86 
       
    87         /**
       
    88         * CHelloWorldBasicAppView.
       
    89         * C++ default constructor.
       
    90         */
       
    91         CHelloWorldBasicAppView();
       
    92 
       
    93     private:
       
    94 
       
    95        /**
       
    96         * font used, when printing user-given text to the screen
       
    97         */
       
    98         const CFont* iFont;
       
    99 
       
   100        /**
       
   101         * descriptor storing the user-given text
       
   102         */
       
   103         TBuf<24> iText;
       
   104     };
       
   105 
       
   106 #endif // __HELLOWORLDBASICAPPVIEW_H__
       
   107 
       
   108 // End of File
       
   109