williamr@2: /* williamr@2: * Copyright (c) 2002-2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: Class declaration for EIKON aligned control. williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef __EIKALIGN_H__ williamr@2: #define __EIKALIGN_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: #include williamr@2: williamr@2: /** williamr@2: * Extends @c CAknControl to support control alignment and margins. williamr@2: * williamr@2: * @lib eikcoctl.lib williamr@2: * @since S60 0.9 williamr@2: */ williamr@2: class CEikAlignedControl : public CAknControl williamr@2: { williamr@2: public: williamr@2: williamr@2: /** williamr@2: * C++ default constructor. williamr@2: */ williamr@2: IMPORT_C CEikAlignedControl(); williamr@2: williamr@2: /** williamr@2: * Destructor williamr@2: */ williamr@2: IMPORT_C ~CEikAlignedControl(); williamr@2: williamr@2: /** williamr@2: * Sets all of the control's margins. williamr@2: * williamr@2: * @param aValue The number of pixels to which all margins will be set. williamr@2: */ williamr@2: IMPORT_C void SetAllMarginsTo(TInt aValue); williamr@2: williamr@2: /** williamr@2: * Sets the control's alignment. williamr@2: * williamr@2: * @param aAlign The alignment to be set to the control. williamr@2: */ williamr@2: IMPORT_C void SetAlignment(TGulAlignmentValue aAlign); williamr@2: williamr@2: public: /** From @c CCoeControl. */ williamr@2: williamr@2: /** williamr@2: * Handles pointer events. williamr@2: * williamr@2: * This function gets called whenever a pointer event occurs in the williamr@2: * control, i.e. when the pointer is within the control's extent, or when williamr@2: * the control has grabbed the pointer. The control should implement this williamr@2: * function to handle pointer events. williamr@2: * williamr@2: * If overriding this method, the implementation must williamr@2: * include a base call to this method. williamr@2: * williamr@2: * From @c CCoeControl. williamr@2: * williamr@2: * @param aPointerEvent The pointer event. williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: williamr@2: protected: williamr@2: williamr@2: /** williamr@2: * Writes the internal state of the control and its components williamr@2: * to @c aWriteStream. williamr@2: * williamr@2: * Does nothing in release mode. williamr@2: * Designed to be overridden and base called from subclasses. williamr@2: * williamr@2: * From @c CCoeControl. williamr@2: * williamr@2: * @param[in,out] aWriteStream A connected write stream. williamr@2: */ williamr@2: IMPORT_C void WriteInternalStateL(RWriteStream& aWriteStream) const; williamr@2: williamr@2: private: /** From @c CAknControl. */ williamr@2: williamr@2: IMPORT_C void* ExtensionInterface( TUid aInterface ); williamr@2: williamr@2: public: williamr@2: /** The control's margins. */ williamr@2: TMargins8 iMargin; williamr@2: williamr@2: /** The control's alignment. */ williamr@2: TGulAlignment iAlignment; williamr@2: williamr@2: private: williamr@2: TInt iSpare[2]; williamr@2: }; williamr@2: williamr@2: #endif // __EIKALIGN_H__