ui/views/docloaders/src/glxviewdocloader.cpp
branchRCL_3
changeset 59 8e5f6eea9c9f
equal deleted inserted replaced
57:ea65f74e6de4 59:8e5f6eea9c9f
       
     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 #include "glxzoomwidget.h"
       
    33 
       
    34 #include "glxdetailstextedit.h"
       
    35 #include "glxdetailsicon.h"
       
    36 
       
    37 //----------------------------------------------------------------------------------------
       
    38 // createObject:creates the custom widget and views of fullscreen view
       
    39 //----------------------------------------------------------------------------------------
       
    40 QObject* GlxFullscreenViewDocLoader::createObject(const QString &type, const QString &name)
       
    41     {
       
    42     qDebug() <<"GlxFullscreenViewDocLoader::createObject -->";
       
    43 
       
    44     if (GLXFULLSCREEN_VIEW == name)
       
    45         {
       
    46         qDebug() << "GlxFullscreenViewDocLoader::createObject:FULLSCREEN_VIEW -->";
       
    47 
       
    48         //Passes the docloader ownership to the view
       
    49         HbMainWindow *window = hbInstance->allMainWindows().first();
       
    50         QObject *object = new GlxFullScreenView(window,this);
       
    51         object->setObjectName(name);
       
    52         return object;
       
    53         }
       
    54 
       
    55     if (GLXFULLSCREEN_COVERFLOW == name) 
       
    56         {
       
    57         qDebug() << "GlxFullscreenViewDocLoader::createObject:CoverFLOW -->";
       
    58 
       
    59         QObject *object = new GlxCoverFlow();
       
    60         object->setObjectName(name);
       
    61         return object;
       
    62         }
       
    63        
       
    64        if (GLXFULLSCREENZOOMWIDGET == name) 
       
    65         {
       
    66         qDebug() << "GlxFullscreenViewDocLoader::createObject:ZOOM -->";
       
    67         QObject *object = new GlxZoomWidget();
       
    68         object->setObjectName(name);
       
    69         return object;
       
    70         }
       
    71     return HbDocumentLoader::createObject(type, name);
       
    72     }
       
    73 
       
    74 
       
    75 //----------------------------------------------------------------------------------------
       
    76 // createObject:creates the custom widget and views of slide show
       
    77 //----------------------------------------------------------------------------------------
       
    78 QObject* GlxSlideShowViewDocLoader::createObject(const QString &type, const QString &name)
       
    79     {
       
    80     qDebug() <<"GlxSlideShowViewDocLoader::createObject -->";
       
    81 
       
    82 
       
    83     if (GLXSLIDESHOW_VIEW == name)
       
    84         {
       
    85         qDebug() << "GlxSlideShowViewDocLoader::createObject:SLIDESHOW -->";
       
    86 
       
    87         //Passes the docloader ownership to the view
       
    88         HbMainWindow *window = hbInstance->allMainWindows().first();
       
    89         QObject *object = new GlxSlideShowView(window,this);
       
    90         object->setObjectName(name);
       
    91         return object;
       
    92         }
       
    93 
       
    94     if (GLXSLIDESHOW_WIDGET == name)
       
    95         {
       
    96         qDebug() << "GlxSlideShowViewDocLoader::createObject:WIDGET -->";
       
    97         QObject *object = new GlxSlideShowWidget();
       
    98         object->setObjectName(name);
       
    99         return object;
       
   100         }
       
   101     return HbDocumentLoader::createObject(type, name);
       
   102     }
       
   103 
       
   104 	//----------------------------------------------------------------------------------------
       
   105 // createObject:creates the custom widget and views of details view
       
   106 //----------------------------------------------------------------------------------------
       
   107 QObject* GlxDetailsViewDocLoader::createObject(const QString &type, const QString &name)
       
   108     {
       
   109     qDebug() <<"GlxDetailsViewDocLoader::createObject -->";
       
   110 
       
   111 
       
   112     if (GLX_DETAILSVIEW_IMGNAME == name)
       
   113         {
       
   114         qDebug() << "GlxDetailsViewDocLoader::createObject:GLX_DETAILSVIEW_IMGNAME -->";
       
   115 
       
   116         QObject *object = new GlxDetailsTextEdit();
       
   117         object->setObjectName(name);
       
   118         return object;
       
   119         }
       
   120     
       
   121     if (GLX_DETAILSVIEW_DESCRPTIONTEXT == name)
       
   122         {
       
   123         qDebug() << "GlxDetailsViewDocLoader::createObject:GLX_DETAILSVIEW_DESCRPTIONTEXT -->";
       
   124 
       
   125         QObject *object = new GlxDetailsTextEdit();
       
   126         object->setObjectName(name);
       
   127         return object;
       
   128         }
       
   129     
       
   130     if (GLX_DETAILSVIEW_FAVICON == name)
       
   131         {
       
   132         qDebug() << "GlxDetailsViewDocLoader::createObject:ICON -->";
       
   133 
       
   134         QObject *object = new GlxDetailsIcon();
       
   135         object->setObjectName(name);
       
   136         return object;
       
   137         }
       
   138     
       
   139     
       
   140     return HbDocumentLoader::createObject(type, name);
       
   141     }
       
   142