bcbedf0ef520598a9e97981e0f198856ac24131e
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / applet / subtitlesapplet.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (directui@nokia.com)
6 **
7 ** This file is part of meegotouch-controlpanelapplets.
8 **
9 ** If you have questions regarding the use of this file, please contact
10 ** Nokia at directui@nokia.com.
11 **
12 ** This library is free software; you can redistribute it and/or
13 ** modify it under the terms of the GNU Lesser General Public
14 ** License version 2.1 as published by the Free Software Foundation
15 ** and appearing in the file LICENSE.LGPL included in the packaging
16 ** of this file.
17 **
18 ****************************************************************************/
19 #include "subtitlesapplet.h"
20 #include "subtitleswidget.h"
21
22 #include "dcpsubtitles.h"
23
24 #include <dcpwidget.h>
25
26 #include <QtGui>
27 #include <MAction>
28
29 #include <MLibrary>
30 M_LIBRARY
31
32 Q_EXPORT_PLUGIN2(subtitlesapplet, SubtitlesApplet)
33
34 SubtitlesApplet::SubtitlesApplet () :
35         m_MainWidget (0)
36 {
37 }
38
39 SubtitlesApplet::~SubtitlesApplet ()
40 {
41 }
42
43 void SubtitlesApplet::init ()
44 {
45 }
46
47 DcpStylableWidget *
48 SubtitlesApplet::constructStylableWidget (int widgetId)
49 {
50     Q_UNUSED (widgetId);
51     /*
52      * Please note that the m_MainWidget is a QPointer that will nullify itself
53      * when the widget is destroyed. Then we need to create a new one when we
54      * asked for it.
55      */
56     if (m_MainWidget == NULL)
57         m_MainWidget = new SubtitlesWidget ();
58
59     return m_MainWidget;
60 }
61
62 QString SubtitlesApplet::title() const
63 {
64     return qtTrId ("Subtitles");
65 }
66
67 QVector<MAction*>
68 SubtitlesApplet::viewMenuItems ()
69 {
70     QVector<MAction*> vector;
71
72     return vector;
73 }
74
75 DcpBrief*
76 SubtitlesApplet::constructBrief (int partId)
77 {
78     Q_UNUSED (partId);
79     return 0;
80 }