notes/notesui/notesviewmanager/src/notesdocloader.cpp
changeset 18 c198609911f9
child 23 fd30d51f876b
equal deleted inserted replaced
0:f979ecb2b13e 18:c198609911f9
       
     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: Definition file for class NotesDocLoader.
       
    15 *
       
    16 */
       
    17 
       
    18 // System includes
       
    19 #include <qdebug.h>
       
    20 
       
    21 // User includes
       
    22 #include "notesdocloader.h"
       
    23 #include "notesmainview.h"
       
    24 #include "notescollectionview.h"
       
    25 #include "notestodoview.h"
       
    26 #include "notesfavoriteview.h"
       
    27 #include "notesnoteview.h"
       
    28 #include "notescommon.h"
       
    29 
       
    30 /*!
       
    31 	\class NotesDocLoader
       
    32 
       
    33 	Custom document loader class for notes view manager.
       
    34  */
       
    35 /*!
       
    36 	From HbDocumentLoader.
       
    37 	Creates and returns an object of type and assigns name as its object name.
       
    38 
       
    39 	\param type The type name as mentioned in docml.
       
    40 	\param name The name of the object as mentioned in docml.
       
    41 	\return QObject* Pointer to the constructed QObject.
       
    42 	\sa HbDocumentLoader
       
    43  */
       
    44 QObject* NotesDocLoader::createObject(const QString &type, const QString &name)
       
    45 {
       
    46 	qDebug() << "notes: NotesDocLoader::createObject -->";
       
    47 
       
    48 	if (NOTES_MAIN_VIEW == name) {
       
    49 		QObject *object = new NotesMainView();
       
    50 		object->setObjectName(name);
       
    51 		return object;
       
    52 	} else if (NOTES_COLLECTION_VIEW == name) {
       
    53 		QObject *object = new NotesCollectionView();
       
    54 		object->setObjectName(name);
       
    55 		return object;
       
    56     } else if (NOTES_TODO_VIEW == name) {
       
    57 		QObject *object = new NotesTodoView();
       
    58 		object->setObjectName(name);
       
    59 		return object;
       
    60     } else if (NOTES_FAVORITES_VIEW == name) {
       
    61 		QObject *object = new NotesFavoriteView();
       
    62 		object->setObjectName(name);
       
    63 		return object;
       
    64 	} else if (NOTES_NOTE_VIEW == name) {
       
    65 		QObject *object = new NotesNoteView();
       
    66 		object->setObjectName(name);
       
    67 		return object;
       
    68     }
       
    69 
       
    70 	qDebug() << "notes: NotesDocLoader::createObject <--";
       
    71 
       
    72 	return HbDocumentLoader::createObject(type, name);
       
    73 }
       
    74 
       
    75 // End of file	--Don't remove this.