videocollection/tsrc/stubs/inc/hblabel.h
changeset 15 cf5481c2bc0b
equal deleted inserted replaced
2:dec420019252 15:cf5481c2bc0b
       
     1 /*
       
     2 * Copyright (c) 2009 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:  stub hblabel for testing video collection ui uitils
       
    15 * 
       
    16 */
       
    17 
       
    18 #ifndef HBLABEL_H
       
    19 #define HBLABEL_H
       
    20 
       
    21 #include <QString>
       
    22 #include "hbwidget.h"
       
    23 
       
    24 class HbLabel : public HbWidget
       
    25 {
       
    26     Q_OBJECT
       
    27 public:
       
    28 
       
    29     /**
       
    30      * Contructor.
       
    31      */       
       
    32     HbLabel() {initializeCount++;}
       
    33     
       
    34     /**
       
    35      * Contructor.
       
    36      */ 
       
    37     HbLabel(const QString&,  QGraphicsItem *parent = 0) : HbWidget(parent){initializeCount++;}
       
    38       
       
    39     /**
       
    40      * Destructor.
       
    41      */   
       
    42     virtual ~HbLabel(){initializeCount--;}
       
    43     
       
    44     /**
       
    45      * counter to make sure alloc dealloc match
       
    46      */
       
    47     static int initializeCount;
       
    48     
       
    49     /**
       
    50      * set text
       
    51      */
       
    52     void setPlainText(QString txt);
       
    53     
       
    54     /**
       
    55      * sets alignment flag
       
    56      */
       
    57     void setAlignment(Qt::AlignmentFlag alignment);
       
    58 
       
    59     /**
       
    60      * clears text
       
    61      */
       
    62     void clear();
       
    63 	
       
    64 	int count() const { return 0;}
       
    65     
       
    66     QGraphicsLayoutItem *itemAt(int index) const 
       
    67     {
       
    68         Q_UNUSED(index);
       
    69         return 0;
       
    70     }
       
    71     void removeAt(int index) { Q_UNUSED(index); }
       
    72     
       
    73     void removeItem(QGraphicsLayoutItem* item){Q_UNUSED(item);}
       
    74     
       
    75     int indexOf(const QGraphicsLayoutItem* item) const
       
    76     {
       
    77         Q_UNUSED(item);
       
    78         return 0;
       
    79     }
       
    80     
       
    81     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const
       
    82        {
       
    83            Q_UNUSED(which);
       
    84            Q_UNUSED(constraint);
       
    85            return QSizeF();
       
    86        }
       
    87     
       
    88     /**
       
    89      * text setted 
       
    90      */
       
    91 	 QString mPlainTxt;
       
    92     
       
    93     /**
       
    94      * alinment setted
       
    95      */
       
    96     Qt::AlignmentFlag mAlignment;
       
    97     
       
    98 };
       
    99 
       
   100 #endif