xref: /aoo42x/main/sw/inc/SwNodeNum.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef _SW_NODE_NUM_HXX
25 #define _SW_NODE_NUM_HXX
26 
27 #include <SwNumberTree.hxx>
28 
29 class SwTxtNode;
30 struct SwPosition;
31 class SwNumRule;
32 class SwNumFmt;
33 
34 class SW_DLLPUBLIC SwNodeNum : public SwNumberTreeNode
35 {
36 public:
37     // --> OD 2008-02-19 #refactorlists#
38     explicit SwNodeNum( SwTxtNode* pTxtNode );
39     explicit SwNodeNum( SwNumRule* pNumRule );
40     // <--
41     virtual ~SwNodeNum();
42 
43     SwNumRule* GetNumRule() const;
44     void ChangeNumRule( SwNumRule& rNumRule );
45     SwTxtNode* GetTxtNode() const;
46 
47     virtual bool IsNotificationEnabled() const;
48 
49     virtual bool IsContinuous() const;
50 
51     virtual bool IsCounted() const;
52 
53     virtual bool LessThan(const SwNumberTreeNode & rNode) const;
54 
55     virtual bool IsRestart() const;
56 
57     virtual SwNumberTree::tSwNumTreeNumber GetStartValue() const;
58 
59 //    String ToString() const;
60 
61     SwPosition GetPosition() const;
62 
63     // --> OD 2006-03-07 #131436#
64     // The number tree root node is deleted, when the corresponding numbering
65     // rule is deleted. In this situation the number tree should be empty -
66     // still registered text nodes aren't allowed. But it is possible, that
67     // text nodes of the undo nodes array are still registered. These will be
68     // unregistered.
69     // Text nodes of the document nodes array aren't allowed to be registered
70     // in this situation - this will be asserted.
71     static void HandleNumberTreeRootNodeDelete( SwNodeNum& rNodeNum );
72     // <--
73 
74     /** determines the <SwNodeNum> instance, which is preceding the given text node
75 
76         OD 2007-09-06 #i81002#
77 
78         @author OD
79     */
80     const SwNodeNum* GetPrecedingNodeNumOf( const SwTxtNode& rTxtNode ) const;
81 
82 protected:
83     virtual SwNumberTreeNode * Create() const;
84 
85     // --> OD 2006-04-26 #i64010#
86     virtual bool HasCountedChildren() const;
87     virtual bool IsCountedForNumbering() const;
88     // <--
89 
90     // --> OD 2008-02-19 #refactorlists#
91     // method called before this tree node has been added to the list tree
92     virtual void PreAdd();
93     // method called at a child after this child has been removed from the list tree
94     virtual void PostRemove();
95     // <--
96 private:
97     SwTxtNode * mpTxtNode;
98     SwNumRule * mpNumRule;
99 
100     // --> OD 2006-03-07 #131436#
101     static void _UnregisterMeAndChildrenDueToRootDelete( SwNodeNum& rNodeNum );
102     // <--
103 
104     SwNodeNum( const SwNodeNum& );              // no copy constructor
105     SwNodeNum& operator=( const SwNodeNum& );   // no assignment operator
106 
107     virtual bool IsCountPhantoms() const;
108 
109     virtual bool IsNotifiable() const;
110 
111     virtual void NotifyNode();
112 };
113 
114 #endif // _SW_NODE_NUM_HXX
115