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 :
20 : #ifndef _EDITOBJ_HXX
21 : #define _EDITOBJ_HXX
22 :
23 : #include <tools/stream.hxx>
24 : #include <tools/debug.hxx>
25 : #include <rsc/rscsfx.hxx>
26 : #include <svl/itemset.hxx>
27 : #include <editeng/eeitem.hxx>
28 : #include <editeng/editdata.hxx>
29 : #include "editeng/editengdllapi.h"
30 :
31 : #include <vector>
32 :
33 : DBG_NAMEEX( EE_EditTextObject )
34 :
35 : class SfxItemPool;
36 : class SfxStyleSheetPool;
37 : class SvxFieldItem;
38 :
39 : namespace editeng {
40 :
41 : class FieldUpdater;
42 :
43 : }
44 :
45 : class EDITENG_DLLPUBLIC EditTextObject
46 : {
47 : private:
48 : sal_uInt16 nWhich;
49 : EDITENG_DLLPRIVATE EditTextObject& operator=( const EditTextObject& );
50 :
51 : protected:
52 : EditTextObject( sal_uInt16 nWhich );
53 : EditTextObject( const EditTextObject& r );
54 :
55 : virtual void StoreData( SvStream& rOStream ) const;
56 : virtual void CreateData( SvStream& rIStream );
57 :
58 : public:
59 : virtual ~EditTextObject();
60 :
61 888 : sal_uInt16 Which() const { return nWhich; }
62 :
63 : virtual sal_uInt16 GetUserType() const; // For OutlinerMode, it can however not save in compatible format
64 : virtual void SetUserType( sal_uInt16 n );
65 :
66 : virtual sal_uLong GetObjectSettings() const;
67 : virtual void SetObjectSettings( sal_uLong n );
68 :
69 : virtual bool IsVertical() const;
70 : virtual void SetVertical( bool bVertical );
71 :
72 : virtual sal_uInt16 GetScriptType() const;
73 :
74 : virtual sal_uInt16 GetVersion() const; // As long as the outliner does not store any record length.
75 :
76 : virtual EditTextObject* Clone() const = 0;
77 :
78 : sal_Bool Store( SvStream& rOStream ) const;
79 : static EditTextObject* Create( SvStream& rIStream,
80 : SfxItemPool* pGlobalTextObjectPool = 0 );
81 :
82 : virtual size_t GetParagraphCount() const;
83 :
84 : virtual String GetText(size_t nParagraph) const;
85 : virtual void Insert(const EditTextObject& rObj, size_t nPara);
86 : virtual void RemoveParagraph(size_t nPara);
87 : virtual EditTextObject* CreateTextObject(size_t nPara, size_t nParas = 1) const;
88 :
89 : virtual sal_Bool HasPortionInfo() const;
90 : virtual void ClearPortionInfo();
91 :
92 : virtual sal_Bool HasOnlineSpellErrors() const;
93 :
94 : virtual sal_Bool HasCharAttribs( sal_uInt16 nWhich = 0 ) const;
95 : virtual void GetCharAttribs( sal_uInt16 nPara, std::vector<EECharAttrib>& rLst ) const;
96 :
97 : virtual sal_Bool RemoveCharAttribs( sal_uInt16 nWhich = 0 );
98 : virtual sal_Bool RemoveParaAttribs( sal_uInt16 nWhich = 0 );
99 :
100 : virtual void MergeParaAttribs( const SfxItemSet& rAttribs, sal_uInt16 nStart = EE_CHAR_START, sal_uInt16 nEnd = EE_CHAR_END );
101 :
102 : virtual sal_Bool IsFieldObject() const;
103 : virtual const SvxFieldItem* GetField() const;
104 : virtual sal_Bool HasField( TypeId aType = NULL ) const;
105 :
106 : virtual SfxItemSet GetParaAttribs(size_t nPara) const;
107 : virtual void SetParaAttribs(size_t nPara, const SfxItemSet& rAttribs);
108 :
109 : virtual sal_Bool HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const;
110 : virtual void GetStyleSheet(size_t nPara, String& rName, SfxStyleFamily& eFamily) const;
111 : virtual void SetStyleSheet(size_t nPara, const String& rName, const SfxStyleFamily& eFamily);
112 : virtual sal_Bool ChangeStyleSheets( const XubString& rOldName, SfxStyleFamily eOldFamily,
113 : const XubString& rNewName, SfxStyleFamily eNewFamily );
114 : virtual void ChangeStyleSheetName( SfxStyleFamily eFamily, const XubString& rOldName, const XubString& rNewName );
115 :
116 : virtual editeng::FieldUpdater GetFieldUpdater() = 0;
117 :
118 : bool operator==( const EditTextObject& rCompare ) const;
119 :
120 : // #i102062#
121 : bool isWrongListEqual(const EditTextObject& rCompare) const;
122 : };
123 :
124 : #endif // _EDITOBJ_HXX
125 :
126 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|