]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/line-spacer.hh
patch::: 1.2.13.jcn4
[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 "interval.hh"
15
16 /**
17   abstract interface to Line spacing.
18
19   TODO
20   add estimate of "force" or energy.
21  */
22
23 class Line_spacer 
24 {
25     
26 public:
27   Real indent_f_;
28   Real line_len_f_;
29   Real default_space_f_;
30
31   Line_spacer();
32     
33   /** solve the spacing problem
34    */
35   virtual void solve (Column_x_positions *) const=0;
36
37   /**
38     Approximate the spacing problem:
39     return a lower bound on the energy
40     */
41   virtual void lower_bound_solution (Column_x_positions *) const=0;
42    
43
44   /**
45      Define the problem. LINELEN < 0 signifies natural width spacing.
46    */
47
48   virtual void add_columns (Link_array<Paper_column>)=0;
49   virtual void OK() const{}
50   virtual void print() const{}
51     
52   /**
53     Call after construction before solving
54     */
55   virtual void prepare(){}
56   virtual ~Line_spacer ();
57 };
58
59 #endif