From 321b78dff7167ad1c1f296c8da70e50e357f5929 Mon Sep 17 00:00:00 2001
From: Pawel Polanski <pawel.3.polanski@nokia.com>
Date: Thu, 23 Sep 2010 20:04:14 +0200
Subject: [PATCH] Improved library creation for mobile targets

Reviewed-by: Alessandro Portale
---
 .../qt4projectmanager/qt4projectmanager.pro   |   5 +
 .../wizards/librarywizard.cpp                 |   4 +
 .../wizards/librarywizarddialog.cpp           |  68 +++++++++-
 .../wizards/librarywizarddialog.h             |   8 ++
 .../wizards/mobilelibraryparameters.cpp       | 119 ++++++++++++++++++
 .../wizards/mobilelibraryparameters.h         |  88 +++++++++++++
 .../wizards/mobilelibrarywizardoptionpage.cpp |  89 +++++++++++++
 .../wizards/mobilelibrarywizardoptionpage.h   |  60 +++++++++
 .../wizards/mobilelibrarywizardoptionpage.ui  |  93 ++++++++++++++
 9 files changed, 529 insertions(+), 5 deletions(-)
 create mode 100644 src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp
 create mode 100644 src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h
 create mode 100644 src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp
 create mode 100644 src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h
 create mode 100644 src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui

diff --git a/src/plugins/qt4projectmanager/qt4projectmanager.pro b/src/plugins/qt4projectmanager/qt4projectmanager.pro
index ea23478ee2a..e7a6bb28886 100644
--- a/src/plugins/qt4projectmanager/qt4projectmanager.pro
+++ b/src/plugins/qt4projectmanager/qt4projectmanager.pro
@@ -19,6 +19,8 @@ HEADERS += qt4deployconfiguration.h \
     wizards/mobileapp.h \
     wizards/mobileappwizard.h \
     wizards/mobileappwizardpages.h \
+    wizards/mobilelibrarywizardoptionpage.h \
+    wizards/mobilelibraryparameters.h \
     wizards/consoleappwizard.h \
     wizards/consoleappwizarddialog.h \
     wizards/libraryparameters.h \
@@ -75,6 +77,8 @@ SOURCES += qt4projectmanagerplugin.cpp \
     wizards/mobileapp.cpp \
     wizards/mobileappwizard.cpp \
     wizards/mobileappwizardpages.cpp \
+    wizards/mobilelibrarywizardoptionpage.cpp \
+    wizards/mobilelibraryparameters.cpp \
     wizards/consoleappwizard.cpp \
     wizards/consoleappwizarddialog.cpp \
     wizards/libraryparameters.cpp \
@@ -124,6 +128,7 @@ FORMS += makestep.ui \
     wizards/targetsetuppage.ui \
     wizards/qmlstandaloneappwizardsourcespage.ui \
     wizards/mobileappwizardoptionspage.ui \
+    wizards/mobilelibrarywizardoptionpage.ui \
     librarydetailswidget.ui
 RESOURCES += qt4projectmanager.qrc \
     wizards/wizards.qrc
diff --git a/src/plugins/qt4projectmanager/wizards/librarywizard.cpp b/src/plugins/qt4projectmanager/wizards/librarywizard.cpp
index e86de20dcd3..e9f415ee1aa 100644
--- a/src/plugins/qt4projectmanager/wizards/librarywizard.cpp
+++ b/src/plugins/qt4projectmanager/wizards/librarywizard.cpp
@@ -31,6 +31,7 @@
 #include "librarywizarddialog.h"
 #include "qt4projectmanager.h"
 #include "qt4projectmanagerconstants.h"
+#include "mobilelibraryparameters.h"
 
 #include <utils/codegeneration.h>
 #include <cpptools/cppmodelmanagerinterface.h>
@@ -82,6 +83,7 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
     const QtProjectParameters projectParams = dialog->parameters();
     const QString projectPath = projectParams.projectPath();
     const LibraryParameters params = dialog->libraryParameters();
