merge the formfield patch from ooo-build
[ooovba.git] / sw / inc / SwNodeNum.hxx
blobceba16e623d05642e9a69e1e0bb0a9c42d282fae
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: SwNodeNum.hxx,v $
10 * $Revision: 1.10 $
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 _SW_NODE_NUM_HXX
32 #define _SW_NODE_NUM_HXX
34 #include <SwNumberTree.hxx>
36 class SwTxtNode;
37 struct SwPosition;
38 class SwNumRule;
39 class SwNumFmt;
41 class SW_DLLPUBLIC SwNodeNum : public SwNumberTreeNode
43 public:
44 // --> OD 2008-02-19 #refactorlists#
45 explicit SwNodeNum( SwTxtNode* pTxtNode );
46 explicit SwNodeNum( SwNumRule* pNumRule );
47 // <--
48 virtual ~SwNodeNum();
50 SwNumRule* GetNumRule() const;
51 void ChangeNumRule( SwNumRule& rNumRule );
52 SwTxtNode* GetTxtNode() const;
54 virtual bool IsNotificationEnabled() const;
56 virtual bool IsContinuous() const;
58 virtual bool IsCounted() const;
60 virtual bool LessThan(const SwNumberTreeNode & rNode) const;
62 virtual bool IsRestart() const;
64 virtual SwNumberTree::tSwNumTreeNumber GetStartValue() const;
66 // String ToString() const;
68 SwPosition GetPosition() const;
70 // --> OD 2006-03-07 #131436#
71 // The number tree root node is deleted, when the corresponding numbering
72 // rule is deleted. In this situation the number tree should be empty -
73 // still registered text nodes aren't allowed. But it is possible, that
74 // text nodes of the undo nodes array are still registered. These will be
75 // unregistered.
76 // Text nodes of the document nodes array aren't allowed to be registered
77 // in this situation - this will be asserted.
78 static void HandleNumberTreeRootNodeDelete( SwNodeNum& rNodeNum );
79 // <--
81 /** determines the <SwNodeNum> instance, which is preceding the given text node
83 OD 2007-09-06 #i81002#
85 @author OD
87 const SwNodeNum* GetPrecedingNodeNumOf( const SwTxtNode& rTxtNode ) const;
89 protected:
90 virtual SwNumberTreeNode * Create() const;
92 // --> OD 2006-04-26 #i64010#
93 virtual bool HasCountedChildren() const;
94 virtual bool IsCountedForNumbering() const;
95 // <--
97 // --> OD 2008-02-19 #refactorlists#
98 // method called before this tree node has been added to the list tree
99 virtual void PreAdd();
100 // method called at a child after this child has been removed from the list tree
101 virtual void PostRemove();
102 // <--
103 private:
104 SwTxtNode * mpTxtNode;
105 SwNumRule * mpNumRule;
107 // --> OD 2006-03-07 #131436#
108 static void _UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum );
109 // <--
111 SwNodeNum( const SwNodeNum& ); // no copy constructor
112 SwNodeNum& operator=( const SwNodeNum& ); // no assignment operator
114 virtual bool IsCountPhantoms() const;
116 virtual bool IsNotifiable() const;
118 virtual void NotifyNode();
121 #endif // _SW_NODE_NUM_HXX