X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyX.h;h=0d8616eff9b98eef606cb2631ec62e76ae1f4049;hb=6c977615633e5e132494b9a7fa778588210f9c95;hp=8dc2661e5a690226174d2aaaa989bde4f4cd5ece;hpb=32871c1284f15265f652ff01c438e539a7c8181f;p=lyx.git diff --git a/src/LyX.h b/src/LyX.h index 8dc2661e5a..0d8616eff9 100644 --- a/src/LyX.h +++ b/src/LyX.h @@ -14,34 +14,38 @@ #ifndef LYX_H #define LYX_H -#include -#include - -#include +#include "support/strfwd.h" namespace lyx { +namespace support { +class FileName; +} + class Buffer; class BufferList; class Converters; class ErrorItem; class Inset; class LyXFunc; -class LyXServer; -class LyXServerSocket; -class LyXView; +class Server; +class ServerSocket; class Messages; class Mover; class Movers; class Session; class KeyMap; +class CmdDef; extern bool use_gui; -namespace frontend { class Application; } +namespace frontend { +class Application; +class LyXView; +} /// initial startup -class LyX : boost::noncopyable { +class LyX { public: LyX(); @@ -50,6 +54,11 @@ public: /// Execute LyX. int exec(int & argc, char * argv[]); + /// Try to exit LyX properly. + /// \p exit_code is 0 by default, if a non zero value is passed, + /// emergencyCleanup() will be called before exiting. + void exit(int exit_code = 0) const; + static LyX & ref(); static LyX const & cref(); @@ -66,11 +75,11 @@ public: LyXFunc & lyxFunc(); LyXFunc const & lyxFunc() const; /// - LyXServer & server(); - LyXServer const & server() const; + Server & server(); + Server const & server() const; /// - LyXServerSocket & socket(); - LyXServerSocket const & socket() const; + ServerSocket & socket(); + ServerSocket const & socket() const; /// frontend::Application & application(); @@ -79,7 +88,10 @@ public: /// KeyMap & topLevelKeymap(); KeyMap const & topLevelKeymap() const; - + + /// + CmdDef & topLevelCmdDef(); + /// Converters & converters(); Converters & systemConverters(); @@ -92,17 +104,19 @@ public: void setGuiLanguage(std::string const & language); /// - LyXView * newLyXView(); - - /** redraw \c inset in all the BufferViews in which it is currently - * visible. If successful return a pointer to the owning Buffer. - */ - Buffer const * const updateInset(Inset const *) const; + frontend::LyXView * newLyXView(); /// Execute batch commands if available. void execBatchCommands(); + /// + void addFileToLoad(std::string const &); + private: + /// noncopyable + LyX(LyX const &); + void operator=(LyX const &); + /// Do some cleanup in preparation of an exit. void prepareExit(); @@ -121,16 +135,8 @@ private: */ void loadFiles(); - /// Create a View, load files and restore GUI Session. - void restoreGuiSession(); - - /// Initialize RC font for the GUI. - void initGuiFont(); - /// initial LyX set up bool init(); - /// set up the default key bindings - void defaultKeyBindings(KeyMap * kbmap); /// set up the default dead key bindings if requested void deadKeyBindings(KeyMap * kbmap); /** Check for the existence of the user's support directory and, @@ -150,20 +156,19 @@ private: /// \param enc_name encodings definition file /// \param symbols_name unicode->LaTeX mapping file bool readEncodingsFile(std::string const & enc_name, - std::string const & symbols_name); + std::string const & symbols_name); /// parsing of non-gui LyX options. void easyParse(int & argc, char * argv[]); /// shows up a parsing error on screen void printError(ErrorItem const &); + /// Use the Pimpl idiom to hide the internals. + // Mostly used for singletons. + struct Impl; + Impl * pimpl_; + /// has this user started lyx for the first time? bool first_start; - /// the parsed command line batch command if any - std::string batch_command; - - /// Use the Pimpl idiom to hide the internals. - struct Singletons; - boost::scoped_ptr pimpl_; friend Movers & theMovers(); friend Mover const & getMover(std::string const & fmt);