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

📄 ocrexampletextcontainer.h

📁 基于symbian 平台 ocr 示例程序
💻 H
字号:
/*
* ==============================================================================
*  Name        : OcrExampleTextContainer.h
*  Part of     : OcrExample
*  Interface   :
*  Description :
*  Version     :
*
*  Copyright (c) 2006 Nokia Corporation.
*  This material, including documentation and any related
*  computer programs, is protected by copyright controlled by
*  Nokia Corporation.
* ==============================================================================
*/

#ifndef OCREXAMPLETESTCONTAINER_H
#define OCREXAMPLETESTCONTAINER_H

// INCLUDES
#include <coecntrl.h>

class CEikGlobalTextEditor;

/**
* TTextContainerData-struct maintains state-information of TextContainer
* This is a POD-type, but offers a constructor to initialize fields to default
* values.
*/
struct TTextContainerData
    {
    /** ctor. Sets the default values */
    TTextContainerData(): iStartPosition(0) {}

    /** position of cursor, when the view is activated */
    TInt    iStartPosition;
    };

/**
 * COcrExampleTextContainer
 * this container implements a "console view", which shows the results of
 * layout analysis and recognition operations. The text is read from the data
 * file, into which the image handling controller writes the data.
 */
class COcrExampleTextContainer : public CCoeControl
    {
    public:
		/**
		* NewL.
		* Two-phased constructor.
		* Construct a COcrExampleTextContainer using two phase construction,
		* and return a pointer to the created object
		* @return A pointer to the created instance of COcrExampleTextContainer
		*/
		static COcrExampleTextContainer* NewL(const TRect& aRect,
		                                      TTextContainerData& aData );
        /** Destructor. */
        virtual ~COcrExampleTextContainer();

        /** imports the content of datafile into read-only editor */
        void ReadTextFromFileL();

        /** sets cursor's starting position, when the view is activated */
        void AdjustCursorL();

    private:
        /** C++ constructor. */
        COcrExampleTextContainer( TTextContainerData& aData );

        /** Symbian OS default constructor. */
        void ConstructL(const TRect& aRect);

    public: // Functions from base classes

        /** From CCoeControl to activate container */
        void ActivateL();

    protected: // Functions from base classes

        /** From CCoeControl set the size and position of its controls. */
        void SizeChanged();

        /**
        * From CCoeControl return the number of controls owned
        * @return TInt number of controls
        */
        TInt CountComponentControls() const;

        /**
        * From CCoeControl returns a control
        * @param aIndex index of a control
        * @return CCoeControl* pointer on a control
        */
        CCoeControl* ComponentControl(TInt aIndex) const;

        /**
        * From CCoeControl event handling section
        * @param aKeyEvent the key event
        * @param aType the type of the event
        * @return TKeyResponse key event was used by this control or not
        */
        TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent,
                                     TEventCode aType );

        /** From CCoeControl */
	    void Draw(const TRect& aRect) const;

    private: //data

        /** pointer to read-only editor */
	    CEikGlobalTextEditor*   iEditor;

        /** state-data of this container */
	    TTextContainerData&     iData;
    };

#endif  //OCREXAMPLETESTCONTAINER_H

// End of File

⌨️ 快捷键说明

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