WebViewportArguments.cpp 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. #include "config.h"
  19. #include "WebViewportArguments.h"
  20. #include "ViewportArguments.h"
  21. namespace BlackBerry {
  22. namespace WebKit {
  23. WebViewportArguments::WebViewportArguments()
  24. :d(new WebCore::ViewportArguments(WebCore::ViewportArguments::ViewportMeta))
  25. {
  26. }
  27. WebViewportArguments::~WebViewportArguments()
  28. {
  29. delete d;
  30. d = 0;
  31. }
  32. float WebViewportArguments::zoom() const
  33. {
  34. return d->zoom;
  35. }
  36. void WebViewportArguments::setZoom(float zoom)
  37. {
  38. d->zoom = zoom;
  39. }
  40. float WebViewportArguments::minZoom() const
  41. {
  42. return d->minZoom;
  43. }
  44. void WebViewportArguments::setMinZoom(float zoom)
  45. {
  46. d->minZoom = zoom;
  47. }
  48. float WebViewportArguments::maxZoom() const
  49. {
  50. return d->maxZoom;
  51. }
  52. void WebViewportArguments::setMaxZoom(float zoom)
  53. {
  54. d->maxZoom = zoom;
  55. }
  56. float WebViewportArguments::width() const
  57. {
  58. return d->width;
  59. }
  60. void WebViewportArguments::setWidth(float width)
  61. {
  62. d->width = width;
  63. }
  64. float WebViewportArguments::height() const
  65. {
  66. return d->height;
  67. }
  68. void WebViewportArguments::setHeight(float height)
  69. {
  70. d->height = height;
  71. }
  72. float WebViewportArguments::devicePixelRatio() const
  73. {
  74. return 0;
  75. }
  76. void WebViewportArguments::setDevicePixelRatio(float)
  77. {
  78. }
  79. float WebViewportArguments::userZoom() const
  80. {
  81. return d->userZoom;
  82. }
  83. void WebViewportArguments::setUserZoom(float zoom)
  84. {
  85. d->userZoom = zoom;
  86. }
  87. bool WebViewportArguments::operator==(const WebViewportArguments& other)
  88. {
  89. return *d == *(other.d);
  90. }
  91. bool WebViewportArguments::operator!=(const WebViewportArguments& other)
  92. {
  93. return *d != *(other.d);
  94. }
  95. } // namespace WebKit
  96. } // namespace BlackBerry