lyx_mirror/src/frontends/controllers/ControlTexinfo.C
Angus Leeming 0be0fcfd59 If I ever see another licence blurb again, it'll be too soon...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7598 a592a061-630c-0410-9148-cb99ea01b6c8
2003-08-23 00:17:00 +00:00

59 lines
1.2 KiB
C

/**
* \file ControlTexinfo.C
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author Herbert Voss
*
* Full author contact details are available in file CREDITS.
*/
#include <config.h>
#include "ControlTexinfo.h"
#include "funcrequest.h"
void getTexFileList(ControlTexinfo::texFileSuffix type,
std::vector<string> & list)
{
string filename;
switch (type) {
case ControlTexinfo::bst:
filename = "bstFiles.lst";
break;
case ControlTexinfo::cls:
filename = "clsFiles.lst";
break;
case ControlTexinfo::sty:
filename = "styFiles.lst";
break;
}
getTexFileList(filename, list);
if (list.empty()) {
// build filelists of all availabe bst/cls/sty-files.
// Done through kpsewhich and an external script,
// saved in *Files.lst
rescanTexStyles();
getTexFileList(filename, list);
}
}
ControlTexinfo::ControlTexinfo(Dialog & parent)
: Dialog::Controller(parent)
{}
void ControlTexinfo::viewFile(string const & filename) const
{
string const arg = "file " + filename;
kernel().dispatch(FuncRequest(LFUN_DIALOG_SHOW, arg));
}
string const ControlTexinfo::getClassOptions(string const & filename) const
{
return getListOfOptions(filename, "cls");
}