MuseScore  3.4
Music composition and notation
editstyle.h
Go to the documentation of this file.
1 //=============================================================================
2 // MusE Score
3 // Linux Music Score Editor
4 //
5 // Copyright (C) 2002-2010 Werner Schweer and others
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 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 //=============================================================================
19 
20 #ifndef __EDITSTYLE_H__
21 #define __EDITSTYLE_H__
22 
23 #include "ui_editstyle.h"
24 #include "globals.h"
25 #include "libmscore/mscore.h"
26 #include "libmscore/style.h"
27 
28 namespace Ms {
29 
30 class Score;
31 class EditStyle;
32 
33 //---------------------------------------------------------
34 // StyleWidget
35 //---------------------------------------------------------
36 
37 struct StyleWidget {
40  QObject* widget;
41  QToolButton* reset;
42  };
43 
44 //---------------------------------------------------------
45 // EditStylePage
48 //---------------------------------------------------------
49 
50 typedef QWidget* EditStyle::* EditStylePage;
51 
52 //---------------------------------------------------------
53 // EditStyle
54 //---------------------------------------------------------
55 
56 class EditStyle : public QDialog, private Ui::EditStyleBase {
57  Q_OBJECT
58 
60  QPushButton* buttonApplyToAllParts;
61  QButtonGroup* stemGroups[VOICES];
62  QVector<StyleWidget> styleWidgets;
63  QButtonGroup* keySigNatGroup;
64  QButtonGroup* clefTypeGroup;
65  bool isTooBig;
66  bool hasShown;
67 
68  virtual void showEvent(QShowEvent*);
69  virtual void hideEvent(QHideEvent*);
70  QVariant getValue(Sid idx);
71  void setValues();
72 
73  void applyToAllParts();
74  const StyleWidget& styleWidget(Sid) const;
75 
76  static const std::map<ElementType, EditStylePage> PAGES;
77 
78  private slots:
79  void selectChordDescriptionFile();
80  void setChordStyle(bool);
81  void toggleHeaderOddEven(bool);
82  void toggleFooterOddEven(bool);
83  void buttonClicked(QAbstractButton*);
84  void setSwingParams(bool);
85  void concertPitchToggled(bool);
86  void lyricsDashMinLengthValueChanged(double);
87  void lyricsDashMaxLengthValueChanged(double);
88  void systemMinDistanceValueChanged(double);
89  void systemMaxDistanceValueChanged(double);
90  void resetStyleValue(int);
91  void valueChanged(int);
92  void textStyleChanged(int);
93  void resetTextStyle(Pid);
94  void textStyleValueChanged(Pid, QVariant);
95  void on_comboFBFont_currentIndexChanged(int index);
96  void on_buttonTogglePagelist_clicked();
97  void editUserStyleName();
98  void endEditUserStyleName();
99  void resetUserStyleName();
100 
101  public:
102  EditStyle(Score*, QWidget*);
103  void setPage(int no);
104  void setScore(Score* s) { cs = s; }
105 
106  void gotoElement(Element* e);
107  static bool elementHasPage(Element* e);
108  };
109 
110 
111 } // namespace Ms
112 #endif
QPushButton * buttonApplyToAllParts
Definition: editstyle.h:60
Pid
Definition: property.h:62
QButtonGroup * keySigNatGroup
Definition: editstyle.h:63
QButtonGroup * clefTypeGroup
Definition: editstyle.h:64
Base class of score layout elements.
Definition: element.h:158
bool showPercent
Definition: editstyle.h:39
QWidget *EditStyle::* EditStylePage
This is a type for a pointer to any QWidget that is a member of EditStyle.
Definition: editstyle.h:50
Definition: score.h:391
void setScore(Score *s)
Definition: editstyle.h:104
QObject * widget
Definition: editstyle.h:40
#define VOICES
Definition: mscore.h:72
QVector< StyleWidget > styleWidgets
Definition: editstyle.h:62
Definition: editstyle.h:37
static const std::map< ElementType, EditStylePage > PAGES
This is a map of element type to pages, to allow the creation of a &#39;Style...&#39; menu for every possible...
Definition: editstyle.h:76
Score * cs
Definition: editstyle.h:59
QToolButton * reset
Definition: editstyle.h:41
Definition: aeolus.cpp:26
Sid
Definition: style.h:33
bool isTooBig
Definition: editstyle.h:65
Sid idx
Definition: editstyle.h:38
Definition: editstyle.h:56
bool hasShown
Definition: editstyle.h:66