Small clean of subtitles applet code.
[mafwsubrenderer] / qmafw-gst-subtitles-renderer / applet / subtitleswidget.h
1 /*
2  *  Subtitles control panel applet.
3  *  Copyright (C) 2011 Roman Moravcik
4  *
5  *  Based on Battery applet from meegotouch-controlpanelapplets
6  *  Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
7  *
8  *  This program is free software; you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation; either version 2 of the License, or
11  *  (at your option) any later version.
12  *
13  *  This program is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with this program; if not, write to the Free Software
20  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
21  */
22
23 #ifndef SUBTITLESWIDGET_H
24 #define SUBTITLESWIDGET_H
25
26 #include <DcpStylableWidget>
27
28 #include <MLinearLayoutPolicy>
29 #include <MLabel>
30 #include <MButton>
31 #include <MComboBox>
32
33 #include <QSettings>
34
35 class SubtitlesWidget : public DcpStylableWidget
36 {
37     Q_OBJECT
38
39 public:
40     SubtitlesWidget (QGraphicsWidget *parent = 0);
41     ~SubtitlesWidget ();
42     bool back ();
43
44 protected:
45     void initWidget();
46
47 private slots:
48     void AutoloadSubtitlesToggled (bool enabled);
49     void RegularStyleButtonToggled (bool toggled);
50     void ItalicStyleButtonToggled (bool toggled);
51     void BoldStyleButtonToggled (bool toggled);
52     void SubtitlesFontSizeActivated (int index);
53     void SubtitlesEncodingActivated (int index);
54
55 private:
56     void addHeaderContainer ();
57     void addAutoloadSubtitlesContainer ();
58     void addSubtitlesFontStyleContainer ();
59     void addSubtitlesFontSizeContainer ();
60     void addSubtitlesEncodingContainer ();
61
62     void retranslateUi ();
63
64 private:
65     MLinearLayoutPolicy     *m_MainLayout;
66     MLabel                  *m_TitleLabel;
67     MButton                 *m_AutoloadSubtitlesSwitch;
68     MLabel                  *m_FontStyleLabel;
69     MButton                 *m_RegularStyleButton;
70     MButton                 *m_ItalicStyleButton;
71     MButton                 *m_BoldStyleButton;
72     MComboBox               *m_SubtitlesFontSizeCombo;
73     MComboBox               *m_SubtitlesEncodingCombo;
74     QSettings               *m_SubtitlesSettings;
75 };
76
77 #endif // SUBTITLESWIDGET_H