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

📄 aknexquerycontainer.h

📁 symbian中询问对话框生成的源代码 适合初学者使用。
💻 H
📖 第 1 页 / 共 2 页
字号:
/*  Copyright (c) 2004, Nokia. All rights reserved */

#ifndef __AKNEXQUERYCONTAINER_H__
#define __AKNEXQUERYCONTAINER_H__

// INCLUDES
#include <coecntrl.h>
#include <coecobs.h>
#include <AknGlobalListQuery.h>
#include <AknQueryDialog.h>
#include <aknglobalmsgquery.h>     // for global message query
#include <AknPopup.h>
#include "AknExQueryGlobalListObserver.h"

// CONSTANTS
const TInt KAknExQueryInitialId = 0;
const TInt KAknExQueryTextBufLength = 128;

#define KAknExQueryGray TRgb( 0xaaaaaa )
#define AKNEXQUERY_LABEL_ORIGIN TPoint( 0, 0 )
#define AKNEXQUERY_LABEL2_POSITION TPoint( 0, 20 )
#define AKNEXQUERY_POPUP_MENU_SIZE TSize( 80, 80 )

const TInt KAknExQueryCountComponentControls = 1;
const TInt KAknExQueryText2BufLength = 32;
const TInt KAknExQueryTextMaxLength = 256;
const TInt KAknExQueryTextLargeMessageLength = 1024; 
const TInt KAknExQueryCodeBufLength = 8;
const TInt KAknExQueryNameColumnIndex = 0;
const TInt KAknExQueryNameGapColumnIndex = 1;
const TInt KAknExQueryArrayFlatResourceId = 1;
const TInt KAknExQueryListBoxRectPointX = 30;
const TInt KAknExQueryListBoxRectPointY = 15;
const TInt KAknExQueryListBoxRectWidth = 120;
const TInt KAknExQueryListBoxRectHeight = 120;

_LIT( KAvkonMbmFilePath, "z:\\system\\data\\avkon.mbm" );
_LIT( KAknExQueryMbmFilePath, "\\system\\apps\\aknexquery\\aknexquery.mbm" );
_LIT( KAknExQueryDefaultDataText, "Hello" );
_LIT( KAknExQueryDefaultPhoneNumber, "12345" );
_LIT( KAknExQueryItText, "it" );

// FORWARD DECLARATIONS
class CEikLabel;
class CEikColumnListBox;
class CAknExQueryView;
class CAknExQueryBaseListEventHandler;

// CLASS DECLARATION

