equal
deleted
inserted
replaced
1 /**************************************************************************** |
1 /**************************************************************************** |
2 ** |
2 ** |
3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). |
3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). |
4 ** All rights reserved. |
4 ** All rights reserved. |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
5 ** Contact: Nokia Corporation (qt-info@nokia.com) |
6 ** |
6 ** |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
7 ** This file is part of the QtGui module of the Qt Toolkit. |
8 ** |
8 ** |
61 #ifndef QT_NO_SOFTKEYMANAGER |
61 #ifndef QT_NO_SOFTKEYMANAGER |
62 QT_BEGIN_NAMESPACE |
62 QT_BEGIN_NAMESPACE |
63 |
63 |
64 class QSoftKeyManagerPrivate; |
64 class QSoftKeyManagerPrivate; |
65 |
65 |
|
66 const char MENU_ACTION_PROPERTY[] = "_q_menuaction"; |
|
67 |
66 class Q_AUTOTEST_EXPORT QSoftKeyManager : public QObject |
68 class Q_AUTOTEST_EXPORT QSoftKeyManager : public QObject |
67 { |
69 { |
68 Q_OBJECT |
70 Q_OBJECT |
69 Q_DECLARE_PRIVATE(QSoftKeyManager) |
71 Q_DECLARE_PRIVATE(QSoftKeyManager) |
70 |
72 |
77 MenuSoftKey, |
79 MenuSoftKey, |
78 CancelSoftKey |
80 CancelSoftKey |
79 }; |
81 }; |
80 |
82 |
81 static void updateSoftKeys(); |
83 static void updateSoftKeys(); |
82 static QAction *createAction(StandardSoftKey standardKey, QWidget *actionWidget); |
|
83 static QAction *createKeyedAction(StandardSoftKey standardKey, Qt::Key key, QWidget *actionWidget); |
|
84 |
|
85 #ifdef Q_WS_S60 |
84 #ifdef Q_WS_S60 |
86 static bool handleCommand(int); |
85 static bool handleCommand(int); |
87 #endif |
86 #endif |
88 |
87 |
89 private: |
88 static QAction *createAction(StandardSoftKey standardKey, QWidget *actionWidget); |
90 QSoftKeyManager(); |
89 static QAction *createKeyedAction(StandardSoftKey standardKey, Qt::Key key, QWidget *actionWidget); |
91 static QSoftKeyManager *instance(); |
90 static QString standardSoftKeyText(StandardSoftKey standardKey); |
92 static const char *standardSoftKeyText(StandardSoftKey standardKey); |
|
93 |
91 |
94 protected: |
92 protected: |
95 bool event(QEvent *e); |
93 bool event(QEvent *e); |
96 |
94 |
97 Q_DISABLE_COPY(QSoftKeyManager) |
95 private: |
|
96 QSoftKeyManager(); |
|
97 static QSoftKeyManager *instance(); |
|
98 bool appendSoftkeys(const QWidget &source, int level); |
|
99 QWidget *softkeySource(QWidget *previousSource, bool& recursiveMerging); |
|
100 bool handleUpdateSoftKeys(); |
98 |
101 |
99 private Q_SLOTS: |
102 private Q_SLOTS: |
100 void cleanupHash(QObject* obj); |
103 void cleanupHash(QObject* obj); |
101 void sendKeyEvent(); |
104 void sendKeyEvent(); |
|
105 |
|
106 private: |
|
107 Q_DISABLE_COPY(QSoftKeyManager) |
102 }; |
108 }; |
103 |
109 |
104 QT_END_NAMESPACE |
110 QT_END_NAMESPACE |
105 #endif //QT_NO_SOFTKEYMANAGER |
111 #endif //QT_NO_SOFTKEYMANAGER |
106 |
112 |