]> git.lyx.org Git - lyx.git/blob - src/RowFlags.h
Avoid null pointer dereference
[lyx.git] / src / RowFlags.h
1 // -*- C++ -*-
2 /**
3  * \file RowFlags.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Jean-Marc Lasgouttes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef ROWFLAGS_H
13 #define ROWFLAGS_H
14
15 // Do not include anything here
16
17 namespace lyx {
18
19 /* The list of possible flags, that can be combined.
20  * Some flags that should logically be here (e.g.,
21  * CanBreakBefore), do not exist. This is because the need has not
22  * been identitfied yet.
23  *
24  * Priorities when before/after disagree:
25  *      AlwaysBreak* > NoBreak* > Break* or CanBreak*.
26  */
27 enum RowFlags {
28         // Do not break before or after this element, except if really
29         // needed (between NoBreak* and CanBreak*).
30         Inline = 0,
31         // break row before this element if the row is not empty
32         BreakBefore = 1 << 0,
33         // Avoid breaking row before this element
34         NoBreakBefore = 1 << 1,
35         // flush the row before this element (useful with BreakBefore)
36         FlushBefore = 1 << 2,
37         // force new (maybe empty) row after this element
38         AlwaysBreakAfter = 1 << 3,
39         // break row after this element if there are more elements
40         BreakAfter = 1 << 4,
41         // break row whenever needed after this element
42         CanBreakAfter = 1 << 5,
43         // Avoid breaking row after this element
44         NoBreakAfter = 1 << 6,
45         // The contents of the row may be broken in two (e.g. string)
46         CanBreakInside = 1 << 7,
47         // Flush the row that ends with this element
48         Flush = 1 << 8,
49         // specify an alignment (left, right) for a display element
50         // (default is center)
51         AlignLeft = 1 << 9,
52         AlignRight = 1 << 10,
53         // A display element breaks row at both ends
54         Display = FlushBefore | BreakBefore | BreakAfter,
55         // Flags that concern breaking after element
56         AfterFlags = AlwaysBreakAfter | BreakAfter | CanBreakAfter | NoBreakAfter
57 };
58
59 } // namespace lyx
60
61 #endif