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" |
24 #include "RenderStyleConstants.h" | 27 #include "RenderStyleConstants.h" |
25 #include "RenderText.h" | 28 #include "RenderText.h" |
26 | 29 |
27 namespace WebCore { | 30 namespace WebCore { |
28 | 31 |
29 class RenderQuote : public RenderText { | 32 class RenderQuote : public RenderText { |
30 public: | 33 public: |
31 RenderQuote(Document*, const QuoteType); | 34 RenderQuote(Document*, const QuoteType); |
32 virtual ~RenderQuote(); | 35 virtual ~RenderQuote(); |
| 36 void attachQuote(); |
| 37 void detachQuote(); |
33 | 38 |
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 const char* renderName() const; | 40 virtual void willBeDestroyed() OVERRIDE; |
41 virtual bool isQuote() const { return true; }; | 41 virtual const char* renderName() const OVERRIDE { return "RenderQuote"; }; |
42 virtual PassRefPtr<StringImpl> originalText() const; | 42 virtual bool isQuote() const OVERRIDE { return true; }; |
43 virtual void computePreferredLogicalWidths(float leadWidth); | 43 virtual PassRefPtr<StringImpl> originalText() const OVERRIDE; |
| 44 virtual void computePreferredLogicalWidths(float leadWidth) OVERRIDE; |
| 45 |
44 const QuotesData* quotesData() const; | 46 const QuotesData* quotesData() const; |
| 47 void updateDepth(); |
| 48 bool isAttached() { return m_attached; } |
45 | 49 |
46 QuoteType m_type; | 50 QuoteType m_type; |
47 int m_depth; | 51 int m_depth; |
48 RenderQuote* m_next; | 52 RenderQuote* m_next; |
49 RenderQuote* m_previous; | 53 RenderQuote* m_previous; |
50 void placeQuote(); | 54 bool m_attached; |
51 }; | 55 }; |
52 | 56 |
53 inline RenderQuote* toRenderQuote(RenderObject* object) | 57 inline RenderQuote* toRenderQuote(RenderObject* object) |
54 { | 58 { |
55 ASSERT(!object || object->isQuote()); | 59 ASSERT(!object || object->isQuote()); |
56 return static_cast<RenderQuote*>(object); | 60 return static_cast<RenderQuote*>(object); |
57 } | 61 } |
58 | 62 |
59 // This will catch anyone doing an unnecessary cast. | 63 // This will catch anyone doing an unnecessary cast. |
60 void toRenderQuote(const RenderQuote*); | 64 void toRenderQuote(const RenderQuote*); |
61 | 65 |
62 } // namespace WebCore | 66 } // namespace WebCore |
63 | 67 |
64 #endif // RenderQuote_h | 68 #endif // RenderQuote_h |
OLD | NEW |