| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). | 2 * Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
| 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 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 #if ENABLE(METER_TAG) | 24 #if ENABLE(METER_TAG) |
| 25 #include "RenderBlock.h" | 25 #include "RenderBlock.h" |
| 26 #include "RenderIndicator.h" | 26 #include "RenderIndicator.h" |
| 27 #include "RenderWidget.h" | 27 #include "RenderWidget.h" |
| 28 | 28 |
| 29 | 29 |
| 30 namespace WebCore { | 30 namespace WebCore { |
| 31 | 31 |
| 32 class HTMLMeterElement; | 32 class HTMLMeterElement; |
| 33 class ShadowBlockElement; | 33 class MeterPartElement; |
| 34 | 34 |
| 35 class RenderMeter : public RenderIndicator { | 35 class RenderMeter : public RenderIndicator { |
| 36 public: | 36 public: |
| 37 RenderMeter(HTMLMeterElement*); | 37 RenderMeter(HTMLMeterElement*); |
| 38 virtual ~RenderMeter(); | 38 virtual ~RenderMeter(); |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 virtual const char* renderName() const { return "RenderMeter"; } | 41 virtual const char* renderName() const { return "RenderMeter"; } |
| 42 virtual bool isMeter() const { return true; } | 42 virtual bool isMeter() const { return true; } |
| 43 virtual void updateFromElement(); |
| 43 virtual void computeLogicalWidth(); | 44 virtual void computeLogicalWidth(); |
| 44 virtual void computeLogicalHeight(); | 45 virtual void computeLogicalHeight(); |
| 45 | 46 |
| 46 virtual void layoutParts(); | 47 virtual void layoutParts(); |
| 47 virtual bool shouldHaveParts() const; | |
| 48 | 48 |
| 49 bool isHorizontal() const; | 49 bool shadowAttached() const { return m_horizontalBarPart; } |
| 50 void updatePartsState(); | 50 IntRect valuePartRect(EBoxOrient) const; |
| 51 IntRect valuePartRect() const; | 51 PseudoId valuePseudoId(EBoxOrient) const; |
| 52 PseudoId valuePseudoId() const; | 52 IntRect barPartRect() const; |
| 53 IntRect barPartRect() const; | 53 PseudoId barPseudoId(EBoxOrient) const; |
| 54 PseudoId barPseudoId() const; | 54 EBoxOrient orientation() const; |
| 55 |
| 55 double valueRatio() const; | 56 double valueRatio() const; |
| 57 bool shouldHaveParts() const; |
| 58 PassRefPtr<MeterPartElement> createPart(PseudoId); |
| 56 | 59 |
| 57 RefPtr<ShadowBlockElement> m_barPart; | 60 RefPtr<MeterPartElement> m_horizontalBarPart; |
| 58 RefPtr<ShadowBlockElement> m_valuePart; | 61 RefPtr<MeterPartElement> m_horizontalValuePart; |
| 62 RefPtr<MeterPartElement> m_verticalBarPart; |
| 63 RefPtr<MeterPartElement> m_verticalValuePart; |
| 59 }; | 64 }; |
| 60 | 65 |
| 61 inline RenderMeter* toRenderMeter(RenderObject* object) | 66 inline RenderMeter* toRenderMeter(RenderObject* object) |
| 62 { | 67 { |
| 63 ASSERT(!object || object->isMeter()); | 68 ASSERT(!object || object->isMeter()); |
| 64 return static_cast<RenderMeter*>(object); | 69 return static_cast<RenderMeter*>(object); |
| 65 } | 70 } |
| 66 | 71 |
| 67 // This will catch anyone doing an unnecessary cast. | 72 // This will catch anyone doing an unnecessary cast. |
| 68 void toRenderMeter(const RenderMeter*); | 73 void toRenderMeter(const RenderMeter*); |
| 69 | 74 |
| 70 } // namespace WebCore | 75 } // namespace WebCore |
| 71 | 76 |
| 72 #endif | 77 #endif |
| 73 | 78 |
| 74 #endif // RenderMeter_h | 79 #endif // RenderMeter_h |
| 75 | 80 |
| OLD | NEW |