emailuis/nmailui/inc/nmviewerheader.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Wed, 18 Aug 2010 09:37:47 +0300
changeset 59 16ed8d08d0b1
parent 54 997a02608b3a
child 68 83cc6bae1de8
permissions -rw-r--r--
Revision: 201031 Kit: 201033

/*
* Copyright (c) 2009 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: NMail viewer view header widget definition
*
*/


#ifndef NMVIEWERHEADER_H_
#define NMVIEWERHEADER_H_

#include <hbwidget.h>

class NmMessage;
class NmAddress;
class NmViewerView;
class HbTextItem;
class HbGroupBox;
class HbLabel;
class HbIconItem;

class NmViewerHeader : public HbWidget
{
Q_OBJECT

public:
    NmViewerHeader(QGraphicsItem *parent=0);
    virtual ~NmViewerHeader();
    void setMessage(NmMessage* message);
    void paint(QPainter *painter,
               const QStyleOptionGraphicsItem *option,
               QWidget *widget);
    void rescaleHeader(const QSizeF layoutReso);
    void setView(NmViewerView* view);
    void updateMessageData(NmMessage* message);
       
private:
    void loadWidgets();
    void setHeaderData();
    void createExpandableHeader();
    QString formatRecipientList(const QString &sender,
                                const QList<NmAddress> &to,
                                const QList<NmAddress> &cc);
    QString addressToDisplay(const NmAddress &addr);
    
private:
    NmMessage *mMessage;                 // Not owned
    QString mSenderName;                // Not owned
    HbTextItem *mSubject;                   // Not owned
    HbTextItem *mSent;                     // Not owned
    HbIconItem *mPrioIcon;              // Not owned
    HbGroupBox *mHeaderBox;             // not owned
    HbLabel *mRecipientsBox;         // Not owned
    NmViewerView *mViewerView;          // Not owned

};

 #endif /* NMVIEWERHEADER_H_ */