LengthSize.h 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. Copyright (C) 1999 Lars Knoll (knoll@kde.org)
  3. Copyright (C) 2006, 2008 Apple Inc. All rights reserved.
  4. This library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Library 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. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Library General Public License for more details.
  12. You should have received a copy of the GNU Library General Public License
  13. along with this library; see the file COPYING.LIB. If not, write to
  14. the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  15. Boston, MA 02110-1301, USA.
  16. */
  17. #ifndef LengthSize_h
  18. #define LengthSize_h
  19. #include "Length.h"
  20. namespace WebCore {
  21. struct LengthSize {
  22. public:
  23. LengthSize()
  24. {
  25. }
  26. LengthSize(Length width, Length height)
  27. : m_width(width)
  28. , m_height(height)
  29. {
  30. }
  31. bool operator==(const LengthSize& o) const
  32. {
  33. return m_width == o.m_width && m_height == o.m_height;
  34. }
  35. void setWidth(Length width) { m_width = width; }
  36. Length width() const { return m_width; }
  37. void setHeight(Length height) { m_height = height; }
  38. Length height() const { return m_height; }
  39. private:
  40. Length m_width;
  41. Length m_height;
  42. };
  43. } // namespace WebCore
  44. #endif // LengthSize_h