1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
23 #include <tools/stream.hxx>
24 #include <tools/debug.hxx>
25 #include <rsc/rscsfx.hxx>
26 #include <svl/itemset.hxx>
27 #include "svl/itempool.hxx"
28 #include <editeng/eeitem.hxx>
29 #include <editeng/editdata.hxx>
30 #include "editeng/editengdllapi.h"
31 #include "editeng/macros.hxx"
33 #include <com/sun/star/text/textfield/Type.hpp>
37 DBG_NAMEEX( EE_EditTextObject
)
40 class SfxStyleSheetPool
;
47 class FieldUpdaterImpl
;
51 class EditTextObjectImpl
;
53 class EDITENG_DLLPUBLIC EditTextObject
: public SfxItemPoolUser
55 friend class EditTextObjectImpl
;
56 friend class editeng::FieldUpdaterImpl
;
57 friend class ImpEditEngine
;
59 EditTextObjectImpl
* mpImpl
;
61 EDITENG_DLLPRIVATE EditTextObject
& operator=( const EditTextObject
& );
63 EditTextObject(); // disabled
65 EditTextObject( SfxItemPool
* pPool
);
67 void StoreData( SvStream
& rStrm
) const;
68 void CreateData( SvStream
& rStrm
);
71 EditTextObject( const EditTextObject
& r
);
72 virtual ~EditTextObject();
74 sal_uInt16
GetUserType() const; // For OutlinerMode, it can however not save in compatible format
75 void SetUserType( sal_uInt16 n
);
77 bool IsVertical() const;
78 void SetVertical( bool bVertical
);
80 sal_uInt16
GetScriptType() const;
82 EditTextObject
* Clone() const;
84 bool Store( SvStream
& rOStream
) const;
86 static EditTextObject
* Create(
87 SvStream
& rIStream
, SfxItemPool
* pGlobalTextObjectPool
= NULL
);
89 sal_Int32
GetParagraphCount() const;
91 String
GetText(sal_Int32 nPara
) const;
93 void ClearPortionInfo();
95 bool HasOnlineSpellErrors() const;
97 void GetCharAttribs( sal_Int32 nPara
, std::vector
<EECharAttrib
>& rLst
) const;
99 bool RemoveCharAttribs( sal_uInt16 nWhich
= 0 );
101 bool IsFieldObject() const;
102 const SvxFieldItem
* GetField() const;
103 const SvxFieldData
* GetFieldData(sal_Int32 nPara
, size_t nPos
, sal_Int32 nType
) const;
104 bool HasField( sal_Int32 nType
= com::sun::star::text::textfield::Type::UNSPECIFIED
) const;
106 const SfxItemSet
& GetParaAttribs(sal_Int32 nPara
) const;
108 void GetStyleSheet(sal_Int32 nPara
, String
& rName
, SfxStyleFamily
& eFamily
) const;
109 void SetStyleSheet(sal_Int32 nPara
, const String
& rName
, const SfxStyleFamily
& eFamily
);
110 bool ChangeStyleSheets(
111 const XubString
& rOldName
, SfxStyleFamily eOldFamily
, const XubString
& rNewName
, SfxStyleFamily eNewFamily
);
112 void ChangeStyleSheetName( SfxStyleFamily eFamily
, const XubString
& rOldName
, const XubString
& rNewName
);
114 editeng::FieldUpdater
GetFieldUpdater();
116 bool operator==( const EditTextObject
& rCompare
) const;
119 bool isWrongListEqual(const EditTextObject
& rCompare
) const;
121 virtual void ObjectInDestruction(const SfxItemPool
& rSfxItemPool
);
123 #if DEBUG_EDIT_ENGINE
128 #endif // _EDITOBJ_HXX
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */