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.
22 * This struct represents a particular LyX "module", which is a like a layout
23 * file, except that it does not stand alone. In that sense, it is more like
24 * a LaTeX package, where a layout file corresponds to a LaTeX class.
30 LyXModule(std::string const & n, std::string const & i,
31 std::string const & d, std::vector<std::string> const & p,
32 std::vector<std::string> const & r,
33 std::vector<std::string> const & e);
34 /// whether the required packages are available
37 std::string const & getName() const { return name; }
39 std::string const & getID() const { return id; }
41 std::string const & getFilename() const { return filename; }
43 std::string const & getDescription() const { return description; }
45 std::vector<std::string> const & getPackageList() const
46 { return packageList; }
48 std::vector<std::string> const & getRequiredModules() const
49 { return requiredModules; }
50 /// Modules this one excludes: the list should be treated disjunctively
51 std::vector<std::string> const & getExcludedModules() const
52 { return excludedModules; }
53 /// \return true if the module is compatible with this one, i.e.,
54 /// it does not exclude us and we do not exclude it.
55 /// this will also return true if modName is unknown and we do not
56 /// exclude it, since in that case we cannot check its exclusions.
57 bool isCompatible(std::string const & modName) const;
59 static bool areCompatible(std::string const & mod1, std::string const & mod2);
61 /// what appears in the ui
63 /// the module's unique identifier
64 /// at present, this is the filename, without the extension
68 /// a short description for use in the ui
69 std::string description;
70 /// the LaTeX packages on which this depends, if any
71 std::vector<std::string> packageList;
72 /// Modules this one requires: at least one
73 std::vector<std::string> requiredModules;
74 /// Modules this one excludes: none of these
75 std::vector<std::string> excludedModules;
82 typedef std::vector<LyXModule> LyXModuleList;
85 * The ModuleList represents the various LyXModule's that are available at
92 /// reads the modules from a file generated by configure.py
95 LyXModuleList::const_iterator begin() const;
97 LyXModuleList::iterator begin();
99 LyXModuleList::const_iterator end() const;
101 LyXModuleList::iterator end();
103 bool empty() const { return modlist_.empty(); }
104 /// Returns a pointer to the LyXModule with filename str.
105 /// Returns a null pointer if no such module is found.
106 LyXModule * operator[](std::string const & str);
109 ModuleList(ModuleList const &);
111 void operator=(ModuleList const &);
112 /// add a module to the list
113 void addLayoutModule(std::string const &, std::string const &,
114 std::string const &, std::vector<std::string> const &,
115 std::vector<std::string> const &, std::vector<std::string> const &);
117 std::vector<LyXModule> modlist_;
120 extern ModuleList moduleList;