initial import
[vuplus_webkit] / Source / WebCore / css / CSSBorderImageValue.h
1 /*
2  * (C) 1999-2003 Lars Knoll (knoll@kde.org)
3  * Copyright (C) 2004, 2005, 2006, 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 CSSBorderImageValue_h
22 #define CSSBorderImageValue_h
23
24 #include "CSSBorderImageSliceValue.h"
25 #include <wtf/PassRefPtr.h>
26 #include <wtf/RefPtr.h>
27
28 namespace WebCore {
29
30 class Rect;
31
32 class CSSBorderImageValue : public CSSValue {
33 public:
34     static PassRefPtr<CSSBorderImageValue> create(PassRefPtr<CSSValue> image, PassRefPtr<CSSBorderImageSliceValue> imageSlice,
35         PassRefPtr<CSSValue> borderSlice, PassRefPtr<CSSValue> outset, PassRefPtr<CSSValue> repeat)
36     {
37         return adoptRef(new CSSBorderImageValue(image, imageSlice, borderSlice, outset, repeat));
38     }
39     virtual ~CSSBorderImageValue();
40
41     virtual String cssText() const;
42
43     CSSValue* imageValue() const { return m_image.get(); }
44
45     virtual void addSubresourceStyleURLs(ListHashSet<KURL>&, const CSSStyleSheet*);
46
47     // The border image.
48     RefPtr<CSSValue> m_image;
49
50     // These four values are used to make "cuts" in the image.  They can be numbers
51     // or percentages.
52     RefPtr<CSSBorderImageSliceValue> m_imageSlice;
53
54     // These four values are used to make "cuts" in the border image drawing area.
55     // They can be numbers, percentages or lengths.
56     RefPtr<CSSValue> m_borderSlice;
57
58     // The outset values are used to inflate the border image drawing area.
59     RefPtr<CSSValue> m_outset;
60
61     // Values for how to handle the scaling/stretching/tiling of the image slices.
62     RefPtr<CSSValue> m_repeat;
63
64 private:
65     CSSBorderImageValue(PassRefPtr<CSSValue> image, PassRefPtr<CSSBorderImageSliceValue>, PassRefPtr<CSSValue> borderSlice,
66         PassRefPtr<CSSValue> outset, PassRefPtr<CSSValue> repeat);
67     virtual bool isBorderImageValue() const { return true; }
68 };
69
70 } // namespace WebCore
71
72 #endif // CSSBorderImageValue_h