1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 * ======================================================
10 * \file ControlTexinfo.C
11 * \author Herbert Voss <voss@lyx.org>
17 #pragma implementation
20 #include "ControlTexinfo.h"
23 #include "helper_funcs.h"
24 #include "tex_helpers.h"
26 #include "frontends/LyXView.h"
28 #include "support/filetools.h" // FileSearch
29 #include "support/path.h"
30 #include "support/lstrings.h"
32 extern string user_lyxdir; // home of *Files.lst
36 string getFileList(ControlTexinfo::texFileSuffix type, bool withFullPath)
39 case ControlTexinfo::bst:
40 return getTexFileList("bstFiles.lst", withFullPath);
42 case ControlTexinfo::cls:
43 return getTexFileList("clsFiles.lst", withFullPath);
45 case ControlTexinfo::sty:
46 return getTexFileList("styFiles.lst", withFullPath);
54 ControlTexinfo::ControlTexinfo(LyXView & lv, Dialogs & d)
55 : ControlDialogBI(lv, d)
59 // build filelists of all availabe bst/cls/sty-files. done through
60 // kpsewhich and an external script, saved in *Files.lst
61 void ControlTexinfo::rescanStyles() const
67 void ControlTexinfo::runTexhash() const
74 ControlTexinfo::getContents(texFileSuffix type, bool withFullPath) const
76 string list(getFileList(type, withFullPath));
81 list = getFileList(type, withFullPath);
87 void ControlTexinfo::viewFile(string const filename) const
89 lv_.getDialogs()->showFile(filename);
93 string const ControlTexinfo::getClassOptions(string const & filename) const
95 return getListOfOptions(filename, "cls");