WebCore/wml/WMLCardElement.h
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     1 /*
       
     2  * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
       
     3  *
       
     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.
       
     8  *
       
     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.
       
    13  *
       
    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.
       
    18  *
       
    19  */
       
    20 
       
    21 #ifndef WMLCardElement_h
       
    22 #define WMLCardElement_h
       
    23 
       
    24 #if ENABLE(WML)
       
    25 #include "WMLEventHandlingElement.h"
       
    26 
       
    27 #include <wtf/Vector.h>
       
    28 
       
    29 namespace WebCore {
       
    30 
       
    31 class WMLTemplateElement;
       
    32 class WMLTimerElement;
       
    33 
       
    34 class WMLCardElement : public WMLElement, public WMLEventHandlingElement {
       
    35 public:
       
    36     WMLCardElement(const QualifiedName&, Document*);
       
    37     virtual ~WMLCardElement();
       
    38 
       
    39     bool isNewContext() const { return m_isNewContext; }
       
    40     bool isOrdered() const { return m_isOrdered; }
       
    41     WMLTimerElement* eventTimer() const { return m_eventTimer; }
       
    42     WMLTemplateElement* templateElement() const { return m_template; }
       
    43 
       
    44     void setTemplateElement(WMLTemplateElement*);
       
    45     void setIntrinsicEventTimer(WMLTimerElement*);
       
    46 
       
    47     void handleIntrinsicEventIfNeeded();
       
    48     void handleDeckLevelTaskOverridesIfNeeded();
       
    49 
       
    50     virtual void parseMappedAttribute(Attribute*);
       
    51     virtual void insertedIntoDocument();
       
    52     virtual RenderObject* createRenderer(RenderArena*, RenderStyle*);
       
    53 
       
    54     // Switch active card in document to the one specified in the URL reference (foo.wml#mycard)
       
    55     // If the 'targetUrl' doesn't contain a reference, use the first <card> element in the document.
       
    56     static WMLCardElement* determineActiveCard(Document*);
       
    57     static WMLCardElement* findNamedCardInDocument(Document*, const String& cardName);
       
    58 
       
    59 private:
       
    60     bool isVisible() const { return m_isVisible; }
       
    61 
       
    62     void showCard();
       
    63     void hideCard();
       
    64 
       
    65     bool m_isNewContext;
       
    66     bool m_isOrdered;
       
    67     bool m_isVisible;
       
    68 
       
    69     WMLTimerElement* m_eventTimer;
       
    70     WMLTemplateElement* m_template;
       
    71 };
       
    72 
       
    73 }
       
    74 
       
    75 #endif
       
    76 #endif