]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTexinfo.C
Merge Herbert's bibtex patch; it doesn't introduce any new bugs and
[lyx.git] / src / frontends / controllers / ControlTexinfo.C
1 /* This file is part of
2  * ======================================================
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \file ControlTexinfo.C
11  * \author Herbert Voss <voss@lyx.org>
12  */
13
14 #include <config.h>
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include "ControlTexinfo.h"
21 #include "Dialogs.h"
22 #include "BufferView.h"
23 #include "gettext.h"
24 #include "helper_funcs.h"
25 #include "tex_helpers.h"
26
27 #include "frontends/LyXView.h"
28
29 #include "support/filetools.h" // FileSearch
30 #include "support/path.h"
31 #include "support/lstrings.h"
32
33 extern string user_lyxdir; // home of *Files.lst
34
35
36 ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d)
37         : ControlDialogBI(lv, d)
38 {}
39
40
41 // build filelists of all availabe bst/cls/sty-files. done through
42 // kpsewhich and an external script, saved in *Files.lst
43 void ControlTexinfo::rescanStyles() const
44 {
45     rescanTexStyles();
46 }
47
48
49 void ControlTexinfo::runTexhash() const
50 {
51     texhash();
52 }
53
54
55 string const
56 ControlTexinfo::getContents(texFileSuffix type, bool withFullPath) const
57 {
58         switch (type) {
59             case bst: 
60                 return getTexFileList("bstFiles.lst", withFullPath);
61                 break;
62             case cls:
63                 return getTexFileList("clsFiles.lst", withFullPath);
64                 break;
65             case sty:
66                 return getTexFileList("styFiles.lst", withFullPath);
67                 break;
68         }
69         return string();
70 }
71
72
73 void ControlTexinfo::viewFile(string const filename) const
74 {
75         lv_.getDialogs()->showFile(filename);
76 }
77
78
79 string const ControlTexinfo::getClassOptions(string const & filename) const
80 {
81         return getListOfOptions(filename, "cls");
82 }