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 SVTOOLS_IN_EDITBROWSEBOX_HXX 25 #error "not to be included directly!" 26 #endif 27 28 //---------------------------------------------------------------------- 29 template <class EDIT> GenericEditImplementation(EDIT & _rEdit)30GenericEditImplementation< EDIT >::GenericEditImplementation( EDIT& _rEdit ) 31 :m_rEdit( _rEdit ) 32 { 33 } 34 35 //---------------------------------------------------------------------- 36 template <class EDIT> GetControl()37Control& GenericEditImplementation< EDIT >::GetControl() 38 { 39 return m_rEdit; 40 } 41 42 //---------------------------------------------------------------------- 43 template <class EDIT> GetText(LineEnd) const44String GenericEditImplementation< EDIT >::GetText( LineEnd ) const 45 { 46 // ignore the line end - this base implementation does not support it 47 return m_rEdit.GetText( ); 48 } 49 50 //---------------------------------------------------------------------- 51 template <class EDIT> SetText(const String & _rStr)52void GenericEditImplementation< EDIT >::SetText( const String& _rStr ) 53 { 54 m_rEdit.SetText( _rStr ); 55 } 56 57 //---------------------------------------------------------------------- 58 template <class EDIT> GetSelection() const59Selection GenericEditImplementation< EDIT >::GetSelection() const 60 { 61 return m_rEdit.GetSelection( ); 62 } 63 64 //---------------------------------------------------------------------- 65 template <class EDIT> SetSelection(const Selection & _rSelection)66void GenericEditImplementation< EDIT >::SetSelection( const Selection& _rSelection ) 67 { 68 m_rEdit.SetSelection( _rSelection ); 69 } 70 71 //---------------------------------------------------------------------- 72 template <class EDIT> SetReadOnly(sal_Bool bReadOnly)73void GenericEditImplementation< EDIT >::SetReadOnly( sal_Bool bReadOnly ) 74 { 75 m_rEdit.SetReadOnly( bReadOnly ); 76 } 77 78 //---------------------------------------------------------------------- 79 template <class EDIT> IsReadOnly() const80sal_Bool GenericEditImplementation< EDIT >::IsReadOnly() const 81 { 82 return m_rEdit.IsReadOnly(); 83 } 84 85 //---------------------------------------------------------------------- 86 template <class EDIT> ReplaceSelected(const String & _rStr)87void GenericEditImplementation< EDIT >::ReplaceSelected( const String& _rStr ) 88 { 89 m_rEdit.ReplaceSelected( _rStr ); 90 } 91 92 //---------------------------------------------------------------------- 93 template <class EDIT> DeleteSelected()94void GenericEditImplementation< EDIT >::DeleteSelected() 95 { 96 m_rEdit.DeleteSelected(); 97 } 98 99 //---------------------------------------------------------------------- 100 template <class EDIT> GetSelected(LineEnd) const101String GenericEditImplementation< EDIT >::GetSelected( LineEnd ) const 102 { 103 return m_rEdit.GetSelected( ); 104 } 105 106 //---------------------------------------------------------------------- 107 template <class EDIT> SetMaxTextLen(xub_StrLen _nMaxLen)108void GenericEditImplementation< EDIT >::SetMaxTextLen( xub_StrLen _nMaxLen ) 109 { 110 m_rEdit.SetMaxTextLen( _nMaxLen ); 111 } 112 113 //---------------------------------------------------------------------- 114 template <class EDIT> GetMaxTextLen() const115xub_StrLen GenericEditImplementation< EDIT >::GetMaxTextLen() const 116 { 117 return (xub_StrLen)m_rEdit.GetMaxTextLen( ); 118 } 119 120 //---------------------------------------------------------------------- 121 template <class EDIT> SetModified()122void GenericEditImplementation< EDIT >::SetModified() 123 { 124 m_rEdit.SetModifyFlag(); 125 } 126 127 //---------------------------------------------------------------------- 128 template <class EDIT> IsModified() const129sal_Bool GenericEditImplementation< EDIT >::IsModified() const 130 { 131 return m_rEdit.IsModified(); 132 } 133 134 //---------------------------------------------------------------------- 135 template <class EDIT> ClearModified()136void GenericEditImplementation< EDIT >::ClearModified() 137 { 138 m_rEdit.ClearModifyFlag(); 139 } 140 141 //---------------------------------------------------------------------- 142 template <class EDIT> SetModifyHdl(const Link & _rLink)143void GenericEditImplementation< EDIT >::SetModifyHdl( const Link& _rLink ) 144 { 145 m_rEdit.SetModifyHdl( _rLink ); 146 } 147 148