Remove deprecated inputItem and inputWindow from QInputMethod
[profile/ivi/qtbase.git] / src / gui / kernel / qplatformtheme.cpp
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the QtGui module of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
20 **
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
28 **
29 ** Other Usage
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #include "qplatformtheme.h"
43
44 #include <QtCore/QVariant>
45 #include <QtCore/QStringList>
46 #include <qpalette.h>
47 #include <qtextformat.h>
48
49 QT_BEGIN_NAMESPACE
50
51 /*!
52     \class QPlatformTheme
53     \since 5.0
54     \internal
55     \preliminary
56     \ingroup qpa
57     \brief The QPlatformTheme class allows customizing the UI based on themes.
58
59 */
60
61 /*!
62     \enum QPlatformTheme::ThemeHint
63
64     This enum describes the available theme hints.
65
66     \value CursorFlashTime (int) Cursor flash time in ms, overriding
67                                  QPlatformIntegration::styleHint.
68
69     \value KeyboardInputInterval (int) Keyboard input interval in ms, overriding
70                                  QPlatformIntegration::styleHint.
71
72     \value MouseDoubleClickInterval (int) Mouse double click interval in ms,
73                                     overriding QPlatformIntegration::styleHint.
74
75     \value StartDragDistance (int) Start drag distance,
76                              overriding QPlatformIntegration::styleHint.
77
78     \value StartDragTime (int) Start drag time in ms,,
79                                overriding QPlatformIntegration::styleHint.
80
81     \value KeyboardAutoRepeatRate (int) Keyboard auto repeat rate,
82                                   overriding QPlatformIntegration::styleHint.
83
84     \value PasswordMaskDelay (int) Pass word mask delay in ms,,
85                                    overriding QPlatformIntegration::styleHint.
86
87     \value StartDragVelocity (int) Velocity of a drag,
88                                    overriding QPlatformIntegration::styleHint.
89
90     \value TextCursorWidth  (int) Determines the width of the text cursor.
91
92     \value DropShadow       (bool) Determines whether the drop shadow effect for
93                             tooltips or whatsthis is enabled.
94
95     \value MaximumScrollBarDragDistance (int) Determines the value returned by
96                             QStyle::pixelMetric(PM_MaximumDragDistance)
97
98     \value ToolButtonStyle (int) A value representing a Qt::ToolButtonStyle.
99
100     \value ToolBarIconSize Icon size for tool bars.
101
102     \value SystemIconThemeName (QString) Name of the icon theme.
103
104     \value SystemIconFallbackThemeName (QString) Name of the fallback icon theme.
105
106     \value IconThemeSearchPaths (QStringList) Search paths for icons.
107
108     \value ItemViewActivateItemOnSingleClick (bool) Activate items by single click.
109
110     \value StyleNames (QStringList) A list of preferred style names.
111
112     \value WindowAutoPlacement (bool) A boolean value indicating whether Windows
113                                (particularly dialogs) are placed by the system
114                                (see _NET_WM_FULL_PLACEMENT in X11).
115
116     \value DialogButtonBoxLayout (int) An integer representing a
117                                  QDialogButtonBox::ButtonLayout value.
118
119     \value DialogButtonBoxButtonsHaveIcons (bool) A boolean value indicating whether
120                                             the buttons of a QDialogButtonBox should have icons.
121
122     \value UseFullScreenForPopupMenu (bool) Pop menus can cover the full screen including task bar.
123
124     \value KeyboardScheme (int) An integer value (enum KeyboardSchemes) specifying the
125                            keyboard scheme.
126
127     \value UiEffects (int) A flag value consisting of UiEffect values specifying the enabled UI animations.
128
129     \value SpellCheckUnderlineStyle (int) A QTextCharFormat::UnderlineStyle specifying
130                                     the underline style used misspelled words when spell checking.
131
132     \sa themeHint(), QStyle::pixelMetric()
133 */
134
135 QPlatformTheme::~QPlatformTheme()
136 {
137
138 }
139
140 bool QPlatformTheme::usePlatformNativeDialog(DialogType type) const
141 {
142     Q_UNUSED(type);
143     return false;
144 }
145
146 QPlatformDialogHelper *QPlatformTheme::createPlatformDialogHelper(DialogType type) const
147 {
148     Q_UNUSED(type);
149     return 0;
150 }
151
152 const QPalette *QPlatformTheme::palette(Palette type) const
153 {
154     Q_UNUSED(type)
155     return 0;
156 }
157
158 const QFont *QPlatformTheme::font(Font type) const
159 {
160     Q_UNUSED(type)
161     return 0;
162 }
163
164 QVariant QPlatformTheme::themeHint(ThemeHint hint) const
165 {
166     return QPlatformTheme::defaultThemeHint(hint);
167 }
168
169 QVariant QPlatformTheme::defaultThemeHint(ThemeHint hint)
170 {
171     switch (hint) {
172     case QPlatformTheme::CursorFlashTime:
173         return QVariant(1000);
174     case QPlatformTheme::KeyboardInputInterval:
175         return QVariant(400);
176     case QPlatformTheme::KeyboardAutoRepeatRate:
177         return QVariant(30);
178     case QPlatformTheme::MouseDoubleClickInterval:
179         return QVariant(400);
180     case QPlatformTheme::StartDragDistance:
181         return QVariant(10);
182     case QPlatformTheme::StartDragTime:
183         return QVariant(500);
184     case QPlatformTheme::PasswordMaskDelay:
185         return QVariant(int(0));
186     case QPlatformTheme::StartDragVelocity:
187         return QVariant(int(0)); // no limit
188     case QPlatformTheme::UseFullScreenForPopupMenu:
189         return QVariant(false);
190     case QPlatformTheme::WindowAutoPlacement:
191         return QVariant(false);
192     case QPlatformTheme::DialogButtonBoxLayout:
193         return QVariant(int(0));
194     case QPlatformTheme::DialogButtonBoxButtonsHaveIcons:
195         return QVariant(false);
196     case QPlatformTheme::ItemViewActivateItemOnSingleClick:
197         return QVariant(false);
198     case QPlatformTheme::ToolButtonStyle:
199         return QVariant(int(Qt::ToolButtonIconOnly));
200     case QPlatformTheme::ToolBarIconSize:
201         return QVariant(int(0));
202     case QPlatformTheme::SystemIconThemeName:
203     case QPlatformTheme::SystemIconFallbackThemeName:
204         return QVariant(QString());
205     case QPlatformTheme::IconThemeSearchPaths:
206         return QVariant(QStringList());
207     case QPlatformTheme::StyleNames:
208         return QVariant(QStringList());
209     case TextCursorWidth:
210         return QVariant(1);
211     case DropShadow:
212         return QVariant(false);
213     case MaximumScrollBarDragDistance:
214         return QVariant(-1);
215     case KeyboardScheme:
216         return QVariant(int(WindowsKeyboardScheme));
217     case UiEffects:
218         return QVariant(int(0));
219     case SpellCheckUnderlineStyle:
220         return QVariant(int(QTextCharFormat::SpellCheckUnderline));
221     }
222     return QVariant();
223 }
224
225 QPlatformMenuItem *QPlatformTheme::createPlatformMenuItem() const
226 {
227     return 0;
228 }
229
230 QPlatformMenu *QPlatformTheme::createPlatformMenu() const
231 {
232     return 0;
233 }
234
235 QPlatformMenuBar *QPlatformTheme::createPlatformMenuBar() const
236 {
237     return 0;
238 }
239
240 #ifndef QT_NO_SYSTEMTRAYICON
241 /*!
242    Factory function for QSystemTrayIcon. This function will return 0 if the platform
243    integration does not support creating any system tray icon.
244 */
245 QPlatformSystemTrayIcon *QPlatformTheme::createPlatformSystemTrayIcon() const
246 {
247     return 0;
248 }
249 #endif
250
251 QT_END_NAMESPACE