|
1 /* |
|
2 * This file is part of the DOM implementation for KDE. |
|
3 * |
|
4 * (C) 1999-2003 Lars Knoll (knoll@kde.org) |
|
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
|
6 * |
|
7 * This library is free software; you can redistribute it and/or |
|
8 * modify it under the terms of the GNU Library General Public |
|
9 * License as published by the Free Software Foundation; either |
|
10 * version 2 of the License, or (at your option) any later version. |
|
11 * |
|
12 * This library is distributed in the hope that it will be useful, |
|
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
|
15 * Library General Public License for more details. |
|
16 * |
|
17 * You should have received a copy of the GNU Library General Public License |
|
18 * along with this library; see the file COPYING.LIB. If not, write to |
|
19 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
20 * Boston, MA 02110-1301, USA. |
|
21 */ |
|
22 |
|
23 #ifndef Pair_h |
|
24 #define Pair_h |
|
25 |
|
26 #include "Shared.h" |
|
27 #include "CSSPrimitiveValue.h" |
|
28 #include <wtf/PassRefPtr.h> |
|
29 |
|
30 namespace WebCore { |
|
31 |
|
32 // A primitive value representing a pair. This is useful for properties like border-radius, background-size/position, |
|
33 // and border-spacing (all of which are space-separated sets of two values). At the moment we are only using it for |
|
34 // border-radius and background-size, but (FIXME) border-spacing and background-position could be converted over to use |
|
35 // it (eliminating some extra -webkit- internal properties). |
|
36 class Pair : public Shared<Pair> { |
|
37 public: |
|
38 Pair() : m_first(0), m_second(0) { } |
|
39 Pair(PassRefPtr<CSSPrimitiveValue> first, PassRefPtr<CSSPrimitiveValue> second) |
|
40 : m_first(first), m_second(second) { } |
|
41 virtual ~Pair() { } |
|
42 |
|
43 CSSPrimitiveValue* first() const { return m_first.get(); } |
|
44 CSSPrimitiveValue* second() const { return m_second.get(); } |
|
45 |
|
46 void setFirst(PassRefPtr<CSSPrimitiveValue> first) { m_first = first; } |
|
47 void setSecond(PassRefPtr<CSSPrimitiveValue> second) { m_second = second; } |
|
48 |
|
49 protected: |
|
50 RefPtr<CSSPrimitiveValue> m_first; |
|
51 RefPtr<CSSPrimitiveValue> m_second; |
|
52 }; |
|
53 |
|
54 } // namespace |
|
55 |
|
56 #endif |