musicwidgetplugin/src/musicwidgetdocumentloader.cpp
changeset 43 0f32e550d9d8
child 59 cd9e40a08dda
equal deleted inserted replaced
38:b93f525c9244 43:0f32e550d9d8
       
     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 Widget custom document loader.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include <hbtoolbutton.h>
       
    20 
       
    21 #include "musicwidgetdocumentloader.h"
       
    22 #include "mpalbumcoverwidget.h"
       
    23 #include "mptrace.h"
       
    24 
       
    25 
       
    26 /*!
       
    27     \class MusicWidgetDocumentLoader
       
    28     \brief Music Widget custom document loader.
       
    29 
       
    30     Music Widget document loader extends Orbit document loader to enable
       
    31     loading of custom widgets.
       
    32 */
       
    33 
       
    34 /*!
       
    35  Creates and returns the object of the given \a type.
       
    36 
       
    37  \reimp
       
    38  */
       
    39 QObject *MusicWidgetDocumentLoader::createObject(const QString& type, const QString &name)
       
    40 {
       
    41     TX_ENTRY_ARGS("type=" << type << ", name=" << name);
       
    42 
       
    43     if ( type == MpAlbumCoverWidget::staticMetaObject.className() ) {
       
    44         QObject *object = new MpAlbumCoverWidget();
       
    45         object->setObjectName(name);
       
    46         TX_EXIT
       
    47         return object;
       
    48     }
       
    49 
       
    50     TX_EXIT
       
    51     return HbDocumentLoader::createObject(type, name);
       
    52 }
       
    53