Added DUI control panel applet
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / applet / subtitlesapplet.cpp
diff --git a/qmafw-gst-subtitles-renderer/applet/subtitlesapplet.cpp b/qmafw-gst-subtitles-renderer/applet/subtitlesapplet.cpp
new file mode 100644 (file)
index 0000000..bcbedf0
--- /dev/null
@@ -0,0 +1,80 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (directui@nokia.com)
+**
+** This file is part of meegotouch-controlpanelapplets.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at directui@nokia.com.
+**
+** This library is free software; you can redistribute it and/or
+** modify it 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.
+**
+****************************************************************************/
+#include "subtitlesapplet.h"
+#include "subtitleswidget.h"
+
+#include "dcpsubtitles.h"
+
+#include <dcpwidget.h>
+
+#include <QtGui>
+#include <MAction>
+
+#include <MLibrary>
+M_LIBRARY
+
+Q_EXPORT_PLUGIN2(subtitlesapplet, SubtitlesApplet)
+
+SubtitlesApplet::SubtitlesApplet () :
+        m_MainWidget (0)
+{
+}
+
+SubtitlesApplet::~SubtitlesApplet ()
+{
+}
+
+void SubtitlesApplet::init ()
+{
+}
+
+DcpStylableWidget *
+SubtitlesApplet::constructStylableWidget (int widgetId)
+{
+    Q_UNUSED (widgetId);
+    /*
+     * Please note that the m_MainWidget is a QPointer that will nullify itself
+     * when the widget is destroyed. Then we need to create a new one when we
+     * asked for it.
+     */
+    if (m_MainWidget == NULL)
+        m_MainWidget = new SubtitlesWidget ();
+
+    return m_MainWidget;
+}
+
+QString SubtitlesApplet::title() const
+{
+    return qtTrId ("Subtitles");
+}
+
+QVector<MAction*>
+SubtitlesApplet::viewMenuItems ()
+{
+    QVector<MAction*> vector;
+
+    return vector;
+}
+
+DcpBrief*
+SubtitlesApplet::constructBrief (int partId)
+{
+    Q_UNUSED (partId);
+    return 0;
+}