]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/Application.h
enable Font cache only for MacOSX and inline width() for other platform.
[lyx.git] / src / frontends / Application.h
index a11be8f17e519cd95f6fb8f2fc93c5437e979e7d..d9589f8078d11dfde3b000a9867c43c9b8186675 100644 (file)
-/**\r
- * \file frontend/Application.h\r
- * This file is part of LyX, the document processor.\r
- * Licence details can be found in the file COPYING.\r
- *\r
- * \author Abdelrazak Younes\r
- *\r
- * Full author contact details are available in file CREDITS.\r
- */\r
-\r
-#ifndef LYX_APPLICATION_H\r
-#define LYX_APPLICATION_H\r
-\r
-#include "lyxfunc.h"\r
-#include "lyxserver.h"\r
-#include "lyxsocket.h"\r
-\r
-#include <boost/scoped_ptr.hpp>\r
-\r
-#include <string>\r
-\r
-class BufferView;\r
-class LyXView;\r
-\r
-namespace lyx {\r
-namespace frontend {\r
-\r
-class Clipboard;\r
-class Gui;\r
-class Selection;\r
-\r
-\r
-/// The main application class\r
-/**\r
-There should be only one instance of this class. No Qt object\r
-initialisation should be done before the instanciation of this class.\r
-\r
-\todo The work areas handling could be moved to a base virtual class\r
-comon to all frontends.\r
-*/\r
-class Application\r
-{\r
-public:\r
-       ///\r
-       Application(int & argc, char ** argv);\r
-       ///\r
-       virtual ~Application() {}\r
-\r
-       int start(std::string const & batch);\r
-       ///\r
-       virtual Gui & gui() = 0;\r
-       ///\r
-       virtual int const exec() = 0;\r
-       ///\r
-       virtual void exit(int status) = 0;\r
-\r
-       ///\r
-       virtual Clipboard & clipboard() = 0;\r
-       ///\r
-       virtual Selection & selection() = 0;\r
-\r
-       ///\r
-       LyXFunc & lyxFunc();\r
-       LyXFunc const & lyxFunc() const;\r
-       ///\r
-       LyXServer & server();\r
-       LyXServer const & server() const;\r
-       ///\r
-       LyXServerSocket & socket();\r
-       LyXServerSocket const & socket() const;\r
-       ///\r
-       void setBufferView(BufferView * buffer_view);\r
-\r
-protected:\r
-       ///\r
-       BufferView * buffer_view_;\r
-\r
-       // FIXME: lyxfunc_ should be private. But the actual construction is done in\r
-       // GuiApplication for now.\r
-\r
-       /// our function handler\r
-       boost::scoped_ptr<LyXFunc> lyxfunc_;\r
-\r
-private:\r
-       ///\r
-       boost::scoped_ptr<LyXServer> lyx_server_;\r
-       ///\r
-       boost::scoped_ptr<LyXServerSocket> lyx_socket_;\r
-\r
-}; // Application\r
-\r
-} // namespace frontend\r
-} // namespace lyx\r
-\r
-extern lyx::frontend::Application * theApp;\r
-\r
-\r
-#endif // LYX_APPLICATION_H\r
+/**
+ * \file frontend/Application.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Abdelrazak Younes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef LYX_APPLICATION_H
+#define LYX_APPLICATION_H
+
+#include <boost/scoped_ptr.hpp>
+
+#include <string>
+
+class BufferList;
+class BufferView;
+class LyXFunc;
+class LyXServer;
+class LyXServerSocket;
+class LyXView;
+       
+namespace lyx {
+namespace frontend {
+
+struct Application_pimpl;
+class Clipboard;
+class FontLoader;
+class Gui;
+class Selection;
+
+/// The main application class
+/**
+There should be only one instance of this class. No Qt object
+initialisation should be done before the instanciation of this class.
+
+\todo The work areas handling could be moved to a base virtual class
+comon to all frontends.
+*/
+class Application
+{
+public:
+       ///
+       Application(int & argc, char ** argv);
+       ///
+       virtual ~Application() {}
+
+       /// Start the main event loop, after executing the given batch
+       /// commands.
+       int start(std::string const & batch);
+       ///
+       virtual Gui & gui() = 0;
+       ///
+       virtual int const exec() = 0;
+
+       /// Quit running LyX.
+       /**
+       * This may either quit directly or record the exit status
+       * and only stop the event loop.
+       */
+       virtual void exit(int status) = 0;
+
+       ///
+       virtual Clipboard & clipboard() = 0;
+       ///
+       virtual Selection & selection() = 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;
+
+       ///
+       LyXFunc & lyxFunc();
+       LyXFunc const & lyxFunc() const;
+       ///
+       LyXServer & server();
+       LyXServer const & server() const;
+       ///
+       LyXServerSocket & socket();
+       LyXServerSocket const & socket() const;
+       ///
+       BufferList & bufferList();
+       BufferList const & bufferList() const;
+
+       /// Create the main window with given geometry settings.
+       LyXView & createView(unsigned int width, unsigned int height,
+               int posx, int posy, bool maximize);
+       
+       ///
+       void setBufferView(BufferView * buffer_view);
+
+protected:
+       /// This BufferView is the one receiving Clipboard and Selection
+       /// Events
+       /// FIXME: \todo use Gui::currentView() in the future
+       BufferView * buffer_view_;
+
+private:
+       /// Application private implementation.
+       Application_pimpl * pimpl_;
+
+}; // Application
+
+} // namespace frontend
+} // namespace lyx
+
+extern lyx::frontend::Application * theApp;
+
+
+#endif // LYX_APPLICATION_H