📄 boss.h
字号:
// boss.h
//
// Copyright (c) 1998 Symbian Ltd. All rights reserved.
//
#ifndef __BOSS_H
#define __BOSS_H
#include <coecntrl.h>
#include <coeccntx.h>
#include <eikappui.h>
#include <eikapp.h>
#include <eikdoc.h>
#include "bossview.h"
#include "bosseng.h"
// UID of app
const TUid KUidBossApp= { 0x10000253 } ;
//
// class CBossAppView
//
class CBossAppView : public CCoeControl, public MCoeControlBrushContext, public MBossControlObserver
{
public:
void ConstructL(const TRect& aRect, TBossPuzzle* aModel);
~CBossAppView();
// changing view
void ConstructViewL();
// various types of update
void Move(TBossPuzzle::TMoveType aMoveType);
void SetFullyOrdered();
void SetBossOrdered();
public:
void NotifyStatus(const TDesC& aMessage);
private: // from MBossControlObserver
void BCOMove(TInt aRow, TInt aCol);
void BCOMove(TBossPuzzle::TMoveType aMoveType);
private: // from CCoeControl
void Draw(const TRect& /*aRect*/) const;
TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType);
TInt CountComponentControls() const;
CCoeControl* ComponentControl(TInt aIndex) const;
private: // new function
void CreateLabelL();
void MoveChecked(TBossPuzzle::TMoveType aMoveType); // do a checked move
private: // data
TBossPuzzle* iModel; // model we're working with
CBossView* iView; // view of boss puzzle
CBossControl* iControl; // control
TZoomFactor iZoom; // zoom factor for enlarging puzzle
};
//
// CBossAppUi
//
class CBossAppUi : public CEikAppUi
{
public:
void ConstructL();
~CBossAppUi();
private: // from CEikAppUi
void HandleCommandL(TInt aCommand);
TBool ProcessCommandParametersL(TApaCommand aCommand,TFileName& aDocumentName,const TDesC& aTail);
void HandleModelChangeL();
private: // handling commands etc
TFileName MainDocPath() const;
private:
CBossAppView* iAppView;
TBossPuzzle* iModel;
};
//
// CBossDocument
//
class CBossDocument : public CEikDocument
{
public:
CBossDocument(CEikApplication& aApp): CEikDocument(aApp) { }
TBossPuzzle* Model() { return(&iModel); }
private: // from CEikDocument
CEikAppUi* CreateAppUiL();
private: // from CApaDocument
void StoreL(CStreamStore& aStore,CStreamDictionary& aStreamDic) const;
void RestoreL(const CStreamStore& aStore,const CStreamDictionary& aStreamDic);
TCapability Capability() const;
CPicture* GlassPictureL();
private:
TBossPuzzle iModel;
};
class CBossGlassDoor : public CPicture
{
public:
// construct/destruct
CBossGlassDoor(TBossPuzzle* aModel);
void ConstructL();
~CBossGlassDoor();
private: // from CPicture
void Draw(CGraphicsContext& aGc,const TPoint& aTopLeft,const TRect& aClipRect,MGraphicsDeviceMap* aMap) const;
inline void ExternalizeL(RWriteStream& ) const {};
void GetOriginalSizeInTwips(TSize& aSize) const;
TPictureCapability Capability() const;
void SetScaleFactor(TInt aScaleFactorWidth,TInt aScaleFactorHeight);
TInt ScaleFactorWidth() const;
TInt ScaleFactorHeight() const;
private:
TBossPuzzle* iModel;
CBossView* iView;
TInt iScaleFactorWidth;
TInt iScaleFactorHeight;
};
//
// CBossApplication
//
class CBossApplication : public CEikApplication
{
private: // from CApaApplication
CApaDocument* CreateDocumentL();
TUid AppDllUid() const;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -