mpviewplugins/mpmediawallviewplugin/src/mpmediawalldocumentloader.cpp
branchRCL_3
changeset 52 14979e23cb5e
equal deleted inserted replaced
50:26a1709b9fec 52:14979e23cb5e
       
     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: Music Player media wall view custom document loader.
       
    15 *
       
    16 */
       
    17 
       
    18 #include <hgmediawall.h>
       
    19 #include <hbtoolbutton.h>
       
    20 
       
    21 #include "mpmediawalldocumentloader.h"
       
    22 #include "mptrace.h"
       
    23 
       
    24 
       
    25 /*!
       
    26     \class MpMediaWallDocumentLoader
       
    27     \brief Music Player media wall view custom document loader.
       
    28 
       
    29     Media wall view document loader extends Orbit document loader to enable
       
    30     loading of custom widgets.
       
    31 */
       
    32 
       
    33 /*!
       
    34  Creates and returns the object of the given \a type.
       
    35 
       
    36  \reimp
       
    37  */
       
    38 QObject *MpMediaWallDocumentLoader::createObject(const QString& type, const QString &name)
       
    39 {
       
    40     TX_ENTRY_ARGS("type=" << type << ", name=" << name);
       
    41 
       
    42     if ( type == HgMediawall::staticMetaObject.className() ) {
       
    43         QObject *object = new HgMediawall();
       
    44         object->setObjectName(name);
       
    45         TX_EXIT
       
    46         return object;
       
    47     }
       
    48     else if ( type == HbToolButton::staticMetaObject.className() ) {
       
    49         QObject *object = new HbToolButton();
       
    50         object->setObjectName(name);
       
    51         TX_EXIT
       
    52         return object;
       
    53     }
       
    54 
       
    55     TX_EXIT
       
    56     return HbDocumentLoader::createObject(type, name);
       
    57 }
       
    58