void WMLRefreshElement::executeTask()
{
    ASSERT(document()->isWMLDocument());
    WMLDocument* document = static_cast<WMLDocument*>(this->document());

    WMLPageState* pageState = wmlPageStateForDocument(document);
    if (!pageState)
        return;

    WMLCardElement* card = document->activeCard();
    if (!card)
        return;

    // Before perform refresh task, we store the current timeout
    // value in the page state and then stop the timer
    WMLTimerElement* timer = card->eventTimer();
    if (timer) {
        timer->storeIntervalToPageState();
        timer->stop();
    }

    storeVariableState(pageState);

    // Redisplay curremt card with current variable state
    if (Frame* frame = document->frame()) {
        if (FrameLoader* loader = frame->loader())
            loader->reload();
    }

    // After refreshing task, resume the timer if it exsits 
    if (timer)
        timer->start();
}
Beispiel #2
0
void WMLPrevElement::executeTask(Event*)
{
    WMLPageState* pageState = wmlPageStateForDocument(document());
    if (!pageState)
        return;

    WMLCardElement* card = pageState->activeCard();
    if (!card)
        return;

    storeVariableState(pageState);

    // Stop the timer of the current card if it is active
    if (WMLTimerElement* eventTimer = card->eventTimer())
        eventTimer->stop();

    pageState->page()->goBack();
}
void WMLPrevElement::executeTask()
{
    ASSERT(document()->isWMLDocument());
    WMLDocument* document = static_cast<WMLDocument*>(this->document());

    WMLPageState* pageState = wmlPageStateForDocument(document);
    if (!pageState)
        return;

    WMLCardElement* card = document->activeCard();
    if (!card)
        return;

    storeVariableState(pageState);

    // Stop the timer of the current card if it is active
    if (WMLTimerElement* eventTimer = card->eventTimer())
        eventTimer->stop();

    pageState->page()->goBack();
}