diff -r dcf0eedfc1a3 -r d189ee25cf9d emailuis/nmailuiwidgets/inc/nmattachmentlistwidget.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/emailuis/nmailuiwidgets/inc/nmattachmentlistwidget.h Tue Aug 31 15:04:17 2010 +0300 @@ -0,0 +1,77 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Attachment list widget +* +*/ +#ifndef NMATTACHMENTLISTWIDGET_H_ +#define NMATTACHMENTLISTWIDGET_H_ + +#include + +#include +#include "nmailuiwidgetsdef.h" + +class NmAttachmentListItem; +class QGraphicsGridLayout; +class QStyleOptionGraphicsItem; +class QPainter; + +class NMAILUIWIDGETS_EXPORT NmAttachmentListWidget : public HbWidget +{ + Q_OBJECT + +public: + NmAttachmentListWidget(QGraphicsItem *parent = 0); + virtual ~NmAttachmentListWidget(); + void setTextColor(const QColor color); + void insertAttachment(const int index, const QString &fileName, const QString &fileSize); + void removeAttachment(const int index); + void setAttachmentSize(int index, const QString &fileSize); + int count() const; + int progressValue(int index) const; + void hideProgressBar(int index); + void paint(QPainter *painter,const QStyleOptionGraphicsItem *option,QWidget *widget); + +public slots: + void setProgressBarValue(int index, int value); + +private slots: + void handleLongPressed(QPointF point); + void handleItemActivated(); + void orientationChanged(Qt::Orientation); + +protected: + virtual void changeEvent(QEvent *event); + +signals: + void itemActivated(int index); + void longPressed(int index, QPointF point); + +private: + void init( ); + void constructUi(); + int findItem(const QObject *obj); + void insertItemToLayout(NmAttachmentListItem* item); + void rearrangeLayout(); + QColor checkColor(); + +private: + Q_DISABLE_COPY(NmAttachmentListWidget) + QList mItemList; //owned + QGraphicsGridLayout *mLayout; + Qt::Orientation mOrientation; + QColor mTextColor; +}; + +#endif // NMATTACHMENTLISTWIDGET_H_