creator/engine/src/creator_scriptelementfactory.cpp
branchRCL_3
changeset 21 b3cee849fa46
equal deleted inserted replaced
20:48060abbbeaf 21:b3cee849fa46
       
     1 /*
       
     2 * Copyright (c) 2010 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 
       
    19 
       
    20 #include "creator_traces.h"
       
    21 #include "creator_scriptelementfactory.h"
       
    22 #include "creator_contactelement.h"
       
    23 #include "creator_calendarelement.h"
       
    24 #include "creator_messageelement.h"
       
    25 #include "creator_fileelement.h"
       
    26 //#include "creator_browserelement.h"
       
    27 #include "creator_logelement.h"
       
    28 //#include "creator_noteelement.h"
       
    29 //#include "creator_impselement.h"
       
    30 #include "creator_landmarkelement.h"
       
    31 #include "creator_mailboxelement.h"
       
    32 //#include "creator_connectionmethodelement.h"
       
    33 
       
    34 CCreatorScriptElement* TCreatorScriptElementFactory::CreateElementL(CCreatorEngine* aEngine, const TDesC& aElementName, const TDesC& aContext )
       
    35     {   
       
    36     LOGSTRING2("TCreatorScriptElementFactory::CreateElementL: %S", &aElementName);
       
    37     
       
    38     if( aContext.Length() >= KFields().Length() && 
       
    39     	aContext.Right(KFields().Length()) == KFields)
       
    40     	{
       
    41     	// This is a field element under 'fields'.
       
    42     	return CCreatorScriptElement::NewL(aEngine, aElementName, aContext);
       
    43     	}    
       
    44     else if( aElementName == creatorcontact::KContact )
       
    45         {
       
    46         return CCreatorContactElement::NewL(aEngine, aElementName, aContext);  
       
    47         }
       
    48     else if( aElementName == creatorcontact::KContactSet)
       
    49         {
       
    50         return CCreatorContactSetElement::NewL(aEngine, aElementName, aContext);
       
    51         }
       
    52     else if( aElementName == creatorcontact::KContactGroup )
       
    53         {
       
    54         return CCreatorContactGroupElement::NewL(aEngine, aElementName, aContext);
       
    55         }
       
    56     else if( aElementName == KFields)
       
    57         {
       
    58         return CCreatorScriptElement::NewL(aEngine, aElementName, aContext);
       
    59         }
       
    60     else if( aElementName == KScript )
       
    61         {
       
    62         return CCreatorScriptRoot::NewL(aEngine, aElementName, aContext);
       
    63         }
       
    64     else if( aElementName == creatorcalendar::KCalendar )
       
    65         {
       
    66         return CCreatorCalendarElement::NewL(aEngine, aElementName, aContext);
       
    67         }
       
    68     else if( aElementName == creatormsg::KMessage )
       
    69         {
       
    70         return CCreatorMessageElement::NewL(aEngine, aElementName, aContext);
       
    71         }
       
    72     else if( aElementName == creatorfile::KFile )
       
    73         {
       
    74         return CCreatorFileElement::NewL(aEngine, aElementName, aContext);
       
    75         }
       
    76     /*
       
    77     else if( aElementName == creatorbrowser::KBookmark ||
       
    78             aElementName == creatorbrowser::KBookmarkFolder ||
       
    79             aElementName == creatorbrowser::KSavedPage ||
       
    80             aElementName == creatorbrowser::KSavedPageFolder )
       
    81         {
       
    82         return CCreatorBrowserElement::NewL(aEngine, aElementName, aContext);
       
    83         }
       
    84     */
       
    85     else if( aElementName == creatorlog::KLog )
       
    86         {
       
    87         return CCreatorLogElement::NewL(aEngine, aElementName, aContext);
       
    88         }
       
    89 /*
       
    90     else if( aElementName == creatornote::KNote )
       
    91         {
       
    92         return CCreatorNoteElement::NewL(aEngine, aElementName, aContext);
       
    93         }
       
    94 */
       
    95 /*
       
    96 	#ifdef __PRESENCE
       
    97     else if( aElementName == creatorimps::KImpsServer )
       
    98         {
       
    99         return CCreatorImpsServerElement::NewL(aEngine, aElementName, aContext);
       
   100         }
       
   101 	#endif // __PRESENCE
       
   102 */
       
   103     else if( aElementName == creatorlandmark::KLandmark )
       
   104         {
       
   105         return CCreatorLandmarkElement::NewL(aEngine, aElementName, aContext);
       
   106         }
       
   107     else if( aElementName == creatormailbox::Kmailbox )
       
   108         {
       
   109         return CCreatorMailboxElement::NewL(aEngine, aElementName, aContext);
       
   110         }
       
   111 /*    
       
   112     else if( aElementName == creatorconnectionmethod::KCm )
       
   113     	{
       
   114     	return CCreatorConnectionMethodElement::NewL(aEngine, aElementName, aContext);
       
   115     	}
       
   116 */    	
       
   117     else
       
   118         {
       
   119         return CCreatorScriptElement::NewL(aEngine, aElementName, aContext);
       
   120         }       
       
   121     }