OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (C) 2011 Kyounga Ra (kyounga.ra@gmail.com) |
| 3 * Copyright (C) 2014 Opera Software ASA. All rights reserved. |
| 4 * |
| 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. |
| 9 * |
| 10 * This library is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. |
| 14 * |
| 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. |
| 19 * |
| 20 */ |
| 21 |
| 22 #ifndef StyleNavigationData_h |
| 23 #define StyleNavigationData_h |
| 24 |
| 25 #include "core/rendering/style/StyleNavigationValue.h" |
| 26 #include "wtf/PassRefPtr.h" |
| 27 #include "wtf/RefCounted.h" |
| 28 |
| 29 namespace blink { |
| 30 |
| 31 class StyleNavigationData : public RefCounted<StyleNavigationData> { |
| 32 public: |
| 33 static PassRefPtr<StyleNavigationData> create() { return adoptRef(new StyleN
avigationData()); } |
| 34 PassRefPtr<StyleNavigationData> copy() const { return adoptRef(new StyleNavi
gationData(*this)); } |
| 35 |
| 36 bool operator==(const StyleNavigationData& o) const |
| 37 { |
| 38 return m_up == o.m_up && m_down == o.m_down && m_left == o.m_left && m_r
ight == o.m_right; |
| 39 } |
| 40 |
| 41 bool operator!=(const StyleNavigationData& o) const |
| 42 { |
| 43 return !(*this == o); |
| 44 } |
| 45 |
| 46 const StyleNavigationValue& up() const { return m_up; } |
| 47 const StyleNavigationValue& down() const { return m_down; } |
| 48 const StyleNavigationValue& left() const { return m_left; } |
| 49 const StyleNavigationValue& right() const { return m_right; } |
| 50 |
| 51 void setUp(const StyleNavigationValue& value) { m_up = value; } |
| 52 void setDown(const StyleNavigationValue& value) { m_down = value; } |
| 53 void setLeft(const StyleNavigationValue& value) { m_left = value; } |
| 54 void setRight(const StyleNavigationValue& value) { m_right = value; } |
| 55 |
| 56 private: |
| 57 StyleNavigationData(); |
| 58 StyleNavigationData(const StyleNavigationData&); |
| 59 |
| 60 StyleNavigationValue m_up; |
| 61 StyleNavigationValue m_down; |
| 62 StyleNavigationValue m_left; |
| 63 StyleNavigationValue m_right; |
| 64 }; |
| 65 |
| 66 } // namespace blink |
| 67 |
| 68 #endif // StyleNavigationData_h |
OLD | NEW |