emailuis/nmailui/inc/nmviewerwebview.h
author hgs
Thu, 10 Jun 2010 16:14:05 +0300
changeset 44 c2d07d913565
parent 43 99bcbff212ad
child 47 f83bd4ae1fe3
child 54 997a02608b3a
permissions -rw-r--r--
201023
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
18
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
44
hgs
parents: 43
diff changeset
     2
 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents: 43
diff changeset
     3
 * All rights reserved.
hgs
parents: 43
diff changeset
     4
 * This component and the accompanying materials are made available
hgs
parents: 43
diff changeset
     5
 * under the terms of "Eclipse Public License v1.0"
hgs
parents: 43
diff changeset
     6
 * which accompanies this distribution, and is available
hgs
parents: 43
diff changeset
     7
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents: 43
diff changeset
     8
 *
hgs
parents: 43
diff changeset
     9
 * Initial Contributors:
hgs
parents: 43
diff changeset
    10
 * Nokia Corporation - initial contribution.
hgs
parents: 43
diff changeset
    11
 *
hgs
parents: 43
diff changeset
    12
 * Contributors:
hgs
parents: 43
diff changeset
    13
 *
hgs
parents: 43
diff changeset
    14
 * Description:
hgs
parents: 43
diff changeset
    15
 *
hgs
parents: 43
diff changeset
    16
 */
18
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    18
#ifndef NMVIEWERWEBVIEW_H_
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
#define NMVIEWERWEBVIEW_H_
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
#include <QGraphicsWebView>
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
43
hgs
parents: 18
diff changeset
    23
#include "nmcommon.h"
hgs
parents: 18
diff changeset
    24
18
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
class NmViewerView;
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
class NmMessage;
44
hgs
parents: 43
diff changeset
    27
class QGestureEvent;
18
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    28
43
hgs
parents: 18
diff changeset
    29
class NmMailViewerWkContentItem
hgs
parents: 18
diff changeset
    30
{
hgs
parents: 18
diff changeset
    31
public:
hgs
parents: 18
diff changeset
    32
    NmMailViewerWkContentItem() 
hgs
parents: 18
diff changeset
    33
        : mData(0), mPartId(0), mIsFetched(false) {}
hgs
parents: 18
diff changeset
    34
    NmMailViewerWkContentItem(QVariant data, NmId partId, bool isFetched) 
hgs
parents: 18
diff changeset
    35
        : mData(data), mPartId(partId), mIsFetched(isFetched) {}
hgs
parents: 18
diff changeset
    36
    QVariant mData;
hgs
parents: 18
diff changeset
    37
    NmId     mPartId;
hgs
parents: 18
diff changeset
    38
    bool     mIsFetched;
hgs
parents: 18
diff changeset
    39
};
hgs
parents: 18
diff changeset
    40
18
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
class NmMailViewerWK : public QGraphicsWebView
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
{
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
    Q_OBJECT
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
public:
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    45
	NmMailViewerWK();
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
	~NmMailViewerWK();
43
hgs
parents: 18
diff changeset
    47
    virtual QVariant loadResource (int type, const QUrl &name, NmId &partId, bool &isFetched);
18
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
    void setParentView(NmViewerView *parentView);
43
hgs
parents: 18
diff changeset
    49
    void addContent(QString key, QVariant val, NmId partId, bool isFetched);
18
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    50
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    51
private:
43
hgs
parents: 18
diff changeset
    52
    QMap<QString,NmMailViewerWkContentItem> mContent;
44
hgs
parents: 43
diff changeset
    53
    NmViewerView *mParentView;                        // Not owned
hgs
parents: 43
diff changeset
    54
};
hgs
parents: 43
diff changeset
    55
hgs
parents: 43
diff changeset
    56
class NmEventFilterWK : public QObject
hgs
parents: 43
diff changeset
    57
{
hgs
parents: 43
diff changeset
    58
    Q_OBJECT
hgs
parents: 43
diff changeset
    59
public:
hgs
parents: 43
diff changeset
    60
    NmEventFilterWK(QObject* parent = 0);
hgs
parents: 43
diff changeset
    61
protected:
hgs
parents: 43
diff changeset
    62
    bool eventFilter(QObject* object, QEvent* event);
hgs
parents: 43
diff changeset
    63
    bool gestureEvent(QGestureEvent* event);
hgs
parents: 43
diff changeset
    64
private:
hgs
parents: 43
diff changeset
    65
    Q_DISABLE_COPY(NmEventFilterWK)
18
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    66
};
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
578830873419 Revision: 201011
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
#endif /* NMVIEWERWEBVIEW_H_*/