]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/elem-group.hh
c49c425a45e3493cfdbb2ff47c9f5d8f08861c32
[lilypond.git] / lily / include / elem-group.hh
1 /*
2   elem-group.hh -- declare Horizontal_vertical_group
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9
10 #ifndef ELEM_GROUP_HH
11 #define ELEM_GROUP_HH
12 #include "score-elem.hh"
13
14 class Elbement_group: public virtual Score_elem {
15 protected:
16     Link_array<Score_elem> elem_l_arr_;
17     
18     virtual void do_print() const ;
19 public:
20     Elbement_group();
21     bool contains_b(Score_elem const *)const;
22     void add_element(Score_elem*);
23     NAME_MEMBERS();
24        
25 };
26
27 class Horizontal_group : public Elbement_group {
28 public:
29     NAME_MEMBERS();
30     Horizontal_group(Horizontal_group const&);
31     Horizontal_group(){}
32     void add_element(Score_elem*);
33 protected:
34     virtual void do_substitute_dependency(Score_elem*,Score_elem*);
35     virtual void do_print() const ;
36   virtual void translate_x(Real);
37     virtual Interval do_width()const;
38 };
39
40 class Vertical_group : public Elbement_group {
41 protected:
42     virtual void translate_y(Real);
43     virtual void do_print() const ;
44   virtual Interval do_height()const;
45     virtual void do_substitute_dependency(Score_elem*,Score_elem*);
46     void add_element(Score_elem*);
47 public:
48     Vertical_group(Vertical_group const &);
49     Vertical_group(){}
50     NAME_MEMBERS();
51 };
52
53 /** A class to treat a group of elements as a single entity. The
54   dimensions are the unions of the dimensions of what it contains.
55   Translation means translating the contents.
56   */
57 class Horizontal_vertical_group : public Vertical_group, 
58                                   public Horizontal_group 
59 {  
60 protected:
61     virtual Horizontal_vertical_group* elem_group() { return this; }
62 public:
63     Element_group();
64     bool contains_b(Score_elem const *)const;
65     NAME_MEMBERS();
66     virtual void do_substitute_dependency(Score_elem*,Score_elem*);
67     virtual void do_print() const;
68     void add_element(Score_elem*);
69 };
70
71 #endif // ELEM_GROUP_HH