1 | /* |
2 | * Copyright (C) 1999 Lars Knoll ([email protected]) |
3 | * (C) 1999 Antti Koivisto ([email protected]) |
4 | * Copyright (C) 2007, 2010 Apple Inc. All rights reserved. |
5 | * |
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. |
10 | * |
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. |
15 | * |
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. |
20 | * |
21 | */ |
22 | |
23 | #pragma once |
24 | |
25 | #include "ActiveDOMObject.h" |
26 | #include "HTMLElement.h" |
27 | |
28 | namespace WebCore { |
29 | |
30 | class RenderMarquee; |
31 | |
32 | class HTMLMarqueeElement final : public HTMLElement, private ActiveDOMObject { |
33 | WTF_MAKE_ISO_ALLOCATED(HTMLMarqueeElement); |
34 | public: |
35 | static Ref<HTMLMarqueeElement> create(const QualifiedName&, Document&); |
36 | |
37 | int minimumDelay() const; |
38 | |
39 | WEBCORE_EXPORT void start(); |
40 | WEBCORE_EXPORT void stop() final; |
41 | |
42 | // Number of pixels to move on each scroll movement. Defaults to 6. |
43 | WEBCORE_EXPORT unsigned scrollAmount() const; |
44 | WEBCORE_EXPORT void setScrollAmount(unsigned); |
45 | |
46 | // Interval between each scroll movement, in milliseconds. Defaults to 60. |
47 | WEBCORE_EXPORT unsigned scrollDelay() const; |
48 | WEBCORE_EXPORT void setScrollDelay(unsigned); |
49 | |
50 | // Loop count. -1 means loop indefinitely. |
51 | WEBCORE_EXPORT int loop() const; |
52 | WEBCORE_EXPORT ExceptionOr<void> setLoop(int); |
53 | |
54 | private: |
55 | HTMLMarqueeElement(const QualifiedName&, Document&); |
56 | |
57 | bool isPresentationAttribute(const QualifiedName&) const final; |
58 | void collectStyleForPresentationAttribute(const QualifiedName&, const AtomString&, MutableStyleProperties&) final; |
59 | |
60 | bool canSuspendForDocumentSuspension() const final; |
61 | void suspend(ReasonForSuspension) final; |
62 | void resume() final; |
63 | const char* activeDOMObjectName() const final { return "HTMLMarqueeElement" ; } |
64 | |
65 | RenderMarquee* renderMarquee() const; |
66 | }; |
67 | |
68 | } // namespace WebCore |
69 | |