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>
33 class LyX : boost::noncopyable {
35 static void exec(int & argc, char * argv[]);
37 static LyX const & cref();
39 /// in the case of failure
40 void emergencyCleanup() const;
42 LastFiles & lastfiles();
43 LastFiles const & lastfiles() const;
45 void addLyXView(boost::shared_ptr<LyXView> const & lyxview);
47 /** redraw \c inset in all the BufferViews in which it is currently
48 * visible. If successful return a pointer to the owning Buffer.
50 Buffer const * const updateInset(InsetBase const *) const;
53 static boost::scoped_ptr<LyX> singleton_;
56 void priv_exec(int & argc, char * argv[]);
58 /// initial LyX set up
60 /// set up the default key bindings
61 void defaultKeyBindings(kb_keymap * kbmap);
62 /// set up the default dead key bindings if requested
63 void deadKeyBindings(kb_keymap * kbmap);
64 /** Check for the existence of the user's support directory and,
65 * if not present, create it. Exits the program if the directory
67 * \returns true if the user-side configuration script
68 * (lib/configure) should be re-run in this directory.
70 bool queryUserLyXDir(bool explicit_userdir);
71 /// read lyxrc/preferences
72 void readRcFile(std::string const & name);
73 /// read the given ui (menu/toolbar) file
74 void readUIFile(std::string const & name);
75 /// read the given languages file
76 void readLanguagesFile(std::string const & name);
77 /// read the given encodings file
78 void readEncodingsFile(std::string const & name);
79 /// parsing of non-gui LyX options. Returns true if gui
80 bool easyParse(int & argc, char * argv[]);
81 /// shows up a parsing error on screen
82 void printError(ErrorItem const &);
84 /// has this user started lyx for the first time?
86 /// the parsed command line batch command if any
87 std::string batch_command;
90 boost::scoped_ptr<LastFiles> lastfiles_;
92 typedef std::list<boost::shared_ptr<LyXView> > ViewList;