|
1 /* |
|
2 * Copyright (c) 1997-1999 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #include <eikbctrl.h> |
|
20 |
|
21 /** |
|
22 * Gets the list of logical colors employed in the drawing of the control, |
|
23 * paired with an explanation of how they are used. Appends the list to aColorUseList. |
|
24 * |
|
25 * @since ER5U |
|
26 */ |
|
27 EXPORT_C void CEikBorderedControl::GetColorUseListL(CArrayFix<TCoeColorUse>& /*aColorUseList*/) const |
|
28 { |
|
29 } |
|
30 |
|
31 /** |
|
32 * Handles a change to the control's resources of type aType |
|
33 * which are shared across the environment, e.g. colors or fonts. |
|
34 * |
|
35 * @since ER5U |
|
36 */ |
|
37 EXPORT_C void CEikBorderedControl::HandleResourceChange(TInt aType) |
|
38 { |
|
39 CCoeControl::HandleResourceChange(aType); |
|
40 } |
|
41 |
|
42 EXPORT_C CEikBorderedControl::CEikBorderedControl() |
|
43 {} |
|
44 |
|
45 EXPORT_C CEikBorderedControl::CEikBorderedControl(const TGulBorder& aBorder) |
|
46 : iBorder(aBorder) |
|
47 {} |
|
48 |
|
49 EXPORT_C TBool CEikBorderedControl::HasBorder() const |
|
50 { |
|
51 return iBorder.HasBorder(); |
|
52 } |
|
53 |
|
54 EXPORT_C void CEikBorderedControl::SetAdjacent(TInt aAdjacent) |
|
55 { |
|
56 iBorder.SetAdjacent(aAdjacent); |
|
57 } |
|
58 |
|
59 /** |
|
60 * Overloaded method which sets the border type to aBorderType for a value from the enum TGulBorder::TBorderType. |
|
61 */ |
|
62 EXPORT_C void CEikBorderedControl::SetBorder(TGulBorder::TBorderType aBorderType) |
|
63 { |
|
64 iBorder=TGulBorder(aBorderType); |
|
65 } |
|
66 |
|
67 /** |
|
68 * Sets the border type to aBorderType. Any one of the values from the enums TGulBorder::TBorderType |
|
69 * or TGulBorder::TLogicalType specifies a valid border type. Custom border types can be created by selecting |
|
70 * <ul> |
|
71 * <li> one value from each of the enums TGulBorder::T3DStyle and TGulBorder::TConstructionStyle, |
|
72 * <li> at most one value from the enums TGulBorder::TOutlineStyle and TGulBorder::TInlineStyle, |
|
73 * <li> at least one value from the enums TGulBorder::TThickness and TGulBorder::TRounding |
|
74 * </ul> |
|
75 * and ORing these values together. |
|
76 * |
|
77 * @since Uikon1.2 |
|
78 */ |
|
79 EXPORT_C void CEikBorderedControl::SetBorder(TInt aBorderType) |
|
80 { |
|
81 iBorder=TGulBorder(aBorderType); |
|
82 } |
|
83 |
|
84 EXPORT_C TGulBorder CEikBorderedControl::Border() const |
|
85 { |
|
86 return iBorder; |
|
87 } |
|
88 |
|
89 EXPORT_C void CEikBorderedControl::Draw(const TRect& /*aRect*/) const |
|
90 { |
|
91 TRect rect=Rect(); |
|
92 CGraphicsContext& gc=SystemGc(); |
|
93 iBorder.Draw(gc,rect); |
|
94 if (IsBlank()) |
|
95 { |
|
96 TRect innerRect=iBorder.InnerRect(rect); |
|
97 gc.SetPenStyle(CGraphicsContext::ENullPen); |
|
98 gc.SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
99 gc.DrawRect(innerRect); |
|
100 } |
|
101 } |
|
102 |
|
103 /** |
|
104 * Writes the internal state of the control and its components to aStream. |
|
105 * Does nothing in release mode. |
|
106 * Designed to be overidden and base called by subclasses. |
|
107 * |
|
108 * @internal |
|
109 * @since App-Framework_6.1 |
|
110 */ |
|
111 #ifndef _DEBUG |
|
112 EXPORT_C void CEikBorderedControl::WriteInternalStateL(RWriteStream&) const |
|
113 {} |
|
114 #else |
|
115 EXPORT_C void CEikBorderedControl::WriteInternalStateL(RWriteStream& aWriteStream) const |
|
116 { |
|
117 _LIT(KEikLitBrdrCtlSt,"<CEikBorderedControl>"); |
|
118 _LIT(KEikLitBrdrCtlEnd,"<\\CEikBorderedControl>"); |
|
119 _LIT(KEikLitBrdrCtlBorder,"<iBorder>"); |
|
120 _LIT(KEikLitBrdrCtlBorderEnd,"<\\iBorder>"); |
|
121 |
|
122 aWriteStream << KEikLitBrdrCtlSt; |
|
123 aWriteStream << KEikLitBrdrCtlBorder; |
|
124 aWriteStream.WriteInt32L(iBorder.Type()); |
|
125 aWriteStream << KEikLitBrdrCtlBorderEnd; |
|
126 CCoeControl::WriteInternalStateL(aWriteStream); |
|
127 aWriteStream << KEikLitBrdrCtlEnd; |
|
128 } |
|
129 #endif |
|
130 |
|
131 EXPORT_C void CEikBorderedControl::HandlePointerEventL(const TPointerEvent& aPointerEvent) |
|
132 { |
|
133 CAknControl::HandlePointerEventL(aPointerEvent); |
|
134 } |
|
135 |
|
136 EXPORT_C void* CEikBorderedControl::ExtensionInterface( TUid /*aInterface*/ ) |
|
137 { |
|
138 return NULL; |
|
139 } |