Canorus
0.7
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
src
drawable
drawablecontext.h
Go to the documentation of this file.
1
8
#ifndef DRAWABLECONTEXT_H_
9
#define DRAWABLECONTEXT_H_
10
11
#include <QList>
12
13
#include "
drawable/drawable.h
"
14
#include "
drawable/drawablemuselement.h
"
15
16
class
CAContext
;
17
18
class
CADrawableContext
:
public
CADrawable
{
19
public
:
20
enum
CADrawableContextType
{
21
DrawableStaff
,
22
DrawableLyricsContext
,
23
DrawableFunctionMarkContext
24
};
25
26
CADrawableContext
(
CAContext
*c,
double
x,
double
y);
27
inline
CAContext
*
context
() {
return
_context
; }
28
CADrawableContextType
drawableContextType
() {
return
_drawableContextType
; }
29
inline
virtual
void
addMElement
(
CADrawableMusElement
*elt) {
30
int
i;
31
for
(i=
_drawableMusElementList
.size()-1; (i>=0) &&
_drawableMusElementList
[i]->
xPos
()>elt->
xPos
(); i--);
32
_drawableMusElementList
.insert( ++i, elt);
33
}
34
virtual
int
removeMElement
(
CADrawableMusElement
*elt) {
return
_drawableMusElementList
.removeAll(elt); }
35
CADrawableMusElement
*
lastDrawableMusElement
() {
if
(
_drawableMusElementList
.size())
return
_drawableMusElementList
.last();
else
return
0; }
36
virtual
CADrawableContext
*
clone
() = 0;
37
QList<CADrawableMusElement*>&
drawableMusElementList
() {
return
_drawableMusElementList
; }
38
39
inline
CADrawableMusElement
*
findMElement
(
CAMusElement
* elt) {
40
for
(
int
i=0; i<
_drawableMusElementList
.size(); i++)
41
if
(
_drawableMusElementList
[i]->musElement()==elt)
42
return
_drawableMusElementList
[i];
43
return
0;
44
}
45
46
QList<CADrawableMusElement*>
findInRange
(
double
x1,
double
x2 );
47
48
protected
:
49
void
setDrawableContextType
(
CADrawableContextType
type ) {
_drawableContextType
= type; }
50
51
CADrawableContextType
_drawableContextType
;
52
CAContext
*
_context
;
53
QList<CADrawableMusElement *>
_drawableMusElementList
;
// List of all the drawable musElements in this context sorted by their left borders
54
};
55
56
#endif
/* DRAWABLECONTEXT_H_ */
Generated on Fri Jan 11 2013 14:40:12 for Canorus by
1.8.3