ui/views/viewsfactory/src/glxviewsfactory.cpp
changeset 23 74c9f037fd5d
child 26 c499df2dbb33
equal deleted inserted replaced
5:f7f0874bfe7d 23:74c9f037fd5d
       
     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:   ?Description
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 //Includes
       
    20 
       
    21 //User Includes
       
    22 #include "glxview.h"
       
    23 #include "glxviewids.h"
       
    24 #include "glxgridview.h"
       
    25 #include "glxlistview.h"
       
    26 #include "glxdetailsview.h"
       
    27 #include "glxviewsfactory.h"
       
    28 #include "glxviewdocloader.h"
       
    29 #include "glxslideshowview.h"
       
    30 #include "glxdocloaderdefs.h"
       
    31 #include "glxfullscreenview.h"
       
    32 
       
    33 GlxView * GlxViewsFactory::createView(qint32 viewId, HbMainWindow *window)
       
    34 {
       
    35     switch ( viewId ) {
       
    36     case GLX_GRIDVIEW_ID :
       
    37         return new GlxGridView(window);
       
    38 
       
    39     case GLX_LISTVIEW_ID :
       
    40         return new GlxListView ( window );
       
    41 
       
    42     case GLX_FULLSCREENVIEW_ID :
       
    43 	{
       
    44 	    GlxFullScreenView *fullscreenView;
       
    45 	    bool isloaded;
       
    46 		
       
    47         GlxFullscreenViewDocLoader *docLoader = new GlxFullscreenViewDocLoader();
       
    48         // Load the   docml file.
       
    49         docLoader->load(GLXFULLSCREENDOCMLPATH, &isloaded);
       
    50                 
       
    51         if(isloaded)
       
    52         {
       
    53         //retreive the full screen view
       
    54          fullscreenView  = static_cast<GlxFullScreenView *> (docLoader->findWidget(GLXFULLSCREEN_VIEW));
       
    55         }  
       
    56         return fullscreenView;
       
    57     }
       
    58 
       
    59    case GLX_DETAILSVIEW_ID :    
       
    60         return new GlxDetailsView( window );
       
    61 
       
    62     case GLX_SLIDESHOWVIEW_ID :
       
    63 	{
       
    64 	    GlxSlideShowView *slideShowView;
       
    65 	    bool isloaded;
       
    66 		
       
    67         GlxSlideShowViewDocLoader *docLoader = new GlxSlideShowViewDocLoader();
       
    68         // Load the   docml file.
       
    69        docLoader->load(GLXSLIDESHOW_PATH, &isloaded);
       
    70        if(isloaded)
       
    71 	   {
       
    72 	     //retreive the Slide show view
       
    73 	     slideShowView  = static_cast<GlxSlideShowView *> (docLoader->findWidget(GLXSLIDESHOW_VIEW));
       
    74 	   }  
       
    75         return slideShowView;
       
    76    }
       
    77 
       
    78     default :
       
    79         return 0;     
       
    80     }
       
    81 }