]> git.lyx.org Git - lyx.git/blob - src/func_status.h
Fixed getMaxWidth() in insetminipage if the width is a percentage and fixed
[lyx.git] / src / func_status.h
1 // -*- C++ -*-
2 #ifndef FUNC_STATUS_H
3 #define FUNC_STATUS_H
4
5 /// The status of a function.
6 namespace func_status {
7
8 enum value_type {
9                 /// No problem
10                 OK = 0,
11                 ///
12                 Unknown = 1,
13                 /// Command cannot be executed
14                 Disabled = 2,
15                 ///
16                 ToggleOn = 4,
17                 ///
18                 ToggleOff = 8
19         };
20
21         inline
22         void toggle(value_type & flag, bool b)
23         {
24                 flag = static_cast<value_type>(flag | (b ? ToggleOn : ToggleOff));
25         }
26 }
27
28 ///
29 inline
30 void operator|=(func_status::value_type & fs, func_status::value_type f)
31 {
32         fs = static_cast<func_status::value_type>(fs | f);
33 }
34
35 #endif