4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
8 * \author Jean-Marc Lasgouttes
11 * Full author contact details are available in file CREDITS.
17 #include <boost/scoped_ptr.hpp>
18 #include <boost/shared_ptr.hpp>
19 #include <boost/utility.hpp>
35 class LyX : boost::noncopyable {
37 static void exec(int & argc, char * argv[]);
39 static LyX const & cref();
41 /// in the case of failure
42 void emergencyCleanup() const;
44 lyx::Session & session();
45 lyx::Session const & session() const;
47 void addLyXView(boost::shared_ptr<LyXView> const & lyxview);
49 /** redraw \c inset in all the BufferViews in which it is currently
50 * visible. If successful return a pointer to the owning Buffer.
52 Buffer const * const updateInset(InsetBase const *) const;
55 static boost::scoped_ptr<LyX> singleton_;
58 void priv_exec(int & argc, char * argv[]);
60 /// initial LyX set up
62 /// set up the default key bindings
63 void defaultKeyBindings(kb_keymap * kbmap);
64 /// set up the default dead key bindings if requested
65 void deadKeyBindings(kb_keymap * kbmap);
66 /** Check for the existence of the user's support directory and,
67 * if not present, create it. Exits the program if the directory
69 * \returns true if the user-side configuration script
70 * (lib/configure) should be re-run in this directory.
72 bool queryUserLyXDir(bool explicit_userdir);
73 /// read lyxrc/preferences
74 void readRcFile(std::string const & name);
75 /// read the given ui (menu/toolbar) file
76 void readUIFile(std::string const & name);
77 /// read the given languages file
78 void readLanguagesFile(std::string const & name);
79 /// read the given encodings file
80 void readEncodingsFile(std::string const & name);
81 /// parsing of non-gui LyX options. Returns true if gui
82 bool easyParse(int & argc, char * argv[]);
83 /// shows up a parsing error on screen
84 void printError(ErrorItem const &);
86 /// has this user started lyx for the first time?
88 /// the parsed command line batch command if any
89 std::string batch_command;
91 /// lyx session, containing lastfiles, lastfilepos, and lastopened
92 boost::scoped_ptr<lyx::Session> session_;
94 typedef std::list<boost::shared_ptr<LyXView> > ViewList;