Home | History | Annotate | Download | only in css
      1 /*
      2  * (C) 1999-2003 Lars Knoll (knoll (at) kde.org)
      3  * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
      4  *
      5  * This library is free software; you can redistribute it and/or
      6  * modify it under the terms of the GNU Library General Public
      7  * License as published by the Free Software Foundation; either
      8  * version 2 of the License, or (at your option) any later version.
      9  *
     10  * This library is distributed in the hope that it will be useful,
     11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     13  * Library General Public License for more details.
     14  *
     15  * You should have received a copy of the GNU Library General Public License
     16  * along with this library; see the file COPYING.LIB.  If not, write to
     17  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
     18  * Boston, MA 02110-1301, USA.
     19  */
     20 
     21 #ifndef CSSValue_h
     22 #define CSSValue_h
     23 
     24 #include "StyleBase.h"
     25 
     26 #include "CSSParserValues.h"
     27 #include "KURLHash.h"
     28 #include <wtf/ListHashSet.h>
     29 #include <wtf/RefPtr.h>
     30 
     31 namespace WebCore {
     32 
     33 class CSSStyleSheet;
     34 
     35 typedef int ExceptionCode;
     36 
     37 class CSSValue : public RefCounted<CSSValue> {
     38 public:
     39     // FIXME: Change name to Type.
     40     enum UnitTypes {
     41         CSS_INHERIT = 0,
     42         CSS_PRIMITIVE_VALUE = 1,
     43         CSS_VALUE_LIST = 2,
     44         CSS_CUSTOM = 3,
     45         CSS_INITIAL = 4
     46     };
     47 
     48     virtual ~CSSValue() { }
     49 
     50     // FIXME: Change this to return UnitTypes.
     51     virtual unsigned short cssValueType() const { return CSS_CUSTOM; }
     52 
     53     virtual String cssText() const = 0;
     54     void setCssText(const String&, ExceptionCode&) { } // FIXME: Not implemented.
     55 
     56     virtual bool isFontValue() const { return false; }
     57     virtual bool isImageGeneratorValue() const { return false; }
     58     virtual bool isImageValue() const { return false; }
     59     virtual bool isImplicitInitialValue() const { return false; }
     60     virtual bool isPrimitiveValue() const { return false; }
     61     virtual bool isTimingFunctionValue() const { return false; }
     62     virtual bool isValueList() const { return false; }
     63     virtual bool isWebKitCSSTransformValue() const { return false; }
     64 
     65 #if ENABLE(SVG)
     66     virtual bool isSVGColor() const { return false; }
     67     virtual bool isSVGPaint() const { return false; }
     68 #endif
     69 
     70     virtual bool isVariableDependentValue() const { return false; }
     71     virtual CSSParserValue parserValue() const { ASSERT_NOT_REACHED(); return CSSParserValue(); }
     72 
     73     virtual void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*) { }
     74 };
     75 
     76 } // namespace WebCore
     77 
     78 #endif // CSSValue_h
     79