ui/views/docloaders/src/glxviewdocloader.cpp
changeset 23 74c9f037fd5d
child 33 1ee2af37811f
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 //INCLUDES
       
    19 #include <hbdocumentloader.h>
       
    20 #include <hbmainwindow.h>
       
    21 #include <hbinstance.h>
       
    22 #include <hbinstance.h>
       
    23 #include <QDebug>
       
    24 
       
    25 //USER INCLUDES
       
    26 #include "glxdocloaderdefs.h" //contains the path and names of the view
       
    27 #include "glxviewdocloader.h"
       
    28 #include "glxfullscreenview.h"
       
    29 #include "glxcoverflow.h"
       
    30 #include "glxslideshowwidget.h"
       
    31 #include "glxslideshowview.h"
       
    32 
       
    33 //----------------------------------------------------------------------------------------
       
    34 // createObject:creates the custom widget and views of fullscreen view
       
    35 //----------------------------------------------------------------------------------------
       
    36 QObject* GlxFullscreenViewDocLoader::createObject(const QString &type, const QString &name)
       
    37     {
       
    38     qDebug() <<"GlxFullscreenViewDocLoader::createObject -->";
       
    39 
       
    40     if (GLXFULLSCREEN_VIEW == name)
       
    41         {
       
    42         qDebug() << "GlxFullscreenViewDocLoader::createObject:FULLSCREEN_VIEW -->";
       
    43 
       
    44         //Passes the docloader ownership to the view
       
    45         HbMainWindow *window = hbInstance->allMainWindows().first();
       
    46         QObject *object = new GlxFullScreenView(window,this);
       
    47         object->setObjectName(name);
       
    48         return object;
       
    49         }
       
    50 
       
    51     if (GLXFULLSCREEN_COVERFLOW == name) 
       
    52         {
       
    53         qDebug() << "GlxFullscreenViewDocLoader::createObject:CoverFLOW -->";
       
    54 
       
    55         QObject *object = new GlxCoverFlow();
       
    56         object->setObjectName(name);
       
    57         return object;
       
    58         }
       
    59     return HbDocumentLoader::createObject(type, name);
       
    60     }
       
    61 
       
    62 
       
    63 //----------------------------------------------------------------------------------------
       
    64 // createObject:creates the custom widget and views of slide show
       
    65 //----------------------------------------------------------------------------------------
       
    66 QObject* GlxSlideShowViewDocLoader::createObject(const QString &type, const QString &name)
       
    67     {
       
    68     qDebug() <<"GlxSlideShowViewDocLoader::createObject -->";
       
    69 
       
    70 
       
    71     if (GLXSLIDESHOW_VIEW == name)
       
    72         {
       
    73         qDebug() << "GlxSlideShowViewDocLoader::createObject:SLIDESHOW -->";
       
    74 
       
    75         //Passes the docloader ownership to the view
       
    76         HbMainWindow *window = hbInstance->allMainWindows().first();
       
    77         QObject *object = new GlxSlideShowView(window,this);
       
    78         object->setObjectName(name);
       
    79         return object;
       
    80         }
       
    81 
       
    82     if (GLXSLIDESHOW_WIDGET == name)
       
    83         {
       
    84         qDebug() << "GlxSlideShowViewDocLoader::createObject:WIDGET -->";
       
    85         QObject *object = new GlxSlideShowWidget();
       
    86         object->setObjectName(name);
       
    87         return object;
       
    88         }
       
    89     return HbDocumentLoader::createObject(type, name);
       
    90     }