radioapp/radiowidgets/src/radioxmluiloader.cpp
changeset 16 f54ebcfc1b80
parent 13 46974bebc798
equal deleted inserted replaced
14:63aabac4416d 16:f54ebcfc1b80
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 // User includes
    18 // User includes
    19 #include "radioxmluiloader.h"
    19 #include "radioxmluiloader.h"
    20 #include "radiomainwindow.h"
       
    21 #include "radiostationsview.h"
       
    22 #include "radiotuningview.h"
       
    23 #include "radiowizardview.h"
       
    24 #include "radioplaylogview.h"
       
    25 #include "radiostationcarousel.h"
       
    26 #include "radiostationcontrolwidget.h"
       
    27 #include "radiofrequencystrip.h"
       
    28 #include "radiobannerlabel.h"
       
    29 #include "radiofadinglabel.h"
       
    30 #include "radiocontextmenu.h"
       
    31 #include "radiostationmodel.h"
       
    32 #include "radiouiengine.h"
       
    33 
    20 
    34 /*!
    21 /*!
    35  *
    22  *
    36  */
    23  */
    37 RadioXmlUiLoader::RadioXmlUiLoader( RadioMainWindow& mainWindow ) :
    24 RadioXmlUiLoader::RadioXmlUiLoader() :
    38     HbDocumentLoader(),
    25     HbDocumentLoader()
    39     mMainWindow( mainWindow )
       
    40 {
    26 {
    41 }
    27 }
    42 
       
    43 /*!
       
    44  *
       
    45  */
       
    46 QObject* RadioXmlUiLoader::createObject( const QString& type, const QString &name )
       
    47 {
       
    48     QObject* object = 0;
       
    49 
       
    50     if ( type == RadioTuningView::staticMetaObject.className() )
       
    51     {
       
    52         object = new RadioTuningView( this );
       
    53     }
       
    54     else if ( type == RadioStationCarousel::staticMetaObject.className() )
       
    55     {
       
    56         object = new RadioStationCarousel( mMainWindow.uiEngine() );
       
    57     }
       
    58     else if ( type == RadioStationControlWidget::staticMetaObject.className() )
       
    59     {
       
    60         object = new RadioStationControlWidget( mMainWindow.uiEngine() );
       
    61     }
       
    62     else if ( type == RadioFrequencyStrip::staticMetaObject.className() )
       
    63     {
       
    64         RadioUiEngine& engine = mMainWindow.uiEngine();
       
    65         object = new RadioFrequencyStrip( engine.minFrequency(),
       
    66                                           engine.maxFrequency(),
       
    67                                           engine.frequencyStepSize(),
       
    68                                           engine.currentFrequency(),
       
    69                                           &engine );
       
    70     }
       
    71     else if ( type == RadioStationsView::staticMetaObject.className() )
       
    72     {
       
    73         object = new RadioStationsView( this );
       
    74     }
       
    75     else if ( type == RadioBannerLabel::staticMetaObject.className() )
       
    76     {
       
    77         object = new RadioBannerLabel();
       
    78     }
       
    79     else if ( type == RadioFadingLabel::staticMetaObject.className() )
       
    80     {
       
    81         object = new RadioFadingLabel();
       
    82     }
       
    83     else if ( type == RadioWizardView::staticMetaObject.className() )
       
    84     {
       
    85         object = new RadioWizardView( this );
       
    86     }
       
    87     else if ( type == RadioContextMenu::staticMetaObject.className() )
       
    88     {
       
    89         object = new RadioContextMenu( mMainWindow.uiEngine() );
       
    90     }
       
    91     else if ( type == RadioPlayLogView::staticMetaObject.className() )
       
    92     {
       
    93         object = new RadioPlayLogView( this );
       
    94     }
       
    95 
       
    96     if ( object )
       
    97     {
       
    98         object->setObjectName( name );
       
    99         return object;
       
   100     }
       
   101 
       
   102     return HbDocumentLoader::createObject( type, name );
       
   103 }