]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/horizontal-align-item.hh
da0794d760e1b595f9a39978f20219fae6e84499
[lilypond.git] / lily / include / horizontal-align-item.hh
1 /*
2   horizontal-align-item.hh -- declare Horizontal_align_item
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef HORIZONTAL_ALIGN_ITEM_HH
11 #define HORIZONTAL_ALIGN_ITEM_HH
12
13 #include "item.hh"
14
15 /**
16   Order elems left to right.
17
18   
19
20   TODO: insert (order, elem)
21   */
22 class Horizontal_align_item : public Item {
23 protected:
24     Link_array<Item> item_l_arr_;
25     Array<int> priority_i_arr_;
26     
27 public:
28     Item * center_l_;
29     /**
30       Which side to align? 
31       -1: left side, 0: centered (around center_l_ if not nil), 1: right side
32      */
33     int align_i_;
34         
35     DECLARE_MY_RUNTIME_TYPEINFO;
36     SCORE_ELEM_CLONE(Horizontal_align_item);
37     void add (Item*, int p);
38     Horizontal_align_item();
39 protected:
40     
41     virtual void do_substitute_dependency (Score_elem * , Score_elem *);
42     /// do calculations before determining horizontal spacing
43     virtual void do_pre_processing();
44     virtual void do_print() const;
45     virtual Interval do_width() const;
46     bool contains_b (Item*) const;
47 };
48 #endif // HORIZONTAL_ALIGN_ITEM_HH