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

📄 svexlistview.h

📁 symbian下读取服务的程序
💻 H
字号:
// Copyright (c) 2006 Murray Read, All rights reserved

#ifndef SVEXLISTVIEW_H
#define SVEXLISTVIEW_H

#include <CoeCntrl.h>
#include <aknlists.h>

const TInt KMaxListText = 256;


// An observer interface for menu and command handling
class MSvexMenuObserver
	{
public:
	IMPORT_C virtual void DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane);
	IMPORT_C virtual void HandleCommandL(TInt aCommand);
	};


// The base class for the list views used extensively in 
// this demo suite. This can be constructed as a window owning
// control for main views, or non-window owning for use in
// dialogs.
// The behavior of the class is customisable by list style,
// item count, item text and behavior on "open".
// It implements the MDesCArray interface to act as the text
// source for the contained listbox.
class CSvexListView : public CCoeControl, public MEikListBoxObserver, public MDesCArray, public MSvexMenuObserver
    {
public:
    IMPORT_C CSvexListView();
    IMPORT_C ~CSvexListView();
    IMPORT_C void ConstructControlL();				// non window owning
    IMPORT_C void ConstructMainPaneL();				// window owning

public:	// virtuals to be implemented
	// Create the list box, allows style customisation
	virtual CEikTextListBox* NewListBoxL() const = 0;
	// Return the number of items in the list
	virtual TInt Count() const = 0;
	// Get the text for a list item
	virtual void GetText(TInt aIndex, TBuf<KMaxListText>& aText) const = 0;
	// Handle the "Open" command, eg from menu or "ok" click.
	IMPORT_C virtual void OpenL();

protected:	// from CCoeControl
	IMPORT_C void SizeChanged();
	IMPORT_C TInt CountComponentControls() const;
	IMPORT_C CCoeControl* ComponentControl(TInt aIndex) const;
	IMPORT_C TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent, TEventCode aType);
	IMPORT_C void HandleResourceChange(TInt aType);

protected:	// from MEikListBoxObserver
	IMPORT_C void HandleListBoxEventL(CEikListBox* aListBox, TListBoxEvent aEventType);

public :  // from MSvexMenuObserver
	IMPORT_C void HandleCommandL(TInt aCommand);

protected:	// from MDesCArray
	IMPORT_C TInt MdcaCount() const;
	IMPORT_C TPtrC16 MdcaPoint(TInt aIndex) const;

protected:
	mutable TBuf<KMaxListText> iBuf;
    CEikTextListBox* iListBox;
    };


#endif

⌨️ 快捷键说明

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