-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEllipseAppView.h
More file actions
149 lines (127 loc) · 3.84 KB
/
EllipseAppView.h
File metadata and controls
149 lines (127 loc) · 3.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
/*
============================================================================
Name : EllipseAppView.h
Author : Sun Jinbo
Copyright : Your copyright notice
Description : Declares view class for application.
============================================================================
*/
#ifndef __ELLIPSEAPPVIEW_h__
#define __ELLIPSEAPPVIEW_h__
// INCLUDES
#include <coecntrl.h>
#include <eikmobs.h>
#include <aknstyluspopupmenu.h>
#include "EllipseEnv.h"
#include "DrawingMethod.h"
#include "Ellipse.hrh"
// FORWARD DECLARATIONS
class CCoordinate;
class CEllipseAppUi;
class CBmpUtils;
// CLASS DECLARATION
class CEllipseAppView : public CCoeControl
, public MDrawingMethodObserver
, public MEikMenuObserver
, public MEllipseEnv
{
public:
// New methods
/**
* NewL.
* Two-phased constructor.
* Create a CEllipseAppView object, which will draw itself to aRect.
* @param aRect The rectangle this view will be drawn to.
* @return a pointer to the created instance of CEllipseAppView.
*/
static CEllipseAppView* NewL(CEllipseAppUi& aAppUi, const TRect& aRect);
/**
* NewLC.
* Two-phased constructor.
* Create a CEllipseAppView object, which will draw itself
* to aRect.
* @param aRect Rectangle this view will be drawn to.
* @return A pointer to the created instance of CEllipseAppView.
*/
static CEllipseAppView* NewLC(CEllipseAppUi& aAppUi, const TRect& aRect);
/**
* ~CEllipseAppView
* Virtual Destructor.
*/
virtual ~CEllipseAppView();
public:
// New functions
void SetDrawingMethodL( TEllipseDrawingMethods aMethod );
TEllipseDrawingMethods DrawingMethod() const;
public:
// from MEllipseEnv
CFbsBitGc*& Gc();
CEikonEnv* EikonEnv();
TRect ViewRect();
public:
// Functions from base classes
/**
* From CoeControl, SizeChanged.
* Called by framework when the view size is changed.
*/
void SizeChanged();
/**
* From CoeControl, HandlePointerEventL.
* Called by framework when a pointer touch event occurs.
* Note: although this method is compatible with earlier SDKs,
* it will not be called in SDKs without Touch support.
* @param aPointerEvent the information about this event
*/
void HandlePointerEventL(const TPointerEvent& aPointerEvent);
void HandleResourceChange( TInt aType );
private:
// MDrawingMethodObserver
void StateChanged( TInt aNewState );
private:
// MEikMenuObserver
void ProcessCommandL( TInt aCommandId );
void SetEmphasis( CCoeControl* /*aMenuControl*/,TBool /*aEmphasis*/ ) {}
private:
// Constructors
/**
* ConstructL
* 2nd phase constructor.
* Perform the second phase construction of a
* CEllipseAppView object.
* @param aRect The rectangle this view will be drawn to.
*/
void ConstructL(const TRect& aRect);
/**
* CEllipseAppView.
* C++ default constructor.
*/
CEllipseAppView(CEllipseAppUi& aAppUi);
private:
// New functions
void CreateBmpBufferL();
void ReleaseBmpBuffer();
static TInt TimerCallback( TAny* aPtr );
void Stop();
void DoFrame();
static TInt IdleCallback( TAny* aPtr );
void DoStart();
void CreatePopupMenuL( const TPoint& aPos );
TRect EllipseRect() const;
void DoDrawBackground();
void ScaleBitmap();
private:
// Member data
CEllipseAppUi& iAppUi;
CFbsBitmap* iBitmap; // owned
CFbsBitmapDevice* iBitmapDevice; // owned
CFbsBitGc* iBitmapGc; // owned
CPeriodic* iPeriodic; // owned
CCoordinate* iCoordinate; // owned
CDrawingMethod* iDrawingMethod; // owned
CIdle* iIdle; // owned.
CAknStylusPopUpMenu* iPopupMenu; // owned
CBmpUtils* iBmpUtils; // owned
TEllipseDrawingMethods iDrawingMethodId;
};
#endif // __ELLIPSEAPPVIEW_h__
// End of File