2001-12-28 13:26:54 +00:00
|
|
|
|
// -*- C++ -*-
|
2003-08-23 00:17:00 +00:00
|
|
|
|
/**
|
2007-04-29 19:53:54 +00:00
|
|
|
|
* \file TextClassList.h
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2002-03-21 17:27:08 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
2001-12-28 13:26:54 +00:00
|
|
|
|
|
|
|
|
|
#ifndef LYXTEXTCLASSLIST_H
|
|
|
|
|
#define LYXTEXTCLASSLIST_H
|
|
|
|
|
|
2007-04-29 19:53:54 +00:00
|
|
|
|
#include "TextClass.h"
|
2004-11-16 20:41:38 +00:00
|
|
|
|
|
2001-12-28 13:26:54 +00:00
|
|
|
|
#include "support/types.h"
|
|
|
|
|
|
|
|
|
|
#include <boost/utility.hpp>
|
|
|
|
|
|
2003-10-07 06:45:25 +00:00
|
|
|
|
#include <string>
|
2001-12-28 13:26:54 +00:00
|
|
|
|
#include <vector>
|
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2007-04-29 18:58:28 +00:00
|
|
|
|
class Layout;
|
2001-12-28 13:26:54 +00:00
|
|
|
|
|
|
|
|
|
/// Reads the style files
|
2006-07-05 17:01:26 +00:00
|
|
|
|
extern bool LyXSetStyle();
|
2001-12-28 13:26:54 +00:00
|
|
|
|
|
|
|
|
|
///
|
2007-04-29 19:53:54 +00:00
|
|
|
|
class TextClassList : boost::noncopyable {
|
2001-12-28 13:26:54 +00:00
|
|
|
|
public:
|
|
|
|
|
///
|
2007-04-29 19:53:54 +00:00
|
|
|
|
typedef std::vector<TextClass> ClassList;
|
2001-12-28 13:26:54 +00:00
|
|
|
|
///
|
|
|
|
|
typedef ClassList::const_iterator const_iterator;
|
|
|
|
|
///
|
2002-07-21 21:21:06 +00:00
|
|
|
|
const_iterator begin() const { return classlist_.begin(); }
|
2001-12-28 13:26:54 +00:00
|
|
|
|
///
|
2002-07-21 21:21:06 +00:00
|
|
|
|
const_iterator end() const { return classlist_.end(); }
|
2001-12-28 13:26:54 +00:00
|
|
|
|
|
2002-05-29 13:28:11 +00:00
|
|
|
|
/// Gets textclass number from name, -1 if textclass name does not exist
|
2006-10-21 00:16:43 +00:00
|
|
|
|
std::pair<bool, textclass_type> const
|
2006-04-09 00:26:19 +00:00
|
|
|
|
numberOfClass(std::string const & textclass) const;
|
2001-12-28 13:26:54 +00:00
|
|
|
|
|
|
|
|
|
///
|
2007-04-29 19:53:54 +00:00
|
|
|
|
TextClass const & operator[](textclass_type textclass) const;
|
2001-12-28 13:26:54 +00:00
|
|
|
|
|
2002-05-29 13:28:11 +00:00
|
|
|
|
/// Read textclass list. Returns false if this fails.
|
2006-04-09 00:26:19 +00:00
|
|
|
|
bool read();
|
2006-04-09 04:35:24 +00:00
|
|
|
|
|
|
|
|
|
/// add a textclass from user local directory.
|
|
|
|
|
/// Return ture/false, and textclass number
|
2006-10-21 00:16:43 +00:00
|
|
|
|
std::pair<bool, textclass_type> const
|
2006-04-09 04:35:24 +00:00
|
|
|
|
addTextClass(std::string const & textclass, std::string const & path);
|
|
|
|
|
|
2001-12-28 13:26:54 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
2002-07-21 21:21:06 +00:00
|
|
|
|
mutable ClassList classlist_;
|
2001-12-28 13:26:54 +00:00
|
|
|
|
};
|
|
|
|
|
|
2002-03-21 17:27:08 +00:00
|
|
|
|
///
|
2007-04-29 19:53:54 +00:00
|
|
|
|
extern TextClassList textclasslist;
|
2001-12-28 13:26:54 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2001-12-28 13:26:54 +00:00
|
|
|
|
#endif
|