2 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
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.
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.
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.
21 #ifndef WMLCardElement_h
22 #define WMLCardElement_h
25 #include "WMLEventHandlingElement.h"
27 #include <wtf/Vector.h>
31 class WMLTemplateElement;
32 class WMLTimerElement;
34 class WMLCardElement : public WMLElement, public WMLEventHandlingElement {
36 static PassRefPtr<WMLCardElement> create(const QualifiedName& tagName, Document*);
38 WMLCardElement(const QualifiedName&, Document*);
39 virtual ~WMLCardElement();
41 bool isNewContext() const { return m_isNewContext; }
42 bool isOrdered() const { return m_isOrdered; }
43 WMLTimerElement* eventTimer() const { return m_eventTimer; }
44 WMLTemplateElement* templateElement() const { return m_template; }
46 void setTemplateElement(WMLTemplateElement*);
47 void setIntrinsicEventTimer(WMLTimerElement*);
49 void handleIntrinsicEventIfNeeded();
50 void handleDeckLevelTaskOverridesIfNeeded();
52 virtual void parseMappedAttribute(Attribute*);
53 virtual void insertedIntoDocument();
54 virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
56 // Switch active card in document to the one specified in the URL reference (foo.wml#mycard)
57 // If the 'targetUrl' doesn't contain a reference, use the first <card> element in the document.
58 static WMLCardElement* determineActiveCard(Document*);
59 static WMLCardElement* findNamedCardInDocument(Document*, const String& cardName);
62 bool isVisible() const { return m_isVisible; }
71 WMLTimerElement* m_eventTimer;
72 WMLTemplateElement* m_template;