RenderQuote.h 2.1 KB

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