]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInfo.h
More GuiInfo usability work
[lyx.git] / src / insets / InsetInfo.h
index 12932025b08e57cb098305b68134ed37a86fea94..e1c42a7c91578573fe6694cb3d237e773049d0c1 100644 (file)
@@ -12,7 +12,7 @@
 #ifndef INSET_INFO_H
 #define INSET_INFO_H
 
 #ifndef INSET_INFO_H
 #define INSET_INFO_H
 
-#include "InsetCollapsable.h"
+#include "InsetCollapsible.h"
 
 namespace lyx {
 
 
 namespace lyx {
 
@@ -30,7 +30,7 @@ uses it to display currently used shortcuts.
 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",
 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
 
 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
@@ -61,9 +61,12 @@ icon: argument is the name of the LFUN such as "paste". The syntax is the same
 
 buffer: argument can be one of "name", "path", "class". This inset output the
     filename, path, and textclass of this buffer.
 
 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
 
 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
@@ -77,7 +80,7 @@ the command buffer (view->Toolbar->Command Buffer).
 
 */
 
 
 */
 
-class InsetInfo : public InsetCollapsable {
+class InsetInfo : public InsetCollapsible {
 public:
        enum info_type {
                UNKNOWN_INFO,   // Invalid type
 public:
        enum info_type {
                UNKNOWN_INFO,   // Invalid type
@@ -89,7 +92,8 @@ public:
                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
                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
        };
 
        ///
        };
 
        ///
@@ -100,6 +104,11 @@ public:
        docstring layoutName() const;
        ///
        Inset * editXY(Cursor & cur, int x, int y);
        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 editable() const { return false; }
        ///
@@ -115,37 +124,47 @@ public:
        ///
        bool validateModifyArgument(docstring const & argument) const;
        ///
        ///
        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);
        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);
        ///
        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;
        ///
        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); }
        ///
        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.
        // 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_;
        ///
        info_type type_;
        ///
        std::string name_;
+       ///
+       bool force_ltr_;
 };
 
 
 };