]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/request.hh
release: 1.0.8
[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@cs.uu.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 #define DEFAULTACCESSOR(T)  virtual T *access_ ## T () { return 0; }
21
22
23 /**
24    An atom of musical information .
25  Hungarian postfix: req
26  @see lilygut manpage
27  */
28 class Request : public Music {
29
30 public:
31     
32   /* *************** */
33
34   virtual ~Request(){}
35
36   DECLARE_MY_RUNTIME_TYPEINFO;
37   VIRTUAL_COPY_CONS(Request,Music);
38     
39   virtual MInterval time_int() const;
40   virtual Moment duration() const { return 0; }
41
42   /*  accessors for children
43       maybe checkout RTTI
44   */
45
46   DEFAULTACCESSOR(Barcheck_req)
47   DEFAULTACCESSOR(Script_req)
48   DEFAULTACCESSOR(Span_req)
49   DEFAULTACCESSOR(Spacing_req)
50   DEFAULTACCESSOR(Musical_req)
51   DEFAULTACCESSOR(Command_req)
52     
53   bool equal_b (Request*) const;
54 protected:
55   virtual bool do_equal_b (Request*) const;
56   virtual void do_print() const;
57 };
58
59
60 #define REQUESTMETHODS(T)       \
61 virtual T * access_ ## T() { return this;}\
62 DECLARE_MY_RUNTIME_TYPEINFO;\
63 VIRTUAL_COPY_CONS(T, Request);\
64 virtual void do_print() const
65
66
67
68 /** Put a script above or below this ``note'' or bar. eg upbow, downbow. Why
69   a request? These symbols may conflict with slurs and brackets, so
70   this also a request */
71
72 class Script_req  : public virtual Request { 
73 public:
74   Direction dir_;
75   General_script_def *scriptdef_p_;
76   
77   bool do_equal_b (Request*) const;
78
79   Script_req();
80   REQUESTMETHODS(Script_req);
81   ~Script_req();
82   Script_req (Script_req const&);
83 };
84
85     
86 #endif