homescreenapp/hsdomainmodel/src/hsdocumentloader.cpp
changeset 69 87476091b3f5
parent 62 341166945d65
equal deleted inserted replaced
67:474929a40a0f 69:87476091b3f5
       
     1 /*
       
     2 * Copyright (c) 2009 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:  Homescreen document loader class.
       
    15 *
       
    16 */
       
    17 
       
    18 #include "hsdocumentloader.h"
       
    19 #include "hspageindicator.h"
       
    20 #include "hstrashbinwidget.h"
       
    21 #include "hsconfiguration.h"
       
    22 
       
    23 /*!
       
    24     \class HsDocumentLoader
       
    25     \ingroup group_hshomescreenstateplugin
       
    26     \brief Homescreen document loader class.
       
    27 
       
    28     Loads own widgets from docml.
       
    29 */
       
    30 
       
    31 /*!
       
    32     Constructor.
       
    33 */
       
    34 HsDocumentLoader::HsDocumentLoader()
       
    35     : HbDocumentLoader()
       
    36 {
       
    37 }
       
    38 
       
    39 /*!
       
    40     Destructor.
       
    41 */
       
    42 HsDocumentLoader::~HsDocumentLoader()
       
    43 {
       
    44 }
       
    45 
       
    46 /*!
       
    47     Looks up an object which inherits class type and of which object name equals to name.
       
    48     \a type type of the desired object.
       
    49     \a name object name of the desired object.
       
    50     */
       
    51 QObject *HsDocumentLoader::createObject(const QString &type, const QString &name)
       
    52 {
       
    53     if (type == HsPageIndicator::staticMetaObject.className()) {
       
    54         QObject *object = new HsPageIndicator(HSCONFIGURATION_GET(pageIndicatorSpacing));
       
    55         object->setObjectName(name);
       
    56         return object;
       
    57     }
       
    58     else if (type == HsTrashBinWidget::staticMetaObject.className()) {
       
    59         QObject *object = new HsTrashBinWidget;
       
    60         object->setObjectName(name);
       
    61         return object;
       
    62     }
       
    63         
       
    64     return HbDocumentLoader::createObject(type, name);
       
    65 }