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 StyleRareInheritedData_h 26 #define StyleRareInheritedData_h 27 28 #include "Color.h" 29 #include "Length.h" 30 #include <wtf/RefCounted.h> 31 #include <wtf/PassRefPtr.h> 32 #include <wtf/text/AtomicString.h> 33 34 namespace WebCore { 35 36 class CursorList; 37 class QuotesData; 38 class ShadowData; 39 40 // This struct is for rarely used inherited CSS3, CSS2, and WebKit-specific properties. 41 // By grouping them together, we save space, and only allocate this object when someone 42 // actually uses one of these properties. 43 class StyleRareInheritedData : public RefCounted<StyleRareInheritedData> { 44 public: create()45 static PassRefPtr<StyleRareInheritedData> create() { return adoptRef(new StyleRareInheritedData); } copy()46 PassRefPtr<StyleRareInheritedData> copy() const { return adoptRef(new StyleRareInheritedData(*this)); } 47 ~StyleRareInheritedData(); 48 49 bool operator==(const StyleRareInheritedData& o) const; 50 bool operator!=(const StyleRareInheritedData& o) const 51 { 52 return !(*this == o); 53 } 54 bool shadowDataEquivalent(const StyleRareInheritedData&) const; 55 56 Color textStrokeColor; 57 float textStrokeWidth; 58 Color textFillColor; 59 Color textEmphasisColor; 60 61 #ifdef ANDROID_CSS_RING 62 Color ringFillColor; 63 Length ringInnerWidth; 64 Length ringOuterWidth; 65 Length ringOutset; 66 Color ringPressedInnerColor; 67 Color ringPressedOuterColor; 68 Length ringRadius; 69 Color ringSelectedInnerColor; 70 Color ringSelectedOuterColor; 71 #endif 72 #ifdef ANDROID_CSS_TAP_HIGHLIGHT_COLOR 73 Color tapHighlightColor; 74 #endif 75 76 ShadowData* textShadow; // Our text shadow information for shadowed text drawing. 77 AtomicString highlight; // Apple-specific extension for custom highlight rendering. 78 79 RefPtr<CursorList> cursorData; 80 Length indent; 81 float m_effectiveZoom; 82 83 // Paged media properties. 84 short widows; 85 short orphans; 86 87 unsigned textSecurity : 2; // ETextSecurity 88 unsigned userModify : 2; // EUserModify (editing) 89 unsigned wordBreak : 2; // EWordBreak 90 unsigned wordWrap : 1; // EWordWrap 91 unsigned nbspMode : 1; // ENBSPMode 92 unsigned khtmlLineBreak : 1; // EKHTMLLineBreak 93 bool textSizeAdjust : 1; // An Apple extension. 94 unsigned resize : 2; // EResize 95 unsigned userSelect : 1; // EUserSelect 96 unsigned colorSpace : 1; // ColorSpace 97 unsigned speak : 3; // ESpeak 98 unsigned hyphens : 2; // Hyphens 99 unsigned textEmphasisFill : 1; // TextEmphasisFill 100 unsigned textEmphasisMark : 3; // TextEmphasisMark 101 unsigned textEmphasisPosition : 1; // TextEmphasisPosition 102 unsigned m_lineBoxContain: 7; // LineBoxContain 103 104 AtomicString hyphenationString; 105 short hyphenationLimitBefore; 106 short hyphenationLimitAfter; 107 108 AtomicString locale; 109 110 AtomicString textEmphasisCustomMark; 111 RefPtr<QuotesData> quotes; 112 113 private: 114 StyleRareInheritedData(); 115 StyleRareInheritedData(const StyleRareInheritedData&); 116 }; 117 118 } // namespace WebCore 119 120 #endif // StyleRareInheritedData_h 121