|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (developer.feedback@nokia.com) |
|
6 ** |
|
7 ** This file is part of the HbApps module of the UI Extensions for Mobile. |
|
8 ** |
|
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 file. |
|
13 ** Please review the following information to ensure the GNU Lesser General |
|
14 ** 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 ** If you have questions regarding the use of this file, please contact |
|
22 ** Nokia at developer.feedback@nokia.com. |
|
23 ** |
|
24 ****************************************************************************/ |
|
25 #ifndef THEMESELECTIONLIST_H |
|
26 #define THEMESELECTIONLIST_H |
|
27 |
|
28 #include <QDir> |
|
29 #include <QModelIndex> |
|
30 #include <QStandardItemModel> |
|
31 #include <QFileSystemWatcher> |
|
32 #include <QTime> |
|
33 #include <hbview.h> |
|
34 #include <hblistwidget.h> |
|
35 |
|
36 #ifdef Q_OS_SYMBIAN |
|
37 #include "themeclientsymbian.h" |
|
38 #else |
|
39 #include "themeclientqt.h" |
|
40 #endif |
|
41 #include "themechangerdefs.h" |
|
42 |
|
43 class HbIcon; |
|
44 |
|
45 class ThemeSelectionList:public HbView |
|
46 { |
|
47 Q_OBJECT |
|
48 public: |
|
49 |
|
50 #ifdef Q_OS_SYMBIAN |
|
51 ThemeSelectionList(ThemeClientSymbian* client); |
|
52 #else |
|
53 ThemeSelectionList(ThemeClientQt* client); |
|
54 #endif |
|
55 |
|
56 ~ThemeSelectionList(); |
|
57 signals: |
|
58 void newThemeSelected(const QString &newthemepath); |
|
59 public slots: |
|
60 void displayThemes(); |
|
61 void setChosen(HbListWidgetItem *item); |
|
62 void applySelection(); |
|
63 void updateThemeList(const QString &path); |
|
64 void sendThemeName(const QString& name); |
|
65 #ifdef THEME_CHANGER_TIMER_LOG |
|
66 void processWhenIdle(); |
|
67 void themeChanged(); |
|
68 #endif |
|
69 |
|
70 protected: |
|
71 bool event(QEvent *e); |
|
72 void resizeEvent(QResizeEvent* event); |
|
73 private: |
|
74 static QStringList rootPaths(); |
|
75 QDir dir; |
|
76 int oldItemIndex; |
|
77 HbListWidget *themelist; |
|
78 HbIcon* rightMark; |
|
79 HbIcon* noMark; |
|
80 HbAction *action; |
|
81 #ifdef Q_OS_SYMBIAN |
|
82 ThemeClientSymbian* client; |
|
83 #else |
|
84 ThemeClientQt* client; |
|
85 #endif |
|
86 |
|
87 QFileSystemWatcher *watcher; |
|
88 QString iCurrentTheme; |
|
89 #ifdef THEME_CHANGER_TIMER_LOG |
|
90 QTime timer; |
|
91 QTimer *idleTimer; |
|
92 #endif |
|
93 }; |
|
94 #endif //THEMESELECTIONLIST_H |