2 * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: Class declaration for EIKON aligned control.
19 #ifndef __EIKALIGN_H__
20 #define __EIKALIGN_H__
25 #include <AknControl.h>
28 * Extends @c CAknControl to support control alignment and margins.
33 class CEikAlignedControl : public CAknControl
38 * C++ default constructor.
40 IMPORT_C CEikAlignedControl();
45 IMPORT_C ~CEikAlignedControl();
48 * Sets all of the control's margins.
50 * @param aValue The number of pixels to which all margins will be set.
52 IMPORT_C void SetAllMarginsTo(TInt aValue);
55 * Sets the control's alignment.
57 * @param aAlign The alignment to be set to the control.
59 IMPORT_C void SetAlignment(TGulAlignmentValue aAlign);
61 public: /** From @c CCoeControl. */
64 * Handles pointer events.
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.
71 * If overriding this method, the implementation must
72 * include a base call to this method.
74 * From @c CCoeControl.
76 * @param aPointerEvent The pointer event.
78 IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent);
83 * Writes the internal state of the control and its components
86 * Does nothing in release mode.
87 * Designed to be overridden and base called from subclasses.
89 * From @c CCoeControl.
91 * @param[in,out] aWriteStream A connected write stream.
93 IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const;
95 private: /** From @c CAknControl. */
97 IMPORT_C void* ExtensionInterface( TUid aInterface );
100 /** The control's margins. */
103 /** The control's alignment. */
104 TGulAlignment iAlignment;
110 #endif // __EIKALIGN_H__