1 //=============================================================================
2 //  MuseScore
3 //  Music Composition & Notation
4 //
5 //  Copyright (C) 2002-2011 Werner Schweer
6 //
7 //  This program is free software; you can redistribute it and/or modify
8 //  it under the terms of the GNU General Public License version 2
9 //  as published by the Free Software Foundation and appearing in
10 //  the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __TEXTTOOLS_H__
14 #define __TEXTTOOLS_H__
15 
16 namespace Ms {
17 
18 class TextBase;
19 class TextCursor;
20 class EditData;
21 class ScoreView;
22 
23 //---------------------------------------------------------
24 //   TextTools
25 //---------------------------------------------------------
26 
27 class TextTools : public QDockWidget {
28       Q_OBJECT
29 
30       TextBase* text;
31       TextCursor* cursor;
32 
33       QToolBar* toolbar;
34       QDoubleSpinBox* typefaceSize;
35       QFontComboBox* typefaceFamily;
36       QAction* typefaceBold;
37       QAction* typefaceItalic;
38       QAction* typefaceUnderline;
39       QAction* typefaceSubscript;
40       QAction* typefaceSuperscript;
41       QAction* showKeyboard;
42 
43       void blockAllSignals(bool val);
44       void updateText();
45       void layoutText();
46 
47    private slots:
48       void sizeChanged(double value);
49       void fontChanged(const QFont&);
50       void boldClicked(bool);
51       void italicClicked(bool);
52       void underlineClicked(bool);
53       void subscriptClicked(bool);
54       void superscriptClicked(bool);
55       void showKeyboardClicked(bool);
56 
57    protected:
58       void changeEvent(QEvent*);
59       void retranslate();
60 
61    public:
62       TextTools(QWidget* parent = 0);
63       void updateTools(EditData&);
kbAction()64       QAction* kbAction() const      { return showKeyboard; }
65       void toggleBold();
66       void toggleItalic();
67       void toggleUnderline();
68       TextBase* textElement();
69       };
70 }
71 
72 #endif
73 
74