camerauis/cameraxui/cxui/src/cxuidocumentloader.cpp
branchRCL_3
changeset 24 bac7acad7cb3
parent 23 61bc0f252b2b
child 25 2c87b2808fd7
equal deleted inserted replaced
23:61bc0f252b2b 24:bac7acad7cb3
     1 /*
       
     2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <hbdocumentloader.h>
       
    20 
       
    21 //#include <hbeffect.h>
       
    22 
       
    23 #include "cxuidocumentloader.h"
       
    24 #include "cxuistillprecaptureview.h"
       
    25 #include "cxuipostcaptureview.h"
       
    26 #include "cxuivideoprecaptureview.h"
       
    27 #include "cxuiscenemodeview.h"
       
    28 #include "cxutils.h" //CX_DEBUG_ASSERT
       
    29 #include "cxuisettingdialog.h"
       
    30 #include "cxuisettingslider.h"
       
    31 #include "cxuisettingradiobuttonlist.h"
       
    32 #include "cxuizoomslider.h"
       
    33 #include "cxeengine.h"
       
    34 #include "cxuienums.h"
       
    35 
       
    36 #ifdef Q_OS_SYMBIAN
       
    37 #include "OstTraceDefinitions.h"
       
    38 #ifdef OST_TRACE_COMPILER_IN_USE
       
    39 #include "cxuidocumentloaderTraces.h"
       
    40 #endif // OST_TRACE_COMPILER_IN_USE
       
    41 #endif // Q_OS_SYMBIAN
       
    42 
       
    43 
       
    44 CxuiDocumentLoader::CxuiDocumentLoader(CxeEngine *engine) : HbDocumentLoader(), mEngine(engine)
       
    45 {
       
    46 }
       
    47 
       
    48 QObject *CxuiDocumentLoader::createObject(const QString& type, const QString &name)
       
    49 {
       
    50     OstTrace0(camerax_performance, CXUIDOCUMENTLOADER_1, "msg: e_CX_DOCUMENTLOADER_CREATEOBJECT 1");
       
    51     QObject *object = NULL;
       
    52 
       
    53     if (type == "HbView") {
       
    54         if (name == CxUiLayout::STILL_PRE_CAPTURE_VIEW) {
       
    55             object = new CxuiStillPrecaptureView();
       
    56         } else if (name == CxUiLayout::VIDEO_PRE_CAPTURE_VIEW) {
       
    57             object = new CxuiVideoPrecaptureView();
       
    58         } else if (name == CxUiLayout::POSTCAPTURE_VIEW) {
       
    59             object = new CxuiPostcaptureView();
       
    60         } else if (name == CxUiLayout::SCENE_MODE_VIEW) {
       
    61             object = new CxuiSceneModeView(NULL);
       
    62         }
       
    63     } else if (type == "HbDialog") {
       
    64         if (name == CxUiLayout::SETTINGS_DIALOG_WIDGET
       
    65          || name == CxUiLayout::SETTINGS_SLIDER_DIALOG_WIDGET) {
       
    66             object = new CxuiSettingDialog();
       
    67         }
       
    68     } else if (type == "HbSlider") {
       
    69         if (name == CxUiLayout::SETTINGS_SLIDER_DIALOG_CONTENT_WIDGET) {
       
    70             object = new CxuiSettingSlider(NULL, mEngine);
       
    71         } else if (name == CxUiLayout::STILL_PRE_CAPTURE_ZOOM_SLIDER
       
    72          || name == CxUiLayout::VIDEO_PRE_CAPTURE_ZOOM_SLIDER) {
       
    73             object = new CxuiZoomSlider();
       
    74         }
       
    75     } else if (type == "HbRadioButtonList") {
       
    76         if (name == CxUiLayout::SETTINGS_DIALOG_CONTENT_WIDGET
       
    77          || name == CxUiLayout::SCENE_MODE_VIEW_RADIOBUTTONS) {
       
    78             object = new CxuiSettingRadioButtonList(NULL, mEngine);
       
    79         }
       
    80     }
       
    81 
       
    82     if (object) {
       
    83         object->setObjectName(name);
       
    84     } else {
       
    85         object = HbDocumentLoader::createObject(type, name);
       
    86     }
       
    87 
       
    88     OstTrace0(camerax_performance, CXUIDOCUMENTLOADER_2, "msg: e_CX_DOCUMENTLOADER_CREATEOBJECT 0");
       
    89     return object;
       
    90 }
       
    91 
       
    92 
       
    93 
       
    94 
       
    95