lilypond-1.1.21
[lilypond.git] / hdr / register.hh
blobda80db38fe4efc1a053dc0b864ba0e91a0688a3a
1 /*
2 register.hh -- part of LilyPond
4 (c) 1996,1997 Han-Wen Nienhuys <hanwen@stack.nl>
5 */
7 #ifndef REGISTER_HH
8 #define REGISTER_HH
10 #include "proto.hh"
11 #include "varray.hh"
12 #include "request.hh"
13 #include "staff-elem-info.hh"
15 /**
16 a struct which processes requests, and creates the #Staff_elem#s.
17 It may use derived classes. Hungarian postfix: register
19 class Request_register {
20 friend class Register_group_register;
21 /**
22 You cannot copy a Request_register
24 Request_register(const Request_register&){}
25 protected:
27 /// utility
28 virtual Paper_def * paper() const;
30 /**
31 try to fit the request in this register
33 @return
34 false: not noted, not taken.
36 true: request swallowed. Don't try to put the request elsewhere.
39 Default: always return false
41 virtual bool try_request(Request *req_l);
43 /// make items/spanners with the requests you got
44 virtual void process_requests(){}
46 /** typeset any items/spanners. Default: do nothing
48 virtual void pre_move_processing(){}
49 /** reset any appropriate data. Default: do nothing
51 virtual void post_move_processing(){}
53 /**
54 Is this request eligible to be processed? Default: return false.
56 virtual bool acceptable_request_b(Request*) const;
58 /**
59 typeset a "command" item. Default: pass on to daddy.
60 If the column is not breakable, #pre_p# and #post_p# are junked
62 virtual void typeset_breakable_item(Item * pre_p ,
63 Item * nobreak_p, Item * post_p);
64 /**
65 Invoke walker method to typeset element. Default: pass on to daddy.
67 virtual void typeset_element(Staff_elem*elem_p);
69 /**
70 take note of item/spanner
71 put item in spanner. Adjust local key; etc.
73 Default: ignore the info
75 virtual void acknowledge_element(Staff_elem_info) {}
76 /**
77 Announce element. Default: pass on to daddy. Utility
79 virtual void announce_element(Staff_elem_info);
80 /**
81 Set features of the register(s). Default: ignore features.
83 virtual void set_feature(Features){}
84 /**
85 Does this equal or contain a certain register?
87 virtual bool contains_b(Request_register*reg_l);
88 /**
89 Get information on the staff. Default: ask daddy.
91 virtual Staff_info get_staff_info();
93 virtual void do_print()const;
94 public:
95 /** Every Request_register (except for the 'top' which is directly
96 inside the Staff_walker, is a element of a group. */
97 Register_group_register * daddy_reg_l_;
99 Request_register();
100 virtual ~Request_register(){}
101 NAME_MEMBERS(Request_register);
102 void print() const;
106 #endif // REGISTER_HH