]> git.lyx.org Git - lyx.git/blob - src/box.h
Partial fix bug 2092: branches not propagated to child documents
[lyx.git] / src / box.h
1 // -*- C++ -*-
2 /**
3  * \file box.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef BOX_H
13 #define BOX_H
14
15 #include <iosfwd>
16
17 /**
18  * A simple class representing rectangular regions.
19  * It is expected that the box be constructed in
20  * normalised form, that is to say : x1,y1 is top-left,
21  * x2,y2 is bottom-right.
22  *
23  * Negative values are allowed.
24  */
25 class Box {
26 public:
27         int x1;
28         int x2;
29         int y1;
30         int y2;
31
32         /// Zero-initialise the member variables.
33         Box();
34         /// Initialise the member variables.
35         Box(int x1_, int x2_, int y1_, int y2_);
36
37         /**
38          * Returns true if the given co-ordinates are within
39          * the box. Check is exclusive (point on a border
40          * returns false).
41          */
42         bool contains(int x, int y);
43 };
44
45
46 std::ostream & operator<<(std::ostream &, Box const &);
47
48 #endif // BOX_H