Consider the case where there is not any layout name.
[lyx.git] / src / FuncStatus.h
blob054b7db81849ff565dbb36f1d237984aea58b4fa
1 // -*- C++ -*-
2 /**
3 * \file FuncStatus.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Jean-Marc Lasgouttes
9 * Full author contact details are available in file CREDITS.
12 #ifndef FUNC_STATUS_H
13 #define FUNC_STATUS_H
15 #include <string>
17 /// The status of a function.
19 class FuncStatus
21 private:
23 enum StatusCodes {
24 /// Command can be executed
25 OK = 0,
26 /// This command does not exist, possibly because it is not
27 /// compiled in (e.g. LFUN_THESAURUS) or the user mistyped
28 /// it in the minibuffer. UNKNOWN commands have no menu entry.
29 UNKNOWN = 1,
30 /// Command cannot be executed
31 DISABLED = 2,
32 /// Command is on (i. e. the menu item has a checkmark
33 /// and the toolbar icon is pushed).
34 /// Not all commands use this
35 ON = 4,
36 /// Command is off (i. e. the menu item has no checkmark
37 /// and the toolbar icon is not pushed).
38 /// Not all commands use this
39 OFF = 8
42 unsigned int v_;
44 std::string message_;
46 public:
47 ///
48 FuncStatus();
49 ///
50 void clear();
51 ///
52 void operator|=(FuncStatus const & f);
53 ///
54 void unknown(bool b);
55 ///
56 bool unknown() const;
58 ///
59 void enabled(bool b);
60 /// tells whether it can be invoked (otherwise it will be grayed-out).
61 bool enabled() const;
63 ///
64 void setOnOff(bool b);
65 /// tells whether the menu item should have a check mark
66 /// (or the toolbar icon should be pushed).
67 bool onoff(bool b) const;
69 ///
70 void message(std::string const & m);
71 ///
72 std::string const & message() const;
75 #endif