xref: /AOO41X/main/editeng/inc/editeng/editobj.hxx (revision 4c5491ea21520f5347760e8fc7d072f082fcde5f)
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 
24 #ifndef _EDITOBJ_HXX
25 #define _EDITOBJ_HXX
26 
27 #include <tools/stream.hxx>
28 #include <tools/debug.hxx>
29 #include <rsc/rscsfx.hxx>
30 #include <svl/itemset.hxx>
31 #include <editeng/eeitem.hxx>
32 #include "editeng/editengdllapi.h"
33 
34 DBG_NAMEEX( EE_EditTextObject )
35 
36 class SfxItemPool;
37 class SfxStyleSheetPool;
38 class SvxFieldItem;
39 class EECharAttribArray;
40 
41 #define EDTOBJ_SETTINGS_ULITEMSUMMATION     0x00000001
42 #define EDTOBJ_SETTINGS_ULITEMFIRSTPARA     0x00000002
43 
44 class EDITENG_DLLPUBLIC EditTextObject
45 {
46 private:
47     sal_uInt16              nWhich;
48     EDITENG_DLLPRIVATE EditTextObject&      operator=( const EditTextObject& );
49 
50 protected:
51                         EditTextObject( sal_uInt16 nWhich );
52                         EditTextObject( const EditTextObject& r );
53 
54     virtual void        StoreData( SvStream& rOStream ) const;
55     virtual void        CreateData( SvStream& rIStream );
56 
57 public:
58     virtual             ~EditTextObject();
59 
Which() const60     sal_uInt16              Which() const { return nWhich; }
61 
62     virtual sal_uInt16      GetUserType() const;    // Fuer OutlinerMode, der kann das aber nicht kompatibel speichern
63     virtual void        SetUserType( sal_uInt16 n );
64 
65     virtual sal_uLong       GetObjectSettings() const;
66     virtual void        SetObjectSettings( sal_uLong n );
67 
68     virtual sal_Bool        IsVertical() const;
69     virtual void        SetVertical( sal_Bool bVertical );
70 
71     virtual sal_uInt16      GetScriptType() const;
72 
73     virtual sal_uInt16      GetVersion() const; // Solange der Outliner keine Recordlaenge speichert
74 
75     virtual EditTextObject* Clone() const = 0;
76 
77     sal_Bool                    Store( SvStream& rOStream ) const;
78     static EditTextObject*  Create( SvStream& rIStream,
79                                 SfxItemPool* pGlobalTextObjectPool = 0 );
80     void                    Skip( SvStream& rIStream );
81 
82     virtual sal_uInt16      GetParagraphCount() const;
83 
84     virtual XubString   GetText( sal_uInt16 nParagraph ) const;
85     virtual void        Insert( const EditTextObject& rObj, sal_uInt16 nPara );
86     virtual void        RemoveParagraph( sal_uInt16 nPara );
87     virtual EditTextObject* CreateTextObject( sal_uInt16 nPara, sal_uInt16 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, EECharAttribArray& 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( sal_uInt16 nPara ) const;
107     virtual void        SetParaAttribs( sal_uInt16 nPara, const SfxItemSet& rAttribs );
108 
109     virtual sal_Bool        HasStyleSheet( const XubString& rName, SfxStyleFamily eFamily ) const;
110     virtual void        GetStyleSheet( sal_uInt16 nPara, XubString& rName, SfxStyleFamily& eFamily ) const;
111     virtual void        SetStyleSheet( sal_uInt16 nPara, const XubString& 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     bool                operator==( const EditTextObject& rCompare ) const;
117 
118     // #i102062#
119     bool isWrongListEqual(const EditTextObject& rCompare) const;
120 };
121 
122 #endif  // _EDITOBJ_HXX
123