mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
7f17f13bfc
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19900 a592a061-630c-0410-9148-cb99ea01b6c8
76 lines
2.0 KiB
C++
76 lines
2.0 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file ModuleList.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Richard Heck
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef MODULELIST_H
|
|
#define MODULELIST_H
|
|
|
|
#include <vector>
|
|
#include "support/FileName.h"
|
|
|
|
#include <boost/utility.hpp>
|
|
|
|
#include <map>
|
|
|
|
namespace lyx {
|
|
|
|
/**
|
|
* This struct represents a particular LyX "module", which is a like a layout
|
|
* file, except that it does not stand alone. In that sense, it is more like
|
|
* a LaTeX package, where a layout file corresponds to a LaTeX class.
|
|
*/
|
|
struct LyXModule {
|
|
/// what appears in the ui
|
|
std::string name;
|
|
/// the filename, without any path
|
|
std::string filename;
|
|
/// a short description for use in the ui
|
|
std::string description;
|
|
/// the LaTeX packages on which this depends, if any (not implemented)
|
|
std::vector<std::string> packageList;
|
|
/// whether those packages are available (not implemented yet)
|
|
bool available;
|
|
};
|
|
|
|
typedef std::vector<LyXModule> LyXModuleList;
|
|
|
|
/**
|
|
* The ModuleList represents the various LyXModule's that are available at
|
|
* present.
|
|
*/
|
|
class ModuleList : boost::noncopyable {
|
|
public:
|
|
/// reads the modules from a file generated by configure.py
|
|
bool load();
|
|
/// add a module to the list
|
|
void addLayoutModule(std::string name, std::string filename,
|
|
std::string description,
|
|
std::vector<std::string> packages);
|
|
///
|
|
LyXModuleList::const_iterator begin() const;
|
|
///
|
|
LyXModuleList::iterator begin();
|
|
///
|
|
LyXModuleList::const_iterator end() const;
|
|
///
|
|
LyXModuleList::iterator end();
|
|
///
|
|
bool empty() { return modlist_.empty(); };
|
|
/// Returns a pointer to the LyXModule with name str.
|
|
/// Returns a null pointer if no such module is found.
|
|
LyXModule * operator[](std::string str);
|
|
private:
|
|
std::vector<LyXModule> modlist_;
|
|
};
|
|
|
|
extern ModuleList moduleList;
|
|
}
|
|
#endif
|