]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/request.hh
partial: 1.0.1.jcn
[lilypond.git] / lily / include / request.hh
1 /*
2   request.hh -- declare Request baseclasses.
3
4   source file of the GNU LilyPond music typesetter
5
6   (c)  1997--1998 Han-Wen Nienhuys <hanwen@stack.nl>
7 */
8
9 #ifndef REQUEST_HH
10 #define REQUEST_HH
11
12
13 #include "string.hh"
14 #include "moment.hh"
15 #include "virtual-methods.hh"
16 #include "input.hh"
17 #include "music.hh"
18 #include "direction.hh"
19
20 /**
21  a voice element wants something printed.
22  Hungarian postfix: req
23  @see lilygut manpage
24  */
25 class Request : public Music {
26
27 public:
28     
29     /* *************** */
30
31     virtual ~Request(){}
32
33     DECLARE_MY_RUNTIME_TYPEINFO;
34     VIRTUAL_COPY_CONS(Request,Music);
35     
36     virtual MInterval time_int() const;
37     virtual Moment duration() const { return 0; }
38
39     /*  accessors for children
40         maybe checkout RTTI
41      */
42     virtual Barcheck_req *barcheck() { return 0; }
43     virtual Script_req *script() { return 0;}
44     virtual Span_req *span() { return 0; }
45     virtual Spacing_req * spacing() { return 0; }
46     virtual Blank_req * blank() { return 0; }
47     virtual Musical_req *musical() { return 0; }
48     virtual Command_req * command() { return 0; }
49     bool equal_b (Request*) const;
50 protected:
51     virtual bool do_equal_b (Request*) const;
52     virtual void do_print() const;
53 };
54
55 #define REQUESTMETHODS(T,accessor)      \
56 virtual T * accessor() { return this;}\
57 DECLARE_MY_RUNTIME_TYPEINFO;\
58 VIRTUAL_COPY_CONS(T, Request);\
59 virtual void do_print() const
60
61
62
63 /** Put a script above or below this ``note'' or bar. eg upbow, downbow. Why
64   a request? These symbols may conflict with slurs and brackets, so
65   this also a request */
66 class Script_req  : public virtual Request { 
67 public:
68     Direction dir_;
69     General_script_def *scriptdef_p_;
70
71     /* *************** */
72     bool do_equal_b (Request*) const;
73
74     Script_req();
75     REQUESTMETHODS(Script_req,script);
76     ~Script_req();
77     Script_req (Script_req const&);
78 };
79
80     
81 #endif