]>
git.saurik.com Git - iphone-api.git/blob - WebCore/HTMLLinkElement.h
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2003, 2008 Apple Inc. All rights reserved.
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
16 * You should have received a copy of the GNU Library General Public License
17 * along with this library; see the file COPYING.LIB. If not, write to
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02110-1301, USA.
23 #ifndef HTMLLinkElement_h
24 #define HTMLLinkElement_h
26 #include "CSSStyleSheet.h"
27 #include "CachedResourceClient.h"
28 #include "CachedResourceHandle.h"
29 #include "HTMLElement.h"
33 class CachedCSSStyleSheet
;
36 class HTMLLinkElement
: public HTMLElement
, public CachedResourceClient
{
38 HTMLLinkElement(const QualifiedName
&, Document
*, bool createdByParser
);
41 virtual HTMLTagStatus
endTagRequirement() const { return TagStatusForbidden
; }
42 virtual int tagPriority() const { return 0; }
44 bool disabled() const;
45 void setDisabled(bool);
47 String
charset() const;
48 void setCharset(const String
&);
51 void setHref(const String
&);
53 String
hreflang() const;
54 void setHreflang(const String
&);
57 void setMedia(const String
&);
60 void setRel(const String
&);
63 void setRev(const String
&);
65 virtual String
target() const;
66 void setTarget(const String
&);
69 void setType(const String
&);
71 StyleSheet
* sheet() const;
73 // overload from HTMLElement
74 virtual void parseMappedAttribute(MappedAttribute
*);
78 virtual void insertedIntoDocument();
79 virtual void removedFromDocument();
81 // from CachedResourceClient
82 virtual void setCSSStyleSheet(const String
&url
, const String
& charset
, const CachedCSSStyleSheet
* sheet
);
83 bool isLoading() const;
84 virtual bool sheetLoaded();
86 bool isAlternate() const { return m_disabledState
== 0 && m_alternate
; }
87 bool isDisabled() const { return m_disabledState
== 2; }
88 bool isEnabledViaScript() const { return m_disabledState
== 1; }
89 bool isIcon() const { return m_isIcon
; }
91 int disabledState() { return m_disabledState
; }
92 void setDisabledState(bool _disabled
);
94 virtual bool isURLAttribute(Attribute
*) const;
96 static void tokenizeRelAttribute(const AtomicString
& value
, bool& stylesheet
, bool& alternate
, bool& icon
, bool& dnsPrefetch
);
98 virtual void addSubresourceAttributeURLs(ListHashSet
<KURL
>&) const;
100 virtual void finishParsingChildren();
103 CachedResourceHandle
<CachedCSSStyleSheet
> m_cachedSheet
;
104 RefPtr
<CSSStyleSheet
> m_sheet
;
108 int m_disabledState
; // 0=unset(default), 1=enabled via script, 2=disabled
113 bool m_isDNSPrefetch
;
114 bool m_createdByParser
;