lilypond-0.1.15
[lilypond.git] / hdr / request.hh
blob1936d5a2abf0fe3e7972859874b27508c99cf908
1 /*
2 request.hh -- declare Request baseclasses.
4 source file of the LilyPond music typesetter
6 (c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
9 #ifndef REQUEST_HH
10 #define REQUEST_HH
11 // LilyPond's second egg of columbus!
13 #include "glob.hh"
14 #include "string.hh"
15 #include "moment.hh"
16 #include "class-name.hh"
18 /**
19 a voice element wants something printed.
20 Hungarian postfix: req
21 @see lilygut manpage
23 class Request {
24 public:
25 Voice_element*elt_l_;
26 char const* defined_ch_c_l_;
28 /* *************** */
29 Voice * voice_l();
30 Request();
31 Request(Request const&);
32 virtual ~Request(){}
34 NAME_MEMBERS(Request);
35 virtual Request* clone() const { return new Request(*this); }
36 void print()const ;
38 virtual Moment duration() const { return 0; }
40 /* accessors for children
41 maybe checkout RTTI
43 virtual Barcheck_req *barcheck() { return 0; }
44 virtual Note_req *note() { return 0;}
45 virtual Script_req *script() { return 0;}
46 virtual Stem_req *stem() { return 0;}
47 virtual Text_req*text() { return 0; }
48 virtual Rest_req *rest() { return 0; }
49 virtual Span_req *span() { return 0; }
50 virtual Beam_req *beam() { return 0 ; }
51 virtual Plet_req* plet() { return 0; }
52 virtual Slur_req *slur() { return 0 ; }
53 virtual Rhythmic_req*rhythmic() { return 0; }
54 virtual Lyric_req* lreq_l() { return 0; }
55 virtual Melodic_req *melodic() { return 0; }
56 virtual Terminate_voice_req *terminate() {return 0;}
57 virtual Group_change_req * groupchange() { return 0;}
58 virtual Group_feature_req * groupfeature() { return 0; }
59 virtual Spacing_req * spacing() { return 0; }
60 virtual Blank_req * blank() { return 0; }
61 virtual Musical_req *musical() { return 0; }
62 virtual Command_req * command() { return 0; }
63 protected:
64 virtual void do_print()const ;
67 #define REQUESTMETHODS(T,accessor) \
68 virtual T * accessor() { return this;}\
69 NAME_MEMBERS(T);\
70 virtual Request *clone() const { return new T(*this); } \
71 virtual void do_print() const
73 #endif