LibreOffice Module sw (master) 1
|
This class is responsible for the delayed display of grammar checks when a paragraph is edited It's a client of the paragraph the cursor points to. More...
#include <GrammarContact.hxx>
Public Member Functions | |
GrammarContact () | |
~GrammarContact () | |
void | updateCursorPosition (const SwPosition &rNewPos) |
Update cursor position reacts to a change of the current input cursor As long as the cursor in inside a paragraph, the grammar checking does not show new grammar faults. More... | |
SwGrammarMarkUp * | getGrammarCheck (SwTextNode &rTextNode, bool bCreate) |
getGrammarCheck checks if the given text node is blocked by the current cursor if not, the normal markup list is returned if blocked, it will return a markup list "proxy" More... | |
void | finishGrammarCheck (SwTextNode &rTextNode) |
finishGrammarCheck() has to be called if a grammar checking has been completed for a text node. More... | |
void | CheckBroadcaster () |
Public Member Functions inherited from SvtListener | |
SvtListener ()=default | |
SvtListener (const SvtListener &r)=default | |
virtual | ~SvtListener () COVERITY_NOEXCEPT_FALSE |
bool | StartListening (SvtBroadcaster &rBroadcaster) |
void | EndListening (SvtBroadcaster &rBroadcaster) |
void | EndListeningAll () |
void | CopyAllBroadcasters (const SvtListener &r) |
bool | HasBroadcaster () const |
virtual void | Notify (const SfxHint &rHint) |
virtual void | Query (QueryBase &rQuery) const |
Private Member Functions | |
DECL_LINK (TimerRepaint, Timer *, void) | |
Private Attributes | |
Timer | m_aTimer |
std::unique_ptr< SwGrammarMarkUp > | m_pProxyList |
bool | m_isFinished |
SwTextNode * | m_pTextNode |
This class is responsible for the delayed display of grammar checks when a paragraph is edited It's a client of the paragraph the cursor points to.
If the cursor position changes, updateCursorPosition has to be called If the grammar checker wants to set a grammar marker at a paragraph, he has to request the grammar list from this class. If the requested paragraph is not edited, it returns the normal grammar list. But if the paragraph is the active one, a proxy list will be returned and all changes are set in this proxy list. If the cursor leaves the paragraph the proxy list will replace the old list. If the grammar checker has completed the paragraph ('setChecked') then a timer is setup which replaces the old list as well.
Definition at line 42 of file GrammarContact.hxx.
sw::GrammarContact::GrammarContact | ( | ) |
Definition at line 29 of file GrammarContact.cxx.
References LINK, m_aTimer, Timer::SetInvokeHandler(), and Timer::SetTimeout().
|
inline |
Definition at line 52 of file GrammarContact.hxx.
References m_aTimer, and Task::Stop().
void sw::GrammarContact::CheckBroadcaster | ( | ) |
Definition at line 38 of file GrammarContact.cxx.
References SvtListener::HasBroadcaster(), m_pProxyList, and m_pTextNode.
Referenced by finishGrammarCheck(), getGrammarCheck(), and updateCursorPosition().
|
private |
void sw::GrammarContact::finishGrammarCheck | ( | SwTextNode & | rTextNode | ) |
finishGrammarCheck() has to be called if a grammar checking has been completed for a text node.
If this text node has not been hidden by the current proxy list it will be repainted. Otherwise the proxy list replaces the old list and the repaint will be triggered by a timer
Definition at line 127 of file GrammarContact.cxx.
References CheckBroadcaster(), SwTextNode::ClearGrammarCheck(), SwTextNode::GetGrammarCheck(), m_aTimer, m_isFinished, m_pProxyList, m_pTextNode, SwTextFrame::repaintTextFrames(), and Timer::Start().
Referenced by sw::finishGrammarCheckFor().
SwGrammarMarkUp * sw::GrammarContact::getGrammarCheck | ( | SwTextNode & | rTextNode, |
bool | bCreate | ||
) |
getGrammarCheck checks if the given text node is blocked by the current cursor if not, the normal markup list is returned if blocked, it will return a markup list "proxy"
Definition at line 87 of file GrammarContact.cxx.
References CheckBroadcaster(), SwGrammarMarkUp::Clone(), COMPLETE_STRING, SwTextNode::GetGrammarCheck(), m_isFinished, m_pProxyList, m_pTextNode, SwTextNode::SetGrammarCheck(), SwTextNode::SetGrammarCheckDirty(), and SwWrongList::SetInvalid().
Referenced by SwXTextMarkup::commitMultiTextMarkup(), SwXTextMarkup::commitStringMarkup(), and lcl_SetWrong().
void sw::GrammarContact::updateCursorPosition | ( | const SwPosition & | rNewPos | ) |
Update cursor position reacts to a change of the current input cursor As long as the cursor in inside a paragraph, the grammar checking does not show new grammar faults.
When the cursor leaves the paragraph, these faults are shown.
Definition at line 61 of file GrammarContact.cxx.
References CheckBroadcaster(), SvtListener::EndListeningAll(), SwPosition::GetNode(), SwNode::GetTextNode(), m_aTimer, m_pProxyList, m_pTextNode, SwTextFrame::repaintTextFrames(), SwTextNode::SetGrammarCheck(), SvtListener::StartListening(), and Task::Stop().
|
private |
Definition at line 44 of file GrammarContact.hxx.
Referenced by finishGrammarCheck(), GrammarContact(), updateCursorPosition(), and ~GrammarContact().
|
private |
Definition at line 46 of file GrammarContact.hxx.
Referenced by finishGrammarCheck(), and getGrammarCheck().
|
private |
Definition at line 45 of file GrammarContact.hxx.
Referenced by CheckBroadcaster(), finishGrammarCheck(), getGrammarCheck(), and updateCursorPosition().
|
private |
Definition at line 47 of file GrammarContact.hxx.
Referenced by CheckBroadcaster(), finishGrammarCheck(), getGrammarCheck(), and updateCursorPosition().