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