ui/detailscustomwidget/detailscustomplugin/main.cpp
changeset 52 a3a4c0de738e
equal deleted inserted replaced
50:a0f57508af73 52:a3a4c0de738e
       
     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:   Details custom widgets plugin
       
    15  *
       
    16  */
       
    17 
       
    18 #include "glxdetailstextedit.h"
       
    19 #include "glxdetailsicon.h"
       
    20 
       
    21 #include <QtPlugin>
       
    22 #include <hbdocumentloaderplugin.h>
       
    23 
       
    24 class GlxDetailsCustomPlugin : public HbDocumentLoaderPlugin
       
    25 {
       
    26 public:
       
    27     QObject *createObject(const QString& type, const QString &name);
       
    28     QList<const QMetaObject *> supportedObjects();  
       
    29 };
       
    30 Q_EXPORT_PLUGIN(GlxDetailsCustomPlugin)
       
    31 
       
    32 QObject *GlxDetailsCustomPlugin::createObject(const QString& type, const QString &name )
       
    33 { 
       
    34  
       
    35     if( type == GlxDetailsTextEdit::staticMetaObject.className() ) {
       
    36         QObject *object = new GlxDetailsTextEdit();
       
    37         object->setObjectName(name);
       
    38         return object;    
       
    39     }
       
    40     
       
    41     if( type == GlxDetailsIcon::staticMetaObject.className() ) {
       
    42         QObject *object = new GlxDetailsIcon();
       
    43         object->setObjectName(name);
       
    44         return object;    
       
    45     }
       
    46     
       
    47     return 0;
       
    48 }
       
    49 
       
    50 QList<const QMetaObject *> GlxDetailsCustomPlugin::supportedObjects()
       
    51 {
       
    52     QList<const QMetaObject *> result;
       
    53     result.append( &GlxDetailsTextEdit::staticMetaObject );
       
    54     result.append( &GlxDetailsIcon::staticMetaObject );
       
    55     return result;
       
    56 }
       
    57 
       
    58 // end of file 
       
    59