camerauis/cameraxui/cxui/src/cxuidocumentloader.cpp
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 06 Jul 2010 14:04:02 +0300
changeset 37 64817133cd1d
parent 21 fa6d9f75d6a6
child 42 feebad15db8c
child 48 42ba2d16bf40
permissions -rw-r--r--
Revision: 201025 Kit: 2010127

/*
* Copyright (c) 2009-2010 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:
*
*/


#include <hbdocumentloader.h>

//#include <hbeffect.h>

#include "cxuidocumentloader.h"
#include "cxuistillprecaptureview.h"
#include "cxuipostcaptureview.h"
#include "cxuivideoprecaptureview.h"
#include "cxuiscenemodeview.h"
#include "cxutils.h" //CX_DEBUG_ASSERT
#include "cxuisettingdialog.h"
#include "cxuisettingslider.h"
#include "cxuisettingradiobuttonlist.h"
#include "cxuizoomslider.h"
#include "cxeengine.h"
#include "cxuienums.h"

#include "OstTraceDefinitions.h"
#ifdef OST_TRACE_COMPILER_IN_USE
#include "cxuidocumentloaderTraces.h"
#endif


CxuiDocumentLoader::CxuiDocumentLoader(CxeEngine *engine) : HbDocumentLoader(), mEngine(engine)
{
}

QObject *CxuiDocumentLoader::createObject(const QString& type, const QString &name)
{
    OstTrace0( camerax_performance, CXUIDOCUMENTLOADER_CREATEOBJECT, "msg: e_CX_DOCLOADER_CREATEOBJECT 1" );
    QObject *object = NULL;

    if (type == "HbView") {
        if (name == CxUiLayout::STILL_PRE_CAPTURE_VIEW) {
            object = new CxuiStillPrecaptureView();
        } else if (name == CxUiLayout::VIDEO_PRE_CAPTURE_VIEW) {
            object = new CxuiVideoPrecaptureView();
        } else if (name == CxUiLayout::POSTCAPTURE_VIEW) {
            object = new CxuiPostcaptureView();
        } else if (name == CxUiLayout::STILL_SCENES_VIEW) {
            object = new CxuiSceneModeView(NULL);
        }
    } else if (type == "HbDialog") {
        if (name == CxUiLayout::SETTINGS_DIALOG_WIDGET
         || name == CxUiLayout::SETTINGS_SLIDER_DIALOG_WIDGET) {
            object = new CxuiSettingDialog();
        }
    } else if (type == "HbSlider") {
        if (name == CxUiLayout::SETTINGS_SLIDER_DIALOG_CONTENT_WIDGET) {
            object = new CxuiSettingSlider(NULL, mEngine);
        } else if (name == CxUiLayout::STILL_PRE_CAPTURE_ZOOM_SLIDER
         || name == CxUiLayout::VIDEO_PRE_CAPTURE_ZOOM_SLIDER) {
            object = new CxuiZoomSlider();
        }
    } else if (type == "HbRadioButtonList") {
        if (name == CxUiLayout::SETTINGS_DIALOG_CONTENT_WIDGET
         || name == CxUiLayout::SCENE_VIEW_RADIOBUTTONS) {
            object = new CxuiSettingRadioButtonList(NULL, mEngine);
        }
    }

    if (object) {
        object->setObjectName(name);
    } else {
        object = HbDocumentLoader::createObject(type, name);
    }

    OstTrace0( camerax_performance, DUP1_CXUIDOCUMENTLOADER_CREATEOBJECT, "msg: e_CX_DOCLOADER_CREATEOBJECT 0" );
    return object;
}