]>
git.saurik.com Git - iphone-api.git/blob - WebCore/Pair.h
2 * This file is part of the DOM implementation for KDE.
4 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc.
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.
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.
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.
26 #include <wtf/RefCounted.h>
27 #include "CSSPrimitiveValue.h"
28 #include <wtf/PassRefPtr.h>
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 RefCounted
<Pair
> {
38 static PassRefPtr
<Pair
> create()
40 return adoptRef(new Pair
);
42 static PassRefPtr
<Pair
> create(PassRefPtr
<CSSPrimitiveValue
> first
, PassRefPtr
<CSSPrimitiveValue
> second
)
44 return adoptRef(new Pair(first
, second
));
48 CSSPrimitiveValue
* first() const { return m_first
.get(); }
49 CSSPrimitiveValue
* second() const { return m_second
.get(); }
51 void setFirst(PassRefPtr
<CSSPrimitiveValue
> first
) { m_first
= first
; }
52 void setSecond(PassRefPtr
<CSSPrimitiveValue
> second
) { m_second
= second
; }
55 Pair() : m_first(0), m_second(0) { }
56 Pair(PassRefPtr
<CSSPrimitiveValue
> first
, PassRefPtr
<CSSPrimitiveValue
> second
)
57 : m_first(first
), m_second(second
) { }
59 RefPtr
<CSSPrimitiveValue
> m_first
;
60 RefPtr
<CSSPrimitiveValue
> m_second
;