1*38d50f7bSAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*38d50f7bSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*38d50f7bSAndrew Rist * or more contributor license agreements. See the NOTICE file 5*38d50f7bSAndrew Rist * distributed with this work for additional information 6*38d50f7bSAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*38d50f7bSAndrew Rist * to you under the Apache License, Version 2.0 (the 8*38d50f7bSAndrew Rist * "License"); you may not use this file except in compliance 9*38d50f7bSAndrew Rist * with the License. You may obtain a copy of the License at 10*38d50f7bSAndrew Rist * 11*38d50f7bSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*38d50f7bSAndrew Rist * 13*38d50f7bSAndrew Rist * Unless required by applicable law or agreed to in writing, 14*38d50f7bSAndrew Rist * software distributed under the License is distributed on an 15*38d50f7bSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*38d50f7bSAndrew Rist * KIND, either express or implied. See the License for the 17*38d50f7bSAndrew Rist * specific language governing permissions and limitations 18*38d50f7bSAndrew Rist * under the License. 19*38d50f7bSAndrew Rist * 20*38d50f7bSAndrew Rist *************************************************************/ 21*38d50f7bSAndrew Rist 22*38d50f7bSAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef SC_TEXTSUNO_HXX 25cdf0e10cSrcweir #define SC_TEXTSUNO_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "global.hxx" // ScRange, ScAddress 28cdf0e10cSrcweir #include "address.hxx" 29cdf0e10cSrcweir #include <editeng/unotext.hxx> 30cdf0e10cSrcweir #include <svl/brdcst.hxx> 31cdf0e10cSrcweir #include <svl/lstner.hxx> 32cdf0e10cSrcweir #include <com/sun/star/text/XTextFieldsSupplier.hpp> 33cdf0e10cSrcweir #include <com/sun/star/sheet/XHeaderFooterContent.hpp> 34cdf0e10cSrcweir #include <com/sun/star/lang/XServiceInfo.hpp> 35cdf0e10cSrcweir #include <com/sun/star/lang/XUnoTunnel.hpp> 36cdf0e10cSrcweir #include <cppuhelper/implbase3.hxx> 37cdf0e10cSrcweir #include <cppuhelper/implbase5.hxx> 38cdf0e10cSrcweir #include "scdllapi.h" 39cdf0e10cSrcweir 40cdf0e10cSrcweir class EditEngine; 41cdf0e10cSrcweir class EditTextObject; 42cdf0e10cSrcweir class SvxEditEngineForwarder; 43cdf0e10cSrcweir class ScDocShell; 44cdf0e10cSrcweir class ScAddress; 45cdf0e10cSrcweir class ScCellObj; 46cdf0e10cSrcweir class ScSimpleEditSource; 47cdf0e10cSrcweir class ScSharedCellEditSource; 48cdf0e10cSrcweir class ScEditEngineDefaulter; 49cdf0e10cSrcweir class ScFieldEditEngine; 50cdf0e10cSrcweir 51cdf0e10cSrcweir struct ScHeaderFieldData; 52cdf0e10cSrcweir 53cdf0e10cSrcweir 54cdf0e10cSrcweir #define SC_HDFT_LEFT 0 55cdf0e10cSrcweir #define SC_HDFT_CENTER 1 56cdf0e10cSrcweir #define SC_HDFT_RIGHT 2 57cdf0e10cSrcweir 58cdf0e10cSrcweir 59cdf0e10cSrcweir // ScHeaderFooterContentObj ist ein dummer Container, der per setPropertyValue 60cdf0e10cSrcweir // wieder in die Seitenvorlage geschrieben werden muss 61cdf0e10cSrcweir 62cdf0e10cSrcweir class ScHeaderFooterContentObj : public cppu::WeakImplHelper3< 63cdf0e10cSrcweir com::sun::star::sheet::XHeaderFooterContent, 64cdf0e10cSrcweir com::sun::star::lang::XUnoTunnel, 65cdf0e10cSrcweir com::sun::star::lang::XServiceInfo > 66cdf0e10cSrcweir { 67cdf0e10cSrcweir private: 68cdf0e10cSrcweir EditTextObject* pLeftText; 69cdf0e10cSrcweir EditTextObject* pCenterText; 70cdf0e10cSrcweir EditTextObject* pRightText; 71cdf0e10cSrcweir SfxBroadcaster aBC; 72cdf0e10cSrcweir 73cdf0e10cSrcweir ScHeaderFooterContentObj(); // disabled 74cdf0e10cSrcweir 75cdf0e10cSrcweir public: 76cdf0e10cSrcweir ScHeaderFooterContentObj( const EditTextObject* pLeft, 77cdf0e10cSrcweir const EditTextObject* pCenter, 78cdf0e10cSrcweir const EditTextObject* pRight ); 79cdf0e10cSrcweir virtual ~ScHeaderFooterContentObj(); 80cdf0e10cSrcweir 81cdf0e10cSrcweir // fuer ScPageHFItem (per getImplementation) GetLeftEditObject() const82cdf0e10cSrcweir const EditTextObject* GetLeftEditObject() const { return pLeftText; } GetCenterEditObject() const83cdf0e10cSrcweir const EditTextObject* GetCenterEditObject() const { return pCenterText; } GetRightEditObject() const84cdf0e10cSrcweir const EditTextObject* GetRightEditObject() const { return pRightText; } 85cdf0e10cSrcweir 86cdf0e10cSrcweir void AddListener( SfxListener& rListener ); 87cdf0e10cSrcweir void RemoveListener( SfxListener& rListener ); 88cdf0e10cSrcweir 89cdf0e10cSrcweir void UpdateText( sal_uInt16 nPart, EditEngine& rSource ); 90cdf0e10cSrcweir 91cdf0e10cSrcweir // XHeaderFooterContent 92cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL 93cdf0e10cSrcweir getLeftText() throw(::com::sun::star::uno::RuntimeException); 94cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL 95cdf0e10cSrcweir getCenterText() throw(::com::sun::star::uno::RuntimeException); 96cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL 97cdf0e10cSrcweir getRightText() throw(::com::sun::star::uno::RuntimeException); 98cdf0e10cSrcweir 99cdf0e10cSrcweir // XUnoTunnel 100cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< 101cdf0e10cSrcweir sal_Int8 >& aIdentifier ) 102cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 103cdf0e10cSrcweir 104cdf0e10cSrcweir static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); 105cdf0e10cSrcweir static ScHeaderFooterContentObj* getImplementation( const com::sun::star::uno::Reference< 106cdf0e10cSrcweir com::sun::star::sheet::XHeaderFooterContent> xObj ); 107cdf0e10cSrcweir 108cdf0e10cSrcweir // XServiceInfo 109cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 110cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 111cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 112cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 113cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 114cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 115cdf0e10cSrcweir }; 116cdf0e10cSrcweir 117cdf0e10cSrcweir 118cdf0e10cSrcweir // ScHeaderFooterTextData: shared data between sub objects of a ScHeaderFooterTextObj 119cdf0e10cSrcweir 120cdf0e10cSrcweir class ScHeaderFooterTextData : public SfxListener 121cdf0e10cSrcweir { 122cdf0e10cSrcweir private: 123cdf0e10cSrcweir ScHeaderFooterContentObj& rContentObj; 124cdf0e10cSrcweir sal_uInt16 nPart; 125cdf0e10cSrcweir ScEditEngineDefaulter* pEditEngine; 126cdf0e10cSrcweir SvxEditEngineForwarder* pForwarder; 127cdf0e10cSrcweir sal_Bool bDataValid; 128cdf0e10cSrcweir sal_Bool bInUpdate; 129cdf0e10cSrcweir 130cdf0e10cSrcweir public: 131cdf0e10cSrcweir ScHeaderFooterTextData( ScHeaderFooterContentObj& rContent, 132cdf0e10cSrcweir sal_uInt16 nP ); 133cdf0e10cSrcweir ~ScHeaderFooterTextData(); 134cdf0e10cSrcweir 135cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 136cdf0e10cSrcweir 137cdf0e10cSrcweir // helper functions 138cdf0e10cSrcweir SvxTextForwarder* GetTextForwarder(); 139cdf0e10cSrcweir void UpdateData(); GetEditEngine()140cdf0e10cSrcweir ScEditEngineDefaulter* GetEditEngine() { GetTextForwarder(); return pEditEngine; } 141cdf0e10cSrcweir GetPart() const142cdf0e10cSrcweir sal_uInt16 GetPart() const { return nPart; } GetContentObj() const143cdf0e10cSrcweir ScHeaderFooterContentObj& GetContentObj() const { return rContentObj; } 144cdf0e10cSrcweir }; 145cdf0e10cSrcweir 146cdf0e10cSrcweir // ScHeaderFooterTextObj veraendert den Text in einem ScHeaderFooterContentObj 147cdf0e10cSrcweir 148cdf0e10cSrcweir class ScHeaderFooterTextObj : public cppu::WeakImplHelper5< 149cdf0e10cSrcweir com::sun::star::text::XText, 150cdf0e10cSrcweir com::sun::star::text::XTextRangeMover, 151cdf0e10cSrcweir com::sun::star::container::XEnumerationAccess, 152cdf0e10cSrcweir com::sun::star::text::XTextFieldsSupplier, 153cdf0e10cSrcweir com::sun::star::lang::XServiceInfo > 154cdf0e10cSrcweir { 155cdf0e10cSrcweir private: 156cdf0e10cSrcweir ScHeaderFooterTextData aTextData; 157cdf0e10cSrcweir SvxUnoText* pUnoText; 158cdf0e10cSrcweir 159cdf0e10cSrcweir void CreateUnoText_Impl(); 160cdf0e10cSrcweir 161cdf0e10cSrcweir public: 162cdf0e10cSrcweir ScHeaderFooterTextObj( ScHeaderFooterContentObj& rContent, 163cdf0e10cSrcweir sal_uInt16 nP ); 164cdf0e10cSrcweir virtual ~ScHeaderFooterTextObj(); 165cdf0e10cSrcweir 166cdf0e10cSrcweir const SvxUnoText& GetUnoText(); 167cdf0e10cSrcweir 168cdf0e10cSrcweir static void FillDummyFieldData( ScHeaderFieldData& rData ); 169cdf0e10cSrcweir 170cdf0e10cSrcweir // XText 171cdf0e10cSrcweir virtual void SAL_CALL insertTextContent( const ::com::sun::star::uno::Reference< 172cdf0e10cSrcweir ::com::sun::star::text::XTextRange >& xRange, 173cdf0e10cSrcweir const ::com::sun::star::uno::Reference< 174cdf0e10cSrcweir ::com::sun::star::text::XTextContent >& xContent, 175cdf0e10cSrcweir sal_Bool bAbsorb ) 176cdf0e10cSrcweir throw(::com::sun::star::lang::IllegalArgumentException, 177cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 178cdf0e10cSrcweir virtual void SAL_CALL removeTextContent( const ::com::sun::star::uno::Reference< 179cdf0e10cSrcweir ::com::sun::star::text::XTextContent >& xContent ) 180cdf0e10cSrcweir throw(::com::sun::star::container::NoSuchElementException, 181cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 182cdf0e10cSrcweir 183cdf0e10cSrcweir // XSimpleText 184cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL 185cdf0e10cSrcweir createTextCursor() throw(::com::sun::star::uno::RuntimeException); 186cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextCursor > SAL_CALL 187cdf0e10cSrcweir createTextCursorByRange( const ::com::sun::star::uno::Reference< 188cdf0e10cSrcweir ::com::sun::star::text::XTextRange >& aTextPosition ) 189cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 190cdf0e10cSrcweir virtual void SAL_CALL insertString( const ::com::sun::star::uno::Reference< 191cdf0e10cSrcweir ::com::sun::star::text::XTextRange >& xRange, 192cdf0e10cSrcweir const ::rtl::OUString& aString, sal_Bool bAbsorb ) 193cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 194cdf0e10cSrcweir virtual void SAL_CALL insertControlCharacter( const ::com::sun::star::uno::Reference< 195cdf0e10cSrcweir ::com::sun::star::text::XTextRange >& xRange, 196cdf0e10cSrcweir sal_Int16 nControlCharacter, sal_Bool bAbsorb ) 197cdf0e10cSrcweir throw(::com::sun::star::lang::IllegalArgumentException, 198cdf0e10cSrcweir ::com::sun::star::uno::RuntimeException); 199cdf0e10cSrcweir 200cdf0e10cSrcweir // XTextRange 201cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL 202cdf0e10cSrcweir getText() throw(::com::sun::star::uno::RuntimeException); 203cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL 204cdf0e10cSrcweir getStart() throw(::com::sun::star::uno::RuntimeException); 205cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL 206cdf0e10cSrcweir getEnd() throw(::com::sun::star::uno::RuntimeException); 207cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getString() throw(::com::sun::star::uno::RuntimeException); 208cdf0e10cSrcweir virtual void SAL_CALL setString( const ::rtl::OUString& aString ) 209cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 210cdf0e10cSrcweir 211cdf0e10cSrcweir // XTextRangeMover 212cdf0e10cSrcweir virtual void SAL_CALL moveTextRange( const ::com::sun::star::uno::Reference< 213cdf0e10cSrcweir ::com::sun::star::text::XTextRange >& xRange, 214cdf0e10cSrcweir sal_Int16 nParagraphs ) 215cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 216cdf0e10cSrcweir 217cdf0e10cSrcweir // XEnumerationAccess 218cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumeration > SAL_CALL 219cdf0e10cSrcweir createEnumeration() throw(::com::sun::star::uno::RuntimeException); 220cdf0e10cSrcweir 221cdf0e10cSrcweir // XElementAccess 222cdf0e10cSrcweir virtual ::com::sun::star::uno::Type SAL_CALL getElementType() 223cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 224cdf0e10cSrcweir virtual sal_Bool SAL_CALL hasElements() throw(::com::sun::star::uno::RuntimeException); 225cdf0e10cSrcweir 226cdf0e10cSrcweir // XTextFieldsSupplier 227cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XEnumerationAccess > SAL_CALL 228cdf0e10cSrcweir getTextFields() throw(::com::sun::star::uno::RuntimeException); 229cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > SAL_CALL 230cdf0e10cSrcweir getTextFieldMasters() throw(::com::sun::star::uno::RuntimeException); 231cdf0e10cSrcweir 232cdf0e10cSrcweir // XServiceInfo 233cdf0e10cSrcweir virtual ::rtl::OUString SAL_CALL getImplementationName() 234cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 235cdf0e10cSrcweir virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName ) 236cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 237cdf0e10cSrcweir virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() 238cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 239cdf0e10cSrcweir }; 240cdf0e10cSrcweir 241cdf0e10cSrcweir 242cdf0e10cSrcweir // derived cursor objects for getImplementation and getText/getStart/getEnd 243cdf0e10cSrcweir 244cdf0e10cSrcweir //! uno3: SvxUnoTextCursor is not derived from XUnoTunnel, but should be (?) 245cdf0e10cSrcweir 246cdf0e10cSrcweir class ScCellTextCursor : public SvxUnoTextCursor 247cdf0e10cSrcweir { 248cdf0e10cSrcweir ScCellObj& rTextObj; 249cdf0e10cSrcweir 250cdf0e10cSrcweir public: 251cdf0e10cSrcweir ScCellTextCursor(const ScCellTextCursor& rOther); 252cdf0e10cSrcweir ScCellTextCursor(ScCellObj& rText); 253cdf0e10cSrcweir virtual ~ScCellTextCursor() throw(); 254cdf0e10cSrcweir GetCellObj() const255cdf0e10cSrcweir ScCellObj& GetCellObj() const { return rTextObj; } 256cdf0e10cSrcweir 257cdf0e10cSrcweir // SvxUnoTextCursor methods reimplemented here: 258cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL 259cdf0e10cSrcweir getText() throw(::com::sun::star::uno::RuntimeException); 260cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL 261cdf0e10cSrcweir getStart() throw(::com::sun::star::uno::RuntimeException); 262cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL 263cdf0e10cSrcweir getEnd() throw(::com::sun::star::uno::RuntimeException); 264cdf0e10cSrcweir 265cdf0e10cSrcweir // XUnoTunnel 266cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< 267cdf0e10cSrcweir sal_Int8 >& aIdentifier ) 268cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 269cdf0e10cSrcweir 270cdf0e10cSrcweir static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); 271cdf0e10cSrcweir static ScCellTextCursor* getImplementation( const com::sun::star::uno::Reference< 272cdf0e10cSrcweir com::sun::star::uno::XInterface> xObj ); 273cdf0e10cSrcweir }; 274cdf0e10cSrcweir 275cdf0e10cSrcweir class ScHeaderFooterTextCursor : public SvxUnoTextCursor 276cdf0e10cSrcweir { 277cdf0e10cSrcweir private: 278cdf0e10cSrcweir ScHeaderFooterTextObj& rTextObj; 279cdf0e10cSrcweir 280cdf0e10cSrcweir public: 281cdf0e10cSrcweir ScHeaderFooterTextCursor(const ScHeaderFooterTextCursor& rOther); 282cdf0e10cSrcweir ScHeaderFooterTextCursor(ScHeaderFooterTextObj& rText); 283cdf0e10cSrcweir virtual ~ScHeaderFooterTextCursor() throw(); 284cdf0e10cSrcweir 285cdf0e10cSrcweir // SvxUnoTextCursor methods reimplemented here: 286cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL 287cdf0e10cSrcweir getText() throw(::com::sun::star::uno::RuntimeException); 288cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL 289cdf0e10cSrcweir getStart() throw(::com::sun::star::uno::RuntimeException); 290cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL 291cdf0e10cSrcweir getEnd() throw(::com::sun::star::uno::RuntimeException); 292cdf0e10cSrcweir 293cdf0e10cSrcweir // XUnoTunnel 294cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< 295cdf0e10cSrcweir sal_Int8 >& aIdentifier ) 296cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 297cdf0e10cSrcweir 298cdf0e10cSrcweir static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); 299cdf0e10cSrcweir static ScHeaderFooterTextCursor* getImplementation( const com::sun::star::uno::Reference< 300cdf0e10cSrcweir com::sun::star::uno::XInterface> xObj ); 301cdf0e10cSrcweir }; 302cdf0e10cSrcweir 303cdf0e10cSrcweir class ScDrawTextCursor : public SvxUnoTextCursor 304cdf0e10cSrcweir { 305cdf0e10cSrcweir private: 306cdf0e10cSrcweir com::sun::star::uno::Reference< com::sun::star::text::XText > xParentText; 307cdf0e10cSrcweir 308cdf0e10cSrcweir public: 309cdf0e10cSrcweir ScDrawTextCursor(const ScDrawTextCursor& rOther); 310cdf0e10cSrcweir ScDrawTextCursor( const com::sun::star::uno::Reference< 311cdf0e10cSrcweir com::sun::star::text::XText >& xParent, 312cdf0e10cSrcweir const SvxUnoTextBase& rText ); 313cdf0e10cSrcweir virtual ~ScDrawTextCursor() throw(); 314cdf0e10cSrcweir 315cdf0e10cSrcweir // SvxUnoTextCursor methods reimplemented here: 316cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XText > SAL_CALL 317cdf0e10cSrcweir getText() throw(::com::sun::star::uno::RuntimeException); 318cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL 319cdf0e10cSrcweir getStart() throw(::com::sun::star::uno::RuntimeException); 320cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::text::XTextRange > SAL_CALL 321cdf0e10cSrcweir getEnd() throw(::com::sun::star::uno::RuntimeException); 322cdf0e10cSrcweir 323cdf0e10cSrcweir // XUnoTunnel 324cdf0e10cSrcweir virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< 325cdf0e10cSrcweir sal_Int8 >& aIdentifier ) 326cdf0e10cSrcweir throw(::com::sun::star::uno::RuntimeException); 327cdf0e10cSrcweir 328cdf0e10cSrcweir static const com::sun::star::uno::Sequence<sal_Int8>& getUnoTunnelId(); 329cdf0e10cSrcweir static ScDrawTextCursor* getImplementation( const com::sun::star::uno::Reference< 330cdf0e10cSrcweir com::sun::star::uno::XInterface> xObj ); 331cdf0e10cSrcweir }; 332cdf0e10cSrcweir 333cdf0e10cSrcweir 334cdf0e10cSrcweir // ScAnnotationTextCursor isn't needed anymore - SvxUnoTextCursor is used instead 335cdf0e10cSrcweir 336cdf0e10cSrcweir 337cdf0e10cSrcweir // ScEditEngineTextObj for formatted cell content that is not inserted in a cell or header/footer 338cdf0e10cSrcweir // (used for XML export of change tracking contents) 339cdf0e10cSrcweir 340cdf0e10cSrcweir class ScSimpleEditSourceHelper 341cdf0e10cSrcweir { 342cdf0e10cSrcweir ScEditEngineDefaulter* pEditEngine; 343cdf0e10cSrcweir SvxEditEngineForwarder* pForwarder; 344cdf0e10cSrcweir ScSimpleEditSource* pOriginalSource; 345cdf0e10cSrcweir 346cdf0e10cSrcweir public: 347cdf0e10cSrcweir ScSimpleEditSourceHelper(); 348cdf0e10cSrcweir ~ScSimpleEditSourceHelper(); 349cdf0e10cSrcweir GetOriginalSource() const350cdf0e10cSrcweir ScSimpleEditSource* GetOriginalSource() const { return pOriginalSource; } GetEditEngine() const351cdf0e10cSrcweir ScEditEngineDefaulter* GetEditEngine() const { return pEditEngine; } 352cdf0e10cSrcweir }; 353cdf0e10cSrcweir 354cdf0e10cSrcweir class ScEditEngineTextObj : public ScSimpleEditSourceHelper, public SvxUnoText 355cdf0e10cSrcweir { 356cdf0e10cSrcweir public: 357cdf0e10cSrcweir ScEditEngineTextObj(); 358cdf0e10cSrcweir virtual ~ScEditEngineTextObj() throw(); 359cdf0e10cSrcweir 360cdf0e10cSrcweir void SetText( const EditTextObject& rTextObject ); 361cdf0e10cSrcweir EditTextObject* CreateTextObject(); 362cdf0e10cSrcweir }; 363cdf0e10cSrcweir 364cdf0e10cSrcweir 365cdf0e10cSrcweir // ScCellTextData: shared data between sub objects of a cell text object 366cdf0e10cSrcweir 367cdf0e10cSrcweir class ScCellTextData : public SfxListener 368cdf0e10cSrcweir { 369cdf0e10cSrcweir protected: 370cdf0e10cSrcweir ScDocShell* pDocShell; 371cdf0e10cSrcweir ScAddress aCellPos; 372cdf0e10cSrcweir ScFieldEditEngine* pEditEngine; 373cdf0e10cSrcweir SvxEditEngineForwarder* pForwarder; 374cdf0e10cSrcweir ScSharedCellEditSource* pOriginalSource; 375cdf0e10cSrcweir sal_Bool bDataValid; 376cdf0e10cSrcweir sal_Bool bInUpdate; 377cdf0e10cSrcweir sal_Bool bDirty; 378cdf0e10cSrcweir sal_Bool bDoUpdate; 379cdf0e10cSrcweir 380cdf0e10cSrcweir protected: 381cdf0e10cSrcweir virtual void GetCellText(const ScAddress& rCellPos, String& rText); 382cdf0e10cSrcweir 383cdf0e10cSrcweir public: 384cdf0e10cSrcweir ScCellTextData(ScDocShell* pDocSh, const ScAddress& rP); 385cdf0e10cSrcweir virtual ~ScCellTextData(); 386cdf0e10cSrcweir 387cdf0e10cSrcweir virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); 388cdf0e10cSrcweir 389cdf0e10cSrcweir // helper functions for ScSharedCellEditSource: 390cdf0e10cSrcweir virtual SvxTextForwarder* GetTextForwarder(); 391cdf0e10cSrcweir void UpdateData(); GetEditEngine()392cdf0e10cSrcweir ScFieldEditEngine* GetEditEngine() { GetTextForwarder(); return pEditEngine; } 393cdf0e10cSrcweir 394cdf0e10cSrcweir ScSharedCellEditSource* GetOriginalSource(); // used as argument for SvxUnoText ctor 395cdf0e10cSrcweir 396cdf0e10cSrcweir // used for ScCellEditSource: GetDocShell() const397cdf0e10cSrcweir ScDocShell* GetDocShell() const { return pDocShell; } GetCellPos() const398cdf0e10cSrcweir const ScAddress& GetCellPos() const { return aCellPos; } 399cdf0e10cSrcweir SetDirty(sal_Bool bValue)400cdf0e10cSrcweir void SetDirty(sal_Bool bValue) { bDirty = bValue; } IsDirty() const401cdf0e10cSrcweir sal_Bool IsDirty() const { return bDirty; } SetDoUpdate(sal_Bool bValue)402cdf0e10cSrcweir void SetDoUpdate(sal_Bool bValue) { bDoUpdate = bValue; } 403cdf0e10cSrcweir }; 404cdf0e10cSrcweir 405cdf0e10cSrcweir class ScCellTextObj : public ScCellTextData, public SvxUnoText 406cdf0e10cSrcweir { 407cdf0e10cSrcweir public: 408cdf0e10cSrcweir ScCellTextObj(ScDocShell* pDocSh, const ScAddress& rP); 409cdf0e10cSrcweir virtual ~ScCellTextObj() throw(); 410cdf0e10cSrcweir }; 411cdf0e10cSrcweir 412cdf0e10cSrcweir 413cdf0e10cSrcweir #endif 414cdf0e10cSrcweir 415