]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Application.h
Encapsulate all menu related stuff inside Menu.cpp and simplify a few things.
[lyx.git] / src / frontends / Application.h
index 89c999318c5699b432aa3a8e3fba6ccdf6dbab85..0cc2ed00f69eef03e37bcfa262035469e4d083a3 100644 (file)
 #include "ColorCode.h"
 
 #include "support/strfwd.h"
+#include "support/docstring.h"
 
 #include <boost/function.hpp>
 
+#include <vector>
+
 
 namespace lyx {
 
 class BufferView;
-struct RGBColor;
 class Buffer;
+class FuncRequest;
+class FuncStatus;
 class Inset;
+class Lexer;
+struct RGBColor;
 
 namespace frontend {
 
@@ -49,18 +55,29 @@ initialisation should be done before the instanciation of this class.
 
  Application (this is the frontend really, should probably be renamed).
    |
-   LyXView-1 (M1 WorkAreas, M1 <= N)
+   LyXView-1 (one or more in case of split-view mode).
+   |  |
+   |  <tab-widget-1-1> 
+   |  |  |
+   |  |  WorkArea-1-1-1 (M1-1 WorkAreas, M1-1 <= N)
+   |  |  | |
+   |  |  | BufferView <-----------> Buffer-c
+   |  |  |   |
+   |  |  |   Cursor
+   |  |  |
+   |  |  WorkArea-1-1-2
+   |  |  | |
+   |  |  | BufferView <-----------> Buffer-a
+   |  |  |   |
+   |  |  |   Cursor
    |  |
-   |  <tab-widget>
-   |     | (many)
-   |     WorkArea-1
-   |       |
-   |       BufferView <-----------> Buffer-c
-   |         |
-   |         Cursor
+   |  <tab-widget-1-2> 
    |
-   LyXView-2 (M2 WorkAreas, M2 <= N, M2 independent of M1)
-      |
+   LyXView-2 (one or more in case of split-view mode).
+   |  |
+   |  <tab-widget-2-1>
+   |  |  |
+   |  |  WorkArea-2-1-1 (M2-1 WorkAreas, M2-1 <= N, M2-1 independent of M1-1)
      ...
 
 
@@ -152,12 +169,17 @@ public:
        virtual ~Application() {}
 
        ///
-       virtual void resetGui() = 0;
+       virtual FuncStatus getStatus(FuncRequest const & cmd) = 0;
+       /// dispatch command.
+       /// \return true if the \c FuncRequest has been dispatched.
+       virtual bool dispatch(FuncRequest const & cmd) = 0;
 
        ///
-       virtual bool closeAllViews() = 0;
-       ///
-       virtual size_t viewCount() const = 0;
+       virtual void resetGui() = 0;
+
+       /// Load files and restore GUI Session.
+       virtual void restoreGuiSession() = 0;
+
        ///
        virtual void hideDialogs(std::string const & name, Inset * inset) const = 0;
        ///
@@ -192,6 +214,11 @@ public:
        */
        virtual void updateColor(ColorCode col) = 0;
 
+       /**
+       * read and create the menu structure
+       */
+       virtual void readMenus(Lexer & lex) = 0;
+
        /**
        * add a callback for socket read notification
        * @param fd socket descriptor (file/socket/etc)
@@ -205,9 +232,8 @@ public:
        */
        virtual void unregisterSocketCallback(int fd) = 0;
 
-       /// Create the main window with given geometry settings.
-       /// \param geometry_arg: only for Windows platform.
-       virtual void createView(std::string const & geometry_arg = std::string()) = 0;
+       virtual bool searchMenu(FuncRequest const & func,
+               std::vector<docstring> & names) const = 0;
 };
 
 } // namespace frontend