Nokia N97 SDK
Example Applications Guide

focuseventappview.h

00001 /*
00002 * ==============================================================================
00003 *  Name        : focuseventappview.h
00004 *  Part of     : Focus event example
00005 *  Interface   :
00006 *  Description :
00007 *  Version     :
00008 *
00009 *  Copyright (c) 2004 - 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 __FOCUSEVENT_APPVIEW_H__
00017 #define __FOCUSEVENT_APPVIEW_H__
00018 
00019 // INCLUDES
00020 #include <coecntrl.h>
00021 
00022 // CONSTANTS
00023 static const TInt KMaxTextLines = 7;
00024 static const TInt KTextXMargin = 10;
00025 static const TInt KTextMinY = 20;
00026 static const TInt KTextDistanceBetweenLines = 20;
00027 static const TInt KTestFrameworkMaxScreenMessageLength = 100;
00028 typedef TBuf<KTestFrameworkMaxScreenMessageLength> TTextLine;
00029 
00030 
00031 // CLASS DECLARATION
00032 class CFocusEventAppView : public CCoeControl
00033     {
00034     public: // Constructors and destructors
00035 
00036         /**
00037         * NewL.
00038         * Two-phased constructor.
00039         * Create a CFocusEventAppView object, which will draw itself to aRect.
00040         * @param aRect The rectangle this view will be drawn to.
00041         * @return a pointer to the created instance of CFocusEventAppView.
00042         */
00043         static CFocusEventAppView* NewL( const TRect& aRect );
00044 
00045         /**
00046         * NewLC.
00047         * Two-phased constructor.
00048         * Create a CFocusEventAppView object, which will draw itself to aRect.
00049         * @param aRect Rectangle this view will be drawn to.
00050         * @return A pointer to the created instance of CFocusEventAppView.
00051         */
00052         static CFocusEventAppView* NewLC( const TRect& aRect );
00053 
00054         /**
00055         * ~CFocusEventAppView.
00056         * Virtual Destructor.
00057         */
00058         virtual ~CFocusEventAppView();
00059 
00060     public: // New functions
00061 
00062         /**
00063         * ShowTextOnScreen.
00064         * Display text on the screen.
00065         * @param aText the text to display
00066         */
00067         void ShowTextOnScreen( const TDesC& aText );
00068 
00069         /**
00070         * Print.
00071         * Display/Write text via the selected methods.
00072         * @param aText the text to display
00073         */
00074         void Print( const TDesC& aText );
00075 
00076         /**
00077         * PrintNewLineL.
00078         * Display/Write a new line via the selected methods.
00079         */
00080         void PrintNewLineL();
00081 
00082     private:  // from CCoeControl
00083 
00084         /**
00085         * Draw.
00086         * Draw this CFocusEventAppView to the screen.
00087         * @param aRect the rectangle of this view that needs updating
00088         */
00089         void Draw( const TRect& aRect ) const;
00090         
00091         /** From CoeControl, HandleResourceChange.
00092         * Called by framework when the view layout is changed.
00093         */
00094         virtual void HandleResourceChange(TInt aType);
00095 
00096     private: // Constructors
00097 
00098         /**
00099         * ConstructL.
00100         * 2nd phase constructor.
00101         * Perform the second phase construction of a CFocusEventAppView object.
00102         * @param aRect The rectangle this view will be drawn to.
00103         */
00104         void ConstructL( const TRect& aRect );
00105 
00106         /**
00107         * CFocusEventAppView.
00108         * C++ default constructor.
00109         */
00110         CFocusEventAppView();
00111 
00112     private: // Data
00113 
00114         /**
00115         * iTextLines
00116         * The lines of text being displayed on the screen
00117         */
00118         RArray <TTextLine> iTextLines;
00119         
00120     };
00121 
00122 #endif // __FOCUSEVENT_APPVIEW_H__
00123 
00124 // End of File

© Nokia 2009

Back to top