S60 5th Edition SDK
Example Applications Guide

helloworldbasicappview.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : helloworldbasicappview.h
00004 *  Part of     : Helloworldbasic
00005 *  Interface   :
00006 *  Description :
00007 *  Version     :
00008 *
00009 *  Copyright (c) 2005-2006 Nokia Corporation.
00010 *  This material, including documentation and any related
00011 *  computer programs, is protected by copyright controlled by
00012 *  Nokia Corporation.
00013 * ==============================================================================
00014 */
00015 
00016 #ifndef __HELLOWORLDBASICAPPVIEW_H__
00017 #define __HELLOWORLDBASICAPPVIEW_H__
00018 
00019 // INCLUDES
00020 #include <coecntrl.h>
00021 
00022 // CLASS DECLARATION
00023 class CHelloWorldBasicAppView : public CCoeControl
00024     {
00025     public: // New methods
00026 
00027         /**
00028         * NewL.
00029         * Two-phased constructor.
00030         * Create a CHelloWorldBasicAppView object, which will draw itself to aRect.
00031         * @param aRect The rectangle this view will be drawn to.
00032         * @return a pointer to the created instance of CHelloWorldBasicAppView.
00033         */
00034         static CHelloWorldBasicAppView* NewL( const TRect& aRect );
00035 
00036         /**
00037         * NewLC.
00038         * Two-phased constructor.
00039         * Create a CHelloWorldBasicAppView object, which will draw itself
00040         * to aRect.
00041         * @param aRect Rectangle this view will be drawn to.
00042         * @return A pointer to the created instance of CHelloWorldBasicAppView.
00043         */
00044         static CHelloWorldBasicAppView* NewLC( const TRect& aRect );
00045 
00046         /**
00047         * ~CHelloWorldBasicAppView
00048         * Virtual Destructor.
00049         */
00050         virtual ~CHelloWorldBasicAppView();
00051 
00052        /**
00053         * GetText
00054         * @return modifiable reference to the descriptor, which stores
00055         *   user-given text
00056         */
00057         TDes& GetText();
00058 
00059     public:  // Functions from base classes
00060 
00061         /**
00062         * From CCoeControl, Draw
00063         * Draw this CHelloWorldBasicAppView to the screen.
00064         * If the user has given a text, it is also printed to the center of
00065         * the screen.
00066         * @param aRect the rectangle of this view that needs updating
00067         */
00068         void Draw( const TRect& aRect ) const;
00069 
00070         /**
00071         * From CoeControl, SizeChanged.
00072         * Called by framework when the view size is changed.
00073         */
00074         virtual void SizeChanged();
00075 
00076     private: // Constructors
00077 
00078         /**
00079         * ConstructL
00080         * 2nd phase constructor.
00081         * Perform the second phase construction of a
00082         * CHelloWorldBasicAppView object.
00083         * @param aRect The rectangle this view will be drawn to.
00084         */
00085         void ConstructL(const TRect& aRect);
00086 
00087         /**
00088         * CHelloWorldBasicAppView.
00089         * C++ default constructor.
00090         */
00091         CHelloWorldBasicAppView();
00092 
00093     private:
00094 
00095        /**
00096         * font used, when printing user-given text to the screen
00097         */
00098         const CFont* iFont;
00099 
00100        /**
00101         * descriptor storing the user-given text
00102         */
00103         TBuf<24> iText;
00104     };
00105 
00106 #endif // __HELLOWORLDBASICAPPVIEW_H__
00107 
00108 // End of File
00109 

© Nokia 2009

Back to top