1 /* |
|
2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Header file for CCamLineVfGridDrawer class. |
|
15 * |
|
16 * Copyright © 2007 Nokia. All rights reserved. |
|
17 * This material, including documentation and any related computer |
|
18 * programs, is protected by copyright controlled by Nokia. All |
|
19 * rights are reserved. Copying, including reproducing, storing, |
|
20 * adapting or translating, any or all of this material requires the |
|
21 * prior written consent of Nokia. This material also contains |
|
22 * confidential information which may not be disclosed to others |
|
23 * without the prior written consent of Nokia. |
|
24 |
|
25 * |
|
26 * |
|
27 */ |
|
28 |
|
29 |
|
30 |
|
31 #ifndef CAMLINEDRAWVFGRID_H |
|
32 #define CAMLINEDRAWVFGRID_H |
|
33 |
|
34 #include <gdi.h> // TRgb |
|
35 #include "camvfgridinterface.h" |
|
36 |
|
37 const TInt KCamLineDrawVfGridUid = 0x07700770; |
|
38 |
|
39 |
|
40 class CBitmapContext; |
|
41 /** |
|
42 * |
|
43 * CCamLineVfGridDrawer class. |
|
44 * |
|
45 */ |
|
46 class CCamLineVfGridDrawer : public CBase, |
|
47 public MCamVfGridDrawer |
|
48 { |
|
49 // ------------------------------------------------------------------------ |
|
50 // Public part |
|
51 public: |
|
52 |
|
53 typedef RArray<TRect> RLineArray; |
|
54 |
|
55 public: // Construction / destruction -------------------- |
|
56 |
|
57 static CCamLineVfGridDrawer* NewL(); |
|
58 |
|
59 virtual ~CCamLineVfGridDrawer(); |
|
60 |
|
61 public: // From MCamVFGridDrawer ------------------------- |
|
62 |
|
63 /** |
|
64 * Init the drawer. |
|
65 * @param aParam Not used. |
|
66 */ |
|
67 virtual void InitL( TAny* aParam ); |
|
68 |
|
69 /** |
|
70 * Draw the full grid. |
|
71 */ |
|
72 virtual void Draw( CBitmapContext& aGc ) const; |
|
73 |
|
74 /** |
|
75 * Draw part of the grid. |
|
76 * Only pure horizontal and pure vertical lines are |
|
77 * supported if partial redraw is used. |
|
78 */ |
|
79 virtual void Draw( const TRect& aRect, |
|
80 CBitmapContext& aGc ) const; |
|
81 |
|
82 /** |
|
83 * Set the grid visibility. |
|
84 * If visibility is set to false, drawing is not done. |
|
85 * @param aVisible Is the grid visible. |
|
86 */ |
|
87 virtual void SetVisible( TBool aVisible ); |
|
88 /** |
|
89 * Get the grid visibility setting. |
|
90 * @return Is grid visible. |
|
91 */ |
|
92 virtual TBool IsVisible() const; |
|
93 |
|
94 public: // New methods |
|
95 |
|
96 /** |
|
97 * SetLines |
|
98 * @param aLineArray Pointer to array containing the new lines |
|
99 * to be used when drawing VF grid. |
|
100 * TRect::iTL and TRect::iTL define the end |
|
101 * points of a line. |
|
102 * @param aLineCount Line count is array. Ignored if aLineArray is NULL. |
|
103 * @param aTakeOwnerShip Is ownership of aLineArray transferred. |
|
104 * |
|
105 */ |
|
106 void SetLinesL( const RLineArray& aLineArray ); |
|
107 |
|
108 void SetLinesL( const TRect& aDrawingRect, |
|
109 TInt aHorizontalLines, |
|
110 TInt aVerticalLines, |
|
111 TBool aBorderedGrid = EFalse ); |
|
112 |
|
113 void SetPenStyle( const CGraphicsContext::TPenStyle& aPenStyle ); |
|
114 void SetPenSize ( const TSize& aPenSize ); |
|
115 void SetPenColor( const TRgb aPenColor ); |
|
116 |
|
117 // ------------------------------------------------------------------------ |
|
118 // Protected part |
|
119 protected: |
|
120 |
|
121 void ConstructL(); |
|
122 |
|
123 // ------------------------------------------------------------------------ |
|
124 // Private part |
|
125 private: |
|
126 |
|
127 CCamLineVfGridDrawer(); |
|
128 |
|
129 private: // Data |
|
130 |
|
131 // Line properties |
|
132 RLineArray iLineArray; // Line end locations |
|
133 TBool iVisible; // Visibility of lines |
|
134 |
|
135 // Drawing parameters |
|
136 CGraphicsContext::TPenStyle iPenStyle; |
|
137 TSize iPenSize; |
|
138 TRgb iPenColor; |
|
139 |
|
140 }; |
|
141 |
|
142 #endif |
|