Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef _TXTFLD_HXX
20 : #define _TXTFLD_HXX
21 :
22 : #include <txatbase.hxx>
23 : #include <tools/string.hxx>
24 :
25 : class SwTxtNode;
26 :
27 : // ATT_FLD ***********************************
28 :
29 : class SwTxtFld : public SwTxtAttr
30 : {
31 : mutable String m_aExpand;
32 : SwTxtNode * m_pTxtNode;
33 :
34 : public:
35 : SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart,
36 : bool const bInClipboard);
37 : virtual ~SwTxtFld();
38 :
39 : void CopyFld( SwTxtFld *pDest ) const;
40 : void Expand() const;
41 : inline void ExpandAlways();
42 :
43 : // get and set TxtNode pointer
44 887 : SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
45 : inline SwTxtNode& GetTxtNode() const;
46 558 : void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
47 : // enable notification that field content has changed and needs reformatting
48 : void NotifyContentChange(SwFmtFld& rFmtFld);
49 :
50 : /**
51 : Returns position of this field.
52 :
53 : @return position of this field. Has to be deleted explicitly.
54 : */
55 : };
56 :
57 590 : inline SwTxtNode& SwTxtFld::GetTxtNode() const
58 : {
59 : OSL_ENSURE( m_pTxtNode, "SwTxtFld:: where is my TxtNode?" );
60 590 : return *m_pTxtNode;
61 : }
62 :
63 0 : inline void SwTxtFld::ExpandAlways()
64 : {
65 0 : m_aExpand += ' ';
66 0 : Expand();
67 0 : }
68 :
69 : #endif
70 :
71 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|