xref: /aoo42x/main/sw/inc/txtfld.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 #ifndef _TXTFLD_HXX
24 #define _TXTFLD_HXX
25 
26 #include <txatbase.hxx>
27 #include <tools/string.hxx>
28 #include <pam.hxx>
29 
30 class SwTxtNode;
31 
32 // ATT_FLD ***********************************
33 
34 class SwTxtFld : public SwTxtAttr
35 {
36     mutable   String m_aExpand;
37     SwTxtNode * m_pTxtNode;
38 
39 public:
40     SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart);
41     virtual ~SwTxtFld();
42 
43 	void CopyFld( SwTxtFld *pDest ) const;
44     void Expand() const;
45 	inline void ExpandAlways();
46 
47     // get and set TxtNode pointer
48     SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
49     inline SwTxtNode& GetTxtNode() const;
50     void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
51     // enable notification that field content has changed and needs reformatting
52     void NotifyContentChange(SwFmtFld& rFmtFld);
53 
54     // #111840#
55     /**
56        Returns position of this field.
57 
58        @return position of this field. Has to be deleted explicitly.
59     */
60 //    SwPosition * GetPosition() const;
61 };
62 
63 inline SwTxtNode& SwTxtFld::GetTxtNode() const
64 {
65     ASSERT( m_pTxtNode, "SwTxtFld:: where is my TxtNode?" );
66     return *m_pTxtNode;
67 }
68 
69 inline void SwTxtFld::ExpandAlways()
70 {
71     m_aExpand += ' ';
72     Expand();
73 }
74 
75 #endif
76 
77