LibreOffice Module sw (master)  1
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
SwGrammarContact Class Reference
Inheritance diagram for SwGrammarContact:
[legend]
Collaboration diagram for SwGrammarContact:
[legend]

Public Member Functions

 SwGrammarContact ()
 
virtual ~SwGrammarContact () override
 
virtual void updateCursorPosition (const SwPosition &rNewPos) override
 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...
 
virtual SwGrammarMarkUpgetGrammarCheck (SwTextNode &rTextNode, bool bCreate) override
 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...
 
virtual void finishGrammarCheck (SwTextNode &rTextNode) override
 finishGrammarCheck() has to be called if a grammar checking has been completed for a text node. More...
 
- Public Member Functions inherited from IGrammarContact
virtual ~IGrammarContact ()
 
- Public Member Functions inherited from SwClient
 SwClient ()
 
 SwClient (SwClient &&) noexcept
 
virtual ~SwClient () override
 
virtual void SwClientNotify (const SwModify &, const SfxHint &rHint) override
 
std::unique_ptr< sw::ModifyChangedHintCheckRegistration (const SfxPoolItem *pOldValue)
 
virtual void ModifyNotification (const SfxPoolItem *pOldValue, const SfxPoolItem *pNewValue)
 
void SwClientNotifyCall (const SwModify &rModify, const SfxHint &rHint)
 
const SwModifyGetRegisteredIn () const
 
SwModifyGetRegisteredIn ()
 
void EndListeningAll ()
 
void StartListeningToSameModifyAs (const SwClient &)
 
virtual bool GetInfo (SfxPoolItem &) const
 
- Public Member Functions inherited from sw::WriterListener
bool IsLast () const
 

Protected Member Functions

virtual void Modify (const SfxPoolItem *pOld, const SfxPoolItem *pNew) override
 
- Protected Member Functions inherited from SwClient
 SwClient (SwModify *pToRegisterIn)
 
SwModifyGetRegisteredInNonConst () const
 
- Protected Member Functions inherited from sw::WriterListener
 WriterListener ()
 
virtual ~WriterListener () COVERITY_NOEXCEPT_FALSE
 

Private Member Functions

SwTextNodegetMyTextNode ()
 
 DECL_LINK (TimerRepaint, Timer *, void)
 

Private Attributes

Timer aTimer
 
std::unique_ptr< SwGrammarMarkUpmpProxyList
 
bool mbFinished
 

Detailed Description

Definition at line 41 of file SwGrammarContact.cxx.

Constructor & Destructor Documentation

SwGrammarContact::SwGrammarContact ( )
virtual SwGrammarContact::~SwGrammarContact ( )
inlineoverridevirtual

Definition at line 51 of file SwGrammarContact.cxx.

References Task::Stop().

Member Function Documentation

SwGrammarContact::DECL_LINK ( TimerRepaint  ,
Timer ,
void   
)
private
void SwGrammarContact::finishGrammarCheck ( SwTextNode rTextNode)
overridevirtual

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

Returns
void

Implements IGrammarContact.

Definition at line 157 of file SwGrammarContact.cxx.

References aTimer, getMyTextNode(), SwClient::GetRegisteredIn(), mbFinished, mpProxyList, SwTextFrame::repaintTextFrames(), SwTextNode::SetGrammarCheck(), and Timer::Start().

SwGrammarMarkUp * SwGrammarContact::getGrammarCheck ( SwTextNode rTextNode,
bool  bCreate 
)
overridevirtual

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"

Returns
a markup list (grammar) for the given SwTextNode

Implements IGrammarContact.

Definition at line 104 of file SwGrammarContact.cxx.

References SwGrammarMarkUp::Clone(), COMPLETE_STRING, SwTextNode::GetGrammarCheck(), SwClient::GetRegisteredIn(), mbFinished, mpProxyList, SwTextNode::SetGrammarCheck(), SwTextNode::SetGrammarCheckDirty(), and SwWrongList::SetInvalid().

SwTextNode* SwGrammarContact::getMyTextNode ( )
inlineprivate

Definition at line 46 of file SwGrammarContact.cxx.

References SwClient::GetRegisteredIn().

Referenced by finishGrammarCheck(), and updateCursorPosition().

void SwGrammarContact::Modify ( const SfxPoolItem pOld,
const SfxPoolItem pNew 
)
overrideprotectedvirtual
void SwGrammarContact::updateCursorPosition ( const SwPosition rNewPos)
overridevirtual

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.

Returns
void

Implements IGrammarContact.

Definition at line 83 of file SwGrammarContact.cxx.

References SwModify::Add(), aTimer, SwClient::EndListeningAll(), getMyTextNode(), SwNodeIndex::GetNode(), SwClient::GetRegisteredIn(), SwNode::GetTextNode(), mpProxyList, SwPosition::nNode, SwTextFrame::repaintTextFrames(), SwTextNode::SetGrammarCheck(), and Task::Stop().

Member Data Documentation

Timer SwGrammarContact::aTimer
private
bool SwGrammarContact::mbFinished
private

Definition at line 45 of file SwGrammarContact.cxx.

Referenced by finishGrammarCheck(), and getGrammarCheck().

std::unique_ptr<SwGrammarMarkUp> SwGrammarContact::mpProxyList
private

The documentation for this class was generated from the following file: