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 _SVDTEXT_HXX 25 #define _SVDTEXT_HXX 26 27 #include <sal/types.h> 28 #include "svx/svxdllapi.h" 29 #include <tools/weakbase.hxx> 30 31 // -------------------------------------------------------------------- 32 33 class OutlinerParaObject; 34 class SdrOutliner; 35 class SdrTextObj; 36 class SdrModel; 37 class SfxItemSet; 38 39 namespace sdr { namespace properties { 40 class TextProperties; 41 }} 42 43 /** This class stores information about one text inside a shape. 44 */ 45 46 class SVX_DLLPUBLIC SdrText : public tools::WeakBase< SdrText > 47 { 48 public: 49 SdrText( SdrTextObj& rObject, OutlinerParaObject* pOutlinerParaObject = 0 ); 50 virtual ~SdrText(); 51 52 virtual void SetModel(SdrModel* pNewModel); 53 virtual void ForceOutlinerParaObject( sal_uInt16 nOutlMode ); 54 55 virtual void SetOutlinerParaObject( OutlinerParaObject* pTextObject ); 56 virtual OutlinerParaObject* GetOutlinerParaObject() const; 57 58 virtual void CheckPortionInfo( SdrOutliner& rOutliner ); 59 virtual void ReformatText(); 60 61 // default uses GetObjectItemSet, but may be overloaded to 62 // return a text-specific ItemSet 63 virtual const SfxItemSet& GetItemSet() const; 64 GetModel() const65 SdrModel* GetModel() const { return mpModel; } GetObject() const66 SdrTextObj& GetObject() const { return mrObject; } 67 68 /** returns the current OutlinerParaObject and removes it from this instance */ 69 OutlinerParaObject* RemoveOutlinerParaObject(); 70 71 protected: 72 virtual const SfxItemSet& GetObjectItemSet(); 73 virtual void SetObjectItem(const SfxPoolItem& rItem); 74 virtual SfxStyleSheet* GetStyleSheet() const; 75 76 private: 77 OutlinerParaObject* mpOutlinerParaObject; 78 SdrTextObj& mrObject; 79 SdrModel* mpModel; 80 bool mbPortionInfoChecked; 81 }; 82 83 #endif //_SVDTEXT_HXX 84 85