⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 focuseventappview.h

📁 用来学习 焦点 的 的例子,可以 好好看看焦点在 symbian中很重要,
💻 H
字号:
/*
* ==============================================================================
*  Name        : focuseventappview.h
*  Part of     : Focus event example
*  Interface   :
*  Description :
*  Version     :
*
*  Copyright (c) 2004 - 2006 Nokia Corporation.
*  This material, including documentation and any related
*  computer programs, is protected by copyright controlled by
*  Nokia Corporation.
* ==============================================================================
*/

#ifndef __FOCUSEVENT_APPVIEW_H__
#define __FOCUSEVENT_APPVIEW_H__

// INCLUDES
#include <coecntrl.h>
#include <eikedwob.h> 
#include "capturingkeys.h"

// CONSTANTS
static const TInt KMaxTextLines = 10;
static const TInt KTextXMargin = 10;
static const TInt KTextMinY = 20;
static const TInt KTextDistanceBetweenLines = 20;
static const TInt KTestFrameworkMaxScreenMessageLength = 100;
typedef TBuf<KTestFrameworkMaxScreenMessageLength> TTextLine;


class CEikEdwin;

// CLASS DECLARATION
class CFocusEventAppView : public CCoeControl,
                           public MEikEdwinObserver,
                           public MKeyCallBack
    {
    public: // Constructors and destructors

        /**
        * NewL.
        * Two-phased constructor.
        * Create a CFocusEventAppView object, which will draw itself to aRect.
        * @param aRect The rectangle this view will be drawn to.
        * @return a pointer to the created instance of CFocusEventAppView.
        */
        static CFocusEventAppView* NewL( const TRect& aRect );

        /**
        * NewLC.
        * Two-phased constructor.
        * Create a CFocusEventAppView object, which will draw itself to aRect.
        * @param aRect Rectangle this view will be drawn to.
        * @return A pointer to the created instance of CFocusEventAppView.
        */
        static CFocusEventAppView* NewLC( const TRect& aRect );

        /**
        * ~CFocusEventAppView.
        * Virtual Destructor.
        */
        virtual ~CFocusEventAppView();

    public: // New functions

        /**
        * ShowTextOnScreen.
        * Display text on the screen.
        * @param aText the text to display
        */
        void ShowTextOnScreen( const TDesC& aText );

        /**
        * Print.
        * Display/Write text via the selected methods.
        * @param aText the text to display
        */
        void Print( const TDesC& aText );

        /**
        * PrintNewLineL.
        * Display/Write a new line via the selected methods.
        */
        void PrintNewLineL();
        
        /**
        * ClearTextOnScreen.
        * Clear all text on the screen.
        */    
        void ClearTextOnScreen();

    private:  // from CCoeControl

        /**
        * Draw.
        * Draw this CFocusEventAppView to the screen.
        * @param aRect the rectangle of this view that needs updating
        */
        void Draw( const TRect& aRect ) const;
        
        /** From CoeControl, HandleResourceChange.
        * Called by framework when the view layout is changed.
        */
        virtual void HandleResourceChange(TInt aType);
        
        /**
         * From CoeControl, SizeChanged.
         * Called by framework when the view size is changed.
         */
        void SizeChanged();

        /**
         * From CoeControl, CountComponentControls.
         *
         */
        TInt CountComponentControls() const;

        /**
         * Gets an indexed component of a compound control
         * @param aIndex The index of the control
         */
        CCoeControl* ComponentControl(TInt aIndex) const;   
        
        /**
         * From CoeControl, OfferKeyEventL.
         * Handles the key-events.
         *
         * @param aKeyEvent Key event.
         * @param aType Type of key event(EEventKey, EEventKeyUp or
         *        EEventKeyDown).
         * @return If key-event is consumed, EKeyWasConsumed. Else
         * EKeyWasNotConsumed.
         */
        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
                                     TEventCode aType );
                                     
    private: // From MEikEdwinObserver 
        virtual void  HandleEdwinEventL( CEikEdwin *aEdwin, 
                                         TEdwinEvent aEventType ); 
                                         
    private: // From MKeyCallBack                                                                    
        virtual TBool KeyCapturedL(TWsEvent aEvent);
                 

    private: // Constructors

        /**
        * ConstructL.
        * 2nd phase constructor.
        * Perform the second phase construction of a CFocusEventAppView object.
        * @param aRect The rectangle this view will be drawn to.
        */
        void ConstructL( const TRect& aRect );

        /**
        * CFocusEventAppView.
        * C++ default constructor.
        */
        CFocusEventAppView();

    private: // Data

        /**
        * iTextLines
        * The lines of text being displayed on the screen
        */
        RArray <TTextLine> iTextLines;
        
        /**
         * Test edwin 1
         * own
         */
        CEikEdwin* iEdwin1;   
        
        /**
         * Test edwin 1
         * own
         */
        CEikEdwin* iEdwin2;  
        
        /**
         * Test edwin 1
         * own
         */
        CEikEdwin* iEdwin3;                       
        
    };

#endif // __FOCUSEVENT_APPVIEW_H__

// End of File

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -