1/*
2 * Copyright (C) 2012 Research In Motion Limited. All rights reserved.
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library 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 GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
17 */
18
19#ifndef WebViewportArguments_h
20#define WebViewportArguments_h
21
22#include "BlackBerryGlobal.h"
23#include "BlackBerryPlatformMisc.h"
24
25// Not for public API purpose.
26namespace WebCore {
27class ViewportArguments;
28}
29
30namespace BlackBerry {
31namespace WebKit {
32
33class WebPage;
34
35/**
36 * A class designed to expose a meta viewport fallback.
37 *
38 * This class simply wraps a WebCore::ViewportArguments. It can be
39 * instantiated by the WebPageClient and supplied to a WebPage to
40 * provide a userViewportArguments object that can be used whenever
41 * there is no meta viewport tag provided in any loaded html.
42 */
43class BLACKBERRY_EXPORT WebViewportArguments {
44public:
45    WebViewportArguments();
46    ~WebViewportArguments();
47
48    // This matches the enum found in WebCore::ViewportArguments
49    enum {
50        ValueAuto = -1,
51        ValueDeviceWidth = -2,
52        ValueDeviceHeight = -3,
53    };
54
55    float zoom() const;
56    void setZoom(float);
57
58    float minZoom() const;
59    void setMinZoom(float);
60
61    float maxZoom() const;
62    void setMaxZoom(float);
63
64    float width() const;
65    void setWidth(float);
66
67    float height() const;
68    void setHeight(float);
69
70    float devicePixelRatio() const;
71    void setDevicePixelRatio(float);
72
73    float userZoom() const;
74    void setUserZoom(float);
75
76    bool operator==(const WebViewportArguments &other);
77    bool operator!=(const WebViewportArguments &other);
78
79private:
80    WebCore::ViewportArguments* d;
81
82private:
83    friend class WebPage;
84    DISABLE_COPY(WebViewportArguments)
85};
86
87} // namespace WebKit
88} // namespace BlackBerry
89
90#endif // WebViewportArguments_h
91