]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/line-spacer.hh
release: 1.2.8
[lilypond.git] / lily / include / line-spacer.hh
1 /*
2   line-spacer.hh -- declare Line_spacer
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1999 Han-Wen Nienhuys <hanwen@cs.uu.nl>
7 */
8
9
10 #ifndef LINE_SPACER_HH
11 #define LINE_SPACER_HH
12 #include "lily-proto.hh"
13 #include "array.hh"
14 #include "vector.hh"
15 #include "interval.hh"
16
17 /**
18   abstract interface to Line spacing.
19
20   TODO
21   add estimate of "force" or energy.
22  */
23
24 class Line_spacer 
25 {
26     
27 public:
28   Real indent_f_;
29   Real line_len_f_;
30   Real default_space_f_;
31
32   Line_spacer();
33     
34   /** solve the spacing problem
35    */
36   virtual void solve (Column_x_positions *) const=0;
37
38   /**
39     Approximate the spacing problem:
40     return a lower bound on the energy
41     */
42   virtual void lower_bound_solution (Column_x_positions *) const=0;
43    
44
45   /**
46      Define the problem. LINELEN < 0 signifies natural width spacing.
47    */
48
49   virtual void add_columns (Link_array<Paper_column>)=0;
50   virtual void OK() const{}
51   virtual void print() const{}
52     
53   /**
54     Call after construction before solving
55     */
56   virtual void prepare(){}
57   virtual ~Line_spacer ();
58 };
59
60 #endif