2 * \file ControlTexinfo.cpp
3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
8 * Full author contact details are available in file CREDITS.
13 #include "ControlTexinfo.h"
14 #include "FuncRequest.h"
16 #include "support/filetools.h"
25 using support::onlyFilename;
29 void getTexFileList(ControlTexinfo::texFileSuffix type,
30 std::vector<string> & list, bool withPath)
34 case ControlTexinfo::bst:
35 filename = "bstFiles.lst";
37 case ControlTexinfo::cls:
38 filename = "clsFiles.lst";
40 case ControlTexinfo::sty:
41 filename = "styFiles.lst";
44 getTexFileList(filename, list);
46 // build filelists of all availabe bst/cls/sty-files.
47 // Done through kpsewhich and an external script,
48 // saved in *Files.lst
50 getTexFileList(filename, list);
54 vector<string>::iterator it = list.begin();
55 vector<string>::iterator end = list.end();
56 for (; it != end; ++it) {
57 *it = onlyFilename(*it);
59 // sort on filename only (no path)
60 std::sort(list.begin(), list.end());
64 ControlTexinfo::ControlTexinfo(Dialog & parent)
65 : Dialog::Controller(parent)
69 void ControlTexinfo::viewFile(string const & filename) const
71 string const arg = "file " + filename;
72 kernel().dispatch(FuncRequest(LFUN_DIALOG_SHOW, arg));
76 string const ControlTexinfo::getClassOptions(string const & filename) const
78 return getListOfOptions(filename, "cls");
82 string const ControlTexinfo::getFileType(ControlTexinfo::texFileSuffix type) const
86 case ControlTexinfo::bst:
89 case ControlTexinfo::cls:
92 case ControlTexinfo::sty:
99 } // namespace frontend