+    const MobileLibraryParameters mobileParams = dialog->mobileLibraryParameters();
 
     const QString sharedLibExportMacro = QtProjectParameters::exportMacro(projectParams.fileName);
 
@@ -131,6 +133,8 @@ Core::GeneratedFiles LibraryWizard::generateFiles(const QWizard *w,
                << "\n\nHEADERS += " << headerFileName;
         if (!globalHeaderFileName.isEmpty())
             proStr << "\\\n        " << globalHeaderFileName << '\n';
+        if (mobileParams.type)
+            mobileParams.writeProFile(proStr);
     }
     profile.setContents(profileContents);
     rc.push_back(profile);
diff --git a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp
index 3e59e48f212..af64734f16a 100644
--- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp
+++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.cpp
@@ -31,6 +31,10 @@
 #include "filespage.h"
 #include "libraryparameters.h"
 #include "modulespage.h"
+#include "mobilelibrarywizardoptionpage.h"
+#include "mobilelibraryparameters.h"
+#include "abstractmobileapp.h"
+#include "qt4projectmanagerconstants.h"
 
 #include <utils/projectintropage.h>
 
@@ -134,8 +138,10 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
                                          QWidget *parent) :
     BaseQt4ProjectWizardDialog(showModulesPage, new LibraryIntroPage, -1, parent),
     m_filesPage(new FilesPage),
+    m_mobilePage(new MobileLibraryWizardOptionPage),
     m_pluginBaseClassesInitialized(false),
