OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright (C) 2011 Kyounga Ra (kyounga.ra@gmail.com) |
| 3 * Copyright (C) 2013 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 StyleNavigationValue_h |
| 23 #define StyleNavigationValue_h |
| 24 |
| 25 #include "wtf/text/WTFString.h" |
| 26 |
| 27 namespace WebCore { |
| 28 |
| 29 class StyleNavigationValue { |
| 30 public: |
| 31 StyleNavigationValue() |
| 32 : m_auto(true) |
| 33 , m_id("") |
| 34 , m_target("current") |
| 35 { } |
| 36 |
| 37 StyleNavigationValue(const AtomicString& id, const AtomicString& target = "c
urrent") |
| 38 : m_auto(false) |
| 39 , m_id(id) |
| 40 , m_target(target) |
| 41 { } |
| 42 |
| 43 StyleNavigationValue(const String& id, const String& target = "current") |
| 44 : m_auto(false) |
| 45 , m_id(AtomicString(id)) |
| 46 , m_target(AtomicString(target)) |
| 47 { } |
| 48 |
| 49 bool isAuto() const |
| 50 { |
| 51 return m_auto; |
| 52 } |
| 53 |
| 54 bool operator==(const StyleNavigationValue& o) const |
| 55 { |
| 56 if (m_auto) |
| 57 return o.m_auto; |
| 58 return m_id == o.m_id && m_target == o.m_target; |
| 59 } |
| 60 |
| 61 bool operator!=(const StyleNavigationValue& o) const |
| 62 { |
| 63 return !(*this == o); |
| 64 } |
| 65 |
| 66 void operator=(const StyleNavigationValue& o) |
| 67 { |
| 68 m_auto = o.m_auto; |
| 69 m_id = o.m_id; |
| 70 m_target = o.m_target; |
| 71 } |
| 72 |
| 73 const AtomicString& id() const { return m_id; } |
| 74 const AtomicString& target() const { return m_target; } |
| 75 |
| 76 private: |
| 77 bool m_auto; |
| 78 AtomicString m_id; |
| 79 AtomicString m_target; |
| 80 }; |
| 81 |
| 82 } // namespace WebCore |
| 83 |
| 84 #endif // StyleNavigationValue_h |
OLD | NEW |