epoc32/include/mw/aknnavilabel.h
author William Roberts <williamr@symbian.org>
Tue, 16 Mar 2010 16:12:26 +0000
branchSymbian2
changeset 2 2fe1408b6811
parent 1 666f914201fb
child 4 837f303aceeb
permissions -rw-r--r--
Final list of Symbian^2 public API header files
     1 /*
     2 * Copyright (c) 2002 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 the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
     8 *
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    11 *
    12 * Contributors:
    13 *
    14 * Description: 
    15 *   Label control to the status pane's navigation pane.
    16 *
    17 *
    18 */
    19 
    20 
    21 #ifndef AKNNAVILABEL_H
    22 #define AKNNAVILABEL_H
    23 
    24 #include <AknControl.h>
    25 
    26 class CAknNaviLabelExtension;
    27 class TAknLayoutText;
    28 
    29 /**
    30  * Label control to the status pane's navigation pane.
    31  */
    32 class CAknNaviLabel : public CAknControl
    33 	{
    34 public:
    35     enum TNaviLabelType
    36         {
    37         ENavigationLabel,
    38         EAdditionalInfoLabel,
    39         EHintText
    40         };
    41 
    42 public:  // new functions
    43 
    44     /**
    45     * Constructor.
    46     */
    47     IMPORT_C CAknNaviLabel();
    48 
    49     /**
    50     * Destructor.
    51     */
    52     IMPORT_C ~CAknNaviLabel();
    53 
    54     /**
    55      * Set type of the label.
    56      * @param aNaviLabelType navigation label type.
    57      */
    58     IMPORT_C void SetNaviLabelType(TNaviLabelType aNaviLabelType);
    59 
    60     /**
    61      * Returns type of the label.
    62      * @return navigation label type.
    63      */
    64     IMPORT_C TNaviLabelType NaviLabelType();
    65 
    66     /**
    67      * Sets navigation label text.
    68      * @param aText reference to the navigation text.
    69      */
    70     IMPORT_C void SetTextL(const TDesC& aText);
    71 
    72     /**
    73      * Returns the current label text.
    74      * @return label text. Ownership of the text is not transfered.
    75      */
    76     inline const TDesC* Text() const;
    77 
    78 public: 
    79 
    80     /**
    81     * From CCoeControl. Handles pointer event.
    82     * @param aPointerEvent Pointer event to be handled.
    83     */
    84 	IMPORT_C void HandlePointerEventL(const TPointerEvent& aPointerEvent); 
    85 
    86 protected: // from CCoeControl
    87 
    88     /**
    89     * From CCoeControl. Handle the size change events.
    90     */
    91     IMPORT_C virtual void SizeChanged();
    92 
    93     /**
    94     * From CCoeControl.  Draw a control.  
    95     *
    96     * @param aRect The region of the control to be redrawn.   
    97     */
    98     IMPORT_C void Draw(const TRect& aRect) const;
    99 private:
   100     /**
   101     * From CAknControl
   102     */
   103     IMPORT_C void* ExtensionInterface( TUid aInterface );
   104 
   105 private:
   106     /**
   107      * Calculates width using margins.
   108      * @return width.
   109      */
   110     TInt WidthInsideMargins() const;
   111 
   112     /**
   113      * Reads the text layout from Aknlayout system.
   114      * @return Text layout.
   115      */
   116     TAknLayoutText LayoutText() const;    
   117 
   118 private:
   119 	HBufC* iText;
   120 	CAknNaviLabelExtension* iExtension;
   121     const CFont* iFont;
   122     TInt iLeftMargin;
   123     TInt iRightMargin;
   124     TInt iSpare;
   125     TInt iRightOffset;
   126     TRgb iColor; 
   127 
   128     TNaviLabelType iLabelType;
   129 	};
   130 
   131 
   132 inline const TDesC* CAknNaviLabel::Text() const
   133 	{ return(iText); }
   134 
   135 
   136 #endif // AKNNAVILABEL_H