searchui/stateproviders/searchstateprovider/src/searchstateprovider.cpp
author hgs
Mon, 06 Sep 2010 09:21:19 +0530
changeset 21 708468d5143e
parent 9 4a2987baf8f7
child 26 367228f82b66
permissions -rw-r--r--
201035

/*
 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 * All rights reserved.
 * This component and the accompanying materials are made available
 * under the terms of "Eclipse Public License v1.0"
 * which accompanies this distribution, and is available
 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
 *
 * Initial Contributors:
 * Nokia Corporation - initial contribution.
 *
 * Contributors:
 *
 * Description:  Implementation of the SEARCH state provider
 *
 */

#include "searchstateprovider.h"
#include "searchprogressivestate.h"
#include "searchinitstate.h"
#include "searchsettingsstate.h"
#include "searchonlinestate.h"

#include <qstate.h>
#include <qdebug.h>

// states
const char initStateFileUri[] = "search.nokia.com/state/initstate";

const char wizardProgressiveStateUri[] =
        "search.nokia.com/state/wizardprogressivestate";
const char wizardSettingStateUri[] =
        "search.nokia.com/state/wizardsettingstate";
const char wizardOnlineStateUri[] =
        "search.nokia.com/state/wizardonlinestate";

// ---------------------------------------------------------------------------
// searchStateProvider::searchStateProvider()
// ---------------------------------------------------------------------------
//
SearchStateProvider::SearchStateProvider(QObject *parent) :
    QObject(parent)
    {
    }
// ---------------------------------------------------------------------------
// SearchStateProvider::createState(const StateToken& aToken)
// ---------------------------------------------------------------------------
//
QState* SearchStateProvider::createState(const QString& uri)
    {
    if (uri == wizardProgressiveStateUri)
        {
        return new SearchProgressiveState();
        }
    else if (uri == wizardSettingStateUri)
        {
        return new SearchSettingsState();
        }
    else if (uri == initStateFileUri)
        {
        return new SearchInitState();
        }
    else if (uri == wizardOnlineStateUri)
        {
        return new SearchOnlineState();
        }
    return NULL;
    }