lilypond-0.0.40
[lilypond.git] / hdr / break.hh
blob7d17470228d7a59756f25a1e6a9a91aae358f377
1 /*
2 break.hh -- part of LilyPond
4 (c) 1996,97 Han-Wen Nienhuys
5 */
7 #ifndef BREAK_HH
8 #define BREAK_HH
9 #include "varray.hh"
10 #include "proto.hh"
11 #include "colhpos.hh"
13 struct Break_algorithm {
14 PScore &pscore_;
15 Real linelength;
17 /* *************** */
19 Break_algorithm(PScore&);
21 /// check if the spacing/breaking problem is well-stated
22 void problem_OK()const;
24 /// search all pcols which are breakable.
25 Line_of_cols find_breaks() const;
27 /// helper: solve for the columns in #curline#.
28 Col_hpositions solve_line(Line_of_cols) const;
30 /// does curline fit on the paper?
31 bool feasible(Line_of_cols)const;
33 virtual Array<Col_hpositions> solve()=0;
36 /// wordwrap type algorithm: move to next line if current is optimal.
37 struct Word_wrap : Break_algorithm {
38 virtual Array<Col_hpositions> solve();
39 Word_wrap(PScore&);
41 #endif // BREAK_HH