/** Base class for the polymorphic implementation class of the <type>Iterator</type>class.Theiteratorsbasedonthisclassare basicallyunidirectionaliterators.Theirdirectioncan,however,be reversedatanypointoftheirlifetime.
*/ class IteratorImplBase
{ public: /** The constructor stores the given arguments to be used by the derived classes. @parampDocument Thedocumentprovidestheinformationtobeiteratedon. @parampViewShellWeak Someinformationhastobetakenfromtheviewshell. @parambDirectionIsForward Thisflagdefinestheiterationdirection.When<TRUE/>then thedirectionisforwardsotherwiseitisbackwards.
*/
IteratorImplBase (SdDrawDocument* pDocument, const std::weak_ptr<ViewShell>& rpViewShellWeak, bool bDirectionIsForward);
IteratorImplBase (SdDrawDocument* pDocument,
std::weak_ptr<ViewShell> pViewShellWeak, bool bDirectionIsForward, PageKind ePageKind, EditMode eEditMode); virtual ~IteratorImplBase();
/** Advance to the next text of the current object or to the next object. Thistakestheiterationdirectioninto account.Thenewobjectpointedtocanberetrieved(amongother information)bycallingthe<member>GetPosition</member>method.
*/ virtualvoid GotoNextText() = 0; /** Return an object that describes the current object. @return Thereturnedobjectdescribesthecurrentobjectpointedtoby theiterator.Seethedescriptionof <type>IteratorPosition</type>fordetailsontheavailable information.
*/ virtualconst IteratorPosition& GetPosition(); /** Create an exact copy of this object. No argument should be specifiedwhencalledfromtheoutside.Itthencreatesanobject firstandpassesthattotheinherited<member>Clone()</member> methodstofillinclassspecificinformation. @return Returnsacopyofthisobject.Whenthismethodiscalledwith anargumentthenthisvaluewillbereturned.
*/ virtual IteratorImplBase* Clone (IteratorImplBase* pObject=nullptr) const; /** Test the equality of the this object and the given iterator. Two iteratorsaretakentobeequalwhentheypointtothesameobject. Iterationdirectionisnottakenintoaccount. @paramrIterator Theiteratortocompareto. @return Whenbothiteratorsareequal<TRUE/>isreturned,<FALSE/>otherwise.
*/ virtualbooloperator== (const IteratorImplBase& rIterator) const; /** This method is used by the equality operator. It is part of a "multimethod" pattern. @paramrIterator Theiteratortocompareto. @return Returns<TRUE/>whenbothiteratorspointtothesameobject.
*/ virtualbool IsEqualSelection(const IteratorImplBase& rIterator) const; /** Reverse the direction of iteration. The current object stays the same.
*/ virtualvoid Reverse();
protected: /// The current position as returned by <member>GetPosition()</member>.
IteratorPosition maPosition; /// The document on whose data the iterator operates.
SdDrawDocument* mpDocument; /// Necessary secondary source of information.
std::weak_ptr<ViewShell> mpViewShellWeak; /// Specifies the search direction. bool mbDirectionIsForward;
};
/** Iterator all objects that belong to the current mark list a.k.a.selection.Itisassumedthatallmarkedobjectsbelongtothe samepage.Itisfurtherassumedthatthemarklistdoesnotchange whileaniteratorisalive.Itisthereforetheresponsibilityofan iterator'sownertohandlethecaseofachangedmarklist.
/** Compare the given iterator with this object. This method handles onlythecasethatthegiveniteratorisaninstanceofthisclass. @paramrIterator Theiteratortocompareto. @return Returns<TRUE/>whenbothiteratorspointtothesameobject.
*/ virtualbool IsEqualSelection(const IteratorImplBase& rIterator) const override;
private: /** Set up page pointer and object list iterator for the specified page. @paramnPageIndex Indexofthenewpage.Itmaylieoutsidethevalidrangefor pageindices.
*/ void SetPage (sal_Int32 nPageIndex);
/// Iterator of all objects on the current page.
std::optional<SdrObjListIter> moObjectIterator;
/// Pointer to the page associated with the current page index. May be NULL.
SdPage* mpPage;
/// Number of pages in the view that is specified by <member>maPosition</member>.
sal_Int32 mnPageCount;
// Don't use this operator.
DocumentIteratorImpl& operator= (const DocumentIteratorImpl& ) = delete;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.