]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/frontend_helpers.h
remove unnneded #include
[lyx.git] / src / frontends / controllers / frontend_helpers.h
1 // -*- C++ -*-
2 /**
3  * \file frontend_helpers.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Angus Leeming
8  * \author Herbert Voß
9  *
10  * Full author contact details are available in file CREDITS.
11  */
12
13 #ifndef FRONTEND_HELPERS_H
14 #define FRONTEND_HELPERS_H
15
16 #include "support/docstring.h"
17
18 #include <utility>
19 #include <vector>
20 #include <string>
21
22 namespace lyx {
23
24 namespace support { class FileFilterList; }
25
26 namespace frontend {
27
28 ///
29 typedef std::pair<docstring, std::string> LanguagePair;
30
31 /** If the caller is the character dialog, add "No change" and "Reset"
32 *  to the vector.
33 */
34 std::vector<LanguagePair> const getLanguageData(bool character_dlg);
35
36 /** Launch a file dialog and return the chosen file.
37         filename: a suggested filename.
38         title: the title of the dialog.
39         pattern: *.ps etc.
40         dir1 = (name, dir), dir2 = (name, dir): extra buttons on the dialog.
41 */
42 docstring const
43 browseFile(docstring const & filename,
44          docstring const & title,
45          support::FileFilterList const & filters,
46          bool save = false,
47          std::pair<docstring, docstring> const & dir1 =
48          std::make_pair(docstring(), docstring()),
49          std::pair<docstring, docstring> const & dir2 =
50          std::make_pair(docstring(), docstring()));
51
52
53 /** Wrapper around browseFile which tries to provide a filename
54         relative to relpath.  If the relative path is of the form "foo.txt"
55         or "bar/foo.txt", then it is returned as relative. OTOH, if it is
56         of the form "../baz/foo.txt", an absolute path is returned. This is
57         intended to be useful for insets which encapsulate files/
58 */
59 docstring const
60 browseRelFile(docstring const & filename,
61                         docstring const & refpath,
62                         docstring const & title,
63                         support::FileFilterList const & filters,
64                         bool save = false,
65                         std::pair<docstring, docstring> const & dir1 =
66                         std::make_pair(docstring(), docstring()),
67                         std::pair<docstring, docstring> const & dir2 =
68                         std::make_pair(docstring(), docstring()));
69
70
71 /** Wrapper around browseFile which tries to provide a filename
72 *  relative to the user or system directory. The dir, name and ext
73 *  parameters have the same meaning as in the
74 *  support::LibFileSearch function.
75 */
76 docstring const
77 browseLibFile(docstring const & dir,
78                         docstring const & name,
79                         docstring const & ext,
80                         docstring const & title,
81                         support::FileFilterList const & filters);
82
83
84 /** Launch a file dialog and return the chosen directory.
85         pathname: a suggested pathname.
86         title: the title of the dialog.
87         dir1 = (name, dir), dir2 = (name, dir): extra buttons on the dialog.
88 */
89 docstring const
90 browseDir(docstring const & pathname,
91          docstring const & title,
92          std::pair<docstring, docstring> const & dir1 =
93          std::make_pair(docstring(), docstring()),
94          std::pair<docstring, docstring> const & dir2 =
95          std::make_pair(docstring(), docstring()));
96
97
98 /** Build filelists of all availabe bst/cls/sty-files. Done through
99 *  kpsewhich and an external script, saved in *Files.lst.
100 */
101 void rescanTexStyles();
102
103 /** Fill \c contents from one of the three texfiles.
104  *  Each entry in the file list is returned as a name_with_path
105  */
106 void getTexFileList(std::string const & filename, std::vector<std::string> & contents);
107
108 } // namespace frontend
109 } // namespace lyx
110
111 #endif // FRONTEND_HELPERS_H