]> git.lyx.org Git - lyx.git/blob - src/lyx_main.h
clean up a bit
[lyx.git] / src / lyx_main.h
1 // -*- C++ -*-
2 /**
3  * \file lyx_main.h
4  * Copyright 2002 the LyX Team
5  * Read the file COPYING
6  *
7  * \author unknown
8  */
9
10 #ifndef LYX_MAIN_H
11 #define LYX_MAIN_H
12
13 #ifdef __GNUG__
14 #pragma interface
15 #endif
16
17 #include "LString.h"
18
19 #include <boost/scoped_ptr.hpp>
20 #include <boost/utility.hpp>
21
22 #include <csignal>
23
24 class LyXRC;
25 class LastFiles;
26 class Buffer;
27 class kb_keymap;
28
29
30 /// e.g. $HOME/.lyx/
31 extern string user_lyxdir;
32 /// e.g. /usr/share/lyx/
33 extern string system_lyxdir;
34 /// e.g. /tmp
35 extern string system_tempdir;
36 /// last files loaded
37 extern boost::scoped_ptr<LastFiles> lastfiles;
38
39
40 /// initial startup
41 class LyX : boost::noncopyable {
42 public:
43         LyX(int & argc, char * argv[]);
44
45         /// in the case of failure
46         static void emergencyCleanup();
47
48 private:
49         /// initial LyX set up
50         void init(bool);
51         /// set up the default key bindings
52         void defaultKeyBindings(kb_keymap * kbmap);
53         /// set up the default dead key bindings if requested
54         void deadKeyBindings(kb_keymap * kbmap);
55         /// check, set up and configure the user dir if necessary
56         void queryUserLyXDir(bool explicit_userdir);
57         /// return true if the given prefs file was successfully read
58         bool readRcFile(string const & name);
59         /// read the given ui (menu/toolbar) file
60         void readUIFile(string const & name);
61         /// read the given languages file
62         void readLanguagesFile(string const & name);
63         /// read the given encodings file
64         void readEncodingsFile(string const & name);
65         /// parsing of non-gui LyX options. Returns true if gui
66         bool easyParse(int & argc, char * argv[]);
67
68         /// has this user started lyx for the first time?
69         bool first_start;
70         /// the parsed command line batch command if any
71         string batch_command;
72 };
73
74 #endif // LYX_MAIN_H