bump product version to 4.1.6.2
[LibreOffice.git] / sw / inc / txtfld.hxx
blobb1e497556398f5741df40d7c19facab29d8ca9f8
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _TXTFLD_HXX
20 #define _TXTFLD_HXX
22 #include <txatbase.hxx>
23 #include <tools/string.hxx>
24 #include <pam.hxx>
26 class SwTxtNode;
28 // ATT_FLD ***********************************
30 class SwTxtFld : public SwTxtAttr
32 mutable String m_aExpand;
33 SwTxtNode * m_pTxtNode;
35 public:
36 SwTxtFld(SwFmtFld & rAttr, xub_StrLen const nStart,
37 bool const bInClipboard);
38 virtual ~SwTxtFld();
40 void CopyFld( SwTxtFld *pDest ) const;
41 void Expand() const;
42 inline void ExpandAlways();
44 // get and set TxtNode pointer
45 SwTxtNode* GetpTxtNode() const { return m_pTxtNode; }
46 inline SwTxtNode& GetTxtNode() const;
47 void ChgTxtNode( SwTxtNode* pNew ) { m_pTxtNode = pNew; }
48 // enable notification that field content has changed and needs reformatting
49 void NotifyContentChange(SwFmtFld& rFmtFld);
51 /**
52 Returns position of this field.
54 @return position of this field. Has to be deleted explicitly.
58 inline SwTxtNode& SwTxtFld::GetTxtNode() const
60 OSL_ENSURE( m_pTxtNode, "SwTxtFld:: where is my TxtNode?" );
61 return *m_pTxtNode;
64 inline void SwTxtFld::ExpandAlways()
66 m_aExpand += ' ';
67 Expand();
70 #endif
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */