OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Nokia Inc. All rights reserved. | 2 * Copyright (C) 2011 Nokia Inc. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
12 * Library General Public License for more details. | 12 * Library General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU Library General Public License | 14 * You should have received a copy of the GNU Library General Public License |
15 * along with this library; see the file COPYING.LIB. If not, write to | 15 * along with this library; see the file COPYING.LIB. If not, write to |
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
17 * Boston, MA 02110-1301, USA. | 17 * Boston, MA 02110-1301, USA. |
18 * | 18 * |
19 */ | 19 */ |
20 | 20 |
21 #ifndef RenderQuote_h | 21 #ifndef RenderQuote_h |
22 #define RenderQuote_h | 22 #define RenderQuote_h |
23 | 23 |
24 #include "Document.h" | |
25 #include "QuotesData.h" | |
26 #include "RenderStyle.h" | |
27 #include "RenderStyleConstants.h" | 24 #include "RenderStyleConstants.h" |
28 #include "RenderText.h" | 25 #include "RenderText.h" |
29 | 26 |
30 namespace WebCore { | 27 namespace WebCore { |
31 | 28 |
32 class RenderQuote : public RenderText { | 29 class RenderQuote : public RenderText { |
33 public: | 30 public: |
34 RenderQuote(Document*, const QuoteType); | 31 RenderQuote(Document*, const QuoteType); |
35 virtual ~RenderQuote(); | 32 virtual ~RenderQuote(); |
36 void attachQuote(); | |
37 void detachQuote(); | |
38 | 33 |
| 34 static void rendererSubtreeAttached(RenderObject*); |
| 35 static void rendererRemovedFromTree(RenderObject*); |
| 36 protected: |
| 37 virtual void styleDidChange(StyleDifference, const RenderStyle* oldStyle); |
| 38 virtual void willBeDestroyed(); |
39 private: | 39 private: |
40 virtual void willBeDestroyed() OVERRIDE; | 40 virtual const char* renderName() const; |
41 virtual const char* renderName() const OVERRIDE { return "RenderQuote"; }; | 41 virtual bool isQuote() const { return true; }; |
42 virtual bool isQuote() const OVERRIDE { return true; }; | 42 virtual PassRefPtr<StringImpl> originalText() const; |
43 virtual PassRefPtr<StringImpl> originalText() const OVERRIDE; | 43 virtual void computePreferredLogicalWidths(float leadWidth); |
44 virtual void computePreferredLogicalWidths(float leadWidth) OVERRIDE; | |
45 | |
46 const QuotesData* quotesData() const; | 44 const QuotesData* quotesData() const; |
47 void updateDepth(); | |
48 | 45 |
49 QuoteType m_type; | 46 QuoteType m_type; |
50 int m_depth; | 47 int m_depth; |
51 RenderQuote* m_next; | 48 RenderQuote* m_next; |
52 RenderQuote* m_previous; | 49 RenderQuote* m_previous; |
53 bool m_attached; | 50 void placeQuote(); |
54 }; | 51 }; |
55 | 52 |
56 inline RenderQuote* toRenderQuote(RenderObject* object) | 53 inline RenderQuote* toRenderQuote(RenderObject* object) |
57 { | 54 { |
58 ASSERT(!object || object->isQuote()); | 55 ASSERT(!object || object->isQuote()); |
59 return static_cast<RenderQuote*>(object); | 56 return static_cast<RenderQuote*>(object); |
60 } | 57 } |
61 | 58 |
62 // This will catch anyone doing an unnecessary cast. | 59 // This will catch anyone doing an unnecessary cast. |
63 void toRenderQuote(const RenderQuote*); | 60 void toRenderQuote(const RenderQuote*); |
64 | 61 |
65 } // namespace WebCore | 62 } // namespace WebCore |
66 | 63 |
67 #endif // RenderQuote_h | 64 #endif // RenderQuote_h |
OLD | NEW |