MuseScore  3.4
Music composition and notation
scoreaccessibility.h
Go to the documentation of this file.
1 #ifndef __SCORE_ACCESSIBILITY__
2 #define __SCORE_ACCESSIBILITY__
3 
4 #include <QStatusBar>
5 #include <QAccessible>
6 #include <QAccessibleWidget>
7 #include "scoreview.h"
8 
9 namespace Ms {
10 
11 //---------------------------------------------------------
12 // AccessibleScoreView
13 //---------------------------------------------------------
14 
15 class AccessibleScoreView : public QObject, QAccessibleWidget {
16  Q_OBJECT
18 
19  public:
21  int childCount() const Q_DECL_OVERRIDE;
22  QAccessibleInterface* child(int /*index*/) const Q_DECL_OVERRIDE;
23  QAccessibleInterface* parent() const Q_DECL_OVERRIDE;
24  QRect rect() const Q_DECL_OVERRIDE;
25  QAccessible::Role role() const Q_DECL_OVERRIDE;
26  QString text(QAccessible::Text t) const Q_DECL_OVERRIDE;
27  QWindow* window() const Q_DECL_OVERRIDE;
28  static QAccessibleInterface* ScoreViewFactory(const QString &classname, QObject *object);
29  };
30 
31 //---------------------------------------------------------
32 // ScoreAccessibility
33 //---------------------------------------------------------
34 
35 class ScoreAccessibility : public QObject {
36  Q_OBJECT
37 
39  QMainWindow* mainWindow;
40  QLabel* statusBarLabel;
41  ScoreAccessibility(QMainWindow* statusBar);
42  std::pair<int, float>barbeat(Element* e);
43  int _oldStaff = -1;
44  int _oldBar = -1;
45 
46  public:
48  void updateAccessibilityInfo();
49  void clearAccessibilityInfo();
50  static void createInstance(QMainWindow* statusBar);
51  static ScoreAccessibility* instance();
52  void currentInfoChanged();
53  static void makeReadable(QString&);
54  };
55 
56 }
57 
58 #endif
static QAccessibleInterface * ScoreViewFactory(const QString &classname, QObject *object)
Definition: scoreaccessibility.cpp:75
QAccessible::Role role() const Q_DECL_OVERRIDE
Definition: scoreaccessibility.cpp:54
Definition: scoreview.h:90
int childCount() const Q_DECL_OVERRIDE
Definition: scoreaccessibility.cpp:34
static ScoreAccessibility * inst
Definition: scoreaccessibility.h:38
Base class of score layout elements.
Definition: element.h:158
QRect rect() const Q_DECL_OVERRIDE
Definition: scoreaccessibility.cpp:49
ScoreView * s
Definition: scoreaccessibility.h:17
QAccessibleInterface * parent() const Q_DECL_OVERRIDE
Definition: scoreaccessibility.cpp:44
QLabel * statusBarLabel
Definition: scoreaccessibility.h:40
Definition: scoreaccessibility.h:15
QMainWindow * mainWindow
Definition: scoreaccessibility.h:39
Definition: aeolus.cpp:26
Definition: scoreaccessibility.h:35
QString text(QAccessible::Text t) const Q_DECL_OVERRIDE
Definition: scoreaccessibility.cpp:59
QAccessibleInterface * child(int) const Q_DECL_OVERRIDE
Definition: scoreaccessibility.cpp:39
QWindow * window() const Q_DECL_OVERRIDE
Definition: scoreaccessibility.cpp:71
AccessibleScoreView(ScoreView *c)
Definition: scoreaccessibility.cpp:28
Definition: text.h:24