homescreenapp/examples/contentpublishclient/src/main.cpp
changeset 36 cdae8c6c3876
child 39 4e8ebe173323
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/homescreenapp/examples/contentpublishclient/src/main.cpp	Fri Apr 16 14:54:01 2010 +0300
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) 2010 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:  Example of home screen content publishing client
+*
+*/
+
+#include <HbApplication>
+#include <HbMainWindow>
+#include <HbView>
+#include <HbPushButton>
+
+#include <QDir>
+
+#include "contentpublishclient.h"
+
+int main(int argc, char *argv[])
+{
+	// Initialization
+    HbApplication app(argc, argv);
+
+    QString path = QDir::toNativeSeparators(QDir("z:\\hsresources\\plugins\\homescreenclientplugin\\").absolutePath());
+    QString fullFileName = path + "\\hshomescreenclientplugin.xml";
+    
+    QServiceManager manager;
+    
+    if(QFile::exists(fullFileName)) {
+        QCoreApplication::addLibraryPath(path);
+        manager.addService(fullFileName);
+    }
+    
+    // Create main window.
+    HbMainWindow* mainWindow = new HbMainWindow();
+
+    // Create content publisher client
+	ContentPublishClient contentPublishClient(manager);
+	
+    QString buttonString = "Create widget";
+    if(!contentPublishClient.load()) {
+        buttonString = "Open failed";
+    }
+
+    HbPushButton* button = new HbPushButton(buttonString);
+
+	// Add view
+    mainWindow->addView(button);
+    
+    contentPublishClient.connect(button, SIGNAL(pressed()), SLOT(addWidget()));
+    
+    // Show main window
+    mainWindow->show();
+
+    return app.exec();
+}