ui/views/docloaders/src/glxviewdocloader.cpp
changeset 23 74c9f037fd5d
child 33 1ee2af37811f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ui/views/docloaders/src/glxviewdocloader.cpp	Fri Mar 19 09:28:59 2010 +0200
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:   ?Description
+ *
+ */
+
+//INCLUDES
+#include <hbdocumentloader.h>
+#include <hbmainwindow.h>
+#include <hbinstance.h>
+#include <hbinstance.h>
+#include <QDebug>
+
+//USER INCLUDES
+#include "glxdocloaderdefs.h" //contains the path and names of the view
+#include "glxviewdocloader.h"
+#include "glxfullscreenview.h"
+#include "glxcoverflow.h"
+#include "glxslideshowwidget.h"
+#include "glxslideshowview.h"
+
+//----------------------------------------------------------------------------------------
+// createObject:creates the custom widget and views of fullscreen view
+//----------------------------------------------------------------------------------------
+QObject* GlxFullscreenViewDocLoader::createObject(const QString &type, const QString &name)
+    {
+    qDebug() <<"GlxFullscreenViewDocLoader::createObject -->";
+
+    if (GLXFULLSCREEN_VIEW == name)
+        {
+        qDebug() << "GlxFullscreenViewDocLoader::createObject:FULLSCREEN_VIEW -->";
+
+        //Passes the docloader ownership to the view
+        HbMainWindow *window = hbInstance->allMainWindows().first();
+        QObject *object = new GlxFullScreenView(window,this);
+        object->setObjectName(name);
+        return object;
+        }
+
+    if (GLXFULLSCREEN_COVERFLOW == name) 
+        {
+        qDebug() << "GlxFullscreenViewDocLoader::createObject:CoverFLOW -->";
+
+        QObject *object = new GlxCoverFlow();
+        object->setObjectName(name);
+        return object;
+        }
+    return HbDocumentLoader::createObject(type, name);
+    }
+
+
+//----------------------------------------------------------------------------------------
+// createObject:creates the custom widget and views of slide show
+//----------------------------------------------------------------------------------------
+QObject* GlxSlideShowViewDocLoader::createObject(const QString &type, const QString &name)
+    {
+    qDebug() <<"GlxSlideShowViewDocLoader::createObject -->";
+
+
+    if (GLXSLIDESHOW_VIEW == name)
+        {
+        qDebug() << "GlxSlideShowViewDocLoader::createObject:SLIDESHOW -->";
+
+        //Passes the docloader ownership to the view
+        HbMainWindow *window = hbInstance->allMainWindows().first();
+        QObject *object = new GlxSlideShowView(window,this);
+        object->setObjectName(name);
+        return object;
+        }
+
+    if (GLXSLIDESHOW_WIDGET == name)
+        {
+        qDebug() << "GlxSlideShowViewDocLoader::createObject:WIDGET -->";
+        QObject *object = new GlxSlideShowWidget();
+        object->setObjectName(name);
+        return object;
+        }
+    return HbDocumentLoader::createObject(type, name);
+    }