4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
23 Format(std::string const & n, std::string const & e, std::string const & p,
24 std::string const & s, std::string const & v, std::string const & ed);
28 bool isChildFormat() const;
30 std::string const parentFormat() const;
32 std::string const & name() const {
36 std::string const & extension() const {
40 std::string const & prettyname() const {
44 std::string const & shortcut() const {
48 std::string const & viewer() const {
52 void setViewer(std::string const & v) {
56 std::string const & editor() const {
62 std::string extension_;
64 std::string prettyname_;
66 std::string shortcut_;
74 bool operator<(Format const & a, Format const & b);
80 typedef std::vector<Format> FormatList;
82 typedef FormatList::const_iterator const_iterator;
84 Format const & get(FormatList::size_type i) const {
88 Format const * getFormat(std::string const & name) const;
90 int getNumber(std::string const & name) const;
92 void add(std::string const & name);
94 void add(std::string const & name, std::string const & extension,
95 std::string const & prettyname, std::string const & shortcut,
96 std::string const & viewer, std::string const & editor);
98 void erase(std::string const & name);
102 void setViewer(std::string const & name, std::string const & command);
104 bool view(Buffer const & buffer, std::string const & filename,
105 std::string const & format_name) const;
107 bool edit(Buffer const & buffer, std::string const & filename,
108 std::string const & format_name) const;
110 std::string const prettyName(std::string const & name) const;
112 std::string const extension(std::string const & name) const;
114 const_iterator begin() const {
115 return formatlist.begin();
118 const_iterator end() const {
119 return formatlist.end();
122 FormatList::size_type size() const {
123 return formatlist.size();
127 FormatList formatlist;
130 extern Formats formats;
132 extern Formats system_formats;