00001 #ifndef YLINESCONSTRAINTS_H
00002 #define YLINESCONSTRAINTS_H
00003 #include <qptrlist.h>
00004 #include <qvaluelist.h>
00005 #include <qstring.h>
00006 #include "../painter/Painter.h"
00007 #include "../MS/MusicSymbol.h"
00008 #define YLINESKIP 20
00009 #define YPARTSKIP 20
00010 #define YSTAFFSKIP 20
00011
00012 void testYLinesConstraint();
00013
00014
00015
00023 class YStaffConstraint{
00024 int staffIndex;
00025 double y;
00026 double height;
00027 int beginMeasureSectionIndex;
00028 QPtrList<MusicSymbol> attachedSymbols;
00029 public:
00030 void draw(Painter * p);
00031 void attachMusicSymbol(MusicSymbol *);
00032 YStaffConstraint(double,int );
00033 double getHeight();
00034 double getY();
00035 int getBeginMeasureSectionIndex();
00036 void setBeginMeasureSectionIndex(int);
00037 void moveY(double);
00038 double getYBaseLine();
00039 QString toString();
00040 };
00041
00050 class YPartConstraint:public QPtrList<YStaffConstraint>{
00051 double y;
00052 double height;
00053 int partIndex;
00054 bool modified;
00055 public:
00056 void draw(Painter * p);
00057 bool isModified();
00058 YPartConstraint(double,int );
00059 YStaffConstraint * getStaff(int);
00060 double getHeight();
00061 double getY();
00062 void setY(double);
00063 QString toString();
00064 };
00065
00073 class YLineConstraint:public QPtrList<YPartConstraint>{
00074 double y;
00075 double height;
00076 int lineIndex;
00080 bool modified;
00081 public:
00082 void draw(Painter * p);
00083 YLineConstraint(double,int);
00084 double getYStaffBaseLine(int,int);
00085 double getHeight();
00086 double getY();
00087 void setY(double);
00088 QString toString();
00089 YPartConstraint * getPart(int);
00090 };
00096 class Header{
00097 bool modified;
00098 double y;
00099 double yMax;
00100 public:
00101 Header(double y);
00102 void setMax (double);
00103 double getWorkTitleY();
00104 double getWorkNumberY();
00105 double getCreatorsY();
00106 double getYEndHeader();
00107 bool isModified();
00108 void touch();
00109 };
00110
00119 class YLinesConstraint:public QPtrList<YLineConstraint>{
00120 double y;
00121 double height;
00122 bool modified;
00123 Header * header;
00124 void recomputeAfterHeader();
00125 protected:
00126 YLineConstraint * getLine(int);
00127 public:
00128 double getYLine(int lineindex);
00129 double getHeight();
00130 double getY();
00131 void draw(Painter * p);
00132 Header * getHeader();
00133 void attachMusicSymbol(int lineIndex,int partIndex,int stafIndex,MusicSymbol *);
00134 void setBeginMeasureSectionIndex(int lineIndex,int partIndex,int stafIndex,int mesureSectionIndex);
00135 int getBeginMeasureSectionIndex(int lineIndex,int partIndex,int stafIndex);
00136 double getYStaffBaseLine(int lineindex,int partindex,int staffindex);
00137 double getLastYStaffBaseLine();
00138 QString toString();
00139 YLinesConstraint(double);
00140 };
00141
00142 #endif