]> git.donarmstrong.com Git - lilypond.git/blob - lily/include/request.hh
release: 1.1.1
[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
21 /** An atom of musical information.  This is an abstract class for any
22   piece of music that does not contain other Music.
23   
24   Hungarian postfix: req
25
26  */
27 class Request : public Music {
28
29 public:
30     
31   virtual ~Request(){}
32
33   DECLARE_MY_RUNTIME_TYPEINFO;
34   VIRTUAL_COPY_CONS(Request,Music);
35     
36   bool equal_b (Request*) const;
37 protected:
38   virtual bool do_equal_b (Request*) const;
39   virtual void do_print() const;
40 };
41
42
43 #define REQUESTMETHODS(T)       \
44 DECLARE_MY_RUNTIME_TYPEINFO;\
45 VIRTUAL_COPY_CONS(T, Request);\
46 virtual void do_print() const
47
48
49
50 /** Put a script above or below this ``note'' or bar. eg upbow, downbow. Why
51   a request? These symbols may conflict with slurs and brackets, so
52   this also a request */
53
54 class Script_req  : public virtual Request { 
55 public:
56   Direction dir_;
57   General_script_def *scriptdef_p_;
58   
59   bool do_equal_b (Request*) const;
60
61   Script_req();
62   REQUESTMETHODS(Script_req);
63   ~Script_req();
64   Script_req (Script_req const&);
65 };
66
67
68 /**
69   Requests to start or stop something.
70  This type of request typically results in the creation of a #Spanner#
71 */
72 class Span_req  : public virtual Request  {
73 public:
74   /// should the spanner start or stop, or is it unwanted?
75   enum Spantype {
76     NOSPAN, START, STOP
77   } spantype;
78   bool do_equal_b (Request*) const;
79   REQUESTMETHODS(Span_req);
80
81   Span_req();
82 };
83
84
85 #endif