|
1 /* |
|
2 * Copyright (c) 2002-2006 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: Class declaration for EIKON aligned control. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef __EIKALIGN_H__ |
|
20 #define __EIKALIGN_H__ |
|
21 |
|
22 #include <coecntrl.h> |
|
23 #include <gulalign.h> |
|
24 #include <gulutil.h> |
|
25 #include <AknControl.h> |
|
26 |
|
27 /** |
|
28 * Extends @c CAknControl to support control alignment and margins. |
|
29 * |
|
30 * @lib eikcoctl.lib |
|
31 * @since S60 0.9 |
|
32 */ |
|
33 class CEikAlignedControl : public CAknControl |
|
34 { |
|
35 public: |
|
36 |
|
37 /** |
|
38 * C++ default constructor. |
|
39 */ |
|
40 IMPORT_C CEikAlignedControl(); |
|
41 |
|
42 /** |
|
43 * Destructor |
|
44 */ |
|
45 IMPORT_C ~CEikAlignedControl(); |
|
46 |
|
47 /** |
|
48 * Sets all of the control's margins. |
|
49 * |
|
50 * @param aValue The number of pixels to which all margins will be set. |
|
51 */ |
|
52 IMPORT_C void SetAllMarginsTo(TInt aValue); |
|
53 |
|
54 /** |
|
55 * Sets the control's alignment. |
|
56 * |
|
57 * @param aAlign The alignment to be set to the control. |
|
58 */ |
|
59 IMPORT_C void SetAlignment(TGulAlignmentValue aAlign); |
|
60 |
|
61 public: /** From @c CCoeControl. */ |
|
62 |
|
63 /** |
|
64 * Handles pointer events. |
|
65 * |
|
66 * This function gets called whenever a pointer event occurs in the |
|
67 * control, i.e. when the pointer is within the control's extent, or when |
|
68 * the control has grabbed the pointer. The control should implement this |
|
69 * function to handle pointer events. |
|
70 * |
|
71 * If overriding this method, the implementation must |
|
72 * include a base call to this method. |
|
73 * |
|
74 * From @c CCoeControl. |
|
75 * |
|
76 * @param aPointerEvent The pointer event. |
|
77 */ |
|
78 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); |
|
79 |
|
80 protected: |
|
81 |
|
82 /** |
|
83 * Writes the internal state of the control and its components |
|
84 * to @c aWriteStream. |
|
85 * |
|
86 * Does nothing in release mode. |
|
87 * Designed to be overridden and base called from subclasses. |
|
88 * |
|
89 * From @c CCoeControl. |
|
90 * |
|
91 * @param[in,out] aWriteStream A connected write stream. |
|
92 */ |
|
93 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const; |
|
94 |
|
95 private: /** From @c CAknControl. */ |
|
96 |
|
97 IMPORT_C void* ExtensionInterface( TUid aInterface ); |
|
98 |
|
99 public: |
|
100 /** The control's margins. */ |
|
101 TMargins8 iMargin; |
|
102 |
|
103 /** The control's alignment. */ |
|
104 TGulAlignment iAlignment; |
|
105 |
|
106 private: |
|
107 TInt iSpare[2]; |
|
108 }; |
|
109 |
|
110 #endif // __EIKALIGN_H__ |