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 #ifndef FORMS_SOURCE_RICHTEXT_RICHTEXTENGINE_HXX 24 #define FORMS_SOURCE_RICHTEXT_RICHTEXTENGINE_HXX 25 26 #include <editeng/editeng.hxx> 27 #include <tools/link.hxx> 28 29 #include <vector> 30 31 class SfxItemPool; 32 class EditStatus; 33 //........................................................................ 34 namespace frm 35 { 36 //........................................................................ 37 38 //==================================================================== 39 //= IEngineStatusListener 40 //==================================================================== 41 class IEngineStatusListener 42 { 43 public: 44 virtual void EditEngineStatusChanged( const EditStatus& _rStatus ) = 0; 45 }; 46 47 //==================================================================== 48 //= RichTextEngine 49 //==================================================================== 50 class RichTextEngine : public EditEngine 51 { 52 private: 53 SfxItemPool* m_pEnginePool; 54 ::std::vector< IEngineStatusListener* > m_aStatusListeners; 55 56 public: 57 static RichTextEngine* Create(); 58 RichTextEngine* Clone(); 59 60 ~RichTextEngine( ); 61 62 // for multiplexing the StatusChanged events of the edit engine 63 void registerEngineStatusListener( IEngineStatusListener* _pListener ); 64 void revokeEngineStatusListener( IEngineStatusListener* _pListener ); 65 getPool()66 inline SfxItemPool* getPool() { return m_pEnginePool; } 67 68 protected: 69 /** constructs a new RichTextEngine. The instances takes the ownership of the given SfxItemPool 70 */ 71 RichTextEngine( SfxItemPool* _pPool ); 72 73 private: 74 RichTextEngine( ); // never implemented 75 RichTextEngine( const RichTextEngine& ); // never implemented 76 RichTextEngine& operator=( const RichTextEngine& ); // never implemented 77 78 private: 79 DECL_LINK( EditEngineStatusChanged, EditStatus* ); 80 }; 81 82 //........................................................................ 83 } // namespace frm 84 //........................................................................ 85 86 #endif // FORMS_SOURCE_RICHTEXT_RICHTEXTENGINE_HXX 87 88