williamr@2: /* williamr@2: * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@2: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * Label control to the status pane's navigation pane. williamr@2: * williamr@2: * williamr@2: */ williamr@2: williamr@2: williamr@2: #ifndef AKNNAVILABEL_H williamr@2: #define AKNNAVILABEL_H williamr@2: williamr@2: #include williamr@2: williamr@2: class CAknNaviLabelExtension; williamr@2: class TAknLayoutText; williamr@2: williamr@2: /** williamr@2: * Label control to the status pane's navigation pane. williamr@2: */ williamr@2: class CAknNaviLabel : public CAknControl williamr@2: { williamr@2: public: williamr@2: enum TNaviLabelType williamr@2: { williamr@2: ENavigationLabel, williamr@2: EAdditionalInfoLabel, williamr@2: EHintText williamr@2: }; williamr@2: williamr@2: public: // new functions williamr@2: williamr@2: /** williamr@2: * Constructor. williamr@2: */ williamr@2: IMPORT_C CAknNaviLabel(); williamr@2: williamr@2: /** williamr@2: * Destructor. williamr@2: */ williamr@2: IMPORT_C ~CAknNaviLabel(); williamr@2: williamr@2: /** williamr@2: * Set type of the label. williamr@2: * @param aNaviLabelType navigation label type. williamr@2: */ williamr@2: IMPORT_C void SetNaviLabelType(TNaviLabelType aNaviLabelType); williamr@2: williamr@2: /** williamr@2: * Returns type of the label. williamr@2: * @return navigation label type. williamr@2: */ williamr@2: IMPORT_C TNaviLabelType NaviLabelType(); williamr@2: williamr@2: /** williamr@2: * Sets navigation label text. williamr@2: * @param aText reference to the navigation text. williamr@2: */ williamr@2: IMPORT_C void SetTextL(const TDesC& aText); williamr@2: williamr@2: /** williamr@2: * Returns the current label text. williamr@2: * @return label text. Ownership of the text is not transfered. williamr@2: */ williamr@2: inline const TDesC* Text() const; williamr@2: williamr@2: public: williamr@2: williamr@2: /** williamr@2: * From CCoeControl. Handles pointer event. williamr@2: * @param aPointerEvent Pointer event to be handled. williamr@2: */ williamr@2: IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); williamr@2: williamr@2: protected: // from CCoeControl williamr@2: williamr@2: /** williamr@2: * From CCoeControl. Handle the size change events. williamr@2: */ williamr@2: IMPORT_C virtual void SizeChanged(); williamr@2: williamr@2: /** williamr@2: * From CCoeControl. Draw a control. williamr@2: * williamr@2: * @param aRect The region of the control to be redrawn. williamr@2: */ williamr@2: IMPORT_C void Draw(const TRect& aRect) const; williamr@2: private: williamr@2: /** williamr@2: * From CAknControl williamr@2: */ williamr@2: IMPORT_C void* ExtensionInterface( TUid aInterface ); williamr@2: williamr@2: private: williamr@2: /** williamr@2: * Calculates width using margins. williamr@2: * @return width. williamr@2: */ williamr@2: TInt WidthInsideMargins() const; williamr@2: williamr@2: /** williamr@2: * Reads the text layout from Aknlayout system. williamr@2: * @return Text layout. williamr@2: */ williamr@2: TAknLayoutText LayoutText() const; williamr@2: williamr@2: private: williamr@2: HBufC* iText; williamr@2: CAknNaviLabelExtension* iExtension; williamr@2: const CFont* iFont; williamr@2: TInt iLeftMargin; williamr@2: TInt iRightMargin; williamr@2: TInt iSpare; williamr@2: TInt iRightOffset; williamr@2: TRgb iColor; williamr@2: williamr@2: TNaviLabelType iLabelType; williamr@2: }; williamr@2: williamr@2: williamr@2: inline const TDesC* CAknNaviLabel::Text() const williamr@2: { return(iText); } williamr@2: williamr@2: williamr@2: #endif // AKNNAVILABEL_H