radioapp/radiowidgetsplugin/main.cpp
branchRCL_3
changeset 20 93c594350b9a
parent 19 cce62ebc198e
equal deleted inserted replaced
19:cce62ebc198e 20:93c594350b9a
     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:
       
    15 *
       
    16 */
       
    17 
       
    18 // System includes
       
    19 #include <QtPlugin>
       
    20 #include <hbdocumentloaderplugin>
       
    21 
       
    22 // User includes
       
    23 #include "radiostationcarousel.h"
       
    24 #include "radiofrequencystrip.h"
       
    25 #include "radiofadinglabel.h"
       
    26 
       
    27 // Class declaration
       
    28 class RadioWidgetsPlugin : public HbDocumentLoaderPlugin
       
    29 {
       
    30 public:
       
    31 
       
    32     QObject* createObject(const QString& type, const QString& name);
       
    33     QList<const QMetaObject*> supportedObjects();
       
    34 
       
    35 };
       
    36 
       
    37 Q_EXPORT_PLUGIN(RadioWidgetsPlugin)
       
    38 
       
    39 /*!
       
    40  *
       
    41  */
       
    42 QObject* RadioWidgetsPlugin::createObject( const QString& type, const QString& name )
       
    43 {
       
    44     QObject* object = 0;
       
    45 
       
    46     if ( type == RadioStationCarousel::staticMetaObject.className() ) {
       
    47         object = new RadioStationCarousel();
       
    48     } else if ( type == RadioFrequencyStrip::staticMetaObject.className() ) {
       
    49         object = new RadioFrequencyStrip();
       
    50     } else if ( type == RadioFadingLabel::staticMetaObject.className() ) {
       
    51         object = new RadioFadingLabel();
       
    52     }
       
    53 
       
    54     if ( object ) {
       
    55         object->setObjectName( name );
       
    56     }
       
    57 
       
    58     return object;
       
    59 }
       
    60 
       
    61 /*!
       
    62  *
       
    63  */
       
    64 QList<const QMetaObject *> RadioWidgetsPlugin::supportedObjects()
       
    65 {
       
    66     QList<const QMetaObject *> result;
       
    67     result.append( &RadioFadingLabel::staticMetaObject );
       
    68     result.append( &RadioFrequencyStrip::staticMetaObject );
       
    69     result.append( &RadioStationCarousel::staticMetaObject );
       
    70     return result;
       
    71 }