1 //=============================================================================
2 //  MuseScore
3 //  Music Composition & Notation
4 //
5 //  Copyright (C) 2010-2014 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 //  as published by the Free Software Foundation and appearing in
10 //  the file LICENCE.GPL
11 //=============================================================================
12 
13 #ifndef __EDITSTAFFTYPE_H__
14 #define __EDITSTAFFTYPE_H__
15 
16 #include "ui_editstafftype.h"
17 #include "ui_stafftypetemplates.h"
18 #include "libmscore/mscore.h"
19 #include "libmscore/stafftype.h"
20 
21 namespace Ms {
22 
23 class ScoreView;
24 class StaffType;
25 class Staff;
26 
27 //---------------------------------------------------------
28 //   EditStaffType
29 //---------------------------------------------------------
30 
31 class EditStaffType : public QDialog, private Ui::EditStaffType {
32       Q_OBJECT
33 
34       Staff* staff;
35       StaffType staffType;
36 
37       virtual void hideEvent(QHideEvent *);
38       void blockSignals(bool block);
39 
40       void setFromDlg();
41 
42       void tabStemsCompatibility(bool checked);
43       void tabMinimShortCompatibility(bool checked);
44       void tabStemThroughCompatibility(bool checked);
45       QString createUniqueStaffTypeName(StaffGroup group);
46       void setValues();
47 
48    private slots:
49       void nameEdited(const QString&);
50       void durFontNameChanged(int idx);
51       void fretFontNameChanged(int idx);
52       void tabStemThroughToggled(bool checked);
53       void tabMinimShortToggled(bool checked);
54       void tabStemsToggled(bool checked);
55       void updatePreview();
56 
57       void savePresets();
58       void loadPresets();
59       void resetToTemplateClicked();
60       void addToTemplatesClicked();
61 //      void staffGroupChanged(int);
62 
63    public:
64       EditStaffType(QWidget* parent, Staff*);
~EditStaffType()65       ~EditStaffType() {}
getStaffType()66       const StaffType* getStaffType() const { return &staffType; }
67       };
68 
69 //---------------------------------------------------------
70 //   StaffTypeTemplates
71 //---------------------------------------------------------
72 
73 class StaffTypeTemplates : public QDialog, private Ui::StaffTypeTemplates {
74       Q_OBJECT
75 
76    public:
77       StaffTypeTemplates(const StaffType&, QWidget* parent = 0);
78       StaffType* staffType() const;
79       };
80 
81 } // namespace Ms
82 #endif
83 
84