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 #include <editeng/unoedsrc.hxx> 25 #include <editeng/unotext.hxx> 26 #include <editeng/eeitem.hxx> 27 #include <editeng/outliner.hxx> 28 #include <editeng/unoipset.hxx> 29 #include <editeng/unoprnms.hxx> 30 #include <editeng/unoforou.hxx> 31 32 class SwDoc; 33 34 struct SwTextAPIEditSource_Impl; 35 class SwTextAPIEditSource : public SvxEditSource 36 { 37 SwTextAPIEditSource_Impl* pImpl; 38 39 virtual SvxEditSource* Clone() const; 40 virtual SvxTextForwarder* GetTextForwarder(); 41 virtual void UpdateData(); 42 explicit SwTextAPIEditSource( const SwTextAPIEditSource& rSource ); 43 44 public: 45 SwTextAPIEditSource(SwDoc* pDoc); 46 virtual ~SwTextAPIEditSource(); 47 48 void Dispose(); 49 void SetText( OutlinerParaObject& rText ); 50 void SetString( const String& rText ); 51 OutlinerParaObject* CreateText(); 52 String GetText(); 53 }; 54 55 class SwTextAPIObject : public SvxUnoText 56 { 57 SwTextAPIEditSource* pSource; 58 public: 59 SwTextAPIObject( SwTextAPIEditSource* p); 60 virtual ~SwTextAPIObject() throw(); 61 void DisposeEditSource() { pSource->Dispose(); } 62 OutlinerParaObject* CreateText() { return pSource->CreateText(); } 63 void SetString( const String& rText ) { pSource->SetString( rText ); } 64 void SetText( OutlinerParaObject& rText ) { pSource->SetText( rText ); } 65 String GetText() { return pSource->GetText(); } 66 }; 67