2 * \file ControlTexinfo.C
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
14 #pragma implementation
17 #include "ControlTexinfo.h"
19 #include "helper_funcs.h"
20 #include "tex_helpers.h"
22 #include "frontends/Dialogs.h"
23 #include "frontends/LyXView.h"
25 #include "support/filetools.h" // FileSearch
26 #include "support/path.h"
27 #include "support/lstrings.h"
29 extern string user_lyxdir; // home of *Files.lst
33 string getFileList(ControlTexinfo::texFileSuffix type, bool withFullPath)
36 case ControlTexinfo::bst:
37 return getTexFileList("bstFiles.lst", withFullPath);
39 case ControlTexinfo::cls:
40 return getTexFileList("clsFiles.lst", withFullPath);
42 case ControlTexinfo::sty:
43 return getTexFileList("styFiles.lst", withFullPath);
51 ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d)
52 : ControlDialogBI(lv, d)
56 // build filelists of all availabe bst/cls/sty-files. done through
57 // kpsewhich and an external script, saved in *Files.lst
58 void ControlTexinfo::rescanStyles() const
64 void ControlTexinfo::runTexhash() const
71 ControlTexinfo::getContents(texFileSuffix type, bool withFullPath) const
73 string list(getFileList(type, withFullPath));
78 list = getFileList(type, withFullPath);
84 void ControlTexinfo::viewFile(string const filename) const
86 lv_.getDialogs().showFile(filename);
90 string const ControlTexinfo::getClassOptions(string const & filename) const
92 return getListOfOptions(filename, "cls");