1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: IGrammarContact.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef IGRAMMARCONTACT_HXX_INCLUDED
32 #define IGRAMMARCONTACT_HXX_INCLUDED
36 class SwGrammarMarkUp
;
39 /** Organizer of the contact between SwTxtNodes and grammar checker
45 /** Update cursor position reacts to a change of the current input cursor
46 As long as the cursor in inside a paragraph, the grammar checking does
47 not show new grammar faults. When the cursor leaves the paragraph, these
51 virtual void updateCursorPosition( const SwPosition
& rNewPos
) = 0;
53 /** getGrammarCheck checks if the given text node is blocked by the current cursor
54 if not, the normal markup list is returned
55 if blocked, it will return a markup list "proxy"
56 @returns a markup list (grammar) for the given SwTxtNode
58 virtual SwGrammarMarkUp
* getGrammarCheck( SwTxtNode
& rTxtNode
, bool bCreate
) = 0;
60 /** finishGrammarCheck() has to be called if a grammar checking has been completed
61 for a text node. If this text node has not been hided by the current proxy list
62 it will be repainted. Otherwise the proxy list replaces the old list and the
63 repaint will be triggered by a timer
66 virtual void finishGrammarCheck( SwTxtNode
& rTxtNode
) = 0;
69 virtual ~IGrammarContact() {}
72 /** Factory for a grammar contact
73 @returns a new created grammar contact object
75 IGrammarContact
* createGrammarContact();
77 /* Helper functions */
79 /** getGrammarContact() delivers the grammar contact of the document (for a given textnode)
80 @returns grammar contact
82 IGrammarContact
* getGrammarContact( const SwTxtNode
& );
84 /** finishGrammarCheck() calls the same function of the grammar contact of the document (for a given textnode)
87 void finishGrammarCheck( SwTxtNode
& );
89 #endif // IGRAMMARCONTACT_HXX_INCLUDED