]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlTexinfo.h
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlTexinfo.h
1 // -*- C++ -*-
2 /**
3  * \file ControlTexinfo.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Herbert Voß
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef CONTROLTEXINFO_H
13 #define CONTROLTEXINFO_H
14
15
16 #include "Dialog.h"
17 #include "tex_helpers.h"
18
19 namespace lyx {
20 namespace frontend {
21
22 /** A controller for Texinfo dialogs. */
23
24 class ControlTexinfo : public Dialog::Controller {
25 public:
26         ///
27         ControlTexinfo(Dialog &);
28         /// Nothing to initialise in this case.
29         virtual bool initialiseParams(std::string const &) { return true; }
30         ///
31         virtual void clearParams() {}
32         ///
33         virtual void dispatchParams() {}
34         ///
35         virtual bool isBufferDependent() const { return false; }
36
37
38         /// the file extensions
39         enum texFileSuffix {cls, sty, bst};
40         /// show contents af a file
41         void viewFile(std::string const & filename) const;
42         /// show all classoptions
43         std::string const getClassOptions(std::string const & filename) const;
44         /// return file type as string
45         std::string const getFileType(ControlTexinfo::texFileSuffix type) const;
46 private:
47         ///
48         virtual void apply() {}
49 };
50
51
52 /** Fill \c contents from one of the three texfiles.
53  *  Each entry in the file list is returned as a pair<name_with_path, name_only>
54  */
55 void getTexFileList(ControlTexinfo::texFileSuffix type,
56                     std::vector<std::string> & contents, bool withPath);
57
58 } // namespace frontend
59 } // namespace lyx
60
61 #endif // CONTROLTEXINFO_H