125 friend class ::sd::outliner::OutlinerContainer;
182 const vcl::Font* pTargetFont, sal_Int32 nOptions,
bool bIsInteractive);
199 class Implementation;
200 ::std::unique_ptr<Implementation>
mpImpl;
368 std::vector<sd::SearchSelection>* pSelections);
509 void SetViewShell(
const std::shared_ptr<::sd::ViewShell>& rpViewShell);
The main purpose of this class is searching and replacing as well as spelling of impress documents.
SdOutliner(SdDrawDocument *pDoc, OutlinerMode nMode)
Create a new sd outliner object.
bool HasNoPreviousMatch()
Detect whether there exists a previous match.
bool HandleFailedSearch()
Handle a failed search (with or without replace) for the outline mode.
void RememberStartPosition()
Remember the current edited object/caret position/page/view mode when starting to search/spell check ...
void PrepareSearchAndReplace()
Prepare to search and replace on the current text object.
void PrepareConversion()
Prepare to do a text conversion on the current text object.
void StartSpelling()
Initialize a spell check but do not start it yet.
std::unique_ptr< const SvxSearchItem > mpSearchItem
The search item contains various attributes that define the type of search.
SdrObject * mpObj
Current object that may be a text object.
sal_uInt16 mnStartPageIndex
The current page index on starting to search/spell check.
::std::vector< unotools::WeakReference< SdrObject > > maMarkListCopy
When the search is restricted to the current selection then this list contains pointers to all the ob...
SdDrawDocument * GetDoc() const
void ProvideNextTextObject()
Provide next object to search or spell check as text object in edit mode on the current page.
void sendLOKSearchResultCallback(const std::shared_ptr< sd::ViewShell > &pViewShell, const OutlinerView *pOutlinerView, std::vector< sd::SearchSelection > *pSelections)
::sd::outliner::Iterator maObjectIterator
The actual object iterator.
sal_uInt16 mnPageCount
The number of pages in the current view.
bool mbStringFound
Specifies whether the search string has been found so far.
virtual bool SpellNextDocument() override
Initiate the spell check of the next relevant text object.
bool mbFoundObject
Set to <TRUE> when an object has been prepared successfully for searching/spell checking.
SdOutliner(const Outliner &)=delete
Forbid copy construction and copy assignment.
void DetectChange()
Detect changes of the document or view and react accordingly.
void ShowEndOfSearchDialog()
Show a dialog that tells the user that the search has ended either because there are no more matches ...
virtual ~SdOutliner() override
Nothing spectacular in the destructor.
SdOutliner & operator=(const Outliner &)=delete
EditMode meStartEditMode
The master page mode that was active when starting to search/spell check.
SdrObject * SetObject(const ::sd::outliner::IteratorPosition &rPosition)
Take a position as returned by an object iterator and switch to the view and page on which the object...
void PutTextIntoOutliner()
Put text of current text object into outliner so that the text can be searched/spell checked.
OutlinerParaObject * mpParaObj
Paragraph object of <member>mpTextObj</member>.
void HandleChangedSelection()
Activate or deactivate the search in the current selection.
bool mbRestrictSearchToSelection
This flag indicates that only the selected objects are to be searched.
bool SearchAndReplaceAll()
Do search and replace for whole document.
std::weak_ptr<::sd::ViewShell > mpWeakViewShell
The view shell containing the view.
VclPtr<::sd::Window > mpWindow
This window contains the view.
bool mbEndOfSearch
A <TRUE> value indicates that the end of the find&replace or spell check has been reached.
void SetViewShell(const std::shared_ptr<::sd::ViewShell > &rpViewShell)
Use this method when the view shell in which to search has changed.
void Initialize(bool bDirectionIsForward)
Initialize the object iterator.
bool mbDirectionIsForward
This flag indicates whether to search forward or backwards.
void SetPage(EditMode eEditMode, sal_uInt16 nPageIndex)
Switch to the page or master page specified by the <member>mnPage</member> index.
int mnIgnoreCurrentPageChangesLevel
While the value of this flag is greater than 0 changes of the current page do not lead to selecting t...
bool StartSearchAndReplace(const SvxSearchItem *pSearchItem)
Initiate a find and/or replace on the next relevant text object.
void PrepareSpelling()
Despite the name this method is called prior to spell checking and searching and replacing.
weld::Window * GetMessageBoxParent()
Find the right parent to use for a message.
void BeginConversion()
This is called internally when text conversion is started.
void StartConversion(LanguageType nSourceLanguage, LanguageType nTargetLanguage, const vcl::Font *pTargetFont, sal_Int32 nOptions, bool bIsInteractive)
Starts the text conversion (hangul/hanja or Chinese simplified/traditional) for the current viewshell...
void EndOfSearch()
Handle the situation that the iterator has reached the last object.
::sd::View * mpView
The view which displays the searched objects.
PageKind meStartViewMode
The view mode that was active when starting to search/spell check.
bool SearchAndReplaceOnce(std::vector<::sd::SearchSelection > *pSelections=nullptr)
Do search and replace for next match.
void IncreIgnoreCurrentPageChangesLevel()
ESelection maStartSelection
The position of the caret when searching /spell checking was started.
void EndConversion()
Release all resources that have been created during the conversion.
::sd::outliner::IteratorPosition maCurrentPosition
The current position of the object iterator.
void PrepareSpellCheck()
Prepare to do spell checking on the current text object.
enum SdOutliner::mode meMode
::sd::outliner::IteratorPosition maLastValidPosition
The last valid position describes where the last text object has been found.
void SetViewMode(PageKind ePageKind)
Switch to a new view mode.
bool ShowWrapAroundDialog()
Show a dialog that asks the user whether to wrap around to the beginning/end of the document and cont...
LanguageType mnConversionLanguage
this is the language that is used for current text conversion.
SdDrawDocument * mpDrawDocument
The document on whose objects and pages this class operates.
void DecreIgnoreCurrentPageChangesLevel()
::sd::outliner::Iterator maSearchStartPosition
The position when the search started.
ESelection GetSearchStartPosition() const
Return the position at which a new search is started with respect to the search direction as specifie...
mode
Specifies whether to search and replace, to spell check or to do a text conversion.
SdrObject * mpStartEditedObject
The object in edit mode when searching /spell checking was started (if any).
sal_Int32 mnText
Current text to be searched/spelled inside the current text object.
bool ConvertNextDocument() override
callback for textconversion
::std::unique_ptr< Implementation > mpImpl
SdrTextObj * mpSearchSpellTextObj
Candidate for being searched/spell checked.
int GetIgnoreCurrentPageChangesLevel() const
void EndSpelling()
Release all resources that have been created during the find&replace or spell check.
void EnterEditMode(bool bGrabFocus)
Switch on edit mode for the currently selected text object.
svx::SpellPortions GetNextSpellSentence()
Iterate over the sentences in all text shapes and stop at the next sentence with spelling errors.
SdrObject * mpFirstObj
this stores the first object that is used for text conversion.
OutlinerView * getOutlinerView()
Returns the current outline view.
bool DetectSelectionChange()
Detect whether the selection has changed.
bool mbPrepareSpellingPending
When this flag is true then a PrepareSpelling() is executed when StartSearchAndReplace() is called th...
bool mbMatchMayExist
This flag indicates whether there may exist a match of the search string before/after the current pos...
void RestoreStartPosition()
Restore the position stored in the last call of <member>RememberStartPositiony</member>.
Data collection specifying a <type>SdrObject</type> and its position in a document and view.
This iterator can be used to iterate over all <type>SdrObject</type> objects of one of three set deno...
std::vector< SpellPortion > SpellPortions
Describes a single search hit: a set of rectangles on a given page.
bool operator==(const SearchSelection &rOther) const
SearchSelection(int nPage, OString aRectangles)
int m_nPage
0-based index of the page that has the selection.
OString m_aRectangles
List of selection rectangles in twips – multiple rectangles only in case the selection spans over mor...