emailuis/nmailuiwidgets/inc/nmattachmentlistitem.h
changeset 18 578830873419
child 20 ecc8def7944a
equal deleted inserted replaced
4:e7aa27f58ae1 18:578830873419
       
     1 /*
       
     2 * Copyright (c) 2010 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: Attachment list item widget
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef NMATTACHMENTLISTITEM_H_
       
    19 #define NMATTACHMENTLISTITEM_H_
       
    20 
       
    21 
       
    22 #include <hbwidget.h>
       
    23 #include"nmailuiwidgetsdef.h"
       
    24 
       
    25 class HbProgressBar;
       
    26 class HbTextItem;
       
    27 class QTimer;
       
    28 
       
    29 class NMAILUIWIDGETS_EXPORT NmAttachmentListItem : public HbWidget
       
    30 {
       
    31     Q_OBJECT
       
    32 
       
    33 public:
       
    34     explicit NmAttachmentListItem(QGraphicsItem *parent = 0);
       
    35     virtual ~NmAttachmentListItem();
       
    36     void setTextItems(const QString &fileName, const QString &fileSize);
       
    37     void setProgressBarValue(const int value);
       
    38     int progressBarValue() const;
       
    39 
       
    40 protected: 
       
    41     void mousePressEvent( QGraphicsSceneMouseEvent *event );
       
    42     void mouseReleaseEvent( QGraphicsSceneMouseEvent *event );
       
    43     
       
    44 private slots:
       
    45     void removeProgressBar();
       
    46     void longPressedActivated();
       
    47 
       
    48 signals: 
       
    49     void itemActivated();
       
    50     void itemLongPressed(QPointF point);
       
    51     
       
    52 private: 
       
    53     void init( );
       
    54     void constructUi();
       
    55     
       
    56 private:
       
    57     Q_DISABLE_COPY(NmAttachmentListItem)
       
    58     HbTextItem *mFileNameText; //owned
       
    59     HbTextItem *mFileSizeText; //owned
       
    60     HbProgressBar *mProgressBar; //owned
       
    61     QTimer *mTimer; //owned
       
    62     bool mButtonPressed;
       
    63     QPointF mLongPressedPoint;
       
    64 
       
    65 };
       
    66 
       
    67 #endif /* NMATTACHMENTLISTITEM_H_ */