]> git.lyx.org Git - lyx.git/blobdiff - src/lyxfunc.h
Fix fuer #209
[lyx.git] / src / lyxfunc.h
index c76751e56651b8b858c1db919a821fbde6f52fa2..9cd6458def1c9d28723a9a2fd1e2c71166595594 100644 (file)
@@ -10,7 +10,7 @@
 #include <sigc++/signal_system.h>
 
 #include "commandtags.h" // for kb_action enum
-#include "func_status.h"
+#include "FuncStatus.h"
 #include "kbsequence.h"
 #include "LString.h"
 
@@ -31,13 +31,22 @@ public:
        LyXFunc(LyXView *);
     
        /// LyX dispatcher, executes lyx actions.
-       string const dispatch(int action, string const & arg = string());
-                        
-       /// The same but uses the name of a lyx command.
-       string const dispatch(string const & cmd);
+       string const dispatch(kb_action ac, string argument = string());
 
-       ///
-       void miniDispatch(string const & cmd);
+       /// The same as dispatch, but also shows shortcuts and command
+       /// name in minibuffer if show_sc is true (more to come?) 
+       void verboseDispatch(kb_action action,
+                            string const & argument,
+                            bool show_sc);
+       
+       /// Same as above, using a pseudoaction as argument
+       void verboseDispatch(int ac, bool show_sc);
+
+       /// Same as above, when the command is provided as a string
+       void verboseDispatch(string const & s, bool show_sc);
+
+       /// 
+       void miniDispatch(string const & s);
 
        ///
        void initMiniBuffer();
@@ -45,12 +54,12 @@ public:
        ///
        void processKeySym(KeySym k, unsigned int state);
 
-       /// we need one internall which is called from inside LyXAction and
+       /// we need one internal which is called from inside LyXAction and
        /// can contain the string argument.
-       func_status::value_type getStatus(int ac) const;
+       FuncStatus getStatus(int ac) const;
        ///
-       func_status::value_type getStatus(int ac
-                                         string const & not_to_use_arg) const;
+       FuncStatus getStatus(kb_action action
+                            string const & argument = string()) const;
        
        /// The last key was meta
        bool wasMetaKey() const;
@@ -58,15 +67,18 @@ public:
         /// True if lyxfunc reports an error
         bool errorStat() const { return errorstat; }
         /// Buffer to store result messages
-        void setMessage(string const & m);
+        void setMessage(string const & m) const;
         /// Buffer to store result messages
         void setErrorMessage(string const &) const; 
+        /// Buffer to store result messages from getStatus
+        void setStatusMessage(string const &) const; 
         /// Buffer to store result messages
         string const getMessage() const { return dispatch_buffer; }
+        /// Buffer to store result messages
+        string const getStatusMessage() const { return status_buffer; }
        /// Handle a accented char keysequenze
        void handleKeyFunc(kb_action action);
-       /// Should a hint message be displayed?
-       void setHintMessage(bool);
+
 private:
        ///
        LyXView * owner;
@@ -93,6 +105,9 @@ private:
            good reason to have this one as static in Dispatch? (Ale)
        */
         mutable string dispatch_buffer;
+        /** Buffer to store messages and result data from getStatus
+       */
+        mutable string status_buffer;
        /// Command name and shortcut information
        string commandshortcut;
 
@@ -116,8 +131,6 @@ private:
        ///
        LyXText * TEXT(bool) const;
        ///
-       //  This is the same for all lyxfunc objects
-       static bool show_sc;
 };
      
      
@@ -130,10 +143,4 @@ bool LyXFunc::wasMetaKey() const
 }
      
 
-inline
-void LyXFunc::setHintMessage(bool hm) 
-{ 
-       show_sc = hm;
-}
-
 #endif