|
1 |
|
2 /* |
|
3 * Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
4 * All rights reserved. |
|
5 * This component and the accompanying materials are made available |
|
6 * under the terms of "Eclipse Public License v1.0" |
|
7 * which accompanies this distribution, and is available |
|
8 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
9 * |
|
10 * Initial Contributors: |
|
11 * Nokia Corporation - initial contribution. |
|
12 * |
|
13 * Contributors: |
|
14 * |
|
15 * Description: |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #ifndef __CSIPLINEGAMEVIEW_H__ |
|
22 #define __CSIPLINEGAMEVIEW_H__ |
|
23 |
|
24 #include <coecntrl.h> |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class CSIPExEngine; |
|
28 |
|
29 // CLASS DECLARATIONS |
|
30 /** |
|
31 * The class implements the the game board drawing. |
|
32 */ |
|
33 class CSIPExGameView : public CCoeControl |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * Static constructor |
|
39 * @param aRect the rectangle this view will be drawn to |
|
40 * @param aParent The pointer to the parent container component. |
|
41 * @param aEngine The reference to the application engine. |
|
42 */ |
|
43 static CSIPExGameView* NewL(const TRect& aRect, const CCoeControl* aParent, CSIPExEngine& aEngine); |
|
44 |
|
45 /** |
|
46 * Static constructor. On return the instance is left the CleanupStack. |
|
47 * @param aRect the rectangle this view will be drawn to |
|
48 * @param aParent The pointer to the parent container component. |
|
49 * @param aEngine The reference to the application engine. |
|
50 */ |
|
51 static CSIPExGameView* NewLC(const TRect& aRect, const CCoeControl* aParent, CSIPExEngine& aEngine); |
|
52 |
|
53 /** |
|
54 * Destructor |
|
55 */ |
|
56 ~CSIPExGameView(); |
|
57 |
|
58 private: |
|
59 |
|
60 /** |
|
61 * Symbian 2nd phase constructor |
|
62 * @param aRect The rectangle this view will be drawn to |
|
63 * @param aParent The pointer to the parent container component. |
|
64 */ |
|
65 void ConstructL(const TRect& aRect, const CCoeControl* aParent); |
|
66 |
|
67 /** |
|
68 * C++ default constructor |
|
69 * @param aEngine The reference to the application engine. |
|
70 */ |
|
71 CSIPExGameView( CSIPExEngine& aEngine ); |
|
72 |
|
73 /** |
|
74 * Drawing game. Decides if the cursor or board will be drawn. |
|
75 * @param aGc The system's graphics context. |
|
76 * @param aRect The rectangle where to draw. |
|
77 */ |
|
78 void DrawGame(CWindowGc& aGc, const TRect& aRect) const; |
|
79 |
|
80 /** |
|
81 * Drawing the game board |
|
82 * @param aGc The system's graphics context. |
|
83 * @param aRect The rectangle where to draw. |
|
84 */ |
|
85 void DrawBoard( CWindowGc& aGc, const TRect& aRect ) const; |
|
86 |
|
87 /** |
|
88 * Drawing the game cursor. |
|
89 * @param aGc The system's graphics context. |
|
90 * @param aRect The rectangle where to draw. |
|
91 */ |
|
92 void DrawCursor(CWindowGc& aGc, const TRect& aRect) const; |
|
93 |
|
94 public: // from CoeControl |
|
95 |
|
96 /** |
|
97 * From CCoeControl |
|
98 */ |
|
99 void Draw(const TRect& aRect) const; |
|
100 |
|
101 /** |
|
102 * From CCoeControl |
|
103 */ |
|
104 TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); |
|
105 |
|
106 /** |
|
107 * From CCoeControl |
|
108 */ |
|
109 void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
110 |
|
111 private: // Data members |
|
112 |
|
113 // Game data |
|
114 CSIPExEngine* iEngine; |
|
115 |
|
116 TInt iLabelSize; |
|
117 TInt iXOffset; |
|
118 TInt iYOffset; |
|
119 TInt iBoxW; |
|
120 TInt iMidW; |
|
121 TRect iRect; |
|
122 }; |
|
123 |
|
124 #endif // __CSIPLINEGAMEVIEW_H__ |
|
125 |
|
126 // End of file |