tizen beta release
[profile/ivi/webkit-efl.git] / Source / 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 "CSSWrapShapes.h"
29 #include "CounterDirectives.h"
30 #include "CursorData.h"
31 #include "DataRef.h"
32 #include "FillLayer.h"
33 #include "LineClampValue.h"
34 #include "NinePieceImage.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 StyleDeprecatedFlexibleBoxData;
45 #if ENABLE(CSS_FILTERS)
46 class StyleFilterData;
47 #endif
48 class StyleFlexibleBoxData;
49 #if ENABLE(CSS_GRID_LAYOUT)
50 class StyleGridData;
51 #endif
52 class StyleMarqueeData;
53 class StyleMultiColData;
54 class StyleReflection;
55 class StyleTransformData;
56
57 class ContentData;
58 struct LengthSize;
59
60 #if ENABLE(DASHBOARD_SUPPORT)
61 struct StyleDashboardRegion;
62 #endif
63
64 // Page size type.
65 // StyleRareNonInheritedData::m_pageSize is meaningful only when 
66 // StyleRareNonInheritedData::m_pageSizeType is PAGE_SIZE_RESOLVED.
67 enum PageSizeType {
68     PAGE_SIZE_AUTO, // size: auto
69     PAGE_SIZE_AUTO_LANDSCAPE, // size: landscape
70     PAGE_SIZE_AUTO_PORTRAIT, // size: portrait
71     PAGE_SIZE_RESOLVED // Size is fully resolved.
72 };
73
74 // This struct is for rarely used non-inherited CSS3, CSS2, and WebKit-specific properties.
75 // By grouping them together, we save space, and only allocate this object when someone
76 // actually uses one of these properties.
77 class StyleRareNonInheritedData : public RefCounted<StyleRareNonInheritedData> {
78 public:
79     static PassRefPtr<StyleRareNonInheritedData> create() { return adoptRef(new StyleRareNonInheritedData); }
80     PassRefPtr<StyleRareNonInheritedData> copy() const { return adoptRef(new StyleRareNonInheritedData(*this)); }
81     ~StyleRareNonInheritedData();
82     
83     bool operator==(const StyleRareNonInheritedData&) const;
84     bool operator!=(const StyleRareNonInheritedData& o) const { return !(*this == o); }
85
86     bool contentDataEquivalent(const StyleRareNonInheritedData&) const;
87     bool counterDataEquivalent(const StyleRareNonInheritedData&) const;
88     bool shadowDataEquivalent(const StyleRareNonInheritedData&) const;
89     bool reflectionDataEquivalent(const StyleRareNonInheritedData&) const;
90     bool animationDataEquivalent(const StyleRareNonInheritedData&) const;
91     bool transitionDataEquivalent(const StyleRareNonInheritedData&) const;
92
93     float opacity; // Whether or not we're transparent.
94
95     float m_aspectRatioDenominator;
96     float m_aspectRatioNumerator;
97
98     short m_counterIncrement;
99     short m_counterReset;
100
101     float m_perspective;
102     Length m_perspectiveOriginX;
103     Length m_perspectiveOriginY;
104
105     LineClampValue lineClamp; // An Apple extension.
106 #if ENABLE(DASHBOARD_SUPPORT)
107     Vector<StyleDashboardRegion> m_dashboardRegions;
108 #endif
109
110     DataRef<StyleDeprecatedFlexibleBoxData> m_deprecatedFlexibleBox; // Flexible box properties
111     DataRef<StyleFlexibleBoxData> m_flexibleBox;
112     DataRef<StyleMarqueeData> m_marquee; // Marquee properties
113     DataRef<StyleMultiColData> m_multiCol; //  CSS3 multicol properties
114     DataRef<StyleTransformData> m_transform; // Transform properties (rotate, scale, skew, etc.)
115
116 #if ENABLE(CSS_FILTERS)
117     DataRef<StyleFilterData> m_filter; // Filter operations (url, sepia, blur, etc.)
118 #endif
119
120 #if ENABLE(CSS_GRID_LAYOUT)
121     DataRef<StyleGridData> m_grid;
122 #endif
123
124     OwnPtr<ContentData> m_content;
125     OwnPtr<CounterDirectiveMap> m_counterDirectives;
126
127     OwnPtr<ShadowData> m_boxShadow;  // For box-shadow decorations.
128     
129     RefPtr<StyleReflection> m_boxReflect;
130
131     OwnPtr<AnimationList> m_animations;
132     OwnPtr<AnimationList> m_transitions;
133
134     FillLayer m_mask;
135     NinePieceImage m_maskBoxImage;
136
137     LengthSize m_pageSize;
138
139     RefPtr<CSSWrapShape> m_wrapShapeInside;
140     RefPtr<CSSWrapShape> m_wrapShapeOutside;
141     Length m_wrapMargin;
142     Length m_wrapPadding;
143     
144     Color m_visitedLinkBackgroundColor;
145     Color m_visitedLinkOutlineColor;
146     Color m_visitedLinkBorderLeftColor;
147     Color m_visitedLinkBorderRightColor;
148     Color m_visitedLinkBorderTopColor;
149     Color m_visitedLinkBorderBottomColor;
150
151     AtomicString m_flowThread;
152     AtomicString m_regionThread;
153     unsigned m_regionOverflow : 1; // RegionOverflow
154
155     unsigned m_regionBreakAfter : 2; // EPageBreak
156     unsigned m_regionBreakBefore : 2; // EPageBreak
157     unsigned m_regionBreakInside : 2; // EPageBreak
158
159     unsigned m_pageSizeType : 2; // PageSizeType
160     unsigned m_transformStyle3D : 1; // ETransformStyle3D
161     unsigned m_backfaceVisibility : 1; // EBackfaceVisibility
162
163     unsigned userDrag : 2; // EUserDrag
164     unsigned textOverflow : 1; // Whether or not lines that spill out should be truncated with "..."
165     unsigned marginBeforeCollapse : 2; // EMarginCollapse
166     unsigned marginAfterCollapse : 2; // EMarginCollapse
167     unsigned matchNearestMailBlockquoteColor : 1; // EMatchNearestMailBlockquoteColor, FIXME: This property needs to be eliminated. It should never have been added.
168     unsigned m_appearance : 6; // EAppearance
169     unsigned m_borderFit : 1; // EBorderFit
170     unsigned m_textCombine : 1; // CSS3 text-combine properties
171
172     unsigned m_wrapFlow: 3; // WrapFlow
173     unsigned m_wrapThrough: 1; // WrapThrough
174
175     bool m_hasAspectRatio : 1; // Whether or not an aspect ratio has been specified.
176 #if USE(ACCELERATED_COMPOSITING)
177     bool m_runningAcceleratedAnimation : 1;
178 #endif
179
180 private:
181     StyleRareNonInheritedData();
182     StyleRareNonInheritedData(const StyleRareNonInheritedData&);
183 };
184
185 } // namespace WebCore
186
187 #endif // StyleRareNonInheritedData_h