tbunosearchcontrollers.cxx (f6e50924) | tbunosearchcontrollers.cxx (27b1daf5) |
---|---|
1/************************************************************** | 1/************************************************************** |
2 * | 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 | 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 * | 10 * |
11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
12 * | 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. | 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 * | 19 * |
20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_svx.hxx" 26 27#include "tbunosearchcontrollers.hxx" --- 12 unchanged lines hidden (view full) --- 40 41namespace svx 42{ 43 44static const ::rtl::OUString SEARCHITEM_SEARCHSTRING = ::rtl::OUString::createFromAscii("SearchItem.SearchString"); 45static const ::rtl::OUString SEARCHITEM_SEARCHBACKWARD = ::rtl::OUString::createFromAscii("SearchItem.Backward"); 46 47static const ::rtl::OUString COMMAND_EXECUTESEARCH = ::rtl::OUString::createFromAscii(".uno:ExecuteSearch"); | 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_svx.hxx" 26 27#include "tbunosearchcontrollers.hxx" --- 12 unchanged lines hidden (view full) --- 40 41namespace svx 42{ 43 44static const ::rtl::OUString SEARCHITEM_SEARCHSTRING = ::rtl::OUString::createFromAscii("SearchItem.SearchString"); 45static const ::rtl::OUString SEARCHITEM_SEARCHBACKWARD = ::rtl::OUString::createFromAscii("SearchItem.Backward"); 46 47static const ::rtl::OUString COMMAND_EXECUTESEARCH = ::rtl::OUString::createFromAscii(".uno:ExecuteSearch"); |
48static const ::rtl::OUString COMMAND_FINDTEXT = ::rtl::OUString::createFromAscii(".uno:FindText") ; | 48static const ::rtl::OUString COMMAND_FINDTEXT = ::rtl::OUString::createFromAscii(".uno:FindText"); |
49static const ::rtl::OUString COMMAND_DOWNSEARCH = ::rtl::OUString::createFromAscii(".uno:DownSearch"); | 49static const ::rtl::OUString COMMAND_DOWNSEARCH = ::rtl::OUString::createFromAscii(".uno:DownSearch"); |
50static const ::rtl::OUString COMMAND_UPSEARCH = ::rtl::OUString::createFromAscii(".uno:UpSearch") ; | 50static const ::rtl::OUString COMMAND_UPSEARCH = ::rtl::OUString::createFromAscii(".uno:UpSearch"); |
51static const ::rtl::OUString COMMAND_APPENDSEARCHHISTORY = ::rtl::OUString::createFromAscii("AppendSearchHistory"); 52 53static const ::rtl::OUString SERVICENAME_URLTRANSFORMER = ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer"); 54static const sal_Int32 REMEMBER_SIZE = 10; 55 56void impl_executeSearch( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr, const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Sequence< css::beans::PropertyValue >& lArgs ) 57{ | 51static const ::rtl::OUString COMMAND_APPENDSEARCHHISTORY = ::rtl::OUString::createFromAscii("AppendSearchHistory"); 52 53static const ::rtl::OUString SERVICENAME_URLTRANSFORMER = ::rtl::OUString::createFromAscii("com.sun.star.util.URLTransformer"); 54static const sal_Int32 REMEMBER_SIZE = 10; 55 56void impl_executeSearch( const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr, const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Sequence< css::beans::PropertyValue >& lArgs ) 57{ |
58 css::uno::Reference< css::util::XURLTransformer > xURLTransformer( rSMgr->createInstance(SERVICENAME_URLTRANSFORMER), css::uno::UNO_QUERY ); 59 if ( xURLTransformer.is() ) 60 { 61 css::util::URL aURL; 62 aURL.Complete = COMMAND_EXECUTESEARCH; 63 xURLTransformer->parseStrict(aURL); | 58 css::uno::Reference< css::util::XURLTransformer > xURLTransformer( rSMgr->createInstance(SERVICENAME_URLTRANSFORMER), css::uno::UNO_QUERY ); 59 if ( xURLTransformer.is() ) 60 { 61 css::util::URL aURL; 62 aURL.Complete = COMMAND_EXECUTESEARCH; 63 xURLTransformer->parseStrict(aURL); |
64 | 64 |
65 css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, css::uno::UNO_QUERY); 66 if ( xDispatchProvider.is() ) 67 { 68 css::uno::Reference< css::frame::XDispatch > xDispatch = xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 ); 69 if ( xDispatch.is() && aURL.Complete.getLength() > 0 ) 70 xDispatch->dispatch( aURL, lArgs ); 71 } 72 } | 65 css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, css::uno::UNO_QUERY); 66 if ( xDispatchProvider.is() ) 67 { 68 css::uno::Reference< css::frame::XDispatch > xDispatch = xDispatchProvider->queryDispatch( aURL, ::rtl::OUString(), 0 ); 69 if ( xDispatch.is() && aURL.Complete.getLength() > 0 ) 70 xDispatch->dispatch( aURL, lArgs ); 71 } 72 } |
73} 74 | 73} 74 |
75FindTextFieldControl::FindTextFieldControl( Window* pParent, WinBits nStyle, 76 css::uno::Reference< css::frame::XFrame >& xFrame, 77 css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager) : 78 ComboBox( pParent, nStyle ), 79 m_xFrame(xFrame), 80 m_xServiceManager(xServiceManager), 81 m_bToClearTextField(sal_True) | 75FindTextFieldControl::FindTextFieldControl( Window* pParent, WinBits nStyle, 76 css::uno::Reference< css::frame::XFrame >& xFrame, 77 css::uno::Reference< css::lang::XMultiServiceFactory >& xServiceManager) : 78 ComboBox( pParent, nStyle ), 79 m_xFrame(xFrame), 80 m_xServiceManager(xServiceManager), 81 m_bToClearTextField(sal_True) |
82{ | 82{ |
83 InitControls_Impl(); | 83 InitControls_Impl(); |
84} 85 86FindTextFieldControl::~FindTextFieldControl() 87{ 88} 89 90void FindTextFieldControl::InitControls_Impl() 91{ | 84} 85 86FindTextFieldControl::~FindTextFieldControl() 87{ 88} 89 90void FindTextFieldControl::InitControls_Impl() 91{ |
92 SetText( SVX_RESSTR( RID_SVXSTR_FINDBAR_FIND ) ); 93 SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor()); | 92 SetText( SVX_RESSTR( RID_SVXSTR_FINDBAR_FIND ) ); 93 SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor()); |
94 | 94 |
95 EnableAutocomplete(sal_True, sal_True); | 95 EnableAutocomplete(sal_True, sal_True); |
96} 97 98void FindTextFieldControl::Remember_Impl(const String& rStr) 99{ | 96} 97 98void FindTextFieldControl::Remember_Impl(const String& rStr) 99{ |
100 sal_uInt16 nCount = GetEntryCount(); | 100 sal_uInt16 nCount = GetEntryCount(); |
101 | 101 |
102 for (sal_uInt16 i=0; i<nCount; ++i) 103 { 104 if ( rStr == GetEntry(i)) 105 return; 106 } | 102 for (sal_uInt16 i=0; i<nCount; ++i) 103 { 104 if ( rStr == GetEntry(i)) 105 return; 106 } |
107 | 107 |
108 if (nCount == REMEMBER_SIZE) 109 RemoveEntry(REMEMBER_SIZE-1); | 108 if (nCount == REMEMBER_SIZE) 109 RemoveEntry(REMEMBER_SIZE-1); |
110 | 110 |
111 InsertEntry(rStr, 0); | 111 InsertEntry(rStr, 0); |
112} 113 114void FindTextFieldControl::Modify() 115{ | 112} 113 114void FindTextFieldControl::Modify() 115{ |
116 ComboBox::Modify(); | 116 ComboBox::Modify(); |
117 | 117 |
118 SetControlForeground( GetSettings().GetStyleSettings().GetWindowTextColor() ); | 118 SetControlForeground( GetSettings().GetStyleSettings().GetWindowTextColor() ); |
119} 120 121long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt ) 122{ | 119} 120 121long FindTextFieldControl::PreNotify( NotifyEvent& rNEvt ) 122{ |
123 long nRet= ComboBox::PreNotify( rNEvt ); | 123 long nRet= ComboBox::PreNotify( rNEvt ); |
124 | 124 |
125 switch ( rNEvt.GetType() ) 126 { 127 case EVENT_KEYINPUT: 128 { 129 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent(); 130 sal_Bool bCtrl = pKeyEvent->GetKeyCode().IsMod1(); 131 sal_Bool bAlt = pKeyEvent->GetKeyCode().IsMod2(); 132 sal_Bool bShift = pKeyEvent->GetKeyCode().IsShift(); 133 sal_uInt16 nCode = pKeyEvent->GetKeyCode().GetCode(); | 125 switch ( rNEvt.GetType() ) 126 { 127 case EVENT_KEYINPUT: 128 { 129 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent(); 130 sal_Bool bCtrl = pKeyEvent->GetKeyCode().IsMod1(); 131 sal_Bool bAlt = pKeyEvent->GetKeyCode().IsMod2(); 132 sal_Bool bShift = pKeyEvent->GetKeyCode().IsShift(); 133 sal_uInt16 nCode = pKeyEvent->GetKeyCode().GetCode(); |
134 | 134 |
135 if ( (bCtrl && bAlt && KEY_F == nCode) || KEY_ESCAPE == nCode ) 136 { 137 nRet = 1; 138 GrabFocusToDocument(); 139 } | 135 if ( (bCtrl && bAlt && KEY_F == nCode) || KEY_ESCAPE == nCode ) 136 { 137 nRet = 1; 138 GrabFocusToDocument(); 139 } |
140 | 140 |
141 if ( KEY_RETURN == nCode ) 142 { 143 Remember_Impl(GetText()); | 141 if ( KEY_RETURN == nCode ) 142 { 143 Remember_Impl(GetText()); |
144 | 144 |
145 ::rtl::OUString sFindText = GetText(); 146 css::uno::Sequence< css::beans::PropertyValue > lArgs(2); | 145 ::rtl::OUString sFindText = GetText(); 146 css::uno::Sequence< css::beans::PropertyValue > lArgs(2); |
147 | 147 |
148 lArgs[0].Name = SEARCHITEM_SEARCHSTRING; 149 lArgs[0].Value <<= sFindText; | 148 lArgs[0].Name = SEARCHITEM_SEARCHSTRING; 149 lArgs[0].Value <<= sFindText; |
150 | 150 |
151 lArgs[1].Name = SEARCHITEM_SEARCHBACKWARD; 152 if (bShift) 153 lArgs[1].Value <<= sal_True; 154 else 155 lArgs[1].Value <<= sal_False; | 151 lArgs[1].Name = SEARCHITEM_SEARCHBACKWARD; 152 if (bShift) 153 lArgs[1].Value <<= sal_True; 154 else 155 lArgs[1].Value <<= sal_False; |
156 | 156 |
157 impl_executeSearch(m_xServiceManager, m_xFrame, lArgs); 158 nRet = 1; 159 } 160 break; 161 } | 157 impl_executeSearch(m_xServiceManager, m_xFrame, lArgs); 158 nRet = 1; 159 } 160 break; 161 } |
162 | 162 |
163 case EVENT_GETFOCUS: 164 if ( m_bToClearTextField ) 165 { 166 SetText( String() ); 167 m_bToClearTextField = sal_False; 168 } 169 SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) ); 170 break; | 163 case EVENT_GETFOCUS: 164 if ( m_bToClearTextField ) 165 { 166 SetText( String() ); 167 m_bToClearTextField = sal_False; 168 } 169 SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) ); 170 break; |
171 | 171 |
172 case EVENT_LOSEFOCUS: 173 if ( GetText().Len() == 0 ) 174 { 175 SetText( SVX_RESSTR( RID_SVXSTR_FINDBAR_FIND ) ); 176 SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor()); 177 m_bToClearTextField = sal_True; 178 } 179 break; 180 } | 172 case EVENT_LOSEFOCUS: 173 if ( GetText().Len() == 0 ) 174 { 175 SetText( SVX_RESSTR( RID_SVXSTR_FINDBAR_FIND ) ); 176 SetControlForeground(GetSettings().GetStyleSettings().GetDisableColor()); 177 m_bToClearTextField = sal_True; 178 } 179 break; 180 } |
181 | 181 |
182 return nRet; | 182 return nRet; |
183} 184 185 186//----------------------------------------------------------------------------------------------------------- 187// SearchToolbarControllersManager 188 189SearchToolbarControllersManager* SearchToolbarControllersManager::m_pInstance = 0; 190 191SearchToolbarControllersManager::SearchToolbarControllersManager() 192{ 193} 194 195SearchToolbarControllersManager::~SearchToolbarControllersManager() 196{ 197} 198 199SearchToolbarControllersManager* SearchToolbarControllersManager::createControllersManager() 200{ | 183} 184 185 186//----------------------------------------------------------------------------------------------------------- 187// SearchToolbarControllersManager 188 189SearchToolbarControllersManager* SearchToolbarControllersManager::m_pInstance = 0; 190 191SearchToolbarControllersManager::SearchToolbarControllersManager() 192{ 193} 194 195SearchToolbarControllersManager::~SearchToolbarControllersManager() 196{ 197} 198 199SearchToolbarControllersManager* SearchToolbarControllersManager::createControllersManager() 200{ |
201 if (!m_pInstance) 202 m_pInstance = new SearchToolbarControllersManager(); | 201 if (!m_pInstance) 202 m_pInstance = new SearchToolbarControllersManager(); |
203 | 203 |
204 return m_pInstance; | 204 return m_pInstance; |
205} 206 207void SearchToolbarControllersManager::registryController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const ::rtl::OUString& sCommandURL ) 208{ | 205} 206 207void SearchToolbarControllersManager::registryController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const ::rtl::OUString& sCommandURL ) 208{ |
209 SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame); 210 if (pIt == aSearchToolbarControllersMap.end()) 211 { 212 SearchToolbarControllersVec lControllers(1); 213 lControllers[0].Name = sCommandURL; 214 lControllers[0].Value <<= xStatusListener; 215 aSearchToolbarControllersMap.insert(SearchToolbarControllersMap::value_type(xFrame, lControllers)); 216 } 217 else 218 { 219 sal_Int32 nSize = pIt->second.size(); 220 for (sal_Int32 i=0; i<nSize; ++i) 221 { 222 if (pIt->second[i].Name.equals(sCommandURL)) 223 return; 224 } | 209 SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame); 210 if (pIt == aSearchToolbarControllersMap.end()) 211 { 212 SearchToolbarControllersVec lControllers(1); 213 lControllers[0].Name = sCommandURL; 214 lControllers[0].Value <<= xStatusListener; 215 aSearchToolbarControllersMap.insert(SearchToolbarControllersMap::value_type(xFrame, lControllers)); 216 } 217 else 218 { 219 sal_Int32 nSize = pIt->second.size(); 220 for (sal_Int32 i=0; i<nSize; ++i) 221 { 222 if (pIt->second[i].Name.equals(sCommandURL)) 223 return; 224 } |
225 | 225 |
226 pIt->second.resize(nSize+1); 227 pIt->second[nSize].Name = sCommandURL; 228 pIt->second[nSize].Value <<= xStatusListener; 229 } | 226 pIt->second.resize(nSize+1); 227 pIt->second[nSize].Name = sCommandURL; 228 pIt->second[nSize].Value <<= xStatusListener; 229 } |
230} 231 232void SearchToolbarControllersManager::freeController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& /*xStatusListener*/, const ::rtl::OUString& sCommandURL ) 233{ | 230} 231 232void SearchToolbarControllersManager::freeController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& /*xStatusListener*/, const ::rtl::OUString& sCommandURL ) 233{ |
234 SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame); 235 if (pIt != aSearchToolbarControllersMap.end()) 236 { 237 for (SearchToolbarControllersVec::iterator pItCtrl=pIt->second.begin(); pItCtrl!=pIt->second.end(); ++pItCtrl) 238 { 239 if (pItCtrl->Name.equals(sCommandURL)) 240 { 241 pIt->second.erase(pItCtrl); 242 break; 243 } 244 } | 234 SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame); 235 if (pIt != aSearchToolbarControllersMap.end()) 236 { 237 for (SearchToolbarControllersVec::iterator pItCtrl=pIt->second.begin(); pItCtrl!=pIt->second.end(); ++pItCtrl) 238 { 239 if (pItCtrl->Name.equals(sCommandURL)) 240 { 241 pIt->second.erase(pItCtrl); 242 break; 243 } 244 } |
245 | 245 |
246 if (pIt->second.empty()) 247 aSearchToolbarControllersMap.erase(pIt); 248 } | 246 if (pIt->second.empty()) 247 aSearchToolbarControllersMap.erase(pIt); 248 } |
249} 250 251css::uno::Reference< css::frame::XStatusListener > SearchToolbarControllersManager::findController( const css::uno::Reference< css::frame::XFrame >& xFrame, const ::rtl::OUString& sCommandURL ) 252{ | 249} 250 251css::uno::Reference< css::frame::XStatusListener > SearchToolbarControllersManager::findController( const css::uno::Reference< css::frame::XFrame >& xFrame, const ::rtl::OUString& sCommandURL ) 252{ |
253 css::uno::Reference< css::frame::XStatusListener > xStatusListener; | 253 css::uno::Reference< css::frame::XStatusListener > xStatusListener; |
254 | 254 |
255 SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame); 256 if (pIt != aSearchToolbarControllersMap.end()) 257 { 258 for (SearchToolbarControllersVec::iterator pItCtrl =pIt->second.begin(); pItCtrl != pIt->second.end(); ++pItCtrl) 259 { 260 if (pItCtrl->Name.equals(sCommandURL)) 261 { 262 pItCtrl->Value >>= xStatusListener; 263 break; 264 } 265 } 266 } | 255 SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame); 256 if (pIt != aSearchToolbarControllersMap.end()) 257 { 258 for (SearchToolbarControllersVec::iterator pItCtrl =pIt->second.begin(); pItCtrl != pIt->second.end(); ++pItCtrl) 259 { 260 if (pItCtrl->Name.equals(sCommandURL)) 261 { 262 pItCtrl->Value >>= xStatusListener; 263 break; 264 } 265 } 266 } |
267 | 267 |
268 return xStatusListener; | 268 return xStatusListener; |
269} 270 271//----------------------------------------------------------------------------------------------------------- 272// FindTextToolbarController 273 274FindTextToolbarController::FindTextToolbarController( const css::uno::Reference< css::lang::XMultiServiceFactory >& rServiceManager ) | 269} 270 271//----------------------------------------------------------------------------------------------------------- 272// FindTextToolbarController 273 274FindTextToolbarController::FindTextToolbarController( const css::uno::Reference< css::lang::XMultiServiceFactory >& rServiceManager ) |
275 :svt::ToolboxController( rServiceManager, 276 css::uno::Reference< css::frame::XFrame >(), 277 COMMAND_FINDTEXT ) | 275 :svt::ToolboxController( rServiceManager, 276 css::uno::Reference< css::frame::XFrame >(), 277 COMMAND_FINDTEXT ) |
278{ 279} 280 281FindTextToolbarController::~FindTextToolbarController() 282{ 283} 284 285// XInterface 286css::uno::Any SAL_CALL FindTextToolbarController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException ) 287{ | 278{ 279} 280 281FindTextToolbarController::~FindTextToolbarController() 282{ 283} 284 285// XInterface 286css::uno::Any SAL_CALL FindTextToolbarController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException ) 287{ |
288 css::uno::Any a = ToolboxController::queryInterface( aType ); 289 if ( a.hasValue() ) 290 return a; | 288 css::uno::Any a = ToolboxController::queryInterface( aType ); 289 if ( a.hasValue() ) 290 return a; |
291 | 291 |
292 return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) ); | 292 return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) ); |
293} 294 295void SAL_CALL FindTextToolbarController::acquire() throw () 296{ | 293} 294 295void SAL_CALL FindTextToolbarController::acquire() throw () 296{ |
297 ToolboxController::acquire(); | 297 ToolboxController::acquire(); |
298} 299 300void SAL_CALL FindTextToolbarController::release() throw () 301{ | 298} 299 300void SAL_CALL FindTextToolbarController::release() throw () 301{ |
302 ToolboxController::release(); | 302 ToolboxController::release(); |
303} 304 305// XServiceInfo 306::rtl::OUString SAL_CALL FindTextToolbarController::getImplementationName() throw( css::uno::RuntimeException ) 307{ | 303} 304 305// XServiceInfo 306::rtl::OUString SAL_CALL FindTextToolbarController::getImplementationName() throw( css::uno::RuntimeException ) 307{ |
308 return getImplementationName_Static(); | 308 return getImplementationName_Static(); |
309} 310 311sal_Bool SAL_CALL FindTextToolbarController::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException ) | 309} 310 311sal_Bool SAL_CALL FindTextToolbarController::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException ) |
312{ 313 const css::uno::Sequence< ::rtl::OUString > aSNL( getSupportedServiceNames() ); 314 const ::rtl::OUString * pArray = aSNL.getConstArray(); | 312{ 313 const css::uno::Sequence< ::rtl::OUString > aSNL( getSupportedServiceNames() ); 314 const ::rtl::OUString * pArray = aSNL.getConstArray(); |
315 | 315 |
316 for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) 317 if( pArray[i] == ServiceName ) 318 return true; | 316 for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) 317 if( pArray[i] == ServiceName ) 318 return true; |
319 | 319 |
320 return false; | 320 return false; |
321} 322 323css::uno::Sequence< ::rtl::OUString > SAL_CALL FindTextToolbarController::getSupportedServiceNames() throw( css::uno::RuntimeException ) 324{ | 321} 322 323css::uno::Sequence< ::rtl::OUString > SAL_CALL FindTextToolbarController::getSupportedServiceNames() throw( css::uno::RuntimeException ) 324{ |
325 return getSupportedServiceNames_Static(); | 325 return getSupportedServiceNames_Static(); |
326} 327 | 326} 327 |
328css::uno::Sequence< ::rtl::OUString > FindTextToolbarController::getSupportedServiceNames_Static() throw() | 328css::uno::Sequence< ::rtl::OUString > FindTextToolbarController::getSupportedServiceNames_Static() throw() |
329{ | 329{ |
330 css::uno::Sequence< ::rtl::OUString > aSNS( 1 ); 331 aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ) ); 332 return aSNS; | 330 css::uno::Sequence< ::rtl::OUString > aSNS( 1 ); 331 aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ) ); 332 return aSNS; |
333} 334 335// XComponent 336void SAL_CALL FindTextToolbarController::dispose() throw ( css::uno::RuntimeException ) 337{ | 333} 334 335// XComponent 336void SAL_CALL FindTextToolbarController::dispose() throw ( css::uno::RuntimeException ) 337{ |
338 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); | 338 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); |
339 | 339 |
340 SearchToolbarControllersManager::createControllersManager()->freeController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); 341 342 svt::ToolboxController::dispose(); 343 delete m_pFindTextFieldControl; 344 m_pFindTextFieldControl = 0; | 340 SearchToolbarControllersManager::createControllersManager()->freeController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); 341 342 svt::ToolboxController::dispose(); 343 delete m_pFindTextFieldControl; 344 m_pFindTextFieldControl = 0; |
345} 346 347// XInitialization 348void SAL_CALL FindTextToolbarController::initialize( const css::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException) 349{ | 345} 346 347// XInitialization 348void SAL_CALL FindTextToolbarController::initialize( const css::uno::Sequence< ::com::sun::star::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException) 349{ |
350 svt::ToolboxController::initialize(aArguments); | 350 svt::ToolboxController::initialize(aArguments); |
351 | 351 |
352 Window* pWindow = VCLUnoHelper::GetWindow( getParent() ); 353 ToolBox* pToolBox = (ToolBox*)pWindow; 354 if ( pToolBox ) 355 { 356 sal_uInt16 nItemCount = pToolBox->GetItemCount(); 357 for ( sal_uInt16 i=0; i<nItemCount; ++i ) 358 { 359 ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i); 360 if ( sItemCommand.equals( COMMAND_DOWNSEARCH ) ) 361 m_nDownSearchId = i; 362 else if (sItemCommand.equals( COMMAND_UPSEARCH )) 363 m_nUpSearchId = i; 364 } 365 } | 352 Window* pWindow = VCLUnoHelper::GetWindow( getParent() ); 353 ToolBox* pToolBox = (ToolBox*)pWindow; 354 if ( pToolBox ) 355 { 356 sal_uInt16 nItemCount = pToolBox->GetItemCount(); 357 for ( sal_uInt16 i=0; i<nItemCount; ++i ) 358 { 359 ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i); 360 if ( sItemCommand.equals( COMMAND_DOWNSEARCH ) ) 361 { 362 pToolBox->EnableItem(i, sal_False); 363 m_nDownSearchId = i; 364 } 365 else if (sItemCommand.equals( COMMAND_UPSEARCH )) 366 { 367 pToolBox->EnableItem(i, sal_False); 368 m_nUpSearchId = i; 369 } 370 } 371 } |
366 | 372 |
367 SearchToolbarControllersManager::createControllersManager()->registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); | 373 SearchToolbarControllersManager::createControllersManager()->registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); |
368} 369 370// XToolbarController 371void SAL_CALL FindTextToolbarController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException ) 372{ 373} 374 375css::uno::Reference< css::awt::XWindow > SAL_CALL FindTextToolbarController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException ) 376{ | 374} 375 376// XToolbarController 377void SAL_CALL FindTextToolbarController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException ) 378{ 379} 380 381css::uno::Reference< css::awt::XWindow > SAL_CALL FindTextToolbarController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) throw ( css::uno::RuntimeException ) 382{ |
377 css::uno::Reference< css::awt::XWindow > xItemWindow; | 383 css::uno::Reference< css::awt::XWindow > xItemWindow; |
378 | 384 |
379 css::uno::Reference< css::awt::XWindow > xParent( Parent ); 380 Window* pParent = VCLUnoHelper::GetWindow( xParent ); 381 if ( pParent ) 382 { 383 ToolBox* pToolbar = ( ToolBox* )pParent; 384 m_pFindTextFieldControl = new FindTextFieldControl( pToolbar, WinBits( WB_DROPDOWN | WB_VSCROLL), m_xFrame, m_xServiceManager ); | 385 css::uno::Reference< css::awt::XWindow > xParent( Parent ); 386 Window* pParent = VCLUnoHelper::GetWindow( xParent ); 387 if ( pParent ) 388 { 389 ToolBox* pToolbar = ( ToolBox* )pParent; 390 m_pFindTextFieldControl = new FindTextFieldControl( pToolbar, WinBits( WB_DROPDOWN | WB_VSCROLL), m_xFrame, m_xServiceManager ); |
385 | 391 |
386 Size aSize(100, m_pFindTextFieldControl->GetTextHeight() + 200); 387 m_pFindTextFieldControl->SetSizePixel( aSize ); 388 m_pFindTextFieldControl->SetModifyHdl(LINK(this, FindTextToolbarController, EditModifyHdl)); 389 } 390 xItemWindow = VCLUnoHelper::GetInterface( m_pFindTextFieldControl ); | 392 Size aSize(100, m_pFindTextFieldControl->GetTextHeight() + 200); 393 m_pFindTextFieldControl->SetSizePixel( aSize ); 394 m_pFindTextFieldControl->SetModifyHdl(LINK(this, FindTextToolbarController, EditModifyHdl)); 395 } 396 xItemWindow = VCLUnoHelper::GetInterface( m_pFindTextFieldControl ); |
391 | 397 |
392 return xItemWindow; | 398 return xItemWindow; |
393} 394 395// XStatusListener 396void SAL_CALL FindTextToolbarController::statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException ) 397{ | 399} 400 401// XStatusListener 402void SAL_CALL FindTextToolbarController::statusChanged( const css::frame::FeatureStateEvent& rEvent ) throw ( css::uno::RuntimeException ) 403{ |
398 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); 399 if ( m_bDisposed ) 400 return; | 404 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); 405 if ( m_bDisposed ) 406 return; |
401 | 407 |
402 ::rtl::OUString aFeatureURL = rEvent.FeatureURL.Complete; 403 if (aFeatureURL.equalsAscii("AppendSearchHistory")) 404 { 405 m_pFindTextFieldControl->Remember_Impl(m_pFindTextFieldControl->GetText()); 406 } | 408 ::rtl::OUString aFeatureURL = rEvent.FeatureURL.Complete; 409 if (aFeatureURL.equalsAscii("AppendSearchHistory")) 410 { 411 m_pFindTextFieldControl->Remember_Impl(m_pFindTextFieldControl->GetText()); 412 } |
407} 408 409IMPL_LINK( FindTextToolbarController, EditModifyHdl, void *, EMPTYARG ) 410{ | 413} 414 415IMPL_LINK( FindTextToolbarController, EditModifyHdl, void *, EMPTYARG ) 416{ |
411 // enable or disable item DownSearch/UpSearch of findbar 412 Window* pWindow = VCLUnoHelper::GetWindow( getParent() ); 413 ToolBox* pToolBox = (ToolBox*)pWindow; 414 if ( pToolBox && m_pFindTextFieldControl ) 415 { 416 if (m_pFindTextFieldControl->GetText().Len()>0) 417 { 418 if ( !pToolBox->IsItemEnabled(m_nDownSearchId) ) 419 pToolBox->EnableItem(m_nDownSearchId, sal_True); 420 if ( !pToolBox->IsItemEnabled(m_nUpSearchId) ) 421 pToolBox->EnableItem(m_nUpSearchId, sal_True); 422 } 423 else 424 { 425 if ( pToolBox->IsItemEnabled(m_nDownSearchId) ) 426 pToolBox->EnableItem(m_nDownSearchId, sal_False); 427 if ( pToolBox->IsItemEnabled(m_nUpSearchId) ) 428 pToolBox->EnableItem(m_nUpSearchId, sal_False); 429 } 430 } | 417 // enable or disable item DownSearch/UpSearch of findbar 418 Window* pWindow = VCLUnoHelper::GetWindow( getParent() ); 419 ToolBox* pToolBox = (ToolBox*)pWindow; 420 if ( pToolBox && m_pFindTextFieldControl ) 421 { 422 if (m_pFindTextFieldControl->GetText().Len()>0) 423 { 424 if ( !pToolBox->IsItemEnabled(m_nDownSearchId) ) 425 pToolBox->EnableItem(m_nDownSearchId, sal_True); 426 if ( !pToolBox->IsItemEnabled(m_nUpSearchId) ) 427 pToolBox->EnableItem(m_nUpSearchId, sal_True); 428 } 429 else 430 { 431 if ( pToolBox->IsItemEnabled(m_nDownSearchId) ) 432 pToolBox->EnableItem(m_nDownSearchId, sal_False); 433 if ( pToolBox->IsItemEnabled(m_nUpSearchId) ) 434 pToolBox->EnableItem(m_nUpSearchId, sal_False); 435 } 436 } |
431 | 437 |
432 return 0; | 438 return 0; |
433} 434 435//----------------------------------------------------------------------------------------------------------- 436// class DownSearchToolboxController 437 438DownSearchToolboxController::DownSearchToolboxController(const css::uno::Reference< css::lang::XMultiServiceFactory >& rServiceManager ) | 439} 440 441//----------------------------------------------------------------------------------------------------------- 442// class DownSearchToolboxController 443 444DownSearchToolboxController::DownSearchToolboxController(const css::uno::Reference< css::lang::XMultiServiceFactory >& rServiceManager ) |
439 : svt::ToolboxController( rServiceManager, 440 css::uno::Reference< css::frame::XFrame >(), 441 COMMAND_DOWNSEARCH ) | 445 : svt::ToolboxController( rServiceManager, 446 css::uno::Reference< css::frame::XFrame >(), 447 COMMAND_DOWNSEARCH ) |
442{ 443} 444 445DownSearchToolboxController::~DownSearchToolboxController() 446{ 447} 448 449// XInterface 450css::uno::Any SAL_CALL DownSearchToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException ) 451{ | 448{ 449} 450 451DownSearchToolboxController::~DownSearchToolboxController() 452{ 453} 454 455// XInterface 456css::uno::Any SAL_CALL DownSearchToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException ) 457{ |
452 css::uno::Any a = ToolboxController::queryInterface( aType ); 453 if ( a.hasValue() ) 454 return a; | 458 css::uno::Any a = ToolboxController::queryInterface( aType ); 459 if ( a.hasValue() ) 460 return a; |
455 | 461 |
456 return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) ); | 462 return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) ); |
457} 458 459void SAL_CALL DownSearchToolboxController::acquire() throw () 460{ | 463} 464 465void SAL_CALL DownSearchToolboxController::acquire() throw () 466{ |
461 ToolboxController::acquire(); | 467 ToolboxController::acquire(); |
462} 463 464void SAL_CALL DownSearchToolboxController::release() throw () 465{ | 468} 469 470void SAL_CALL DownSearchToolboxController::release() throw () 471{ |
466 ToolboxController::release(); | 472 ToolboxController::release(); |
467} 468 469// XServiceInfo 470::rtl::OUString SAL_CALL DownSearchToolboxController::getImplementationName() throw( css::uno::RuntimeException ) 471{ | 473} 474 475// XServiceInfo 476::rtl::OUString SAL_CALL DownSearchToolboxController::getImplementationName() throw( css::uno::RuntimeException ) 477{ |
472 return getImplementationName_Static(); | 478 return getImplementationName_Static(); |
473} 474 475sal_Bool SAL_CALL DownSearchToolboxController::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException ) | 479} 480 481sal_Bool SAL_CALL DownSearchToolboxController::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException ) |
476{ 477 const css::uno::Sequence< ::rtl::OUString > aSNL( getSupportedServiceNames() ); 478 const ::rtl::OUString * pArray = aSNL.getConstArray(); | 482{ 483 const css::uno::Sequence< ::rtl::OUString > aSNL( getSupportedServiceNames() ); 484 const ::rtl::OUString * pArray = aSNL.getConstArray(); |
479 | 485 |
480 for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) 481 if( pArray[i] == ServiceName ) 482 return true; | 486 for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) 487 if( pArray[i] == ServiceName ) 488 return true; |
483 | 489 |
484 return false; | 490 return false; |
485} 486 487css::uno::Sequence< ::rtl::OUString > SAL_CALL DownSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException ) 488{ | 491} 492 493css::uno::Sequence< ::rtl::OUString > SAL_CALL DownSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException ) 494{ |
489 return getSupportedServiceNames_Static(); | 495 return getSupportedServiceNames_Static(); |
490} 491 | 496} 497 |
492css::uno::Sequence< ::rtl::OUString > DownSearchToolboxController::getSupportedServiceNames_Static() throw() | 498css::uno::Sequence< ::rtl::OUString > DownSearchToolboxController::getSupportedServiceNames_Static() throw() |
493{ | 499{ |
494 css::uno::Sequence< ::rtl::OUString > aSNS( 1 ); 495 aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" )); 496 return aSNS; | 500 css::uno::Sequence< ::rtl::OUString > aSNS( 1 ); 501 aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" )); 502 return aSNS; |
497} 498 499// XComponent 500void SAL_CALL DownSearchToolboxController::dispose() throw ( css::uno::RuntimeException ) 501{ | 503} 504 505// XComponent 506void SAL_CALL DownSearchToolboxController::dispose() throw ( css::uno::RuntimeException ) 507{ |
502 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); | 508 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); |
503 | 509 |
504 SearchToolbarControllersManager::createControllersManager()->freeController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); | 510 SearchToolbarControllersManager::createControllersManager()->freeController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); |
505 | 511 |
506 svt::ToolboxController::dispose(); | 512 svt::ToolboxController::dispose(); |
507} 508 509// XInitialization 510void SAL_CALL DownSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException ) 511{ | 513} 514 515// XInitialization 516void SAL_CALL DownSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException ) 517{ |
512 svt::ToolboxController::initialize( aArguments ); 513 SearchToolbarControllersManager::createControllersManager()->registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); | 518 svt::ToolboxController::initialize( aArguments ); 519 SearchToolbarControllersManager::createControllersManager()->registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); |
514} 515 516// XToolbarController 517void SAL_CALL DownSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException) 518{ | 520} 521 522// XToolbarController 523void SAL_CALL DownSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException) 524{ |
519 if ( m_bDisposed ) 520 throw css::lang::DisposedException(); | 525 if ( m_bDisposed ) 526 throw css::lang::DisposedException(); |
521 | 527 |
522 ::rtl::OUString sFindText; 523 Window* pWindow = VCLUnoHelper::GetWindow( getParent() ); 524 ToolBox* pToolBox = (ToolBox*)pWindow; 525 if ( pToolBox ) 526 { 527 sal_uInt16 nItemCount = pToolBox->GetItemCount(); 528 for ( sal_uInt16 i=0; i<nItemCount; ++i ) 529 { 530 ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i); 531 if ( sItemCommand.equals( COMMAND_FINDTEXT ) ) 532 { 533 Window* pItemWin = pToolBox->GetItemWindow(i); 534 if (pItemWin) 535 sFindText = pItemWin->GetText(); 536 break; 537 } 538 } 539 } | 528 ::rtl::OUString sFindText; 529 Window* pWindow = VCLUnoHelper::GetWindow( getParent() ); 530 ToolBox* pToolBox = (ToolBox*)pWindow; 531 if ( pToolBox ) 532 { 533 sal_uInt16 nItemCount = pToolBox->GetItemCount(); 534 for ( sal_uInt16 i=0; i<nItemCount; ++i ) 535 { 536 ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i); 537 if ( sItemCommand.equals( COMMAND_FINDTEXT ) ) 538 { 539 Window* pItemWin = pToolBox->GetItemWindow(i); 540 if (pItemWin) 541 sFindText = pItemWin->GetText(); 542 break; 543 } 544 } 545 } |
540 | 546 |
541 css::uno::Sequence< css::beans::PropertyValue > lArgs(2); 542 lArgs[0].Name = SEARCHITEM_SEARCHSTRING; 543 lArgs[0].Value <<= sFindText; 544 lArgs[1].Name = SEARCHITEM_SEARCHBACKWARD; 545 lArgs[1].Value <<= sal_False; | 547 css::uno::Sequence< css::beans::PropertyValue > lArgs(2); 548 lArgs[0].Name = SEARCHITEM_SEARCHSTRING; 549 lArgs[0].Value <<= sFindText; 550 lArgs[1].Name = SEARCHITEM_SEARCHBACKWARD; 551 lArgs[1].Value <<= sal_False; |
546 | 552 |
547 impl_executeSearch(m_xServiceManager, m_xFrame, lArgs); | 553 impl_executeSearch(m_xServiceManager, m_xFrame, lArgs); |
548 | 554 |
549 css::frame::FeatureStateEvent aEvent; 550 aEvent.FeatureURL.Complete = COMMAND_APPENDSEARCHHISTORY; 551 css::uno::Reference< css::frame::XStatusListener > xStatusListener = SearchToolbarControllersManager::createControllersManager()->findController(m_xFrame, COMMAND_FINDTEXT); 552 if (xStatusListener.is()) 553 xStatusListener->statusChanged( aEvent ); | 555 css::frame::FeatureStateEvent aEvent; 556 aEvent.FeatureURL.Complete = COMMAND_APPENDSEARCHHISTORY; 557 css::uno::Reference< css::frame::XStatusListener > xStatusListener = SearchToolbarControllersManager::createControllersManager()->findController(m_xFrame, COMMAND_FINDTEXT); 558 if (xStatusListener.is()) 559 xStatusListener->statusChanged( aEvent ); |
554} 555 556// XStatusListener 557void SAL_CALL DownSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ ) throw ( css::uno::RuntimeException ) 558{ | 560} 561 562// XStatusListener 563void SAL_CALL DownSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ ) throw ( css::uno::RuntimeException ) 564{ |
559 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); 560 if ( m_bDisposed ) 561 return; | 565 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); 566 if ( m_bDisposed ) 567 return; |
562} 563 564//----------------------------------------------------------------------------------------------------------- 565// class UpSearchToolboxController 566 567UpSearchToolboxController::UpSearchToolboxController( const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager ) | 568} 569 570//----------------------------------------------------------------------------------------------------------- 571// class UpSearchToolboxController 572 573UpSearchToolboxController::UpSearchToolboxController( const css::uno::Reference< css::lang::XMultiServiceFactory > & rServiceManager ) |
568 :svt::ToolboxController( rServiceManager, 569 css::uno::Reference< css::frame::XFrame >(), 570 COMMAND_UPSEARCH ) | 574 :svt::ToolboxController( rServiceManager, 575 css::uno::Reference< css::frame::XFrame >(), 576 COMMAND_UPSEARCH ) |
571{ 572} 573 574UpSearchToolboxController::~UpSearchToolboxController() 575{ 576} 577 578// XInterface 579css::uno::Any SAL_CALL UpSearchToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException ) 580{ | 577{ 578} 579 580UpSearchToolboxController::~UpSearchToolboxController() 581{ 582} 583 584// XInterface 585css::uno::Any SAL_CALL UpSearchToolboxController::queryInterface( const css::uno::Type& aType ) throw ( css::uno::RuntimeException ) 586{ |
581 css::uno::Any a = ToolboxController::queryInterface( aType ); 582 if ( a.hasValue() ) 583 return a; | 587 css::uno::Any a = ToolboxController::queryInterface( aType ); 588 if ( a.hasValue() ) 589 return a; |
584 | 590 |
585 return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) ); | 591 return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) ); |
586} 587 588void SAL_CALL UpSearchToolboxController::acquire() throw () 589{ | 592} 593 594void SAL_CALL UpSearchToolboxController::acquire() throw () 595{ |
590 ToolboxController::acquire(); | 596 ToolboxController::acquire(); |
591} 592 593void SAL_CALL UpSearchToolboxController::release() throw () 594{ | 597} 598 599void SAL_CALL UpSearchToolboxController::release() throw () 600{ |
595 ToolboxController::release(); | 601 ToolboxController::release(); |
596} 597 598// XServiceInfo 599::rtl::OUString SAL_CALL UpSearchToolboxController::getImplementationName() throw( css::uno::RuntimeException ) 600{ | 602} 603 604// XServiceInfo 605::rtl::OUString SAL_CALL UpSearchToolboxController::getImplementationName() throw( css::uno::RuntimeException ) 606{ |
601 return getImplementationName_Static(); | 607 return getImplementationName_Static(); |
602} 603 604sal_Bool SAL_CALL UpSearchToolboxController::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException ) | 608} 609 610sal_Bool SAL_CALL UpSearchToolboxController::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException ) |
605{ 606 const css::uno::Sequence< ::rtl::OUString > aSNL( getSupportedServiceNames() ); 607 const ::rtl::OUString * pArray = aSNL.getConstArray(); | 611{ 612 const css::uno::Sequence< ::rtl::OUString > aSNL( getSupportedServiceNames() ); 613 const ::rtl::OUString * pArray = aSNL.getConstArray(); |
608 | 614 |
609 for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) 610 if( pArray[i] == ServiceName ) 611 return true; | 615 for( sal_Int32 i = 0; i < aSNL.getLength(); i++ ) 616 if( pArray[i] == ServiceName ) 617 return true; |
612 | 618 |
613 return false; | 619 return false; |
614} 615 616css::uno::Sequence< ::rtl::OUString > SAL_CALL UpSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException ) 617{ | 620} 621 622css::uno::Sequence< ::rtl::OUString > SAL_CALL UpSearchToolboxController::getSupportedServiceNames() throw( css::uno::RuntimeException ) 623{ |
618 return getSupportedServiceNames_Static(); | 624 return getSupportedServiceNames_Static(); |
619} 620 | 625} 626 |
621css::uno::Sequence< ::rtl::OUString > UpSearchToolboxController::getSupportedServiceNames_Static() throw() | 627css::uno::Sequence< ::rtl::OUString > UpSearchToolboxController::getSupportedServiceNames_Static() throw() |
622{ | 628{ |
623 css::uno::Sequence< ::rtl::OUString > aSNS( 1 ); 624 aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ) ); 625 return aSNS; | 629 css::uno::Sequence< ::rtl::OUString > aSNS( 1 ); 630 aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ToolbarController" ) ); 631 return aSNS; |
626} 627 628// XComponent 629void SAL_CALL UpSearchToolboxController::dispose() throw ( css::uno::RuntimeException ) 630{ | 632} 633 634// XComponent 635void SAL_CALL UpSearchToolboxController::dispose() throw ( css::uno::RuntimeException ) 636{ |
631 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); | 637 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); |
632 | 638 |
633 SearchToolbarControllersManager::createControllersManager()->freeController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); | 639 SearchToolbarControllersManager::createControllersManager()->freeController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); |
634 | 640 |
635 svt::ToolboxController::dispose(); | 641 svt::ToolboxController::dispose(); |
636} 637 638// XInitialization 639void SAL_CALL UpSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException ) 640{ | 642} 643 644// XInitialization 645void SAL_CALL UpSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException ) 646{ |
641 svt::ToolboxController::initialize( aArguments ); 642 SearchToolbarControllersManager::createControllersManager()->registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); | 647 svt::ToolboxController::initialize( aArguments ); 648 SearchToolbarControllersManager::createControllersManager()->registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL); |
643} 644 645// XToolbarController 646void SAL_CALL UpSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException ) 647{ | 649} 650 651// XToolbarController 652void SAL_CALL UpSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ ) throw ( css::uno::RuntimeException ) 653{ |
648 if ( m_bDisposed ) 649 throw css::lang::DisposedException(); | 654 if ( m_bDisposed ) 655 throw css::lang::DisposedException(); |
650 | 656 |
651 ::rtl::OUString sFindText; 652 Window* pWindow = VCLUnoHelper::GetWindow( getParent() ); 653 ToolBox* pToolBox = (ToolBox*)pWindow; 654 if ( pToolBox ) 655 { 656 sal_uInt16 nItemCount = pToolBox->GetItemCount(); 657 for ( sal_uInt16 i=0; i<nItemCount; ++i ) 658 { 659 ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i); 660 if ( sItemCommand.equals( COMMAND_FINDTEXT ) ) 661 { 662 Window* pItemWin = pToolBox->GetItemWindow(i); 663 if (pItemWin) 664 sFindText = pItemWin->GetText(); 665 break; 666 } 667 } 668 } | 657 ::rtl::OUString sFindText; 658 Window* pWindow = VCLUnoHelper::GetWindow( getParent() ); 659 ToolBox* pToolBox = (ToolBox*)pWindow; 660 if ( pToolBox ) 661 { 662 sal_uInt16 nItemCount = pToolBox->GetItemCount(); 663 for ( sal_uInt16 i=0; i<nItemCount; ++i ) 664 { 665 ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i); 666 if ( sItemCommand.equals( COMMAND_FINDTEXT ) ) 667 { 668 Window* pItemWin = pToolBox->GetItemWindow(i); 669 if (pItemWin) 670 sFindText = pItemWin->GetText(); 671 break; 672 } 673 } 674 } |
669 | 675 |
670 css::uno::Sequence< css::beans::PropertyValue > lArgs(2); 671 lArgs[0].Name = SEARCHITEM_SEARCHSTRING; 672 lArgs[0].Value <<= sFindText; 673 lArgs[1].Name = SEARCHITEM_SEARCHBACKWARD; 674 lArgs[1].Value <<= sal_True; | 676 css::uno::Sequence< css::beans::PropertyValue > lArgs(2); 677 lArgs[0].Name = SEARCHITEM_SEARCHSTRING; 678 lArgs[0].Value <<= sFindText; 679 lArgs[1].Name = SEARCHITEM_SEARCHBACKWARD; 680 lArgs[1].Value <<= sal_True; |
675 | 681 |
676 impl_executeSearch(m_xServiceManager, m_xFrame, lArgs); | 682 impl_executeSearch(m_xServiceManager, m_xFrame, lArgs); |
677 | 683 |
678 css::frame::FeatureStateEvent aEvent; 679 aEvent.FeatureURL.Complete = COMMAND_APPENDSEARCHHISTORY; 680 css::uno::Reference< css::frame::XStatusListener > xStatusListener = SearchToolbarControllersManager::createControllersManager()->findController(m_xFrame, COMMAND_FINDTEXT); 681 if (xStatusListener.is()) 682 xStatusListener->statusChanged( aEvent ); | 684 css::frame::FeatureStateEvent aEvent; 685 aEvent.FeatureURL.Complete = COMMAND_APPENDSEARCHHISTORY; 686 css::uno::Reference< css::frame::XStatusListener > xStatusListener = SearchToolbarControllersManager::createControllersManager()->findController(m_xFrame, COMMAND_FINDTEXT); 687 if (xStatusListener.is()) 688 xStatusListener->statusChanged( aEvent ); |
683} 684 685// XStatusListener 686void SAL_CALL UpSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ ) throw ( css::uno::RuntimeException ) 687{ | 689} 690 691// XStatusListener 692void SAL_CALL UpSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ ) throw ( css::uno::RuntimeException ) 693{ |
688 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); 689 if ( m_bDisposed ) 690 return; | 694 vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); 695 if ( m_bDisposed ) 696 return; |
691} 692 693//----------------------------------------------------------------------------------------------------------- 694// class FindbarDispatcher 695 696FindbarDispatcher::FindbarDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory) | 697} 698 699//----------------------------------------------------------------------------------------------------------- 700// class FindbarDispatcher 701 702FindbarDispatcher::FindbarDispatcher(const css::uno::Reference< css::lang::XMultiServiceFactory >& xFactory) |
697 : m_xFactory( xFactory ) | 703 : m_xFactory( xFactory ) |
698{ 699} 700 701FindbarDispatcher::~FindbarDispatcher() 702{ | 704{ 705} 706 707FindbarDispatcher::~FindbarDispatcher() 708{ |
703 m_xFactory = NULL; 704 m_xFrame = NULL; | 709 m_xFactory = NULL; 710 m_xFrame = NULL; |
705} 706 707// XInterface 708css::uno::Any SAL_CALL FindbarDispatcher::queryInterface( const css::uno::Type& aType ) throw( css::uno::RuntimeException ) 709{ | 711} 712 713// XInterface 714css::uno::Any SAL_CALL FindbarDispatcher::queryInterface( const css::uno::Type& aType ) throw( css::uno::RuntimeException ) 715{ |
710 css::uno::Any aReturn( ::cppu::queryInterface( aType, 711 static_cast< css::lang::XServiceInfo* >(this), 712 static_cast< css::lang::XInitialization* >(this), 713 static_cast< css::frame::XDispatchProvider* >(this), 714 static_cast< css::frame::XDispatch* >(this)) ); | 716 css::uno::Any aReturn( ::cppu::queryInterface( aType, 717 static_cast< css::lang::XServiceInfo* >(this), 718 static_cast< css::lang::XInitialization* >(this), 719 static_cast< css::frame::XDispatchProvider* >(this), 720 static_cast< css::frame::XDispatch* >(this)) ); |
715 | 721 |
716 if ( aReturn.hasValue() ) 717 return aReturn; | 722 if ( aReturn.hasValue() ) 723 return aReturn; |
718 | 724 |
719 return OWeakObject::queryInterface( aType ); | 725 return OWeakObject::queryInterface( aType ); |
720} 721 722void SAL_CALL FindbarDispatcher::acquire() throw() 723{ | 726} 727 728void SAL_CALL FindbarDispatcher::acquire() throw() 729{ |
724 OWeakObject::acquire(); | 730 OWeakObject::acquire(); |
725} 726 727void SAL_CALL FindbarDispatcher::release() throw() 728{ | 731} 732 733void SAL_CALL FindbarDispatcher::release() throw() 734{ |
729 OWeakObject::release(); | 735 OWeakObject::release(); |
730} 731 732// XServiceInfo 733::rtl::OUString SAL_CALL FindbarDispatcher::getImplementationName() throw( css::uno::RuntimeException ) 734{ | 736} 737 738// XServiceInfo 739::rtl::OUString SAL_CALL FindbarDispatcher::getImplementationName() throw( css::uno::RuntimeException ) 740{ |
735 return getImplementationName_Static(); | 741 return getImplementationName_Static(); |
736} 737 738sal_Bool SAL_CALL FindbarDispatcher::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException ) | 742} 743 744sal_Bool SAL_CALL FindbarDispatcher::supportsService( const ::rtl::OUString& ServiceName ) throw( css::uno::RuntimeException ) |
739{ 740 return ( 741 ServiceName.equalsAscii("com.sun.star.comp.svx.FindbarDispatcher") || 742 ServiceName.equalsAscii("com.sun.star.frame.ProtocolHandler") 743 ); | 745{ 746 return ( 747 ServiceName.equalsAscii("com.sun.star.comp.svx.FindbarDispatcher") || 748 ServiceName.equalsAscii("com.sun.star.frame.ProtocolHandler") 749 ); |
744} 745 746css::uno::Sequence< ::rtl::OUString > SAL_CALL FindbarDispatcher::getSupportedServiceNames() throw( css::uno::RuntimeException ) 747{ | 750} 751 752css::uno::Sequence< ::rtl::OUString > SAL_CALL FindbarDispatcher::getSupportedServiceNames() throw( css::uno::RuntimeException ) 753{ |
748 return getSupportedServiceNames_Static(); | 754 return getSupportedServiceNames_Static(); |
749} 750 | 755} 756 |
751css::uno::Sequence< ::rtl::OUString > FindbarDispatcher::getSupportedServiceNames_Static() throw() | 757css::uno::Sequence< ::rtl::OUString > FindbarDispatcher::getSupportedServiceNames_Static() throw() |
752{ | 758{ |
753 css::uno::Sequence< ::rtl::OUString > aSNS( 2 ); 754 aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.FindbarDispatcher" )); 755 aSNS.getArray()[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ProtocolHandler" )); 756 return aSNS; | 759 css::uno::Sequence< ::rtl::OUString > aSNS( 2 ); 760 aSNS.getArray()[0] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.svx.FindbarDispatcher" )); 761 aSNS.getArray()[1] = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.frame.ProtocolHandler" )); 762 return aSNS; |
757} 758 759// XInitialization 760void SAL_CALL FindbarDispatcher::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException ) 761{ | 763} 764 765// XInitialization 766void SAL_CALL FindbarDispatcher::initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) throw ( css::uno::Exception, css::uno::RuntimeException ) 767{ |
762 if ( aArguments.getLength() ) 763 aArguments[0] >>= m_xFrame; | 768 if ( aArguments.getLength() ) 769 aArguments[0] >>= m_xFrame; |
764} 765 766// XDispatchProvider 767css::uno::Reference< css::frame::XDispatch > SAL_CALL FindbarDispatcher::queryDispatch( const css::util::URL& aURL, const ::rtl::OUString& /*sTargetFrameName*/, sal_Int32 /*nSearchFlags*/ ) throw( css::uno::RuntimeException ) 768{ | 770} 771 772// XDispatchProvider 773css::uno::Reference< css::frame::XDispatch > SAL_CALL FindbarDispatcher::queryDispatch( const css::util::URL& aURL, const ::rtl::OUString& /*sTargetFrameName*/, sal_Int32 /*nSearchFlags*/ ) throw( css::uno::RuntimeException ) 774{ |
769 css::uno::Reference< css::frame::XDispatch > xDispatch; | 775 css::uno::Reference< css::frame::XDispatch > xDispatch; |
770 | 776 |
771 if ( aURL.Protocol.equalsAscii("vnd.sun.star.findbar:") ) 772 xDispatch = this; | 777 if ( aURL.Protocol.equalsAscii("vnd.sun.star.findbar:") ) 778 xDispatch = this; |
773 | 779 |
774 return xDispatch; | 780 return xDispatch; |
775} 776 777css::uno::Sequence < css::uno::Reference< css::frame::XDispatch > > SAL_CALL FindbarDispatcher::queryDispatches( const css::uno::Sequence < css::frame::DispatchDescriptor >& seqDescripts ) throw( css::uno::RuntimeException ) 778{ | 781} 782 783css::uno::Sequence < css::uno::Reference< css::frame::XDispatch > > SAL_CALL FindbarDispatcher::queryDispatches( const css::uno::Sequence < css::frame::DispatchDescriptor >& seqDescripts ) throw( css::uno::RuntimeException ) 784{ |
779 sal_Int32 nCount = seqDescripts.getLength(); 780 css::uno::Sequence < css::uno::Reference < XDispatch > > lDispatcher( nCount ); | 785 sal_Int32 nCount = seqDescripts.getLength(); 786 css::uno::Sequence < css::uno::Reference < XDispatch > > lDispatcher( nCount ); |
781 | 787 |
782 for( sal_Int32 i=0; i<nCount; ++i ) 783 lDispatcher[i] = queryDispatch( seqDescripts[i].FeatureURL, seqDescripts[i].FrameName, seqDescripts[i].SearchFlags ); | 788 for( sal_Int32 i=0; i<nCount; ++i ) 789 lDispatcher[i] = queryDispatch( seqDescripts[i].FeatureURL, seqDescripts[i].FrameName, seqDescripts[i].SearchFlags ); |
784 | 790 |
785 return lDispatcher; | 791 return lDispatcher; |
786} 787 788// XDispatch 789void SAL_CALL FindbarDispatcher::dispatch( const css::util::URL& aURL, const css::uno::Sequence < css::beans::PropertyValue >& /*lArgs*/ ) throw( css::uno::RuntimeException ) 790{ | 792} 793 794// XDispatch 795void SAL_CALL FindbarDispatcher::dispatch( const css::util::URL& aURL, const css::uno::Sequence < css::beans::PropertyValue >& /*lArgs*/ ) throw( css::uno::RuntimeException ) 796{ |
791 //vnd.sun.star.findbar:FocusToFindbar - set cursor to the FindTextFieldControl of the findbar 792 if ( aURL.Path.equalsAscii("FocusToFindbar") ) 793 { 794 css::uno::Reference< css::beans::XPropertySet > xPropSet(m_xFrame, css::uno::UNO_QUERY); 795 if(!xPropSet.is()) 796 return; | 797 //vnd.sun.star.findbar:FocusToFindbar - set cursor to the FindTextFieldControl of the findbar 798 if ( aURL.Path.equalsAscii("FocusToFindbar") ) 799 { 800 css::uno::Reference< css::beans::XPropertySet > xPropSet(m_xFrame, css::uno::UNO_QUERY); 801 if(!xPropSet.is()) 802 return; |
797 | 803 |
798 css::uno::Reference< css::frame::XLayoutManager > xLayoutManager; 799 css::uno::Any aValue = xPropSet->getPropertyValue( ::rtl::OUString::createFromAscii("LayoutManager") ); 800 aValue >>= xLayoutManager; 801 if (!xLayoutManager.is()) 802 return; | 804 css::uno::Reference< css::frame::XLayoutManager > xLayoutManager; 805 css::uno::Any aValue = xPropSet->getPropertyValue( ::rtl::OUString::createFromAscii("LayoutManager") ); 806 aValue >>= xLayoutManager; 807 if (!xLayoutManager.is()) 808 return; |
803 | 809 |
804 const ::rtl::OUString sResourceURL = ::rtl::OUString::createFromAscii("private:resource/toolbar/findbar"); 805 css::uno::Reference< css::ui::XUIElement > xUIElement = xLayoutManager->getElement(sResourceURL); 806 if (!xUIElement.is()) 807 return; | 810 const ::rtl::OUString sResourceURL = ::rtl::OUString::createFromAscii("private:resource/toolbar/findbar"); 811 css::uno::Reference< css::ui::XUIElement > xUIElement = xLayoutManager->getElement(sResourceURL); 812 if (!xUIElement.is()) 813 return; |
808 | 814 |
809 css::uno::Reference< css::awt::XWindow > xWindow(xUIElement->getRealInterface(), css::uno::UNO_QUERY); 810 Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); 811 ToolBox* pToolBox = (ToolBox*)pWindow; 812 if ( pToolBox ) 813 { 814 sal_uInt16 nItemCount = pToolBox->GetItemCount(); 815 for ( sal_uInt16 i=0; i<nItemCount; ++i ) 816 { 817 ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i); 818 if ( sItemCommand.equalsAscii(".uno:FindText") ) 819 { 820 Window* pItemWin = pToolBox->GetItemWindow( i ); 821 if ( pItemWin ) 822 { 823 pItemWin->GrabFocus(); 824 return; 825 } 826 } 827 } 828 } | 815 css::uno::Reference< css::awt::XWindow > xWindow(xUIElement->getRealInterface(), css::uno::UNO_QUERY); 816 Window* pWindow = VCLUnoHelper::GetWindow( xWindow ); 817 ToolBox* pToolBox = (ToolBox*)pWindow; 818 if ( pToolBox ) 819 { 820 sal_uInt16 nItemCount = pToolBox->GetItemCount(); 821 for ( sal_uInt16 i=0; i<nItemCount; ++i ) 822 { 823 ::rtl::OUString sItemCommand = pToolBox->GetItemCommand(i); 824 if ( sItemCommand.equalsAscii(".uno:FindText") ) 825 { 826 Window* pItemWin = pToolBox->GetItemWindow( i ); 827 if ( pItemWin ) 828 { 829 pItemWin->GrabFocus(); 830 return; 831 } 832 } 833 } 834 } |
829 | 835 |
830 } | 836 } |
831} 832 833void SAL_CALL FindbarDispatcher::addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& /*xControl*/, const css::util::URL& /*aURL*/ ) throw ( css::uno::RuntimeException ) 834{ 835} 836 837void SAL_CALL FindbarDispatcher::removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& /*xControl*/, const css::util::URL& /*aURL*/ ) throw ( css::uno::RuntimeException ) 838{ 839} 840 841//----------------------------------------------------------------------------------------------------------- | 837} 838 839void SAL_CALL FindbarDispatcher::addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& /*xControl*/, const css::util::URL& /*aURL*/ ) throw ( css::uno::RuntimeException ) 840{ 841} 842 843void SAL_CALL FindbarDispatcher::removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& /*xControl*/, const css::util::URL& /*aURL*/ ) throw ( css::uno::RuntimeException ) 844{ 845} 846 847//----------------------------------------------------------------------------------------------------------- |
842// create Instance | 848// create Instance |
843 | 849 |
844css::uno::Reference< css::uno::XInterface > SAL_CALL FindTextToolbarController_createInstance( 845 const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) | 850css::uno::Reference< css::uno::XInterface > SAL_CALL FindTextToolbarController_createInstance( 851 const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) |
846{ | 852{ |
847 return *new FindTextToolbarController( rSMgr ); | 853 return *new FindTextToolbarController( rSMgr ); |
848} 849 | 854} 855 |
850css::uno::Reference< css::uno::XInterface > SAL_CALL DownSearchToolboxController_createInstance( 851 const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) | 856css::uno::Reference< css::uno::XInterface > SAL_CALL DownSearchToolboxController_createInstance( 857 const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) |
852{ | 858{ |
853 return *new DownSearchToolboxController( rSMgr ); | 859 return *new DownSearchToolboxController( rSMgr ); |
854} 855 | 860} 861 |
856css::uno::Reference< css::uno::XInterface > SAL_CALL UpSearchToolboxController_createInstance( 857 const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) | 862css::uno::Reference< css::uno::XInterface > SAL_CALL UpSearchToolboxController_createInstance( 863 const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) |
858{ | 864{ |
859 return *new UpSearchToolboxController( rSMgr ); | 865 return *new UpSearchToolboxController( rSMgr ); |
860} 861 | 866} 867 |
862css::uno::Reference< css::uno::XInterface > SAL_CALL FindbarDispatcher_createInstance( 863 const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) | 868css::uno::Reference< css::uno::XInterface > SAL_CALL FindbarDispatcher_createInstance( 869 const css::uno::Reference< css::lang::XMultiServiceFactory >& rSMgr ) |
864{ | 870{ |
865 return *new FindbarDispatcher( rSMgr ); | 871 return *new FindbarDispatcher( rSMgr ); |
866} 867 868//----------------------------------------------------------------------------------------------------------- 869} | 872} 873 874//----------------------------------------------------------------------------------------------------------- 875} |