-    m_filesPageId(-1), m_modulesPageId(-1), m_targetPageId(-1)
+    m_filesPageId(-1), m_modulesPageId(-1), m_targetPageId(-1),
+    m_mobilePageId(-1)
 {
     setWindowIcon(icon);
     setWindowTitle(templateName);
@@ -155,6 +161,9 @@ LibraryWizardDialog::LibraryWizardDialog(const QString &templateName,
     m_filesPageId = addPage(m_filesPage);
     wizardProgress()->item(m_filesPageId)->setTitle(tr("Details"));
 
+    m_mobilePageId = addPage(m_mobilePage);
+    wizardProgress()->item(m_mobilePageId)->setTitle(tr("Symbian specific"));
+
     connect(this, SIGNAL(currentIdChanged(int)), this, SLOT(slotCurrentIdChanged(int)));
 
     foreach (QWizardPage *p, extensionPages)
@@ -171,6 +180,11 @@ void LibraryWizardDialog::setLowerCaseFiles(bool l)
     m_filesPage->setLowerCaseFiles(l);
 }
 
+void LibraryWizardDialog::setSymbianUid(const QString &uid)
+{
+    m_mobilePage->setSymbianUid(uid);
+}
+
 QtProjectParameters::Type  LibraryWizardDialog::type() const
 {
     return static_cast<const LibraryIntroPage*>(introPage())->type();
@@ -178,6 +192,18 @@ QtProjectParameters::Type  LibraryWizardDialog::type() const
 
 int LibraryWizardDialog::nextId() const
 {
+    //if there was no Symbian target defined we omit "Symbian specific" step
+    //we omit this step if the library type is not dll
+    if (currentId() == m_filesPageId) {
+        bool symbianTargetEnabled = isTargetSelected(QLatin1String(Constants::S60_DEVICE_TARGET_ID))
+                || isTargetSelected(QLatin1String(Constants::S60_EMULATOR_TARGET_ID));
+        if (!symbianTargetEnabled || type() != QtProjectParameters::SharedLibrary) {
+            QList<int> ids = pageIds();
+            int mobileIndex = ids.lastIndexOf(m_mobilePageId);
+            if (mobileIndex>=0)
+                return ids[mobileIndex+1];
+        }
+    }
     // When leaving the intro or target page, the modules page is skipped
     // in the case of a plugin since it knows its dependencies by itself.
     const int m_beforeModulesPageId = m_targetPageId != -1 ? m_targetPageId : 0;
@@ -215,13 +241,19 @@ void LibraryWizardDialog::slotCurrentIdChanged(int id)
 {
     if (debugLibWizard)
         qDebug() << Q_FUNC_INFO << id;
-    // Switching to files page: Set up base class accordingly (plugin)
-    if (id != m_filesPageId)
-        return;
+    if (id == m_filesPageId)
+        setupFilesPage();// Switching to files page: Set up base class accordingly (plugin)
+    else if (id == m_mobilePageId
+             || m_mobilePage->symbianUid().isEmpty() && currentPage()->isFinalPage())
+        setupMobilePage();
+}
+
+void LibraryWizardDialog::setupFilesPage()
+{
     switch (type()) {
     case QtProjectParameters::Qt4Plugin:
         if (!m_pluginBaseClassesInitialized) {
-             if (debugLibWizard)
+            if (debugLibWizard)
                 qDebug("initializing for plugins");
             QStringList baseClasses;
             const int pluginBaseClassCount = sizeof(pluginBaseClasses)/sizeof(PluginBaseClasses);
@@ -246,6 +278,12 @@ void LibraryWizardDialog::slotCurrentIdChanged(int id)
     }
 }
 
+void LibraryWizardDialog::setupMobilePage()
+{
+    m_mobilePage->setSymbianUid(AbstractMobileApp::symbianUidForPath(path()+projectName()));
+    m_mobilePage->setLibraryType(type());
+}
+
 LibraryParameters LibraryWizardDialog::libraryParameters() const
 {
     LibraryParameters rc;
@@ -260,5 +298,25 @@ LibraryParameters LibraryWizardDialog::libraryParameters() const
     return rc;
 }
 
+MobileLibraryParameters LibraryWizardDialog::mobileLibraryParameters() const
+{
+    MobileLibraryParameters mlp;
+    mlp.libraryType = type();
+    mlp.fileName = projectName();
+
+    //Symbian and Maemo stuff should always be added to pro file. Even if no mobile target is specified
+    mlp.type |= MobileLibraryParameters::Symbian|MobileLibraryParameters::Maemo;
+
+    if (mlp.type & MobileLibraryParameters::Symbian) {
+        mlp.symbianUid = m_mobilePage->symbianUid();
+        mlp.symbianCapabilities |= m_mobilePage->networkEnabled()?MobileLibraryParameters::NetworkServices:0;
+    }
+
+    if (mlp.type & MobileLibraryParameters::Maemo) {
+        //TODO fill this for Maemo
+    }
+    return mlp;
+}
+
 } // namespace Internal
 } // namespace Qt4ProjectManager
diff --git a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h
index 7188be13882..baba067b8c9 100644
--- a/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h
+++ b/src/plugins/qt4projectmanager/wizards/librarywizarddialog.h
@@ -38,7 +38,9 @@ namespace Internal {
 
 struct QtProjectParameters;
 class FilesPage;
+class MobileLibraryWizardOptionPage;
 struct LibraryParameters;
+struct MobileLibraryParameters;
 
 // Library wizard dialog.
 class LibraryWizardDialog : public BaseQt4ProjectWizardDialog
@@ -54,9 +56,11 @@ public:
 
     void setSuffixes(const QString &header, const QString &source,  const QString &form= QString());
     void setLowerCaseFiles(bool);
+    void setSymbianUid(const QString &uid);
 
     QtProjectParameters parameters() const;
     LibraryParameters libraryParameters() const;
+    MobileLibraryParameters mobileLibraryParameters() const;
 
     virtual int nextId() const;
 
@@ -65,12 +69,16 @@ private slots:
 
 private:
     QtProjectParameters::Type type() const;
+    void setupFilesPage();
+    void setupMobilePage();
 
     FilesPage *m_filesPage;
+    MobileLibraryWizardOptionPage *m_mobilePage;
     bool m_pluginBaseClassesInitialized;
     int m_filesPageId;
     int m_modulesPageId;
     int m_targetPageId;
+    int m_mobilePageId;
 };
 
 } // namespace Internal
diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp
new file mode 100644
index 00000000000..0d7fca93033
--- /dev/null
+++ b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.cpp
@@ -0,0 +1,119 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+
+#include "mobilelibraryparameters.h"
+#include "qtprojectparameters.h"
+
+#include <QtCore/QTextStream>
+
+namespace Qt4ProjectManager {
+namespace Internal {
+
+struct SymbianCapability {
+    const char *name;
+    const int value;
+};
+
+static const SymbianCapability symbianCapability[] =
+{
+    { "LocalServices", MobileLibraryParameters::LocalServices },
+    { "Location", MobileLibraryParameters::Location },
+    { "NetworkServices", MobileLibraryParameters::NetworkServices },
+    { "ReadUserData", MobileLibraryParameters::ReadUserData },
+    { "UserEnvironment", MobileLibraryParameters::UserEnvironment },
+    { "WriteUserData", MobileLibraryParameters::WriteUserData },
+    { "PowerMgmt", MobileLibraryParameters::PowerMgmt },
+    { "ProtServ", MobileLibraryParameters::ProtServ },
+    { "ReadDeviceData", MobileLibraryParameters::ReadDeviceData },
+    { "SurroundingsDD", MobileLibraryParameters::SurroundingsDD },
+    { "SwEvent", MobileLibraryParameters::SwEvent },
+    { "TrustedUI", MobileLibraryParameters::TrustedUI },
+    { "WriteDeviceData", MobileLibraryParameters::WriteDeviceData },
+    { "CommDD", MobileLibraryParameters::CommDD },
+    { "DiskAdmin", MobileLibraryParameters::DiskAdmin },
+    { "NetworkControl", MobileLibraryParameters::NetworkControl },
+    { "MultimediaDD", MobileLibraryParameters::MultimediaDD },
+    { "AllFiles", MobileLibraryParameters::AllFiles },
+    { "DRM", MobileLibraryParameters::DRM },
+    { "TCB", MobileLibraryParameters::TCB },
+
+};
+
+QString generateCapabilitySet(uint capabilities)
+{
+    const int symbianCapabilityCount = sizeof(symbianCapability)/sizeof(SymbianCapability);
+    QString capabilitySet;
+    for(int i = 0; i < symbianCapabilityCount; ++i)
+        if (capabilities&symbianCapability[i].value)
+            capabilitySet += QLatin1String(symbianCapability[i].name) + " ";
+    return capabilitySet;
+}
+
+MobileLibraryParameters::MobileLibraryParameters() :
+    type(0), libraryType(TypeNone), symbianCapabilities(CapabilityNone)
+{
+}
+
+void MobileLibraryParameters::writeProFile(QTextStream &str) const
+{
+    if (type&Symbian)
+        writeSymbianProFile(str);
+    if (type&Maemo)
+        writeMaemoProFile(str);
+}
+
+void MobileLibraryParameters::writeSymbianProFile(QTextStream &str) const
+{
+    if (libraryType != QtProjectParameters::SharedLibrary)
+        return; //nothing to do when the library is not shared library
+
+    str << "\n"
+           "symbian {\n"
+           "    #Symbian specific definitions\n"
+           "    MMP_RULES += EXPORTUNFROZEN\n"
+           "    TARGET.UID3 = " + symbianUid + "\n"
+           "    TARGET.CAPABILITY = " + generateCapabilitySet(symbianCapabilities).toAscii() + "\n"
+           "    TARGET.EPOCALLOWDLLDATA = 1\n"
+           "    BLD_INF_RULES.prj_exports += \"" + fileName + ".h\"\n"
+           "    BLD_INF_RULES.prj_exports += \"" + fileName + "_global.h\"\n"
+           "    addFiles.sources = " + fileName + ".dll\n"
+           "    addFiles.path = !:/sys/bin\n"
+           "    DEPLOYMENT += addFiles\n"
+           "}\n";
+}
+
+void MobileLibraryParameters::writeMaemoProFile(QTextStream &str) const
+{
+    str << "\n"
+           "maemo {\n" //TODO fill it for Maemo
+           "}\n";
+}
+
+} // namespace Internal
+} // namespace Qt4ProjectManager
diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h
new file mode 100644
index 00000000000..45011879c69
--- /dev/null
+++ b/src/plugins/qt4projectmanager/wizards/mobilelibraryparameters.h
@@ -0,0 +1,88 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+
+#ifndef MOBILELIBRARYPARAMETERS_H
+#define MOBILELIBRARYPARAMETERS_H
+
+#include <QtCore/QString>
+
+QT_BEGIN_NAMESPACE
+class QTextStream;
+QT_END_NAMESPACE
+
+namespace Qt4ProjectManager {
+namespace Internal {
+
+// Additional parameters required for creating mobile
+// libraries
+struct MobileLibraryParameters {
+    enum Type { TypeNone = 0, Symbian = 0x1, Maemo = 0x2 };
+    enum Capability {
+        CapabilityNone  = 0,
+        LocalServices   = 1 << 0,
+        Location        = 1 << 1,
+        NetworkServices = 1 << 2,
+        ReadUserData    = 1 << 3,
+        UserEnvironment = 1 << 4,
+        WriteUserData   = 1 << 5,
+        PowerMgmt       = 1 << 6,
+        ProtServ        = 1 << 7,
+        ReadDeviceData  = 1 << 8,
+        SurroundingsDD  = 1 << 9,
+        SwEvent         = 1 << 10,
+        TrustedUI       = 1 << 11,
+        WriteDeviceData = 1 << 12,
+        CommDD          = 1 << 13,
+        DiskAdmin       = 1 << 14,
+        NetworkControl  = 1 << 15,
+        MultimediaDD    = 1 << 16,
+        AllFiles        = 1 << 17,
+        DRM             = 1 << 18,
+        TCB             = 1 << 19
+    };
+
+    MobileLibraryParameters();
+    void writeProFile(QTextStream &str) const;
+
+private:
+    void writeSymbianProFile(QTextStream &str) const;
+    void writeMaemoProFile(QTextStream &str) const;
+
+public:
+    uint type;
+    uint libraryType;
+    QString fileName;
+
+    QString symbianUid;
+    uint symbianCapabilities;
+};
+
+} // namespace Internal
+} // namespace Qt4ProjectManager
+#endif // MOBILELIBRARYPARAMETERS_H
diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp
new file mode 100644
index 00000000000..e1d175bc384
--- /dev/null
+++ b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.cpp
@@ -0,0 +1,89 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+
+#include "MobileLibraryWizardOptionPage.h"
+#include "ui_mobilelibrarywizardoptionpage.h"
+#include "qtprojectparameters.h"
+
+#include <coreplugin/coreconstants.h>
+
+#include <QtGui/QDesktopServices>
+#include <QtGui/QFileDialog>
+#include <QtGui/QMessageBox>
+
+namespace Qt4ProjectManager {
+namespace Internal {
+
+class MobileLibraryWizardOptionPagePrivate
+{
+    Ui::MobileLibraryWizardOptionPage ui;
+    friend class MobileLibraryWizardOptionPage;
+
+    QtProjectParameters::Type libraryType;
+};
+
+MobileLibraryWizardOptionPage::MobileLibraryWizardOptionPage(QWidget *parent)
+    : QWizardPage(parent)
+    , m_d(new MobileLibraryWizardOptionPagePrivate)
+{
+    m_d->ui.setupUi(this);
+}
+
+MobileLibraryWizardOptionPage::~MobileLibraryWizardOptionPage()
+{
+    delete m_d;
+}
+
+QString MobileLibraryWizardOptionPage::symbianUid() const
+{
+    return m_d->ui.symbianTargetUid3LineEdit->text();
+}
+
+void MobileLibraryWizardOptionPage::setSymbianUid(const QString &uid)
+{
+    m_d->ui.symbianTargetUid3LineEdit->setText(uid);
+}
+
+void MobileLibraryWizardOptionPage::setNetworkEnabled(bool enableIt)
+{
+    m_d->ui.symbianEnableNetworkChackBox->setChecked(enableIt);
+}
+
+bool MobileLibraryWizardOptionPage::networkEnabled() const
+{
+    return m_d->ui.symbianEnableNetworkChackBox->isChecked();
+}
+
+void MobileLibraryWizardOptionPage::setLibraryType(int type)
+{
+    m_d->libraryType = static_cast<QtProjectParameters::Type>(type);
+}
+
+} // namespace Internal
+} // namespace Qt4ProjectManager
diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h
new file mode 100644
index 00000000000..56af8d02ce2
--- /dev/null
+++ b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.h
@@ -0,0 +1,60 @@
+/**************************************************************************
+**
+** This file is part of Qt Creator
+**
+** Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+**
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** Commercial Usage
+**
+** Licensees holding valid Qt Commercial licenses may use this file in
+** accordance with the Qt Commercial License Agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and Nokia.
+**
+** GNU Lesser General Public License Usage
+**
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file.  Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** If you are unsure which license is appropriate for your use, please
+** contact the sales department at http://qt.nokia.com/contact.
+**
+**************************************************************************/
+
+#ifndef MOBILELIBRARYWIZARDOPTIONPAGE_H
+#define MOBILELIBRARYWIZARDOPTIONPAGE_H
+
+#include <QtGui/QWizardPage>
+
+namespace Qt4ProjectManager {
+namespace Internal {
+
+class MobileLibraryWizardOptionPage : public QWizardPage
+{
+    Q_OBJECT
+    Q_DISABLE_COPY(MobileLibraryWizardOptionPage)
+
+public:
+    explicit MobileLibraryWizardOptionPage(QWidget *parent = 0);
+    virtual ~MobileLibraryWizardOptionPage();
+
+    void setSymbianUid(const QString &uid);
+    QString symbianUid() const;
+    void setNetworkEnabled(bool enableIt);
+    bool networkEnabled() const;
+    void setLibraryType(int type);
+
+private:
+    class MobileLibraryWizardOptionPagePrivate *m_d;
+};
+
+} // end of namespace Internal
+} // end of namespace Qt4ProjectManager
+
+#endif // MOBILELIBRARYWIZARDOPTIONPAGE_H
diff --git a/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui
new file mode 100644
index 00000000000..76d3e725992
--- /dev/null
+++ b/src/plugins/qt4projectmanager/wizards/mobilelibrarywizardoptionpage.ui
@@ -0,0 +1,93 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>MobileLibraryWizardOptionPage</class>
+ <widget class="QWizardPage" name="MobileLibraryWizardOptionPage">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>404</width>
+    <height>548</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>WizardPage</string>
+  </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <widget class="QFrame" name="frame">
+     <property name="frameShape">
+      <enum>QFrame::StyledPanel</enum>
+     </property>
+     <property name="frameShadow">
+      <enum>QFrame::Raised</enum>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout">
+      <item>
+       <layout class="QFormLayout" name="formLayout">
+        <item row="1" column="0">
+         <widget class="QCheckBox" name="symbianEnableNetworkChackBox">
+          <property name="text">
+           <string>Enable network access</string>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="0">
+         <widget class="QLabel" name="symbianTargetUid3Label">
+          <property name="sizePolicy">
+           <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
+            <horstretch>0</horstretch>
+            <verstretch>0</verstretch>
+           </sizepolicy>
+          </property>
+          <property name="text">
+           <string>Target UID3:</string>
+          </property>
+          <property name="buddy">
+           <cstring>symbianTargetUid3LineEdit</cstring>
+          </property>
+         </widget>
+        </item>
+        <item row="0" column="1">
+         <layout class="QHBoxLayout" name="horizontalLayout_3">
+          <item>
+           <widget class="QLineEdit" name="symbianTargetUid3LineEdit"/>
+          </item>
+          <item>
+           <spacer name="horizontalSpacer_2">
+            <property name="orientation">
+             <enum>Qt::Horizontal</enum>
+            </property>
+            <property name="sizeHint" stdset="0">
+             <size>
+              <width>40</width>
+              <height>20</height>
+             </size>
+            </property>
+           </spacer>
+          </item>
+         </layout>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
-- 
GitLab