mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-21 15:18:45 +00:00
c3a34a64f1
* undo_funcs.h: Removed setCursorParUndo to simplify things a bit. Renamed setUndo family to recordUndo. Renamed FINISH to ATOMIC which I think is a bit clearer. EDIT is gone, since it was premature optimisation, and broken for mathed anyway. * undo_funcs.C (performUndoOrRedo): Cleaned up and made it work with cursor positioning in insets as well (math insets still do not work, but that's a different story anyway.) It mysteriously crashes sometimes with undo in the first paragraph, but I'm fairly confident that this is a compiler bug. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7358 a592a061-630c-0410-9148-cb99ea01b6c8
93 lines
1.9 KiB
C++
93 lines
1.9 KiB
C++
// -*- C++ -*-
|
|
/* \file iterators.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author unknown
|
|
* \author Lars Gullik Bjønnes
|
|
*
|
|
* Full author contact details are available in file CREDITS
|
|
*/
|
|
|
|
#ifndef ITERATORS_H
|
|
#define ITERATORS_H
|
|
|
|
#include "ParagraphList.h"
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
class ParIterator {
|
|
public:
|
|
///
|
|
ParIterator(ParagraphList::iterator pit, ParagraphList const & pl);
|
|
///
|
|
~ParIterator();
|
|
///
|
|
ParIterator(ParIterator const &);
|
|
///
|
|
void operator=(ParIterator const &);
|
|
///
|
|
ParIterator & operator++();
|
|
///
|
|
Paragraph & operator*() const;
|
|
///
|
|
ParagraphList::iterator operator->() const;
|
|
/// This gives us the top-most parent paragraph
|
|
ParagraphList::iterator outerPar() const;
|
|
///
|
|
ParagraphList::iterator pit() const;
|
|
///
|
|
ParagraphList & plist() const;
|
|
///
|
|
size_t size() const;
|
|
///
|
|
friend
|
|
bool operator==(ParIterator const & iter1, ParIterator const & iter2);
|
|
private:
|
|
struct Pimpl;
|
|
boost::scoped_ptr<Pimpl> pimpl_;
|
|
};
|
|
|
|
///
|
|
bool operator==(ParIterator const & iter1, ParIterator const & iter2);
|
|
|
|
///
|
|
bool operator!=(ParIterator const & iter1, ParIterator const & iter2);
|
|
|
|
|
|
class ParConstIterator {
|
|
public:
|
|
///
|
|
ParConstIterator(ParagraphList::iterator pit, ParagraphList const & pl);
|
|
///
|
|
~ParConstIterator();
|
|
///
|
|
ParConstIterator(ParConstIterator const &);
|
|
///
|
|
ParConstIterator & operator++();
|
|
///
|
|
ParagraphList::const_iterator pit() const;
|
|
///
|
|
Paragraph const & operator*() const;
|
|
///
|
|
ParagraphList::const_iterator operator->() const;
|
|
|
|
/// depth of nesting
|
|
size_t size() const;
|
|
///
|
|
friend
|
|
bool operator==(ParConstIterator const & iter1,
|
|
ParConstIterator const & iter2);
|
|
private:
|
|
struct Pimpl;
|
|
boost::scoped_ptr<Pimpl> pimpl_;
|
|
};
|
|
|
|
bool operator==(ParConstIterator const & iter1,
|
|
ParConstIterator const & iter2);
|
|
|
|
bool operator!=(ParConstIterator const & iter1,
|
|
ParConstIterator const & iter2);
|
|
|
|
#endif
|