#ifndef INSET_INFO_H
#define INSET_INFO_H
-#include "InsetCollapsable.h"
+#include "InsetCollapsible.h"
namespace lyx {
This inset has two arguments: the type and argument of the information. The
screen and latex output is the content of the information. An InsetInfo can
have type "shortcuts", "shortcut", "lyxrc", "package", "textclass", "menu",
-or "buffer". Arguments and outputs vary by type.
+"buffer" or "vcs". Arguments and outputs vary by type.
shortcuts: argument of this type of InsetInfo is the name of the LFUN such as
"math-insert \alpha". The syntax is the same as what is used in the bind
buffer: argument can be one of "name", "path", "class". This inset output the
filename, path, and textclass of this buffer.
-
-lyxinfo: argument must (presently) be "version". This inset outputs information
- about the version of LyX currently in use.
+
+lyxinfo: argument must (presently) be "version". This inset outputs information
+ about the version of LyX currently in use.
+
+vcs: argument can be one of "revision", "tree-revision", "author", "time", "date".
+ This insets outputs revision control information, if available.
There is currently no GUI, no menu entry for this inset. A user can define a
shortcut for "info-insert" (e.g. C-S-I), and
*/
-class InsetInfo : public InsetCollapsable {
+class InsetInfo : public InsetCollapsible {
public:
enum info_type {
UNKNOWN_INFO, // Invalid type
MENU_INFO, // Which menu item is used for certain function
ICON_INFO, // which toolbar icon is used for certain function
BUFFER_INFO, // Buffer related information
- LYX_INFO // LyX version information
+ LYX_INFO, // LyX version information
+ VCS_INFO, // Version control information
};
///
docstring layoutName() const;
///
Inset * editXY(Cursor & cur, int x, int y);
+ /** FIXME: we would like to do that, but then InsetText::updateBuffer breaks
+ * on info insets. Do we need to run this method on InsetInfo contents?
+ * Having a InsetInfo that hides an InsetText is really annoying, actually.
+ */
+ ///bool isActive() const { return false; }
///
bool editable() const { return false; }
///
///
bool validateModifyArgument(docstring const & argument) const;
///
+ std::vector<std::pair<std::string,docstring>> getArguments(std::string const &) const;
+ ///
bool showInsetDialog(BufferView * bv) const;
///
bool getStatus(Cursor &, FuncRequest const &, FuncStatus &) const;
///
void doDispatch(Cursor & cur, FuncRequest & cmd);
+ /// Force inset into LTR environment if surroundings are RTL
+ bool forceLTR() const;
///
void setInfo(std::string const & info);
- /// update info_ and text
- void updateInfo();
+ ///
+ void updateBuffer(ParIterator const & it, UpdateType utype);
///
docstring toolTip(BufferView const & bv, int x, int y) const;
///
std::string contextMenu(BufferView const &, int, int) const;
///
std::string contextMenuName() const;
- /// should paragraph indendation be ommitted in any case?
+ /// should paragraph indendation be omitted in any case?
bool neverIndent() const { return true; }
private:
///
virtual Inset * clone() const { return new InsetInfo(*this); }
///
- void error(std::string const & err);
+ void error(docstring const & err, Language const *);
///
- void setText(docstring const & str);
+ void info(docstring const & err, Language const *);
+ ///
+ void setText(docstring const & str, Language const *);
// make sure that the other version of setText is still available.
- using InsetCollapsable::setText;
+ using InsetCollapsible::setText;
+ ///
+ bool initialized_;
///
info_type type_;
///
std::string name_;
+ ///
+ bool force_ltr_;
};