/**
* CAknExQueryContainer  container control class.
*/
class CAknExQueryContainer : public CCoeControl
    {
    public:
        //Type of actions to be performed at timer expiry
        enum TTimerUpdateType {
	        ENoUpdate          = 0, //default
	        EUpdateGlobalQuery,
            ECancelGlobalQuery,
            ECancelListQuery,
            ECancelPopupList,
            EUpdateGlobalListQueryUp,
            EUpdateGlobalListQueryDown,
            EUpdateGlobalListQuerySelect,
            ECancelQueryAnim,
            ENoTimer
	        };

    private: // Enumerations

        enum TAknExQueryComponentControls
            {
            EAknExQueryComponentLabel, //0
            EAknExQueryComponentLabel2, //1 
            EAknExQueryComponentListBox //2
            };

    public: // Constructors and destructor

        /**
        * CAknExQueryContainer
        * Constructor.
        * @param aView Pointer to View class object.
        */
        CAknExQueryContainer( CAknExQueryView* aView );

        /**
        * ConstructL
        * Symbian default constructor.
        * @param aRect Frame rectangle for container.
        */
        void ConstructL( const TRect& aRect );

        /**
        * ~CAknExQueryContainer
        * Destructor.
        */
        virtual ~CAknExQueryContainer();

    public: // New functions

        /**
        * ShowConfirmationQueryL
        * Shows confirmation query.
        * @param aResourceId for dialog.
        * @param aTextResourceId for prompt.
        * @param aToneFlaga is flag for adding tone to argument of constructor.
        * @param aPromptFlag is flag for displaying prompt dynamically.
        */
        void ShowConfirmationQueryL( 
            const TInt aResourceId,
            const TInt aTextResourceId = 0,
            const TBool aPromptFlag = EFalse,
            const TBool aToneFlag = EFalse,
            const TBool aHeaderTextAndImageFlag = EFalse,
			const CAknQueryDialog::TTone aTone = CAknQueryDialog::ENoTone );
 

        /**
        * ShowDataQueryL
        * Shows data query.
        * @param aResourceId for dialog.
        * @param aTextResourceId for inial value.
        * @param aPromptResourceId for ptompt
        * @param aMaxLength sets up the length of the character.
        */
        void ShowDataQueryL( 
            const TInt aQueryResourceId,
            const TInt aTextResourceId = 0,
            const TInt aPromptResoureId = 0,
            const TInt aMaxLength = 0,
            const TInt aDisplayFlag = ETrue );


        /**
        * ShowTimeQueryL
        * Shows time query.
        * @param aResourceQueryId for dialog
        * @param aResourceValued for inial value
        * @param aResourcePromptId for prompt
        */
        void ShowTimeQueryL( 
            TInt aResourceQueryId, 
            TInt aResourceValueId, 
            TInt aResourcePromptId = 0 );

        /**
        * ShowDurationLayoutL
        * Shows duration layout.
        */
        void ShowDurationLayoutL();

        /**
        * ShowNumberLayoutL
        * Shows number layout.
        */
        void ShowNumberLayoutL( const TInt aResourceId, 
                                const TInt aPromptResouceId = 0,
                                const TInt aQueryValue = 0, 
                                TInt aMinimumValue = 0, 
                                TInt aMaximumValue = 0 );

        /**
        * ShowPopupSubMenuLayoutL
        * Show popup menu layout.
        * @param aTitle.
        */
        void ShowPopupSubMenuLayoutL( TBool aTitle );

        /**
        * ShowListQueryL
        * Show list query.
        * @param aResourceId.
        */
        void ShowListQueryL( const TInt aResourceId );
 
        /**
        * PopoutListBoxL
        * Create handler.
        * @param aCommand.
        */
        void PopoutListBoxL( TInt aCommand );

        /**
        * CreateListBoxL
        * Creates listbox object.
        * @param aCommand.
        */
        TBool CreateListBoxL( TInt aCommand );

        /**
        * DeleteListBoxL
        * Deletes listbox object.
        */
        void DeleteListBoxL();

        /**
        * CreateLabelL
        * Creates label object.
        * @param aResourceId.
        */
        void CreateLabelL( TInt aResourceId );

        /**
        * DeleteLabelL
        * Deletes label object.
        */
        void DeleteLabelL();

        /**
        * SetTextToLabelL
        * Set Label text.
        * @param aResourceId.
        */
        void SetTextToLabelL( TInt aResourceId );

        /**
        * ShowMessageL
        * Show Message Text. 
        * @param aMessage
        */
        void ShowMessageL( const TDesC& aMessage );

        /**
        * ShowMessageQueryL
        * Show Message Query
        */
        void ShowMessageQueryL();

        /**
        * ShowGlobalMessageQueryL
        * Show Global Message Query
        */
        void ShowGlobalMessageQueryL( 
            const TTimerUpdateType& aUpdateType = ENoUpdate );

        /**
        * ShowQueryWithHeadingLineL
        * Show Query with Heading text
        * @param aResouceId
        */
        void ShowQueryWithHeadingLineL( TInt aResouceId, TInt aTextId = 0 );

        /**
        * ShowMultiLineTextAndTextLayoutL
        * Show multi line text and text layout.
        * @param aResouceId
        * @param aTopResourceId
        * @param aBottomResourceId
        * @param aSetPromptaFlag
        * @param aLengthOfFirstEditor
        * @param aLengthOfSecondEditor
        */
        void ShowMultiLineTextAndTextLayoutL( 
                const TInt aResouceId ,
                const TInt aTopResourceId = 0,
                const TInt aBottomResourceId = 0,
                const TBool aSetPromptFlag = EFalse,
                const TInt aLengthOfFirstEditor = 0,
                const TInt aLengthOfSecondEditor = 0 );
     
        /**
        * ShowMultiLineTextAndNumberLayoutL
        * Show multi line text and number layout.
        * @param aResourceId
        */
        void ShowMultiLineTextAndNumberLayoutL( const TInt aResourceId );

        /**
        * ShowMultiLineTextAndLDurationLayoutL
        * Show multi line text and duration layout.
        * @param aResourceId
        */
        void ShowMultiLineTextAndLDurationLayoutL( const TInt aResourceId );

        /**
        * ShowMultiLineTimeAndTimeLayoutL
        * Show multi line time and time layout.
        * @param aResourceId for dialog
        * @param aTopResourceId for top of multi line 
        * @param aBottomResourceId for bottom of multi line
        */
        void ShowMultiLineTimeAndTimeLayoutL( 
            const TInt aResourceId,
            const TInt aTopResourceId,
            const TInt aBottomResourceId );

        /**
        * ShowMultiLineNumberAndNumberLayoutL
        * Show multi line number and number layout.
        */
        void ShowMultiLineNumberAndNumberLayoutL();

        /**
        * ShowMultiLineTextAndTimeLayoutL
        * Show multi line text and time layout.
        * @param aResourceId for dialog
        * @param aBottomResourceId for bottom of multi line
        */
        void ShowMultiLineTextAndTimeLayoutL( 
            const TInt aResourceId,
            const TInt aBottomResourceId = 0 );

        /**
        * ShowMultiLineTimeAndDurationLayoutL
        * Show multi line time and duration layout.
        * @param aResourceId for dialog
        * @param aTopResourceId for top of multi line.
        */
        void ShowMultiLineTimeAndDurationLayoutL( 
            const TInt aResourceId, 
            const TInt aTopResourceId );

        /**
        * DoRunDlgL

⌨️ 快捷键说明

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