emailuis/nmailui/src/nmuidocumentloader.cpp
changeset 18 578830873419
child 20 ecc8def7944a
equal deleted inserted replaced
4:e7aa27f58ae1 18:578830873419
       
     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 #include "nmuiheaders.h"
       
    19 
       
    20 /*!
       
    21     Constructor
       
    22 */
       
    23 NmUiDocumentLoader::NmUiDocumentLoader(const HbMainWindow *window) : HbDocumentLoader(window)
       
    24 {
       
    25 }
       
    26 
       
    27 /*!
       
    28     Destructor
       
    29 */
       
    30 NmUiDocumentLoader::~NmUiDocumentLoader()
       
    31 {
       
    32 }
       
    33 
       
    34 /*!
       
    35     createObject. Function returns Nmail UI specific objects from DocML
       
    36 */
       
    37 QObject *NmUiDocumentLoader::createObject(const QString& type, const QString &name)
       
    38 {
       
    39     QObject *res = NULL;
       
    40     if( type == NmMailViewerWK::staticMetaObject.className() ) {
       
    41         res = new NmMailViewerWK();
       
    42         res->setObjectName(name);
       
    43     }
       
    44     if( type == NmBaseViewScrollArea::staticMetaObject.className() ) {
       
    45         res = new NmBaseViewScrollArea();
       
    46         res->setObjectName(name);
       
    47     }
       
    48     if( type == NmViewerHeader::staticMetaObject.className() ) {
       
    49         res = new NmViewerHeader();
       
    50         res->setObjectName(name);
       
    51     }
       
    52     if (res == NULL) {
       
    53         res = HbDocumentLoader::createObject(type, name);
       
    54     }
       
    55     return res;
       
    56 }