]> git.lyx.org Git - lyx.git/blob - src/lyx_main.h
ws change
[lyx.git] / src / lyx_main.h
1 // -*- C++ -*-
2 /* This file is part of
3 * ======================================================
4 *
5 *           LyX, The Document Processor
6 *
7 *           Copyright 1995 Matthias Ettrich
8 *           Copyright 1995-2001 The LyX Team.
9 *
10 * ====================================================== */
11
12 /* This is the declaration of the LyX class, there should only
13  * exist _one_ instance of this in the application. */
14
15 #ifndef LYX_MAIN_H
16 #define LYX_MAIN_H
17
18 #ifdef __GNUG__
19 #pragma interface
20 #endif
21
22 #include <csignal>
23
24 #include "LString.h"
25
26 #include <boost/smart_ptr.hpp>
27 #include <boost/utility.hpp>
28
29 class LyXGUI;
30 class LyXRC;
31 class LastFiles;
32 class Buffer;
33 class kb_keymap;
34
35 ///
36 extern string system_lyxdir;
37 ///
38 extern string user_lyxdir;
39 ///
40 extern string system_tempdir;
41 ///
42 extern boost::scoped_ptr<LastFiles> lastfiles;
43 /* we should hopefully be able to move this
44  * inside the LyX class */
45
46
47 /**
48   This is the main LyX object it encapsulates most of the other objects.
49 */
50 class LyX : boost::noncopyable {
51 public:
52         /// the only allowed constructor
53         LyX(int * argc, char * argv[]); // constructor
54         /// Always is useful a destructor
55         ~LyX();
56
57         /// in the case of failure
58         static void emergencyCleanup();
59
60 private:
61         /// Should be a maximum of 1 LyXGUI.
62         boost::scoped_ptr<LyXGUI> lyxGUI;
63         /// does this user start lyx for the first time?
64         bool first_start;
65         ///
66         string batch_command;
67         ///
68         void runtime();
69         ///
70         void init(bool);
71         ///
72         void defaultKeyBindings(kb_keymap * kbmap);
73         ///
74         void deadKeyBindings(kb_keymap * kbmap);
75         ///
76         void queryUserLyXDir(bool explicit_userdir);
77         /** Search for and read the LyXRC file name, return
78             true if successfull.
79         */
80         bool readRcFile(string const & name);
81         /// Read the ui file `name'
82         void readUIFile(string const & name);
83         /// Read the languages file `name'
84         void readLanguagesFile(string const & name);
85         /// Read the encodings file `name'
86         void readEncodingsFile(string const & name);
87         ///
88         bool easyParse(int * argc, char * argv[]);
89 };
90
91 #endif