]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTexinfo.C
The std::string mammoth path.
[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 Voß
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 using std::string;
18
19
20 void getTexFileList(ControlTexinfo::texFileSuffix type,
21                     std::vector<string> & list)
22 {
23         string filename;
24         switch (type) {
25         case ControlTexinfo::bst:
26                 filename = "bstFiles.lst";
27                 break;
28         case ControlTexinfo::cls:
29                 filename = "clsFiles.lst";
30                 break;
31         case ControlTexinfo::sty:
32                 filename = "styFiles.lst";
33                 break;
34         }
35         getTexFileList(filename, list);
36         if (list.empty()) {
37                 // build filelists of all availabe bst/cls/sty-files.
38                 // Done through kpsewhich and an external script,
39                 // saved in *Files.lst
40                 rescanTexStyles();
41                 getTexFileList(filename, list);
42         }
43 }
44
45
46 ControlTexinfo::ControlTexinfo(Dialog & parent)
47         : Dialog::Controller(parent)
48 {}
49
50
51 void ControlTexinfo::viewFile(string const & filename) const
52 {
53         string const arg = "file " + filename;
54         kernel().dispatch(FuncRequest(LFUN_DIALOG_SHOW, arg));
55 }
56
57
58 string const ControlTexinfo::getClassOptions(string const & filename) const
59 {
60         return getListOfOptions(filename, "cls");
61 }