app/tsrc/unittest_mpmtpinfolink/stub/inc/hblabel.h
changeset 37 eb79a7c355bf
equal deleted inserted replaced
36:a0afa279b8fe 37:eb79a7c355bf
       
     1 /*
       
     2 * Copyright (c) 2007 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:  HbLabel stub for testing MpMtpInfoLink
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HBLABEL_H
       
    19 #define HBLABEL_H
       
    20 
       
    21 #include <QGraphicsView>
       
    22 
       
    23 namespace Hb
       
    24 {
       
    25 /*!
       
    26     A type definition for text wrapping
       
    27 */
       
    28     enum TextWrapping
       
    29     {
       
    30         TextNoWrap = 0,
       
    31         TextWordWrap = 1,
       
    32         TextWrapAnywhere = 3
       
    33     };
       
    34 }
       
    35 
       
    36 class HbLabel : public QObject
       
    37 {
       
    38 
       
    39 public:
       
    40     explicit HbLabel ();
       
    41     virtual ~HbLabel ();
       
    42 
       
    43     QString plainText() const;
       
    44     QString html() const;
       
    45 
       
    46     void setTextWrapping(Hb::TextWrapping mode);
       
    47     Hb::TextWrapping textWrapping() const;
       
    48 
       
    49     void setPlainText(const QString &text);
       
    50     void setHtml(const QString &text);
       
    51     QRectF boundingRect();
       
    52 
       
    53 private:
       
    54     QString mText;
       
    55     QString mHtmlText;
       
    56     Hb::TextWrapping mTextWrapping;
       
    57 };
       
    58 
       
    59 
       
    60 #endif // HBLABEL_H