landmarksui/uicontrols/src/CLmkMfneSeparator.cpp
branchRCL_3
changeset 17 1fc85118c3ae
parent 16 8173571d354e
child 18 870918037e16
equal deleted inserted replaced
16:8173571d354e 17:1fc85118c3ae
     1 /*
       
     2 * Copyright (c) 2005 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 "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".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:    LandmarksUi Content File -
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 // INCLUDE FILES
       
    26 #include <eikenv.h>
       
    27 
       
    28 #include "CLmkMfneSeparator.h"
       
    29 
       
    30 CLmkMfneSeparator::CLmkMfneSeparator()
       
    31     {
       
    32     }
       
    33 
       
    34 CLmkMfneSeparator::~CLmkMfneSeparator()
       
    35     {
       
    36     delete iText;
       
    37     }
       
    38 
       
    39 CLmkMfneSeparator* CLmkMfneSeparator::NewL(const TDesC& aText)
       
    40     {
       
    41     CLmkMfneSeparator* self = new(ELeave) CLmkMfneSeparator();
       
    42     CleanupStack::PushL(self);
       
    43     self->SetTextL(aText);
       
    44     CleanupStack::Pop(self);
       
    45     return self;
       
    46     }
       
    47 
       
    48 void CLmkMfneSeparator::SetTextL(const TDesC& aText)
       
    49     {
       
    50     delete iText;
       
    51     iText = NULL;
       
    52     iText = HBufC::NewL(aText.Length());
       
    53     *iText = aText;
       
    54     }
       
    55 
       
    56 TInt CLmkMfneSeparator::MaximumWidthInPixels(
       
    57     const CFont& aFont,
       
    58     TBool /*aShrinkToMinimumSize*/)
       
    59     {
       
    60     return aFont.TextWidthInPixels(*iText);
       
    61     }
       
    62 
       
    63 TCoeInputCapabilities CLmkMfneSeparator::InputCapabilities() const
       
    64     {
       
    65     return TCoeInputCapabilities(TCoeInputCapabilities::ENone);
       
    66     }
       
    67 
       
    68 const TDesC& CLmkMfneSeparator::Text() const
       
    69     {
       
    70     return *iText;
       
    71     }