merged tag ooo/OOO330_m14
[LibreOffice.git] / sw / inc / IGrammarContact.hxx
blob44c54b55fe9fc02a11594b6851be687ce011f08f
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
28 #ifndef IGRAMMARCONTACT_HXX_INCLUDED
29 #define IGRAMMARCONTACT_HXX_INCLUDED
31 struct SwPosition;
32 class SwTxtNode;
33 class SwGrammarMarkUp;
34 class SwDoc;
36 /** Organizer of the contact between SwTxtNodes and grammar checker
38 class IGrammarContact
40 public:
42 /** Update cursor position reacts to a change of the current input cursor
43 As long as the cursor in inside a paragraph, the grammar checking does
44 not show new grammar faults. When the cursor leaves the paragraph, these
45 faults are shown.
46 @returns void
48 virtual void updateCursorPosition( const SwPosition& rNewPos ) = 0;
50 /** getGrammarCheck checks if the given text node is blocked by the current cursor
51 if not, the normal markup list is returned
52 if blocked, it will return a markup list "proxy"
53 @returns a markup list (grammar) for the given SwTxtNode
55 virtual SwGrammarMarkUp* getGrammarCheck( SwTxtNode& rTxtNode, bool bCreate ) = 0;
57 /** finishGrammarCheck() has to be called if a grammar checking has been completed
58 for a text node. If this text node has not been hided by the current proxy list
59 it will be repainted. Otherwise the proxy list replaces the old list and the
60 repaint will be triggered by a timer
61 @returns void
63 virtual void finishGrammarCheck( SwTxtNode& rTxtNode ) = 0;
65 public:
66 virtual ~IGrammarContact() {}
69 /** Factory for a grammar contact
70 @returns a new created grammar contact object
72 IGrammarContact* createGrammarContact();
74 /* Helper functions */
76 /** getGrammarContact() delivers the grammar contact of the document (for a given textnode)
77 @returns grammar contact
79 IGrammarContact* getGrammarContact( const SwTxtNode& );
81 /** finishGrammarCheck() calls the same function of the grammar contact of the document (for a given textnode)
82 @returns void
84 void finishGrammarCheck( SwTxtNode& );
86 #endif // IGRAMMARCONTACT_HXX_INCLUDED