Warning, file /sdk/lokalize/src/actionproxy.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001 /* 0002 This file is part of Lokalize 0003 0004 SPDX-FileCopyrightText: 2008-2014 Nick Shaforostoff <shafff@ukr.net> 0005 SPDX-FileCopyrightText: 2018-2019 Simon Depiets <sdepiets@gmail.com> 0006 0007 SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL 0008 */ 0009 0010 #ifndef ACTIONPROXY_H 0011 #define ACTIONPROXY_H 0012 0013 #include <QObject> 0014 #include <QKeySequence> 0015 #include <QMap> 0016 #include <QVector> 0017 0018 class QLabel; 0019 class QStatusBar; 0020 0021 #if 0 0022 0023 /** 0024 * used for connecting qactions to subwindows: 0025 * forwards signals and saves/restores state on subwindow switch 0026 */ 0027 class ActionProxy: public QObject 0028 { 0029 Q_OBJECT 0030 0031 public: 0032 ActionProxy(QObject* parent, QObject* receiver = 0, const char* slot = 0); 0033 ~ActionProxy(); 0034 0035 void registerAction(QAction*); 0036 void unregisterAction(/*QAction**/); 0037 0038 void setStatusTip(const QString& st) 0039 { 0040 m_statusTip = st; //for TM suggestions 0041 } 0042 QKeySequence shortcut() 0043 { 0044 return m_keySequence; 0045 };//for TM suggestions 0046 0047 public Q_SLOTS: 0048 void setDisabled(bool); 0049 void setEnabled(bool enabled) 0050 { 0051 setDisabled(!enabled); 0052 } 0053 void setChecked(bool); 0054 0055 private Q_SLOTS: 0056 void handleToggled(bool); 0057 0058 Q_SIGNALS: 0059 void triggered(bool = false); 0060 void toggled(bool); 0061 0062 private: 0063 QAction* m_currentAction; 0064 bool m_disabled; 0065 bool m_checked; 0066 QString m_statusTip; 0067 QKeySequence m_keySequence; 0068 }; 0069 0070 #endif 0071 0072 class StatusBarProxy: public QMap<int, QString> 0073 { 0074 public: 0075 StatusBarProxy(): m_currentStatusBar(nullptr) {} 0076 ~StatusBarProxy() {} 0077 0078 void insert(int, const QString&); 0079 0080 void registerStatusBar(QStatusBar*, const QVector<QLabel*>& statusBarLabels); 0081 void unregisterStatusBar() 0082 { 0083 m_currentStatusBar = nullptr; 0084 } 0085 0086 private: 0087 QStatusBar* m_currentStatusBar; 0088 QVector<QLabel*> m_statusBarLabels; 0089 }; 0090 0091 0092 #define ID_STATUS_CURRENT 0 0093 #define ID_STATUS_TOTAL 1 0094 #define ID_STATUS_FUZZY 2 0095 #define ID_STATUS_UNTRANS 3 0096 #define ID_STATUS_ISFUZZY 4 0097 #define ID_STATUS_PROGRESS 5 0098 //#define TOTAL_ID_STATUSES 6 0099 //#define ID_STATUS_READONLY 6 0100 //#define ID_STATUS_CURSOR 7 0101 0102 #endif