]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTexinfo.C
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[lyx.git] / src / frontends / controllers / ControlTexinfo.C
1 /**
2  * \file ControlTexinfo.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author Herbert Voss
7  *
8  * Full author contact details are available in file CREDITS
9  */
10
11 #include <config.h>
12
13 #include "ControlTexinfo.h"
14 #include "funcrequest.h"
15
16
17 void getTexFileList(ControlTexinfo::texFileSuffix type,
18                     std::vector<string> & list)
19 {
20         string filename;
21         switch (type) {
22         case ControlTexinfo::bst:
23                 filename = "bstFiles.lst";
24                 break;
25         case ControlTexinfo::cls:
26                 filename = "clsFiles.lst";
27                 break;
28         case ControlTexinfo::sty:
29                 filename = "styFiles.lst";
30                 break;
31         }
32         getTexFileList(filename, list);
33         if (list.empty()) {
34                 // build filelists of all availabe bst/cls/sty-files.
35                 // Done through kpsewhich and an external script,
36                 // saved in *Files.lst
37                 rescanTexStyles();
38                 getTexFileList(filename, list);
39         }
40 }
41
42
43 ControlTexinfo::ControlTexinfo(Dialog & parent)
44         : Dialog::Controller(parent)
45 {}
46
47
48 void ControlTexinfo::viewFile(string const & filename) const
49 {
50         string const arg = "file " + filename;
51         kernel().dispatch(FuncRequest(LFUN_DIALOG_SHOW, arg));
52 }
53
54
55 string const ControlTexinfo::getClassOptions(string const & filename) const
56 {
57         return getListOfOptions(filename, "cls");
58 }