author | hgs |
Fri, 15 Oct 2010 17:30:59 -0400 | |
changeset 16 | 3c88a81ff781 |
parent 3 | 0954f5dd2cd0 |
permissions | -rw-r--r-- |
0
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
2 |
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
3 |
* All rights reserved. |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
4 |
* |
3 | 5 |
* This program is free software: you can redistribute it and/or modify |
6 |
* it under the terms of the GNU Lesser General Public License as published by |
|
7 |
* the Free Software Foundation, version 2.1 of the License. |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU Lesser General Public License for more details. |
|
0
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
13 |
* |
3 | 14 |
* You should have received a copy of the GNU Lesser General Public License |
15 |
* along with this program. If not, |
|
16 |
* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/". |
|
0
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
17 |
* |
3 | 18 |
* Description: |
0
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
* |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
*/ |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
21 |
|
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#ifndef __WEBPAGEDATA_H__ |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
23 |
#define __WEBPAGEDATA_H__ |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
24 |
|
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
25 |
#include <QImage> |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
26 |
#include <QPoint> |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
27 |
#include <QMetaType> |
3 | 28 |
#include "BWFGlobal.h" |
0
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
29 |
|
16 | 30 |
class BWF_EXPORT WebPageData |
0
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
31 |
{ |
16 | 32 |
static const unsigned int DataMagic = 0x5AFEF00D; |
33 |
||
0
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
34 |
public: |
16 | 35 |
WebPageData() : |
36 |
magic(0) // default constructor should create valid item |
|
37 |
, minScale(1.0) |
|
38 |
, maxScale(1.0) |
|
39 |
, userScalable(true) |
|
40 |
, initialScale(1.0) |
|
41 |
, rect(QRectF()) |
|
42 |
, webViewRect(QRectF()) |
|
43 |
, scale(1.0) |
|
44 |
, viewportSize(QSizeF()) |
|
45 |
, specifiedWidth(QString()) |
|
46 |
, specifiedHeight(QString()) |
|
47 |
, fitToScreen(0) |
|
48 |
{}; |
|
49 |
||
50 |
WebPageData(qreal aMaxScale, qreal aMinScale, qreal aUserScalable, qreal aInitialScale) : |
|
51 |
magic(DataMagic) |
|
52 |
, minScale(aMinScale) |
|
53 |
, maxScale(aMaxScale) |
|
54 |
, userScalable(aUserScalable) |
|
55 |
, initialScale(aInitialScale) |
|
56 |
, rect(QRectF()) |
|
57 |
, webViewRect(QRectF()) |
|
58 |
, scale(1.0) |
|
59 |
, viewportSize(QSizeF()) |
|
60 |
, specifiedWidth(QString()) |
|
61 |
, specifiedHeight(QString()) |
|
62 |
, fitToScreen(0) |
|
63 |
{}; |
|
64 |
||
65 |
WebPageData(qreal aMaxScale, qreal aMinScale, qreal aUserScalable, qreal aInitialScale, const QRectF& aRect, const QRectF& aWebViewRect, |
|
66 |
qreal aScale, const QSizeF& aViewportSize, const QString& aSpecifiedWidth, const QString& aSpecifiedHeight, bool aFitToScreen) : |
|
67 |
magic(DataMagic) |
|
68 |
, minScale(aMinScale) |
|
69 |
, maxScale(aMaxScale) |
|
70 |
, userScalable(aUserScalable) |
|
71 |
, initialScale(aInitialScale) |
|
72 |
, rect(aRect) |
|
73 |
, webViewRect(aWebViewRect) |
|
74 |
, scale(aScale) |
|
75 |
, viewportSize(aViewportSize) |
|
76 |
, specifiedWidth(aSpecifiedWidth) |
|
77 |
, specifiedHeight(aSpecifiedHeight) |
|
78 |
, fitToScreen(aFitToScreen) |
|
79 |
{}; |
|
80 |
||
81 |
WebPageData(const WebPageData& o) : //: QObject() |
|
82 |
magic(o.magic) |
|
83 |
, minScale(o.minScale) |
|
84 |
, maxScale(o.maxScale) |
|
85 |
, userScalable(o.userScalable) |
|
86 |
, initialScale(o.initialScale) |
|
87 |
, rect(o.rect) |
|
88 |
, webViewRect(o.webViewRect) |
|
89 |
, scale(o.scale) |
|
90 |
, viewportSize(o.viewportSize) |
|
91 |
, specifiedWidth(o.specifiedWidth) |
|
92 |
, specifiedHeight(o.specifiedHeight) |
|
93 |
, fitToScreen(o.fitToScreen) |
|
94 |
{}; |
|
95 |
||
96 |
bool isValid() const { return magic == DataMagic; } |
|
97 |
||
98 |
unsigned int magic; |
|
99 |
qreal minScale; |
|
100 |
qreal maxScale; |
|
101 |
bool userScalable; |
|
102 |
qreal initialScale; |
|
103 |
QRectF rect; |
|
104 |
QRectF webViewRect; |
|
105 |
qreal scale; |
|
106 |
QSizeF viewportSize; |
|
107 |
QString specifiedWidth; |
|
108 |
QString specifiedHeight; |
|
109 |
bool fitToScreen; |
|
0
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
110 |
}; |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
111 |
Q_DECLARE_METATYPE (WebPageData) |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
QDataStream &operator<<(QDataStream &out, const WebPageData &myObj); |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
QDataStream &operator>>(QDataStream &in, WebPageData &myObj); |
1450b09d0cfd
Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
#endif |