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

📄 aknexlistcolumncontainer.h

📁 symbian ui的 例子 初学者可以 好好看看,这个是培训的资料,应该比较宝贵
💻 H
字号:
/*  Copyright (c) 2005, Nokia. All rights reserved */

#ifndef __AKNEXLISTCOLUMNCONTAINER_H__
#define __AKNEXLISTCOLUMNCONTAINER_H__

// INCLUDES
#include <eiklbo.h>
#include "AknExListBaseContainer.h"

// CONSTANTS
// for length.
const TInt KAknExListLabelBufLength = 256;
const TInt KAknExListMarkedIndexBufLength = 256;
const TInt KAknExListInfoTextBufLength =256;
const TInt KAknExListInformationBufLength = 256;
const TInt KAknExListSelectionIndexFormatBufLength = 256;
const TInt KAknExListNonTextBufLength = 256;
const TInt KAknExListTabBufLength = 4;
const TInt KAknExListItemBufLength = 256;
// for initialization.
const TInt KAknExListInitValueOfListFlags = 0;
const TInt KAknExListInitItemCount = 0;
const TInt KAknExListInitTabCount = 0;
const TInt KAknExListInitPosition = 0;
const TInt KAknExListInitCount = 0;
const TInt KAknExListStartCount = 0;
// for key event.
#define AKNEXLIST_ICONPRIORITY_KEY '0'
#define AKNEXLIST_MARKEDINDEX_KEY '0'

#define IAPPUI static_cast<CAknExListAppUi*>( iCoeEnv->AppUi() )

// FORWARD DECLARATIONS
class CEikLabel;
class CEikColumnListBox;
class CAknSearchField;
class CAknExListColumnView;

// CLASS DECLARATION

/**
* CAknExListColumnContainer  container control class.
*/
class CAknExListColumnContainer :
    public CAknExListBaseContainer,
    public MEikListBoxObserver
    {
    private: // Enumerations

        enum TAknExListComponentControls
            {
            EAknExListDefaultComponent,
            EAknExListComponent1,
            EAknExListComponent2
            };

        enum TAknExListPriority
            {
            EKAknExListFirstPriority = 1,
            EKAknExListSecondPriority,
            EKAknExListThirdPriority
            };

        enum TAknExListIconIndex
            {
            EKAknExListFirstIconIndex = 1,
            EKAknExListSecondIconIndex,
            EKAknExListThirdIconIndex
            };

        enum TAknExListItemIndex
            {
            EKAknExListItemIndex0,
            EKAknExListItemIndex1
            };

    public: // Constructors and destructor

        /**
        * CAknExListColumnContainer
        * Copy constructor.
        * @param aView Pointer of CAknExListColumnView class.
        */
        CAknExListColumnContainer( CAknExListColumnView* aView );

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

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

    public: // New functions

        /**
        * Displays listbox or start screen.
        * @param aOutlineId The ID of outline to displayed next.
        */
        void DisplayListBoxL( const TInt aOutlineId );

        
    public: // From CoeControl

        /**
        * From CoeControl, OfferKeyEventL.
        * Handles the key-events.
        * @return If key-event is consumed, EKeyWasConsumed. Else
        * EKeyWasNotConsumed.
        * @param aKeyEvent Key event.
        * @param aType Type of key event( EEventKey, EEventKeyUp or
        * EEventKeyDown ).
        */
        TKeyResponse OfferKeyEventL( 
            const TKeyEvent& aKeyEvent,
            TEventCode aType );

    public: // From MEikListBoxObserver

        /**
        * HandleListBoxEventL
        * Handles listbox event.
        * @param aListBox Pointer to ListBox object is not used.
        * @param aEventType Type of listbox event.
        */
        void HandleListBoxEventL( 
            CEikListBox* aListBox,
            TListBoxEvent aEventType );
            
		/**
        * From CoeControl, HandleResourceChange.
        * Called by framework when the view layout is changed.
        */
        virtual void HandleResourceChange(TInt aType);

    private: // New functions
        /**
        * SetLabelL
        * Creates and sets label control object.
        * @param aResourceId Resource ID of text.
        */
        void SetLabelL( const TInt aResourceId );

        /**
        * SetCountAndAddItemL
        * Sets count of added list items and calls AddItemL().
        * @param aKeyEvent Key event.
        */
        void SetCountAndAddItemL( const TKeyEvent& aKeyEvent );

        /**
        * SetCountAndRemoveItemL
        * Sets count of removed list items and calls RemoveItemL().
        * @param aKeyEvent Key event.
        */
        void SetCountAndRemoveItemL( const TKeyEvent& aKeyEvent );

        /**
        * AdditionalIconPriorityL
        * Confirms priority of additional icons.
        */
        void AdditionalIconPriorityL();

        /**
        * SizeChangedForFindBox
        * Called by framework when the view size is changed for creating
        * listbox with findbox.
        */
        void SizeChangedForFindBox();

    private: // From CAknExListBaseContainer

        /**
        * GraphicIconL
        * Appends graphics data.
        * @param Pointer of icon using graphics for listbox.
        */
        void GraphicIconL( CArrayPtr<CGulIcon>* aIcons );

    private: // From CoeControl

        /**
        * From CoeControl, SizeChanged.
        * Called by framework when the view size is changed.
        */
        void SizeChanged();

        /**
        * From CoeControl, CountComponentControls.
        * Returns number of components.
        * @return Number of controls.
        */
        TInt CountComponentControls() const;

        /**
        * From CCoeControl, ComponentControl.
        * Returns pointer to particular component.
        * @return Pointer to Control's component control, identified by index.
        * @param aIndex Index of the control.
        */
        CCoeControl* ComponentControl( TInt aIndex ) const;

    private: // Data

        /**
        * iLabel
        * Owned by CAknExListColumnContainer object.
        */
        CEikLabel* iLabel;

        /**
        * iListBox
        * Owned by CAknExListColumnContainer object.
        */
        CEikColumnListBox* iListBox;

        /**
        * iView
        * Does not own.
        */
        CAknExListColumnView* iView;

        /**
        * iFindBox
        * Owned by CAknExListColumnContainer object.
        */
        CAknSearchField* iFindBox;

        /**
        * iOutlineId
        */
        TInt iOutlineId;

    };

#endif // __AKNEXLISTCOLUMNCONTAINER_H__

// End of File

⌨️ 快捷键说明

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