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