OSDN Git Service

am 02f67ae0: am ae583467: add meta-files about 3rd party projects
[android-x86/external-webkit.git] / WebCore / rendering / style / StyleRareNonInheritedData.h
1 /*
2  * Copyright (C) 2000 Lars Knoll (knoll@kde.org)
3  *           (C) 2000 Antti Koivisto (koivisto@kde.org)
4  *           (C) 2000 Dirk Mueller (mueller@kde.org)
5  * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
6  * Copyright (C) 2006 Graham Dennis (graham.dennis@gmail.com)
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public License
19  * along with this library; see the file COPYING.LIB.  If not, write to
20  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  * Boston, MA 02110-1301, USA.
22  *
23  */
24
25 #ifndef StyleRareNonInheritedData_h
26 #define StyleRareNonInheritedData_h
27
28 #include "CounterDirectives.h"
29 #include "CursorData.h"
30 #include "DataRef.h"
31 #include "FillLayer.h"
32 #include "LineClampValue.h"
33 #include "NinePieceImage.h"
34 #include "StyleTransformData.h"
35 #include <wtf/OwnPtr.h>
36 #include <wtf/PassRefPtr.h>
37 #include <wtf/Vector.h>
38
39 namespace WebCore {
40
41 class AnimationList;
42 class CSSStyleSelector;
43 class ShadowData;
44 class StyleFlexibleBoxData;
45 class StyleMarqueeData;
46 class StyleMultiColData;
47 class StyleReflection;
48 class StyleTransformData;
49
50 struct ContentData;
51 struct LengthSize;
52
53 #if ENABLE(DASHBOARD_SUPPORT)
54 struct StyleDashboardRegion;
55 #endif
56
57 #if ENABLE(XBL)
58 class BindingURI;
59 #endif
60
61 // Page size type.
62 // StyleRareNonInheritedData::m_pageSize is meaningful only when 
63 // StyleRareNonInheritedData::m_pageSizeType is PAGE_SIZE_RESOLVED.
64 enum PageSizeType {
65     PAGE_SIZE_AUTO, // size: auto
66     PAGE_SIZE_AUTO_LANDSCAPE, // size: landscape
67     PAGE_SIZE_AUTO_PORTRAIT, // size: portrait
68     PAGE_SIZE_RESOLVED // Size is fully resolved.
69 };
70
71 // This struct is for rarely used non-inherited CSS3, CSS2, and WebKit-specific properties.
72 // By grouping them together, we save space, and only allocate this object when someone
73 // actually uses one of these properties.
74 class StyleRareNonInheritedData : public RefCounted<StyleRareNonInheritedData> {
75 public:
76     static PassRefPtr<StyleRareNonInheritedData> create() { return adoptRef(new StyleRareNonInheritedData); }
77     PassRefPtr<StyleRareNonInheritedData> copy() const { return adoptRef(new StyleRareNonInheritedData(*this)); }
78     ~StyleRareNonInheritedData();
79     
80 #if ENABLE(XBL)
81     bool bindingsEquivalent(const StyleRareNonInheritedData&) const;
82 #endif
83
84     bool operator==(const StyleRareNonInheritedData&) const;
85     bool operator!=(const StyleRareNonInheritedData& o) const { return !(*this == o); }
86
87     bool contentDataEquivalent(const StyleRareNonInheritedData& o) const;
88     bool shadowDataEquivalent(const StyleRareNonInheritedData& o) const;
89     bool reflectionDataEquivalent(const StyleRareNonInheritedData& o) const;
90     bool animationDataEquivalent(const StyleRareNonInheritedData&) const;
91     bool transitionDataEquivalent(const StyleRareNonInheritedData&) const;
92
93     LineClampValue lineClamp; // An Apple extension.
94 #if ENABLE(DASHBOARD_SUPPORT)
95     Vector<StyleDashboardRegion> m_dashboardRegions;
96 #endif
97     float opacity; // Whether or not we're transparent.
98
99     DataRef<StyleFlexibleBoxData> flexibleBox; // Flexible box properties 
100     DataRef<StyleMarqueeData> marquee; // Marquee properties
101     DataRef<StyleMultiColData> m_multiCol; //  CSS3 multicol properties
102     DataRef<StyleTransformData> m_transform; // Transform properties (rotate, scale, skew, etc.)
103
104     OwnPtr<ContentData> m_content;
105     OwnPtr<CounterDirectiveMap> m_counterDirectives;
106
107     unsigned userDrag : 2; // EUserDrag
108     bool textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
109     unsigned marginTopCollapse : 2; // EMarginCollapse
110     unsigned marginBottomCollapse : 2; // EMarginCollapse
111     unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added.
112     unsigned m_appearance : 6; // EAppearance
113     unsigned m_borderFit : 1; // EBorderFit
114     
115     short m_counterIncrement;
116     short m_counterReset;
117     
118 #if USE(ACCELERATED_COMPOSITING)
119     bool m_runningAcceleratedAnimation : 1;
120 #endif
121     OwnPtr<ShadowData> m_boxShadow;  // For box-shadow decorations.
122     
123     RefPtr<StyleReflection> m_boxReflect;
124
125     OwnPtr<AnimationList> m_animations;
126     OwnPtr<AnimationList> m_transitions;
127
128     FillLayer m_mask;
129     NinePieceImage m_maskBoxImage;
130
131     ETransformStyle3D m_transformStyle3D;
132     EBackfaceVisibility m_backfaceVisibility;
133     float m_perspective;
134     Length m_perspectiveOriginX;
135     Length m_perspectiveOriginY;
136
137     LengthSize m_pageSize;
138     PageSizeType m_pageSizeType;
139
140 #if ENABLE(XBL)
141     OwnPtr<BindingURI> bindingURI; // The XBL binding URI list.
142 #endif
143     
144 private:
145     StyleRareNonInheritedData();
146     StyleRareNonInheritedData(const StyleRareNonInheritedData&);
147 };
148
149 } // namespace WebCore
150
151 #endif // StyleRareNonInheritedData_h