4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Bernhard Roider
9 * Full author contact details are available in file CREDITS.
15 #include "FuncRequest.h"
17 #include "support/strfwd.h"
24 /// Creates command definitions
27 /// type for map between a macro name and its info
28 typedef std::map
<std::string
, FuncRequest
> CmdDefMap
;
29 /// type for a set containing all locked definitions
30 typedef std::set
<std::string
> LockSet
;
34 bool read(std::string
const & def_file
);
37 * Look up a definition, lock it and return the
38 * associated action if it is not locked.
39 * @param name the name of the command
40 * @param func contains the action on success
41 * @return true if lock was successful
43 bool lock(std::string
const & name
, FuncRequest
& func
);
45 /// release a locked definition
46 void release(std::string
const & name
);
50 /// possible reasons for not allowed definitions
51 enum newCmdDefResult
{
59 * Add a new command definition.
60 * @param name internal recursion level
62 newCmdDefResult
newCmdDef(std::string
const & name
,
63 std::string
const & def
);
71 /// Implementation is in LyX.cpp
72 extern CmdDef
& theTopLevelCmdDef();