]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Application.h
more of that...
[lyx.git] / src / frontends / Application.h
index 858bf3e77d5e1c9a5654ef01df363adc091ca34e..997d41a5af06a6954a9e44d4263f18de7dbc91b3 100644 (file)
 
 #include <boost/function.hpp>
 
-#include <vector>
-
 
 namespace lyx {
 
 class BufferView;
-struct RGBColor;
 class Buffer;
+class FuncRequest;
+class FuncStatus;
 class Inset;
+class MenuBackend;
+struct RGBColor;
 
 namespace frontend {
 
@@ -51,18 +52,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>
-   |     | (many)
-   |     WorkArea-1
-   |       |
-   |       BufferView <-----------> Buffer-c
-   |         |
-   |         Cursor
+   |  <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-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)
      ...
 
 
@@ -149,21 +161,21 @@ class Application
 {
 public:
        ///
-       Application() : current_view_(0) {}
+       Application() {}
        ///
        virtual ~Application() {}
 
        ///
-       virtual int createRegisteredView() = 0;
-       ///
-       virtual bool unregisterView(int id) = 0;
-       ///
-       virtual bool closeAllViews() = 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 LyXView & view(int id) const = 0;
-       ///
-       std::vector<int> const & viewIds() { return view_ids_; }
+       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;
@@ -182,22 +194,6 @@ public:
        */
        virtual void exit(int status) = 0;
 
-       /**
-       * Synchronise all pending events.
-       */
-       virtual void syncEvents() = 0;
-       ///
-       virtual FontLoader & fontLoader() = 0;
-
-       /// return a suitable serif font name.
-       virtual std::string const romanFontName() = 0;
-
-       /// return a suitable sans serif font name.
-       virtual std::string const sansFontName() = 0;
-
-       /// return a suitable monospaced font name.
-       virtual std::string const typewriterFontName() = 0;
-
        /**
        * Given col, fills r, g, b in the range 0-255.
        * The function returns true if successful.
@@ -228,23 +224,9 @@ public:
        */
        virtual void unregisterSocketCallback(int fd) = 0;
 
-       /// Create the main window with given geometry settings.
-       /// \param geometry_arg: only for Windows platform.
-       virtual LyXView & createView(std::string const & geometry_arg) = 0;
-
-       ///
-       LyXView const * currentView() const { return current_view_; }
-       ///
-       LyXView * currentView() { return current_view_; }
-       ///
-       void setCurrentView(LyXView & view) { current_view_ = &view; }
-
-protected:
-       /// This LyXView is the one receiving Clipboard and Selection
-       /// events
-       LyXView * current_view_;
        ///
-       std::vector<int> view_ids_;
+       virtual MenuBackend const & menuBackend() const = 0;
+       virtual MenuBackend & menuBackend() = 0;
 };
 
 } // namespace frontend