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

📄 aoexampleappui.h

📁 Active Object实现动画
💻 H
字号:
/*
* ==============================================================================
*  Name     : CAOExampleAppUi from AOExampleAppUi.h
*  Part of  : AOExample
*  Created  : 3.5.2004 by Markus Pelkonen
*  Description: Declares the UI class for the application.
*  Version  :
*  Copyright: Nokia
* ==============================================================================
*/

#ifndef AOEXAMPLEAPPUI_H
#define AOEXAMPLEAPPUI_H

#include <eikapp.h>
#include <eikdoc.h>
#include <e32std.h>
#include <coeccntx.h>
#include <aknappui.h>
#include "AOExampleEngine.h"

class CAOExampleContainer;
class CEikEdwin;

/**
 * Application UI class.  Provides support for the EIKON control architecture.
 *
 * This constructs an UI having one CAOExampleContainer. During construction
 * this creates an instance of AOExampleEngine. When user requests to fetch a
 * document, the engine is requested to do the work. This class gets
 * notifications when document is fetched or fetch is cancelled through
 * MEngineObserver interface.
 */
class CAOExampleAppUi : public CAknAppUi,
                        public CAOExampleEngine::MEngineObserver
    {
    public: // methods

        /**
        * Constructs this object ready for action. The container, the engine and
        * the dynamic buffer attributes are constructed.
        */
        void ConstructL();

        /**
        * Destructor.
        */
        ~CAOExampleAppUi();

    private: // From MEikMenuObserver

        virtual void DynInitMenuPaneL( TInt aResourceId,
                                       CEikMenuPane* aMenuPane );

    private: // From CAknAppUi

        /**
        * Handles the menu commands requested by the user.
        *
        * If the user did select to fetch a file the implementation asks the
        * engine to fetch the file asynchronously. The engine notifies this
        * class though method FileFetched(CBufBase*) when the document is
        * fetched through Cancelled(const TDesC&) if it failed to fetch the
        * content.
        *
        * If the user did select exit action, the application is shut down.
        */
        virtual void HandleCommandL( TInt aCommand );

        /**
        * Processes keys the user has pressed. The container is designed
        * to process all key presses in this application so key events
        * are forwarded to container method
        * OfferKeyEventL(const TKeyEvent&,TEventCode).
        */
        virtual TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent,
                                              TEventCode aType );

    private: // From MEngineObserver

        /**
         * Called by the example engine when the document is fetched.
         * The content is shown in the editor component.
         * @see CAOEngineExample::MEngineObserver
         */
        virtual void FileFetched(CBufBase* aContent);

        /**
         * Called by the example engine if document couln't be
         * fetched. The error message is shown in the editor
         * component.
         * @see CAOEngineExample::MEngineObserver
         */
        virtual void Cancelled(const TDesC& aReason);

        /**
         * Called when by the engine. The event is shown in editor.
         * @see CAOEngineExample::MEngineObserver
         */
        virtual void ToState(CAOExampleEngine::TStates aState);

    private: // attributes

        CAOExampleContainer*      iAppContainer;
        CAOExampleEngine*         iAOExampleEngine;
        CBufFlat*                 iBuf;
        TBuf<128>                 iUrl;
        CAOExampleEngine::TStates iPrevState;
    };

#endif

⌨️ 快捷键说明

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