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_RICHTEXTVIEWPORT_HXX 24 #define FORMS_SOURCE_RICHTEXT_RICHTEXTVIEWPORT_HXX 25 26 #include <vcl/ctrl.hxx> 27 28 class EditView; 29 //........................................................................ 30 namespace frm 31 { 32 //........................................................................ 33 34 //==================================================================== 35 //= RichTextViewPort 36 //==================================================================== 37 class RichTextViewPort : public Control 38 { 39 private: 40 EditView* m_pView; 41 Link m_aInvalidationHandler; 42 bool m_bHideInactiveSelection; 43 44 public: 45 RichTextViewPort( Window* _pParent ); 46 47 void setView( EditView& _rView ); 48 setAttributeInvalidationHandler(const Link & _rHandler)49 inline void setAttributeInvalidationHandler( const Link& _rHandler ) { m_aInvalidationHandler = _rHandler; } 50 51 void SetHideInactiveSelection( bool _bHide ); 52 bool GetHideInactiveSelection() const; 53 54 protected: 55 virtual void Paint( const Rectangle& rRect ); 56 virtual void GetFocus(); 57 virtual void LoseFocus(); 58 virtual void KeyInput( const KeyEvent& _rKEvt ); 59 virtual void MouseMove( const MouseEvent& _rMEvt ); 60 virtual void MouseButtonDown( const MouseEvent& _rMEvt ); 61 virtual void MouseButtonUp( const MouseEvent& _rMEvt ); 62 63 private: implInvalidateAttributes() const64 inline void implInvalidateAttributes() const 65 { 66 if ( m_aInvalidationHandler.IsSet() ) 67 m_aInvalidationHandler.Call( NULL ); 68 } 69 }; 70 71 //........................................................................ 72 } // namespace frm 73 //........................................................................ 74 75 #endif // FORMS_SOURCE_RICHTEXT_RICHTEXTVIEWPORT_HXX 76 77