Home | History | Annotate | Download | only in html
      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 HTMLMeterElement_h
     22 #define HTMLMeterElement_h
     23 
     24 #if ENABLE(METER_TAG)
     25 #include "HTMLFormControlElement.h"
     26 
     27 namespace WebCore {
     28 
     29 class MeterValueElement;
     30 
     31 class HTMLMeterElement : public HTMLFormControlElement {
     32 public:
     33     static PassRefPtr<HTMLMeterElement> create(const QualifiedName&, Document*, HTMLFormElement*);
     34 
     35     enum GaugeRegion {
     36         GaugeRegionOptimum,
     37         GaugeRegionSuboptimal,
     38         GaugeRegionEvenLessGood
     39     };
     40 
     41     double min() const;
     42     void setMin(double, ExceptionCode&);
     43 
     44     double max() const;
     45     void setMax(double, ExceptionCode&);
     46 
     47     double value() const;
     48     void setValue(double, ExceptionCode&);
     49 
     50     double low() const;
     51     void setLow(double, ExceptionCode&);
     52 
     53     double high() const;
     54     void setHigh(double, ExceptionCode&);
     55 
     56     double optimum() const;
     57     void setOptimum(double, ExceptionCode&);
     58 
     59     double valueRatio() const;
     60     GaugeRegion gaugeRegion() const;
     61 
     62 private:
     63     HTMLMeterElement(const QualifiedName&, Document*, HTMLFormElement*);
     64     virtual ~HTMLMeterElement();
     65 
     66     virtual bool recalcWillValidate() const { return false; }
     67     virtual const AtomicString& formControlType() const;
     68     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
     69     virtual void parseMappedAttribute(Attribute*);
     70     virtual void attach();
     71 
     72     void didElementStateChange();
     73     void createShadowSubtree();
     74 
     75     RefPtr<MeterValueElement> m_value;
     76 };
     77 
     78 } // namespace
     79 
     80 #endif
     81 #endif
     82