]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/xform_helpers.h
Swap two printer related help messages.
[lyx.git] / src / frontends / xforms / xform_helpers.h
1 #ifndef XFORMHELPERS_H
2 #define XFORMHELPERS_H
3
4 #ifdef __GNUG_
5 #pragma interface
6 #endif
7
8 #include <utility> // pair
9 //#include <config.h>
10 #include "LString.h"
11 #include "Color.h"
12
13 // Take a string and add breaks so that it fits into a desired label width, w
14 string formatted(string const &label, int w, int size, int style);
15
16 /** Launch a file dialog and return the chosen file.
17     filename: a suggested filename.
18     title: the title of the dialog.
19     pattern: *.ps etc.
20     dir1 = (name, dir), dir2 = (name, dir): extra buttons on the dialog.
21 */
22 string const browseFile(string const & filename,
23                         string const & title,
24                         string const & pattern, 
25                         std::pair<string,string> const & dir1,
26                         std::pair<string,string> const & dir2);
27
28 /// struct holding xform-specific colors
29 struct XformColor : public NamedColor {
30         int colorID;
31         XformColor() : NamedColor(), colorID(0) {}
32         static bool read(string const &);
33         static bool write(string const &);
34 };
35
36
37 /** Some functions that perform some quite detailed tests to ascertain whether
38     the directory or file is readable or writeable. If not, then an error
39     message is placed in error_message. */
40 class RWInfo {
41 public:
42         ///
43         static bool WriteableDir(string const & dir);
44         ///
45         static bool ReadableDir(string const & dir);
46         ///
47         static bool WriteableFile(string const & file);
48         ///
49         static bool ReadableFile(string const & file);
50         ///
51         static string const & ErrorMessage() { return error_message; }
52 private:
53         ///
54         static string error_message;
55 };
56 #endif