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

📄 bookeditorview.h

📁 Symbian s60 3RD 数据库开发实例
💻 H
字号:
/*
 * ============================================================================
 *  Name     : BookEditorView from BookEditorView.h
 *  Part of  : Bookstore
 *  Created  : 8.12.2003 by Forum Nokia
 *  Version  : 1.0
 *  Copyright: Nokia Corporation
 * ============================================================================
 */

#ifndef __BOOKEDITORVIEW_H__
#define __BOOKEDITORVIEW_H__


#include <coecntrl.h>

// Forward declarations
class CEikLabel;
class CEikEdwin;

/**
 * Class:       CBookEditorView
 *
 * Description: An instance of this class is the Application View object for
 *              the Bookstore example application.
 *
 *              This is window owning container control. It shows three
 *              editboxes, where user can give in book properties.
 */
class CBookEditorView: public CCoeControl
    {

public:

    /**
     * Function:    NewL
     *
     * Description: Create a CBookEditorView object, which will draw
     *              itself to aRect.
     *
     * Param:       aRect the rectangle this view will be drawn to
     *
     * Returns:     A pointer to the created instance of CBookEditorView
     */
    static CBookEditorView* NewL(const TRect& aRect);

    /**
     * Function:    ~CBookEditorView
     * Description: Destroy the object
     */
     ~CBookEditorView();

public:  // For the use of CBookstoreAppUi

    /**
     * Function:    GetAuthor
     *
     * Description: Returns author in the iEdwinAuthor editor field.
     *              Provide long enough descriptor.
     */
    void GetAuthor(TDes& aResult) const;

    /**
     * Function:    GetTitle
     *
     * Description: Returns book title in the iEdwinTitle editor field.
     *              Provide long enough descriptor.
     */
    void GetTitle(TDes& aResult) const;

    /**
     * Function:    GetDescription
     *
     * Description: Returns book description in the iEdwinDescription
     *              editor field. Provide long enough descriptor.
     */
    void GetDescription(TDes& aResult) const;

private: // Construction

    /**
     * Function:    ConstructL
     *
     * Description: Perform the second phase construction of a
     *              CBookEditorView object.
     *
     * Param:       aRect the rectangle this view will be drawn to
     */
    void ConstructL(const TRect& aRect);

    /**
     * Function:   CBookEditorView
     *
     * Description: Perform the first phase of two phase construction.
     */
    CBookEditorView();


private: // from CCoeControl

    /**
     * Function:    SizeChanged
     *
     * Description: Determines controls' sizes according to current state.
     */
    void SizeChanged();

    /**
     * Function:     CountComponentControls
     *
     * Returns:      Number of controls within this container.
     */
    TInt CountComponentControls() const;

    /**
     * Function:     ComponentControl
     *
     * Param:        aIndex of control
     *
     * Returns:      One of the controls this class owns.
     */
    CCoeControl* ComponentControl(TInt aIndex) const;

    /**
     * Function:     Draw
     *
     * Description:  Paints this container control (but not
     *               the controls within this container).
     *
     * Param:        aRect Frame rectangle for container.
     */
    void Draw(const TRect& aRect) const;

    /**
     * Function:     OfferKeyEventL
     *
     * Description:  Handles key events for this control. Mostly forwards
     *               them to contained controls (editor controls)
     *
     * Param:        aKeyEvent The key event.
     *
     * Param:        aType The type of the event.
     *
     * Returns:      Indicates whether or not the key event was
     *               used (consumed) by this control.
     */
    TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,
                                TEventCode aType);

private:

    CEikLabel* iLabelAuthor;
    CEikLabel* iLabelTitle;
    CEikLabel* iLabelDescription;

    CEikEdwin* iEdwinAuthor;
    CEikEdwin* iEdwinTitle;
    CEikEdwin* iEdwinDescription;
    };


#endif // __BOOKEDITORVIEW_H__

⌨️ 快捷键说明

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