emailuis/nmailuiwidgetsplugin/src/nmailuiwidgetsplugin.cpp
branchRCL_3
changeset 63 d189ee25cf9d
equal deleted inserted replaced
61:dcf0eedfc1a3 63:d189ee25cf9d
       
     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: Nmail plugin for custom widgets
       
    15 *
       
    16 */
       
    17 
       
    18 #include "emailtrace.h"
       
    19 
       
    20 #include "nmailuiwidgetsplugin.h"
       
    21 #include <nmrecipientlineedit.h>
       
    22 #include <nmhtmllineedit.h>
       
    23 #include <nmeditortextedit.h>
       
    24 #include <nmbaseviewscrollarea.h>
       
    25 #include <nmattachmentlistwidget.h>
       
    26 
       
    27 QObject *NMailUiWidgetsPlugin::createObject(const QString& type, const QString &name )
       
    28 {
       
    29     NM_FUNCTION;
       
    30     
       
    31     if( type == NmBaseViewScrollArea::staticMetaObject.className() ) {
       
    32         QObject *object = new NmBaseViewScrollArea;
       
    33         object->setObjectName(name);
       
    34         return object;
       
    35     }
       
    36     if( type == NmRecipientLineEdit::staticMetaObject.className() ) {
       
    37         QObject *object = new NmRecipientLineEdit;
       
    38         object->setObjectName(name);
       
    39         return object;
       
    40     }
       
    41     if( type == NmHtmlLineEdit::staticMetaObject.className() ) {
       
    42         QObject *object = new NmHtmlLineEdit;
       
    43         object->setObjectName(name);
       
    44         return object;
       
    45     }
       
    46     if( type == NmEditorTextEdit::staticMetaObject.className() ) {
       
    47         QObject *object = new NmEditorTextEdit;
       
    48         object->setObjectName(name);
       
    49         return object;
       
    50     }
       
    51     if( type == NmAttachmentListWidget::staticMetaObject.className() ) {
       
    52         QObject *object = new NmAttachmentListWidget;
       
    53         object->setObjectName(name);
       
    54         return object;
       
    55     }
       
    56     return 0;
       
    57 }
       
    58 
       
    59 QList<const QMetaObject *> NMailUiWidgetsPlugin::supportedObjects()
       
    60 {
       
    61     QList<const QMetaObject *> result;
       
    62     result.append( &NmBaseViewScrollArea::staticMetaObject );
       
    63     result.append( &NmRecipientLineEdit::staticMetaObject );
       
    64     result.append( &NmHtmlLineEdit::staticMetaObject );
       
    65     result.append( &NmEditorTextEdit::staticMetaObject );
       
    66     result.append( &NmAttachmentListWidget::staticMetaObject );
       
    67     return result;
       
    68 }
       
    69 
       
    70 // end of file
       
    71