1/* 2 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 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 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 * 19 */ 20 21#ifndef AccessibilityProgressIndicator_h 22#define AccessibilityProgressIndicator_h 23 24#if ENABLE(PROGRESS_ELEMENT) || ENABLE(METER_ELEMENT) 25#include "AccessibilityRenderObject.h" 26 27namespace WebCore { 28 29#if ENABLE(METER_ELEMENT) 30class HTMLMeterElement; 31class RenderMeter; 32#endif 33 34#if ENABLE(PROGRESS_ELEMENT) 35class HTMLProgressElement; 36class RenderProgress; 37#endif 38 39class AccessibilityProgressIndicator : public AccessibilityRenderObject { 40public: 41#if ENABLE(PROGRESS_ELEMENT) 42 static PassRefPtr<AccessibilityProgressIndicator> create(RenderProgress*); 43#endif 44#if ENABLE(METER_ELEMENT) 45 static PassRefPtr<AccessibilityProgressIndicator> create(RenderMeter*); 46#endif 47 48private: 49 virtual AccessibilityRole roleValue() const { return ProgressIndicatorRole; } 50 51 virtual bool isProgressIndicator() const { return true; } 52 53 virtual float valueForRange() const; 54 virtual float maxValueForRange() const; 55 virtual float minValueForRange() const; 56 57#if ENABLE(PROGRESS_ELEMENT) 58 explicit AccessibilityProgressIndicator(RenderProgress*); 59 HTMLProgressElement* progressElement() const; 60#endif 61#if ENABLE(METER_ELEMENT) 62 explicit AccessibilityProgressIndicator(RenderMeter*); 63 HTMLMeterElement* meterElement() const; 64#endif 65 66 virtual bool computeAccessibilityIsIgnored() const; 67}; 68 69 70} // namespace WebCore 71 72#endif // ENABLE(PROGRESS_ELEMENT) || ENABLE(METER_ELEMENT) 73 74#endif // AccessibilityProgressIndicator_h 75