|
1 // Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // |
|
15 |
|
16 /** |
|
17 @file |
|
18 @internalComponent - Internal Symbian test code |
|
19 */ |
|
20 |
|
21 #if !defined(__COEGRID_H__) |
|
22 #define __COEGRID_H__ |
|
23 |
|
24 #if !defined(__E32STD_H_) |
|
25 #include <e32std.h> |
|
26 #endif |
|
27 #if !defined(__GRDSTD_H_) |
|
28 #include <grdstd.h> |
|
29 #endif |
|
30 #if !defined(__COECNTRL_H_) |
|
31 #include <coecntrl.h> |
|
32 #endif |
|
33 #include <eikenv.h> |
|
34 |
|
35 enum TCoeGridPanic |
|
36 { |
|
37 ECoeGridCellOutOfRange |
|
38 }; |
|
39 |
|
40 class CTGridQueryDialog; |
|
41 //! A CCoeControl derived class.\n |
|
42 /** |
|
43 The class is used to instantiate a Grid window.\n |
|
44 The Grid window is a control which receives the events and delegates the |
|
45 handling of events to GridLay and Grid Img classes.\n |
|
46 */ |
|
47 class CGridWin : public CCoeControl |
|
48 { |
|
49 public: |
|
50 enum TResizeMode { EResizeOff, EResizeColumn, EResizeRow }; |
|
51 public: |
|
52 virtual ~CGridWin(); |
|
53 static CGridWin* NewL(CCoeControl* aWin,CGridLay *aGridLay,CGridImg *aGridImg); |
|
54 void ConstructL(CCoeControl* aWin); |
|
55 CGridWin(CGridLay *aGridLay,CGridImg *aGridImg); |
|
56 CGridLay* GridLay() const; |
|
57 CGridImg* GridImg() const; |
|
58 //replace |
|
59 virtual void Draw(const TRect& aRect) const; |
|
60 virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
61 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
62 virtual void SizeChanged(); |
|
63 void SetResizeMode(TResizeMode aMode); |
|
64 TInt ResizeMode(); |
|
65 void DrawCellL(const TCellRef& aCell) const; |
|
66 void DrawRangeL(const TRangeRef& aRange) const; |
|
67 void DrawSelectedL() const; |
|
68 TCellRef CursorPos() const; |
|
69 void SetCursorPosL(const TCellRef& aCursorPos) const; |
|
70 void ExposeCellL(const TCellRef& aCell) const; |
|
71 protected: |
|
72 CGridLay* const iGridLay; |
|
73 CGridImg* iGridImg; |
|
74 private: |
|
75 CGridWin(); //not implemented |
|
76 TInt operator=(const CGridWin&); //not implemented TInt to stop warning |
|
77 private: |
|
78 TInt iTestInt; |
|
79 TResizeMode iResizeMode; |
|
80 }; |
|
81 //! A CCoeControl derived class.\n |
|
82 /** |
|
83 The class is used to instantiate a Grid window.\n |
|
84 The Grid window is a control which receives the events and delegates the |
|
85 handling of events to GridLay and Grid Img classes.\n |
|
86 */ |
|
87 class CGrid2Win : public CCoeControl |
|
88 { |
|
89 public: |
|
90 enum TResizeMode { EResizeOff, EResizeColumn, EResizeRow }; |
|
91 public: |
|
92 virtual ~CGrid2Win(); |
|
93 static CGrid2Win* NewL(CCoeControl* aWin,CGridLay *aGridLay,CGridImg *aGridImg); |
|
94 void ConstructL(CCoeControl* aWin); |
|
95 CGrid2Win(CGridLay *aGridLay,CGridImg *aGridImg); |
|
96 CGridLay* GridLay() const; |
|
97 CGridImg* GridImg() const; |
|
98 //replace |
|
99 virtual void Draw(const TRect& aRect) const; |
|
100 virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
101 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
102 virtual void SizeChanged(); |
|
103 void SetResizeMode(TResizeMode aMode); |
|
104 TInt ResizeMode(); |
|
105 void DrawCellL(const TCellRef& aCell) const; |
|
106 void DrawRangeL(const TRangeRef& aRange) const; |
|
107 void DrawSelectedL() const; |
|
108 TCellRef CursorPos() const; |
|
109 void SetCursorPosL(const TCellRef& aCursorPos) const; |
|
110 void ExposeCellL(const TCellRef& aCell) const; |
|
111 protected: |
|
112 CGridLay* const iGridLay; |
|
113 CGridImg* iGridImg; |
|
114 private: |
|
115 CGrid2Win(); //not implemented |
|
116 TInt operator=(const CGrid2Win&); //not implemented TInt to stop warning |
|
117 private: |
|
118 TInt iTestInt; |
|
119 TResizeMode iResizeMode; |
|
120 }; |
|
121 //! A CCoeControl derived class.\n |
|
122 /** |
|
123 A query dialog providing options for resizing a row or column.\n |
|
124 */ |
|
125 class CTGridQueryDialog : public CCoeControl |
|
126 { |
|
127 public: |
|
128 CTGridQueryDialog(TBool& aIsColumn); |
|
129 ~CTGridQueryDialog(); |
|
130 //TBool ExecuteLD(); |
|
131 void ConstructL(); |
|
132 virtual TKeyResponse OfferKeyEventL(const TKeyEvent& aKeyEvent,TEventCode aType); |
|
133 private: |
|
134 virtual void Draw(const TRect& aRect) const; |
|
135 private: |
|
136 TBool& iIsColumn; |
|
137 TBool iExitConfirmed; |
|
138 }; |
|
139 |
|
140 #endif |