listview.h
来自「《UIQ 3 The Complete Guide》书的源代码」· C头文件 代码 · 共 95 行
H
95 行
//
// ListView.h - List view for our signed app
//
// Copyright (C) UIQ Technology AB, 2007
//
// This material is provided "as is" without any warranty to its performance or functionality.
// In no event shall UIQ Technology be liable for any damages whatsoever arising out of the
// use or inabilty to use this material.
//
#ifndef __LISTVIEW_H__
#define __LISTVIEW_H__
// these pragmas stop the compiler complaining that params to functions not being used in body
#ifdef __CW32__
#pragma warn_unusedarg off
#endif // __CW32__
#pragma warning(disable : 4100)
#include <QikAppUi.h>
#include <QikViewBase.h>
#include <QikListBoxModel.h>
#include <QikListBox.h>
#include <MQikListBoxData.h>
#include <QikEditCategoryObserver.h>
#include <mdaaudiosampleplayer.h>
#include "Engine.h"
/////////////////////////////////////////////////////////////////////////////////////////////
enum TAppSoundLevel
{
ESoundLevelLow,
ESoundLevelMedium,
ESoundLevelHigh,
};
class CListView : public CQikViewBase,
public MQikListBoxObserver,
public MQikEditCategoryObserver,
public MMdaAudioPlayerCallback
{
protected:
// from CQikViewBase
TVwsViewId ViewId() const;
void HandleCommandL(CQikCommand& aCommand);
void ViewConstructL();
void ViewDeactivated();
void ViewActivatedL(const TVwsViewId& aPrevViewId,const TUid aCustomMessageId,const TDesC8& aCustomMessage);
CQikCommand* DynInitOrDeleteCommandL(CQikCommand* aCommand,const CCoeControl& aControlAddingCommands);
// from MQikListBoxObserver
void HandleListBoxEventL(CQikListBox* aListBox,TQikListBoxEvent aEventType,TInt aItemIndex,TInt aSlotId);
//from MQikEditCategoryObserver
TBool OkToAddCategory() const;
TBool DoAddCategoryL(TInt& aHandle);
TBool OkToRenameCategory(TInt aHandle, const TDesC& aNewName) const;
TBool DoRenameCategoryL(TInt aHandle, const TDesC& aNewName);
TBool OkToMergeCategories(TInt aSourceHandle, TInt aTargetHandle) const;
TBool DoMergeCategoriesL(TInt aSourceHandle, TInt aTargetHandle);
TBool OkToDeleteCategory(TInt aHandle) const;
TBool DoDeleteCategoryL(TInt aHandle);
TBool IsCategoryEmpty(TInt aHandle) const;
// from MMdaAudioPlayerCallback
void MapcInitComplete(TInt aError,const TTimeIntervalMicroSeconds& aDuration);
void MapcPlayComplete(TInt aError);
// new methods
void UpdateCommandAvailability();
void UpdateListBoxL();
void SetCurrentEntry();
void SortListL(const TFolderEntrySortType aType,const TFolderEntrySortOrder aOrder,const TInt aCmdId);
void SendFileAsL();
void DeleteCurrentEntryL();
void TidyUpSoundPlayer();
void PlayAudioEntryL();
void OpenEntryL();
public:
// new methods
~CListView();
CListView(CQikAppUi& aAppUi,CAppEngine* aEngine);
protected:
CAppEngine* iEngine;
// sound playback support
TAppSoundLevel iLevel;
TBool iSoundInitialized;
CMdaAudioPlayerUtility* iSoundPlayer;
};
#endif // __LISTVIEW_H__
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?