/** Use this enum to specify the initial location of the object pointed to by anewlycreatediterator.Thevaluesare <ul><li><const>BEGIN</const>forthefirstobjectwithreferenceto iterationdirection.</li> <li>ENDforonepastthelastvalidobjector,iftheiteratorisa backwarditerator,theobjectinfrontofthefirstvalidone.</li> <li>CURRENTforthecurrentobject.Becausethereisonlyacurrent pagethisusuallyistakentobethefirst/lastobjectonthecurrent page.</li></ul>
*/ enum IteratorLocation {BEGIN,END,CURRENT};
/** This iterator can be used to iterate over all <type>SdrObject</type> objectsofoneofthreesetdenotedbythe<type>IteratorType</type>: <ul><li>Allobjectsofthecurrentmarklist(selection) (type==SELECTION).</li> <li>Allobjectsinthecurrentview(type==SINGLE_VIEW).</li> <li>Allobjectsinallviews(type=DOCUMENT).</li></ul>
/** The copy constructor creates a new iterator by copying the implementationobject.
*/
Iterator (const Iterator& rIterator);
Iterator(Iterator&& rIterator) noexcept;
/** Create a new iterator with the implementation object being the providedone. @parampObject Acopyofthisobjectwillbecometheimplementationobject.
*/ explicit Iterator (std::unique_ptr<IteratorImplBase> pObject);
~Iterator();
/** Assign the iterator from the given one. The implementation object ofthisiteratorwillbeacopyofthegiveniterator. @paramrIterator Theiteratorwhichtoassignfrom.
*/
Iterator& operator= (const Iterator& rIterator);
Iterator& operator=(Iterator&& rIterator) noexcept;
/** Return the current position of the iterator. @return Returnsareferencetothecurrentposition.Thereforethis methodisnotthreadsafe.Thereasonforthisbehaviouris,of course,toomitthecopyingofthereturnedposition.
*/ const IteratorPosition& operator* () const; /** The prefix increment operator returns the iterator pointing to the nextobject.Whenindoubtpreferthisoperatoroverthepostfix incrementoperator. @return Returnsareferencetothisiteratorpointingtothenextobject.
*/
Iterator& operator++ (); /** Test equality of two iterators. Two iterators are taken to be equal whentheypointareofthesametype(theirimplementationobjects areinstancesofthesameclass)andpointtothesameobject. @paramrIterator Theiteratortotestequalitywith. @return Returns<TRUE/>whenbothiteratorspointtothesameobject.
*/ booloperator== (const Iterator& rIterator) const; /** Test whether two iterators point to different objects. This is just thenegationoftheresultoftheequalityoperator. @paramrIterator Theiteratortotestinequalitywith. @return Returns<TRUE/>whenbothiteratorspointtothedifferentobjects.
*/ booloperator!= (const Iterator& rIterator) const; /** Reverse the direction of iteration. The position of the iterator is notchanged.Thuscallingthismethodtwicereturnstotheoldstate.
*/ void Reverse();
private: /// The implementation object to which most of the methods are forwarded.
std::unique_ptr<IteratorImplBase> mxIterator;
};
/** This class wraps the <type>SdOutliner</type> class and represents it as acontainerof<type>SdrObject</type>objects.Itsmainpurposeisto provideiteratorsforcertainsub-setsofthoseobjects.Thesesub-sets area)thesetofthecurrentlyselectedobjects,b)allobjectsinthe currentview,andc)allobjectsinallviews.
<p>Thedirectionofthereturnediteratorsdependsontheunderlying <type>SdOutliner</type>objectandisusuallysetinthesearch dialog.</p>
*/ class OutlinerContainer
{ public: /** Create a new wrapper object for the given outliner. @parampOutliner Theoutlinerthatisrepresentedbythenewobjectas <type>SdrObject</type>container.
*/
OutlinerContainer (SdOutliner* pOutliner);
/** Return an iterator that points to the first object of one of the setsdescribedabove.Thistakesalsointoaccountthedirectionof iteration. @return Thereturnediteratorpointseithertothefirst(forward search)ortothelastobject(backwardsearch)oftheset.
*/
Iterator begin();
/** Return an iterator that marks the end of the iteration. This takes alsointoaccountthedirectionofiteration.Theobjectpointedto isnotvalid. @return Thereturnediteratorpointseithertothatobjectpastthelast one(forwardsearch)ortotheoneinfrontofthefirst (backwardsearch).
*/
Iterator end();
/** Return an iterator that points to the current object of one of the setsdescribedabove.Thistakesalsointoaccountthedirectionof iteration. @return Thereturnediteratorpointseithertothefirst(forward search)ortothelastobject(backwardsearch)ofthesetof selectedobjectsorofthecurrentpageifthesearchsetspans morethanonepage.
*/
Iterator current();
private: /// The wrapped outliner that is represented as object container.
SdOutliner* mpOutliner;
/** Create an iterator. The object pointed to depends on the search directionretrievedfromtheoutlinerobject <member>mpOutliner</member>andthegivenlocation. @paramaLocation Thisspecifieswhetherthereturnediteratorpointstothe first,(onepastthe)last,orcurrentobject. @return Returnsaniteratorasconstructedby <member>CreateSelectionIterator()</member>,
*/
Iterator CreateIterator (IteratorLocation aLocation);
/** Create an iterator that iterates over all currently selected <type>SdrObjects</type>objectsofthe<member>mpOutliner</member> outliner. @paramrObjectList Listofcurrentlyselectedobjects.Thislistisnecessary sothattheselectioncanbechangedwithoutaffectingthe iterator. @parampDocument Thedocumenttowhichtheobjectsbelong. @parampViewShell Theviewshellwhichdisplaystheobjects. @parambDirectionIsForward Thedirectionofiteration.Itdefaultstoforward. @paramaLocation Thisspecifiesatwhichobjecttheiteratorpointsinitially.
*/ static Iterator CreateSelectionIterator ( const ::std::vector<::unotools::WeakReference<SdrObject>>& rObjectList,
SdDrawDocument* pDocument, const std::shared_ptr<ViewShell>& rpViewShell, bool bDirectionIsForward,
IteratorLocation aLocation);
/** Create an iterator that iterates over all <type>SdrObjects</type> objectsofthe<member>mpOutliner</member>outliner. @parampDocument Thedocumenttowhichtheobjectsbelong. @parampViewShell Theviewshellwhichdisplaystheobjects. @parambDirectionIsForward Thedirectionofiteration.Itdefaultstoforward. @paramaLocation Thisspecifiesatwhichobjecttheiteratorpointsinitially.
*/ static Iterator CreateDocumentIterator (
SdDrawDocument* pDocument, const std::shared_ptr<ViewShell>& rpViewShell, bool bDirectionIsForward,
IteratorLocation aLocation);
/** Return the index of a page that contains an object that a new iteratorshallpointto.Thispageindexdependsprimarilyonthe location,iterationdirection,aswellasoneditmodeandpage kind. @parampDocument Thedocumenttowhichthepagebelongs. @parampViewShell Theviewshellwhichdisplaysthepage. @paramePageKind Specifiestheviewthepagebelongsto. @parameEditMode Specifieswhetherthepageisamasterpage. @parambDirectionIsForward Thedirectionofiteration. @paramaLocation Thisspecifiesatwhichobjecttheiteratorpointsinitially.
*/ static sal_Int32 GetPageIndex (
SdDrawDocument const * pDocument, const std::shared_ptr<ViewShell>& rpViewShell,
PageKind ePageKind,
EditMode eEditMode, bool bDirectionIsForward,
IteratorLocation aLocation);
// Do not allow default constructor and copying of outliner containers.
OutlinerContainer (const OutlinerContainer&) = delete;
OutlinerContainer& operator= (const OutlinerContainer&) = delete;
};
/** Data collection specifying a <type>SdrObject</type> and its position in adocumentandview.
*/ class IteratorPosition
{ public: /** Create a new object with all data members set to default values. Thesevaluesshouldnotbeaccessed.Theonlyuseoftheobjectas itisasamarkerincomparisons.
*/
IteratorPosition();
/** Compare two positions for equality. @return <TRUE/>isreturnedonlywhenalldatamembershavethesame valuesinbothpositionobjects.
*/ booloperator== (const IteratorPosition& aPosition) const;
/// Pointer to the actual <type>SdrObject</type> object.
::unotools::WeakReference<SdrObject> mxObject;
/// Number of the actual SdrText from the current <type>SdrObject</type>
sal_Int32 mnText;
/// The index of a page where the object is located on.
sal_Int32 mnPageIndex; /// Page kind of the view.
PageKind mePageKind; /// Edit mode of the view.
EditMode meEditMode;
};
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.