1/*
2 * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2008 Apple Inc. 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#ifndef StylePropertyShorthand_h
22#define StylePropertyShorthand_h
23
24#include "CSSPropertyNames.h"
25
26namespace WebCore {
27
28class StylePropertyShorthand {
29    WTF_MAKE_FAST_ALLOCATED;
30public:
31    StylePropertyShorthand()
32        : m_properties(0)
33        , m_propertiesForInitialization(0)
34        , m_length(0)
35    {
36    }
37
38    StylePropertyShorthand(const CSSPropertyID* properties, unsigned numProperties)
39        : m_properties(properties)
40        , m_propertiesForInitialization(0)
41        , m_length(numProperties)
42    {
43    }
44
45    StylePropertyShorthand(const CSSPropertyID* properties, const StylePropertyShorthand** propertiesForInitialization, unsigned numProperties)
46        : m_properties(properties)
47        , m_propertiesForInitialization(propertiesForInitialization)
48        , m_length(numProperties)
49    {
50    }
51
52    const CSSPropertyID* properties() const { return m_properties; }
53    const StylePropertyShorthand** propertiesForInitialization() const { return m_propertiesForInitialization; }
54    unsigned length() const { return m_length; }
55
56private:
57    const CSSPropertyID* m_properties;
58    const StylePropertyShorthand** m_propertiesForInitialization;
59    unsigned m_length;
60};
61
62const StylePropertyShorthand& backgroundShorthand();
63const StylePropertyShorthand& backgroundPositionShorthand();
64const StylePropertyShorthand& backgroundRepeatShorthand();
65const StylePropertyShorthand& borderShorthand();
66const StylePropertyShorthand& borderAbridgedShorthand();
67const StylePropertyShorthand& borderBottomShorthand();
68const StylePropertyShorthand& borderColorShorthand();
69const StylePropertyShorthand& borderImageShorthand();
70const StylePropertyShorthand& borderLeftShorthand();
71const StylePropertyShorthand& borderRadiusShorthand();
72const StylePropertyShorthand& borderRightShorthand();
73const StylePropertyShorthand& borderSpacingShorthand();
74const StylePropertyShorthand& borderStyleShorthand();
75const StylePropertyShorthand& borderTopShorthand();
76const StylePropertyShorthand& borderWidthShorthand();
77const StylePropertyShorthand& listStyleShorthand();
78const StylePropertyShorthand& fontShorthand();
79const StylePropertyShorthand& marginShorthand();
80const StylePropertyShorthand& outlineShorthand();
81const StylePropertyShorthand& overflowShorthand();
82const StylePropertyShorthand& paddingShorthand();
83const StylePropertyShorthand& transitionShorthand();
84const StylePropertyShorthand& webkitAnimationShorthand();
85const StylePropertyShorthand& webkitAnimationShorthandForParsing();
86const StylePropertyShorthand& webkitBorderAfterShorthand();
87const StylePropertyShorthand& webkitBorderBeforeShorthand();
88const StylePropertyShorthand& webkitBorderEndShorthand();
89const StylePropertyShorthand& webkitBorderStartShorthand();
90const StylePropertyShorthand& webkitColumnsShorthand();
91const StylePropertyShorthand& webkitColumnRuleShorthand();
92const StylePropertyShorthand& webkitFlexFlowShorthand();
93const StylePropertyShorthand& webkitFlexShorthand();
94const StylePropertyShorthand& webkitGridColumnShorthand();
95const StylePropertyShorthand& webkitGridRowShorthand();
96const StylePropertyShorthand& webkitMarginCollapseShorthand();
97const StylePropertyShorthand& webkitMarqueeShorthand();
98const StylePropertyShorthand& webkitMaskShorthand();
99const StylePropertyShorthand& webkitMaskPositionShorthand();
100const StylePropertyShorthand& webkitMaskRepeatShorthand();
101const StylePropertyShorthand& webkitTextEmphasisShorthand();
102const StylePropertyShorthand& webkitTextStrokeShorthand();
103const StylePropertyShorthand& webkitTransitionShorthand();
104const StylePropertyShorthand& webkitTransformOriginShorthand();
105
106// Returns an empty list if the property is not a shorthand
107const StylePropertyShorthand& shorthandForProperty(CSSPropertyID);
108
109bool isExpandedShorthand(CSSPropertyID);
110
111} // namespace WebCore
112
113#endif // StylePropertyShorthand_h
114