LibreOffice Module svx (master)  1
tbunosearchcontrollers.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <sal/config.h>
21 
22 #include <map>
23 #include <vector>
24 
25 #include <config_feature_desktop.h>
26 
27 #include <svx/strings.hrc>
28 #include <svx/dialmgr.hxx>
29 
33 #include <cppuhelper/weak.hxx>
34 #include <com/sun/star/beans/PropertyValue.hpp>
35 #include <com/sun/star/beans/XPropertySet.hpp>
36 #include <com/sun/star/frame/DispatchDescriptor.hpp>
37 #include <com/sun/star/frame/XDispatch.hpp>
38 #include <com/sun/star/frame/XDispatchProvider.hpp>
39 #include <com/sun/star/frame/XLayoutManager.hpp>
40 #include <com/sun/star/frame/XStatusListener.hpp>
41 #include <com/sun/star/lang/XInitialization.hpp>
42 #include <com/sun/star/lang/XServiceInfo.hpp>
43 #include <com/sun/star/text/XTextRange.hpp>
44 #include <com/sun/star/ui/XUIElement.hpp>
45 #include <com/sun/star/util/URL.hpp>
46 #include <com/sun/star/util/URLTransformer.hpp>
47 #include <com/sun/star/util/SearchAlgorithms.hpp>
48 #include <com/sun/star/util/SearchAlgorithms2.hpp>
49 
51 #include <svl/ctloptions.hxx>
52 #include <svl/srchitem.hxx>
56 #include <vcl/toolbox.hxx>
57 #include <vcl/svapp.hxx>
58 #include <rtl/instance.hxx>
59 #include <svx/srchdlg.hxx>
60 #include <vcl/event.hxx>
61 
62 #include <findtextfield.hxx>
63 #include <labelitemwindow.hxx>
64 
65 using namespace css;
66 
67 namespace {
68 
69 static const char COMMAND_FINDTEXT[] = ".uno:FindText";
70 static const char COMMAND_DOWNSEARCH[] = ".uno:DownSearch";
71 static const char COMMAND_UPSEARCH[] = ".uno:UpSearch";
72 static const char COMMAND_FINDALL[] = ".uno:FindAll";
73 static const char COMMAND_MATCHCASE[] = ".uno:MatchCase";
74 static const char COMMAND_SEARCHFORMATTED[] = ".uno:SearchFormattedDisplayString";
75 
76 static const sal_Int32 REMEMBER_SIZE = 10;
77 
78 class CheckButtonItemWindow final : public InterimItemWindow
79 {
80 public:
81  CheckButtonItemWindow(vcl::Window* pParent, const OUString& rLabel)
82  : InterimItemWindow(pParent, "svx/ui/checkbuttonbox.ui", "CheckButtonBox")
83  , m_xWidget(m_xBuilder->weld_check_button("checkbutton"))
84  {
85  m_xWidget->connect_key_press(LINK(this, CheckButtonItemWindow, KeyInputHdl));
86  m_xWidget->set_label(rLabel);
87  SetSizePixel(m_xWidget->get_preferred_size());
88  }
89 
90  bool get_active() const
91  {
92  return m_xWidget->get_active();
93  }
94 
95  virtual void dispose() override
96  {
97  m_xWidget.reset();
99  }
100 
101  virtual ~CheckButtonItemWindow() override
102  {
103  disposeOnce();
104  }
105 
106  virtual void GetFocus() override
107  {
108  if (m_xWidget)
109  m_xWidget->grab_focus();
111  }
112 
113 private:
114  std::unique_ptr<weld::CheckButton> m_xWidget;
115 
116  DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
117 };
118 
119 IMPL_LINK(CheckButtonItemWindow, KeyInputHdl, const KeyEvent&, rKeyEvent, bool)
120 {
121  return ChildKeyInput(rKeyEvent);
122 }
123 
124 void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
125  const css::uno::Reference< css::frame::XFrame >& xFrame,
126  const ToolBox* pToolBox,
127  const bool aSearchBackwards,
128  const bool aFindAll = false )
129 {
130  css::uno::Reference< css::util::XURLTransformer > xURLTransformer( css::util::URLTransformer::create( rxContext ) );
131  css::util::URL aURL;
132  aURL.Complete = ".uno:ExecuteSearch";
133  xURLTransformer->parseStrict(aURL);
134 
135  OUString sFindText;
136  bool aMatchCase = false;
137  bool bSearchFormatted = false;
138  if ( pToolBox )
139  {
140  ToolBox::ImplToolItems::size_type nItemCount = pToolBox->GetItemCount();
141  for ( ToolBox::ImplToolItems::size_type i=0; i<nItemCount; ++i )
142  {
143  sal_uInt16 id = pToolBox->GetItemId(i);
144  OUString sItemCommand = pToolBox->GetItemCommand(id);
145  if ( sItemCommand == COMMAND_FINDTEXT )
146  {
147  FindTextFieldControl* pItemWin = static_cast<FindTextFieldControl*>(pToolBox->GetItemWindow(id));
148  if (pItemWin)
149  sFindText = pItemWin->get_active_text();
150  } else if ( sItemCommand == COMMAND_MATCHCASE )
151  {
152  CheckButtonItemWindow* pItemWin = static_cast<CheckButtonItemWindow*>(pToolBox->GetItemWindow(id));
153  if (pItemWin)
154  aMatchCase = pItemWin->get_active();
155  } else if ( sItemCommand == COMMAND_SEARCHFORMATTED )
156  {
157  CheckButtonItemWindow* pItemWin = static_cast<CheckButtonItemWindow*>(pToolBox->GetItemWindow(id));
158  if (pItemWin)
159  bSearchFormatted = pItemWin->get_active();
160  }
161  }
162  }
163 
164  SvtCTLOptions aCTLOptions;
165  TransliterationFlags nFlags = TransliterationFlags::NONE;
166  if (!aMatchCase)
167  nFlags |= TransliterationFlags::IGNORE_CASE;
168  if (aCTLOptions.IsCTLFontEnabled())
169  nFlags |= TransliterationFlags::IGNORE_DIACRITICS_CTL
170  | TransliterationFlags::IGNORE_KASHIDA_CTL;
171 
172  auto aArgs( comphelper::InitPropertySequence( {
173  { "SearchItem.SearchString", css::uno::makeAny( sFindText ) },
174  { "SearchItem.Backward", css::uno::makeAny( aSearchBackwards ) },
175  { "SearchItem.SearchFlags", css::uno::makeAny( sal_Int32(0) ) },
176  { "SearchItem.TransliterateFlags", css::uno::makeAny( static_cast<sal_Int32>(nFlags) ) },
177  { "SearchItem.Command", css::uno::makeAny( static_cast<sal_Int16>(aFindAll ?SvxSearchCmd::FIND_ALL : SvxSearchCmd::FIND ) ) },
178  { "SearchItem.AlgorithmType", css::uno::makeAny( sal_Int16(css::util::SearchAlgorithms_ABSOLUTE) ) },
179  { "SearchItem.AlgorithmType2", css::uno::makeAny( sal_Int16(css::util::SearchAlgorithms2::ABSOLUTE) ) },
180  { "SearchItem.SearchFormatted", css::uno::makeAny( bSearchFormatted ) }
181  } ) );
182 
183  css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, css::uno::UNO_QUERY);
184  if ( xDispatchProvider.is() )
185  {
186  css::uno::Reference< css::frame::XDispatch > xDispatch = xDispatchProvider->queryDispatch( aURL, OUString(), 0 );
187  if ( xDispatch.is() && !aURL.Complete.isEmpty() )
188  xDispatch->dispatch( aURL, aArgs );
189  }
190 }
191 
192 }
193 
195  css::uno::Reference< css::frame::XFrame > const & xFrame,
196  const css::uno::Reference< css::uno::XComponentContext >& xContext) :
197  InterimItemWindow(pParent, "svx/ui/findbox.ui", "FindBox"),
198  m_nAsyncGetFocusId(nullptr),
199  m_xWidget(m_xBuilder->weld_combo_box("find")),
200  m_xFrame(xFrame),
201  m_xContext(xContext),
202  m_pAcc(svt::AcceleratorExecute::createAcceleratorHelper())
203 {
204  m_xWidget->set_entry_placeholder_text(SvxResId(RID_SVXSTR_FINDBAR_FIND));
205  m_xWidget->set_entry_completion(true, true);
206  m_pAcc->init(m_xContext, m_xFrame);
207 
208  m_xWidget->connect_focus_in(LINK(this, FindTextFieldControl, FocusInHdl));
209  m_xWidget->connect_key_press(LINK(this, FindTextFieldControl, KeyInputHdl));
210  m_xWidget->connect_entry_activate(LINK(this, FindTextFieldControl, ActivateHdl));
211 
212  m_xWidget->set_size_request(250, -1);
213  SetSizePixel(m_xWidget->get_preferred_size());
214 }
215 
216 void FindTextFieldControl::Remember_Impl(const OUString& rStr)
217 {
218  const sal_Int32 nCount = m_xWidget->get_count();
219 
220  for (sal_Int32 i=0; i<nCount; ++i)
221  {
222  if (rStr == m_xWidget->get_text(i))
223  return;
224  }
225 
226  if (nCount == REMEMBER_SIZE)
227  m_xWidget->remove(REMEMBER_SIZE-1);
228 
229  m_xWidget->insert_text(0, rStr);
230 }
231 
233 {
234  OUString aString;
235 
236  try
237  {
238  css::uno::Reference<css::frame::XController> xController(m_xFrame->getController(), css::uno::UNO_SET_THROW);
239  css::uno::Reference<css::frame::XModel> xModel(xController->getModel(), css::uno::UNO_SET_THROW);
240  css::uno::Reference<css::container::XIndexAccess> xIndexAccess(xModel->getCurrentSelection(), css::uno::UNO_QUERY_THROW);
241  if (xIndexAccess->getCount() > 0)
242  {
243  css::uno::Reference<css::text::XTextRange> xTextRange(xIndexAccess->getByIndex(0), css::uno::UNO_QUERY_THROW);
244  aString = xTextRange->getString();
245  }
246  }
247  catch ( ... )
248  {
249  }
250 
251  if ( !aString.isEmpty() )
252  {
253  // If something is selected in the document, prepopulate with this
254  m_xWidget->set_entry_text(aString);
255  m_aChangeHdl.Call(*m_xWidget);
256  }
257  else if (get_count() > 0)
258  {
259  // Else, prepopulate with last search word (fdo#84256)
260  m_xWidget->set_entry_text(m_xWidget->get_text(0));
261  }
262 }
263 
264 IMPL_LINK(FindTextFieldControl, KeyInputHdl, const KeyEvent&, rKeyEvent, bool)
265 {
266  if (isDisposed())
267  return true;
268 
269  bool bRet = false;
270 
271  bool bShift = rKeyEvent.GetKeyCode().IsShift();
272  bool bMod1 = rKeyEvent.GetKeyCode().IsMod1();
273  sal_uInt16 nCode = rKeyEvent.GetKeyCode().GetCode();
274 
275  // Close the search bar on Escape
276  if ( KEY_ESCAPE == nCode )
277  {
278  bRet = true;
279  GrabFocusToDocument();
280 
281  // hide the findbar
282  css::uno::Reference< css::beans::XPropertySet > xPropSet(m_xFrame, css::uno::UNO_QUERY);
283  if (xPropSet.is())
284  {
285  css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
286  css::uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
287  aValue >>= xLayoutManager;
288  if (xLayoutManager.is())
289  {
290  const OUString sResourceURL( "private:resource/toolbar/findbar" );
291  xLayoutManager->hideElement( sResourceURL );
292  xLayoutManager->destroyElement( sResourceURL );
293  }
294  }
295  }
296  // Select text in the search box when Ctrl-F pressed
297  else if ( bMod1 && nCode == KEY_F )
298  m_xWidget->select_entry_region(0, -1);
299 
300  // Execute the search when Return, Ctrl-G or F3 pressed
301  else if ( KEY_RETURN == nCode || (bMod1 && (KEY_G == nCode)) || (KEY_F3 == nCode) )
302  {
303  ActivateFind(bShift);
304  bRet = true;
305  }
306  else
307  {
308  auto awtKey = svt::AcceleratorExecute::st_VCLKey2AWTKey(rKeyEvent.GetKeyCode());
309  const OUString aCommand(m_pAcc->findCommand(awtKey));
310  if (aCommand == ".uno:SearchDialog")
311  bRet = m_pAcc->execute(awtKey);
312  }
313 
314  return bRet || ChildKeyInput(rKeyEvent);
315 }
316 
318 {
319  Remember_Impl(m_xWidget->get_active_text());
320 
321  vcl::Window* pWindow = GetParent();
322  ToolBox* pToolBox = static_cast<ToolBox*>(pWindow);
323 
324  impl_executeSearch(m_xContext, m_xFrame, pToolBox, bShift);
325 }
326 
328 {
329  if (isDisposed())
330  return true;
331 
332  ActivateFind(false);
333 
334  return true;
335 }
336 
337 IMPL_LINK_NOARG(FindTextFieldControl, OnAsyncGetFocus, void*, void)
338 {
339  m_nAsyncGetFocusId = nullptr;
340  m_xWidget->select_entry_region(0, -1);
341 }
342 
344 {
345  if (m_nAsyncGetFocusId)
346  return;
347  // do it async to defeat entry in combobox having its own ideas about the focus
348  m_nAsyncGetFocusId = Application::PostUserEvent(LINK(this, FindTextFieldControl, OnAsyncGetFocus));
349 }
350 
352 {
353  if (m_nAsyncGetFocusId)
354  {
356  m_nAsyncGetFocusId = nullptr;
357  }
358  m_xWidget.reset();
360 }
361 
363 {
364  disposeOnce();
365 }
366 
368 {
369  m_aChangeHdl = rLink;
370  m_xWidget->connect_changed(rLink);
371 }
372 
374 {
375  return m_xWidget->get_count();
376 }
377 
378 OUString FindTextFieldControl::get_text(int nIndex) const
379 {
380  return m_xWidget->get_text(nIndex);
381 }
382 
384 {
385  return m_xWidget->get_active_text();
386 }
387 
388 void FindTextFieldControl::append_text(const OUString& rText)
389 {
390  m_xWidget->append_text(rText);
391 }
392 
394 {
395  m_xWidget->set_entry_message_type(eType);
396 }
397 
399 {
400  if (m_xWidget)
401  m_xWidget->grab_focus();
403 }
404 
405 namespace {
406 
407 class SearchToolbarControllersManager
408 {
409 public:
410 
411  SearchToolbarControllersManager();
412 
413  static SearchToolbarControllersManager& createControllersManager();
414 
415  void registryController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const OUString& sCommandURL );
416  void freeController ( const css::uno::Reference< css::frame::XFrame >& xFrame, const OUString& sCommandURL );
417  css::uno::Reference< css::frame::XStatusListener > findController( const css::uno::Reference< css::frame::XFrame >& xFrame, const OUString& sCommandURL );
418 
419  void saveSearchHistory(const FindTextFieldControl* m_pFindTextFieldControl);
420  void loadSearchHistory(FindTextFieldControl* m_pFindTextFieldControl);
421 
422 private:
423 
424  typedef ::std::vector< css::beans::PropertyValue > SearchToolbarControllersVec;
425  typedef ::std::map< css::uno::Reference< css::frame::XFrame >, SearchToolbarControllersVec > SearchToolbarControllersMap;
426  SearchToolbarControllersMap aSearchToolbarControllersMap;
427  std::vector<OUString> m_aSearchStrings;
428 
429 };
430 
431 SearchToolbarControllersManager::SearchToolbarControllersManager()
432 {
433 }
434 
435 class theSearchToolbarControllersManager
436  : public rtl::Static<SearchToolbarControllersManager,
437  theSearchToolbarControllersManager>
438 {
439 };
440 
441 SearchToolbarControllersManager& SearchToolbarControllersManager::createControllersManager()
442 {
443  return theSearchToolbarControllersManager::get();
444 }
445 
446 void SearchToolbarControllersManager::saveSearchHistory(const FindTextFieldControl* pFindTextFieldControl)
447 {
448  const sal_Int32 nECount( pFindTextFieldControl->get_count() );
449  m_aSearchStrings.resize( nECount );
450  for( sal_Int32 i=0; i<nECount; ++i )
451  {
452  m_aSearchStrings[i] = pFindTextFieldControl->get_text(i);
453  }
454 }
455 
456 void SearchToolbarControllersManager::loadSearchHistory(FindTextFieldControl* pFindTextFieldControl)
457 {
458  for( size_t i=0; i<m_aSearchStrings.size(); ++i )
459  {
460  pFindTextFieldControl->append_text(m_aSearchStrings[i]);
461  }
462 }
463 
464 void SearchToolbarControllersManager::registryController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const OUString& sCommandURL )
465 {
466  SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame);
467  if (pIt == aSearchToolbarControllersMap.end())
468  {
469  SearchToolbarControllersVec lControllers(1);
470  lControllers[0].Name = sCommandURL;
471  lControllers[0].Value <<= xStatusListener;
472  aSearchToolbarControllersMap.emplace(xFrame, lControllers);
473  }
474  else
475  {
476  sal_Int32 nSize = pIt->second.size();
477  for (sal_Int32 i=0; i<nSize; ++i)
478  {
479  if (pIt->second[i].Name == sCommandURL)
480  return;
481  }
482 
483  pIt->second.resize(nSize+1);
484  pIt->second[nSize].Name = sCommandURL;
485  pIt->second[nSize].Value <<= xStatusListener;
486  }
487 }
488 
489 void SearchToolbarControllersManager::freeController( const css::uno::Reference< css::frame::XFrame >& xFrame, const OUString& sCommandURL )
490 {
491  SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame);
492  if (pIt != aSearchToolbarControllersMap.end())
493  {
494  auto pItCtrl = std::find_if(pIt->second.begin(), pIt->second.end(),
495  [&sCommandURL](const css::beans::PropertyValue& rCtrl) { return rCtrl.Name == sCommandURL; });
496  if (pItCtrl != pIt->second.end())
497  pIt->second.erase(pItCtrl);
498 
499  if (pIt->second.empty())
500  aSearchToolbarControllersMap.erase(pIt);
501  }
502 }
503 
504 css::uno::Reference< css::frame::XStatusListener > SearchToolbarControllersManager::findController( const css::uno::Reference< css::frame::XFrame >& xFrame, const OUString& sCommandURL )
505 {
506  css::uno::Reference< css::frame::XStatusListener > xStatusListener;
507 
508  SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame);
509  if (pIt != aSearchToolbarControllersMap.end())
510  {
511  auto pItCtrl = std::find_if(pIt->second.begin(), pIt->second.end(),
512  [&sCommandURL](const css::beans::PropertyValue& rCtrl) { return rCtrl.Name == sCommandURL; });
513  if (pItCtrl != pIt->second.end())
514  pItCtrl->Value >>= xStatusListener;
515  }
516 
517  return xStatusListener;
518 }
519 
520 class FindTextToolbarController : public svt::ToolboxController,
521  public css::lang::XServiceInfo
522 {
523 public:
524 
525  FindTextToolbarController( const css::uno::Reference< css::uno::XComponentContext > & rxContext );
526 
527  // XInterface
528  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
529  virtual void SAL_CALL acquire() throw () override;
530  virtual void SAL_CALL release() throw () override;
531 
532  // XServiceInfo
533  virtual OUString SAL_CALL getImplementationName() override;
534  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
535  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
536 
537  // XComponent
538  virtual void SAL_CALL dispose() override;
539 
540  // XInitialization
541  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
542 
543  // XToolbarController
544  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
545 
546  // XStatusListener
547  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override;
548 
549  DECL_LINK(EditModifyHdl, weld::ComboBox&, void);
550 
551 private:
552 
553  void textfieldChanged();
554 
555  VclPtr<FindTextFieldControl> m_pFindTextFieldControl;
556 
557  sal_uInt16 m_nDownSearchId;
558  sal_uInt16 m_nUpSearchId;
559  sal_uInt16 m_nFindAllId;
560 
561 };
562 
563 FindTextToolbarController::FindTextToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
564  : svt::ToolboxController(rxContext, css::uno::Reference< css::frame::XFrame >(), COMMAND_FINDTEXT)
565  , m_pFindTextFieldControl(nullptr)
566  , m_nDownSearchId(0)
567  , m_nUpSearchId(0)
568  , m_nFindAllId(0)
569 {
570 }
571 
572 // XInterface
573 css::uno::Any SAL_CALL FindTextToolbarController::queryInterface( const css::uno::Type& aType )
574 {
575  css::uno::Any a = ToolboxController::queryInterface( aType );
576  if ( a.hasValue() )
577  return a;
578 
579  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
580 }
581 
582 void SAL_CALL FindTextToolbarController::acquire() throw ()
583 {
585 }
586 
587 void SAL_CALL FindTextToolbarController::release() throw ()
588 {
590 }
591 
592 // XServiceInfo
593 OUString SAL_CALL FindTextToolbarController::getImplementationName()
594 {
595  return "com.sun.star.svx.FindTextToolboxController";
596 }
597 
598 sal_Bool SAL_CALL FindTextToolbarController::supportsService( const OUString& ServiceName )
599 {
600  return cppu::supportsService(this, ServiceName);
601 }
602 
603 css::uno::Sequence< OUString > SAL_CALL FindTextToolbarController::getSupportedServiceNames()
604 {
605  return { "com.sun.star.frame.ToolbarController" };
606 }
607 
608 // XComponent
609 void SAL_CALL FindTextToolbarController::dispose()
610 {
611  SolarMutexGuard aSolarMutexGuard;
612 
613  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
614 
616  if (m_pFindTextFieldControl != nullptr) {
617  SearchToolbarControllersManager::createControllersManager()
618  .saveSearchHistory(m_pFindTextFieldControl);
619  m_pFindTextFieldControl.disposeAndClear();
620  }
621 }
622 
623 // XInitialization
624 void SAL_CALL FindTextToolbarController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
625 {
627 
629  ToolBox* pToolBox = static_cast<ToolBox*>(pWindow.get());
630  if ( pToolBox )
631  {
632  m_nDownSearchId = pToolBox->GetItemId(COMMAND_DOWNSEARCH);
633  m_nUpSearchId = pToolBox->GetItemId(COMMAND_UPSEARCH);
634  m_nFindAllId = pToolBox->GetItemId(COMMAND_FINDALL);
635  }
636 
637  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
638 }
639 
640 css::uno::Reference< css::awt::XWindow > SAL_CALL FindTextToolbarController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent )
641 {
642  css::uno::Reference< css::awt::XWindow > xItemWindow;
643 
644  VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xParent );
645  if ( pParent )
646  {
647  ToolBox* pToolbar = static_cast<ToolBox*>(pParent.get());
648  m_pFindTextFieldControl = VclPtr<FindTextFieldControl>::Create(pToolbar, m_xFrame, m_xContext);
649 
650  m_pFindTextFieldControl->connect_changed(LINK(this, FindTextToolbarController, EditModifyHdl));
651  SearchToolbarControllersManager::createControllersManager().loadSearchHistory(m_pFindTextFieldControl);
652  }
653  xItemWindow = VCLUnoHelper::GetInterface( m_pFindTextFieldControl );
654 
655  return xItemWindow;
656 }
657 
658 // XStatusListener
659 void SAL_CALL FindTextToolbarController::statusChanged( const css::frame::FeatureStateEvent& rEvent )
660 {
661  SolarMutexGuard aSolarMutexGuard;
662  if ( m_bDisposed )
663  return;
664 
665  OUString aFeatureURL = rEvent.FeatureURL.Complete;
666  if ( aFeatureURL == "AppendSearchHistory" )
667  {
668  m_pFindTextFieldControl->Remember_Impl(m_pFindTextFieldControl->get_active_text());
669  }
670  // enable up/down buttons in case there is already text (from the search history)
671  textfieldChanged();
672 }
673 
674 IMPL_LINK_NOARG(FindTextToolbarController, EditModifyHdl, weld::ComboBox&, void)
675 {
676  // Clear SearchLabel when search string altered
677  #if HAVE_FEATURE_DESKTOP
679  #endif
680 
681  textfieldChanged();
682 }
683 
684 void FindTextToolbarController::textfieldChanged() {
685  // enable or disable item DownSearch/UpSearch/FindAll of findbar
687  ToolBox* pToolBox = static_cast<ToolBox*>(pWindow.get());
688  if ( pToolBox && m_pFindTextFieldControl )
689  {
690  bool enableButtons = !m_pFindTextFieldControl->get_active_text().isEmpty();
691  pToolBox->EnableItem(m_nDownSearchId, enableButtons);
692  pToolBox->EnableItem(m_nUpSearchId, enableButtons);
693  pToolBox->EnableItem(m_nFindAllId, enableButtons);
694  }
695 }
696 
697 class UpDownSearchToolboxController : public svt::ToolboxController,
698  public css::lang::XServiceInfo
699 {
700 public:
701  enum Type { UP, DOWN };
702 
703  UpDownSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, Type eType );
704 
705  // XInterface
706  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
707  virtual void SAL_CALL acquire() throw () override;
708  virtual void SAL_CALL release() throw () override;
709 
710  // XServiceInfo
711  virtual OUString SAL_CALL getImplementationName() override;
712  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
713  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
714 
715  // XComponent
716  virtual void SAL_CALL dispose() override;
717 
718  // XInitialization
719  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
720 
721  // XToolbarController
722  virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
723 
724  // XStatusListener
725  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
726 
727 private:
728  Type meType;
729 };
730 
731 UpDownSearchToolboxController::UpDownSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext, Type eType )
732  : svt::ToolboxController( rxContext,
733  css::uno::Reference< css::frame::XFrame >(),
734  (eType == UP) ? OUString( COMMAND_UPSEARCH ): OUString( COMMAND_DOWNSEARCH ) ),
735  meType( eType )
736 {
737 }
738 
739 // XInterface
740 css::uno::Any SAL_CALL UpDownSearchToolboxController::queryInterface( const css::uno::Type& aType )
741 {
742  css::uno::Any a = ToolboxController::queryInterface( aType );
743  if ( a.hasValue() )
744  return a;
745 
746  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
747 }
748 
749 void SAL_CALL UpDownSearchToolboxController::acquire() throw ()
750 {
751  ToolboxController::acquire();
752 }
753 
754 void SAL_CALL UpDownSearchToolboxController::release() throw ()
755 {
756  ToolboxController::release();
757 }
758 
759 // XServiceInfo
760 OUString SAL_CALL UpDownSearchToolboxController::getImplementationName()
761 {
762  return meType == UpDownSearchToolboxController::UP?
763  OUString( "com.sun.star.svx.UpSearchToolboxController" ) :
764  OUString( "com.sun.star.svx.DownSearchToolboxController" );
765 }
766 
767 sal_Bool SAL_CALL UpDownSearchToolboxController::supportsService( const OUString& ServiceName )
768 {
769  return cppu::supportsService(this, ServiceName);
770 }
771 
772 css::uno::Sequence< OUString > SAL_CALL UpDownSearchToolboxController::getSupportedServiceNames()
773 {
774  return { "com.sun.star.frame.ToolbarController" };
775 }
776 
777 // XComponent
778 void SAL_CALL UpDownSearchToolboxController::dispose()
779 {
780  SolarMutexGuard aSolarMutexGuard;
781 
782  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
783 
785 }
786 
787 // XInitialization
788 void SAL_CALL UpDownSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
789 {
791  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
792 }
793 
794 // XToolbarController
795 void SAL_CALL UpDownSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ )
796 {
797  if ( m_bDisposed )
798  throw css::lang::DisposedException();
799 
800  VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( getParent() );
801  ToolBox* pToolBox = static_cast<ToolBox*>(pWindow.get());
802 
803  impl_executeSearch(m_xContext, m_xFrame, pToolBox, meType == UP );
804 
805  css::frame::FeatureStateEvent aEvent;
806  aEvent.FeatureURL.Complete = "AppendSearchHistory";
807  css::uno::Reference< css::frame::XStatusListener > xStatusListener = SearchToolbarControllersManager::createControllersManager().findController(m_xFrame, COMMAND_FINDTEXT);
808  if (xStatusListener.is())
809  xStatusListener->statusChanged( aEvent );
810 }
811 
812 // XStatusListener
813 void SAL_CALL UpDownSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ )
814 {
815 }
816 
817 class MatchCaseToolboxController : public svt::ToolboxController,
818  public css::lang::XServiceInfo
819 {
820 public:
821  MatchCaseToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
822 
823  // XInterface
824  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
825  virtual void SAL_CALL acquire() throw () override;
826  virtual void SAL_CALL release() throw () override;
827 
828  // XServiceInfo
829  virtual OUString SAL_CALL getImplementationName() override;
830  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
831  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
832 
833  // XComponent
834  virtual void SAL_CALL dispose() override;
835 
836  // XInitialization
837  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
838 
839  // XToolbarController
840  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
841 
842  // XStatusListener
843  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
844 
845 private:
846  VclPtr<CheckButtonItemWindow> m_xMatchCaseControl;
847 };
848 
849 MatchCaseToolboxController::MatchCaseToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
850  : svt::ToolboxController( rxContext,
851  css::uno::Reference< css::frame::XFrame >(),
852  COMMAND_MATCHCASE )
853  , m_xMatchCaseControl(nullptr)
854 {
855 }
856 
857 // XInterface
858 css::uno::Any SAL_CALL MatchCaseToolboxController::queryInterface( const css::uno::Type& aType )
859 {
860  css::uno::Any a = ToolboxController::queryInterface( aType );
861  if ( a.hasValue() )
862  return a;
863 
864  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
865 }
866 
867 void SAL_CALL MatchCaseToolboxController::acquire() throw ()
868 {
869  ToolboxController::acquire();
870 }
871 
872 void SAL_CALL MatchCaseToolboxController::release() throw ()
873 {
874  ToolboxController::release();
875 }
876 
877 // XServiceInfo
878 OUString SAL_CALL MatchCaseToolboxController::getImplementationName()
879 {
880  return "com.sun.star.svx.MatchCaseToolboxController";
881 }
882 
883 sal_Bool SAL_CALL MatchCaseToolboxController::supportsService( const OUString& ServiceName )
884 {
885  return cppu::supportsService(this, ServiceName);
886 }
887 
888 css::uno::Sequence< OUString > SAL_CALL MatchCaseToolboxController::getSupportedServiceNames()
889 {
890  return { "com.sun.star.frame.ToolbarController" };
891 }
892 
893 // XComponent
894 void SAL_CALL MatchCaseToolboxController::dispose()
895 {
896  SolarMutexGuard aSolarMutexGuard;
897 
898  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
899 
901 
902  m_xMatchCaseControl.disposeAndClear();
903 }
904 
905 // XInitialization
906 void SAL_CALL MatchCaseToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
907 {
909 
910  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
911 }
912 
913 css::uno::Reference< css::awt::XWindow > SAL_CALL MatchCaseToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent )
914 {
915  css::uno::Reference< css::awt::XWindow > xItemWindow;
916 
917  VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xParent );
918  if ( pParent )
919  {
920  ToolBox* pToolbar = static_cast<ToolBox*>(pParent.get());
921  m_xMatchCaseControl = VclPtr<CheckButtonItemWindow>::Create(pToolbar, SvxResId(RID_SVXSTR_FINDBAR_MATCHCASE));
922  }
923  xItemWindow = VCLUnoHelper::GetInterface(m_xMatchCaseControl);
924 
925  return xItemWindow;
926 }
927 
928 // XStatusListener
929 void SAL_CALL MatchCaseToolboxController::statusChanged( const css::frame::FeatureStateEvent& )
930 {
931 }
932 
933 class SearchFormattedToolboxController : public svt::ToolboxController,
934  public css::lang::XServiceInfo
935 {
936 public:
937  SearchFormattedToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
938 
939  // XInterface
940  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
941  virtual void SAL_CALL acquire() throw () override;
942  virtual void SAL_CALL release() throw () override;
943 
944  // XServiceInfo
945  virtual OUString SAL_CALL getImplementationName() override;
946  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
947  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
948 
949  // XComponent
950  virtual void SAL_CALL dispose() override;
951 
952  // XInitialization
953  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
954 
955  // XToolbarController
956  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
957 
958  // XStatusListener
959  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
960 
961 private:
962  VclPtr<CheckButtonItemWindow> m_xSearchFormattedControl;
963 };
964 
965 SearchFormattedToolboxController::SearchFormattedToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
966  : svt::ToolboxController( rxContext,
967  css::uno::Reference< css::frame::XFrame >(),
968  COMMAND_SEARCHFORMATTED )
969  , m_xSearchFormattedControl(nullptr)
970 {
971 }
972 
973 // XInterface
974 css::uno::Any SAL_CALL SearchFormattedToolboxController::queryInterface( const css::uno::Type& aType )
975 {
976  css::uno::Any a = ToolboxController::queryInterface( aType );
977  if ( a.hasValue() )
978  return a;
979 
980  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
981 }
982 
983 void SAL_CALL SearchFormattedToolboxController::acquire() throw ()
984 {
985  ToolboxController::acquire();
986 }
987 
988 void SAL_CALL SearchFormattedToolboxController::release() throw ()
989 {
990  ToolboxController::release();
991 }
992 
993 // XServiceInfo
994 OUString SAL_CALL SearchFormattedToolboxController::getImplementationName()
995 {
996  return "com.sun.star.svx.SearchFormattedToolboxController";
997 }
998 
999 sal_Bool SAL_CALL SearchFormattedToolboxController::supportsService( const OUString& ServiceName )
1000 {
1001  return cppu::supportsService(this, ServiceName);
1002 }
1003 
1004 css::uno::Sequence< OUString > SAL_CALL SearchFormattedToolboxController::getSupportedServiceNames()
1005 {
1006  return { "com.sun.star.frame.ToolbarController" };
1007 }
1008 
1009 // XComponent
1010 void SAL_CALL SearchFormattedToolboxController::dispose()
1011 {
1012  SolarMutexGuard aSolarMutexGuard;
1013 
1014  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
1015 
1017 
1018  m_xSearchFormattedControl.disposeAndClear();
1019 }
1020 
1021 // XInitialization
1022 void SAL_CALL SearchFormattedToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
1023 {
1025 
1026  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
1027 }
1028 
1029 css::uno::Reference< css::awt::XWindow > SAL_CALL SearchFormattedToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent )
1030 {
1031  css::uno::Reference< css::awt::XWindow > xItemWindow;
1032 
1033  VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xParent );
1034  if ( pParent )
1035  {
1036  ToolBox* pToolbar = static_cast<ToolBox*>(pParent.get());
1037  m_xSearchFormattedControl = VclPtr<CheckButtonItemWindow>::Create(pToolbar, SvxResId(RID_SVXSTR_FINDBAR_SEARCHFORMATTED));
1038  }
1039  xItemWindow = VCLUnoHelper::GetInterface(m_xSearchFormattedControl);
1040 
1041  return xItemWindow;
1042 }
1043 
1044 // XStatusListener
1045 void SAL_CALL SearchFormattedToolboxController::statusChanged( const css::frame::FeatureStateEvent& )
1046 {
1047 }
1048 
1049 class FindAllToolboxController : public svt::ToolboxController,
1050  public css::lang::XServiceInfo
1051 {
1052 public:
1053  FindAllToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1054 
1055  // XInterface
1056  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
1057  virtual void SAL_CALL acquire() throw () override;
1058  virtual void SAL_CALL release() throw () override;
1059 
1060  // XServiceInfo
1061  virtual OUString SAL_CALL getImplementationName() override;
1062  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1063  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1064 
1065  // XComponent
1066  virtual void SAL_CALL dispose() override;
1067 
1068  // XInitialization
1069  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
1070 
1071  // XToolbarController
1072  virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
1073 
1074  // XStatusListener
1075  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
1076 };
1077 
1078 FindAllToolboxController::FindAllToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
1079  : svt::ToolboxController( rxContext,
1080  css::uno::Reference< css::frame::XFrame >(),
1081  ".uno:FindAll" )
1082 {
1083 }
1084 
1085 // XInterface
1086 css::uno::Any SAL_CALL FindAllToolboxController::queryInterface( const css::uno::Type& aType )
1087 {
1088  css::uno::Any a = ToolboxController::queryInterface( aType );
1089  if ( a.hasValue() )
1090  return a;
1091 
1092  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
1093 }
1094 
1095 void SAL_CALL FindAllToolboxController::acquire() throw ()
1096 {
1097  ToolboxController::acquire();
1098 }
1099 
1100 void SAL_CALL FindAllToolboxController::release() throw ()
1101 {
1102  ToolboxController::release();
1103 }
1104 
1105 // XServiceInfo
1106 OUString SAL_CALL FindAllToolboxController::getImplementationName()
1107 {
1108  return "com.sun.star.svx.FindAllToolboxController";
1109 }
1110 
1111 
1112 sal_Bool SAL_CALL FindAllToolboxController::supportsService( const OUString& ServiceName )
1113 {
1114  return cppu::supportsService(this, ServiceName);
1115 }
1116 
1117 css::uno::Sequence< OUString > SAL_CALL FindAllToolboxController::getSupportedServiceNames()
1118 {
1119  return { "com.sun.star.frame.ToolbarController" };
1120 }
1121 
1122 // XComponent
1123 void SAL_CALL FindAllToolboxController::dispose()
1124 {
1125  SolarMutexGuard aSolarMutexGuard;
1126 
1127  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
1128 
1130 }
1131 
1132 // XInitialization
1133 void SAL_CALL FindAllToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
1134 {
1135  svt::ToolboxController::initialize( aArguments );
1136  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
1137 }
1138 
1139 // XToolbarController
1140 void SAL_CALL FindAllToolboxController::execute( sal_Int16 /*KeyModifier*/ )
1141 {
1142  if ( m_bDisposed )
1143  throw css::lang::DisposedException();
1144 
1145  VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( getParent() );
1146  ToolBox* pToolBox = static_cast<ToolBox*>(pWindow.get());
1147 
1148  impl_executeSearch(m_xContext, m_xFrame, pToolBox, false, true);
1149 }
1150 
1151 // XStatusListener
1152 void SAL_CALL FindAllToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ )
1153 {
1154 }
1155 
1156 class ExitSearchToolboxController : public svt::ToolboxController,
1157  public css::lang::XServiceInfo
1158 {
1159 public:
1160  ExitSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1161 
1162  // XInterface
1163  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
1164  virtual void SAL_CALL acquire() throw () override;
1165  virtual void SAL_CALL release() throw () override;
1166 
1167  // XServiceInfo
1168  virtual OUString SAL_CALL getImplementationName() override;
1169  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1170  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1171 
1172  // XComponent
1173  virtual void SAL_CALL dispose() override;
1174 
1175  // XInitialization
1176  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
1177 
1178  // XToolbarController
1179  virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
1180 
1181  // XStatusListener
1182  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
1183 };
1184 
1185 ExitSearchToolboxController::ExitSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
1186  : svt::ToolboxController( rxContext,
1187  css::uno::Reference< css::frame::XFrame >(),
1188  ".uno:ExitSearch" )
1189 {
1190 }
1191 
1192 // XInterface
1193 css::uno::Any SAL_CALL ExitSearchToolboxController::queryInterface( const css::uno::Type& aType )
1194 {
1195  css::uno::Any a = ToolboxController::queryInterface( aType );
1196  if ( a.hasValue() )
1197  return a;
1198 
1199  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
1200 }
1201 
1202 void SAL_CALL ExitSearchToolboxController::acquire() throw ()
1203 {
1204  ToolboxController::acquire();
1205 }
1206 
1207 void SAL_CALL ExitSearchToolboxController::release() throw ()
1208 {
1209  ToolboxController::release();
1210 }
1211 
1212 // XServiceInfo
1213 OUString SAL_CALL ExitSearchToolboxController::getImplementationName()
1214 {
1215  return "com.sun.star.svx.ExitFindbarToolboxController";
1216 }
1217 
1218 
1219 sal_Bool SAL_CALL ExitSearchToolboxController::supportsService( const OUString& ServiceName )
1220 {
1221  return cppu::supportsService(this, ServiceName);
1222 }
1223 
1224 css::uno::Sequence< OUString > SAL_CALL ExitSearchToolboxController::getSupportedServiceNames()
1225 {
1226  return { "com.sun.star.frame.ToolbarController" };
1227 }
1228 
1229 // XComponent
1230 void SAL_CALL ExitSearchToolboxController::dispose()
1231 {
1232  SolarMutexGuard aSolarMutexGuard;
1233 
1234  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
1235 
1237 }
1238 
1239 // XInitialization
1240 void SAL_CALL ExitSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
1241 {
1242  svt::ToolboxController::initialize( aArguments );
1243  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
1244 }
1245 
1246 // XToolbarController
1247 void SAL_CALL ExitSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ )
1248 {
1249  vcl::Window *pFocusWindow = Application::GetFocusWindow();
1250  if ( pFocusWindow )
1251  pFocusWindow->GrabFocusToDocument();
1252 
1253  // hide the findbar
1254  css::uno::Reference< css::beans::XPropertySet > xPropSet(m_xFrame, css::uno::UNO_QUERY);
1255  if (xPropSet.is())
1256  {
1257  css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
1258  css::uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
1259  aValue >>= xLayoutManager;
1260  if (xLayoutManager.is())
1261  {
1262  const OUString sResourceURL( "private:resource/toolbar/findbar" );
1263  xLayoutManager->hideElement( sResourceURL );
1264  xLayoutManager->destroyElement( sResourceURL );
1265  }
1266  }
1267 }
1268 
1269 // XStatusListener
1270 void SAL_CALL ExitSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ )
1271 {
1272 }
1273 
1274 class SearchLabelToolboxController : public svt::ToolboxController,
1275  public css::lang::XServiceInfo
1276 {
1277 public:
1278  SearchLabelToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1279 
1280  // XInterface
1281  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
1282  virtual void SAL_CALL acquire() throw () override;
1283  virtual void SAL_CALL release() throw () override;
1284 
1285  // XServiceInfo
1286  virtual OUString SAL_CALL getImplementationName() override;
1287  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1288  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1289 
1290  // XComponent
1291  virtual void SAL_CALL dispose() override;
1292 
1293  // XInitialization
1294  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
1295 
1296  // XToolbarController
1297  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
1298 
1299  // XStatusListener
1300  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
1301 
1302 private:
1303  VclPtr<LabelItemWindow> m_xSL;
1304 };
1305 
1306 SearchLabelToolboxController::SearchLabelToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
1307  : svt::ToolboxController( rxContext,
1308  css::uno::Reference< css::frame::XFrame >(),
1309  ".uno:SearchLabel" )
1310 {
1311 }
1312 
1313 // XInterface
1314 css::uno::Any SAL_CALL SearchLabelToolboxController::queryInterface( const css::uno::Type& aType )
1315 {
1316  css::uno::Any a = ToolboxController::queryInterface( aType );
1317  if ( a.hasValue() )
1318  return a;
1319 
1320  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
1321 }
1322 
1323 void SAL_CALL SearchLabelToolboxController::acquire() throw ()
1324 {
1325  ToolboxController::acquire();
1326 }
1327 
1328 void SAL_CALL SearchLabelToolboxController::release() throw ()
1329 {
1330  ToolboxController::release();
1331 }
1332 
1333 // XServiceInfo
1334 OUString SAL_CALL SearchLabelToolboxController::getImplementationName()
1335 {
1336  return "com.sun.star.svx.SearchLabelToolboxController";
1337 }
1338 
1339 
1340 sal_Bool SAL_CALL SearchLabelToolboxController::supportsService( const OUString& ServiceName )
1341 {
1342  return cppu::supportsService(this, ServiceName);
1343 }
1344 
1345 css::uno::Sequence< OUString > SAL_CALL SearchLabelToolboxController::getSupportedServiceNames()
1346 {
1347  return { "com.sun.star.frame.ToolbarController" };
1348 }
1349 
1350 // XComponent
1351 void SAL_CALL SearchLabelToolboxController::dispose()
1352 {
1353  SolarMutexGuard aSolarMutexGuard;
1354 
1355  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
1356 
1358  m_xSL.disposeAndClear();
1359 }
1360 
1361 // XInitialization
1362 void SAL_CALL SearchLabelToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
1363 {
1364  svt::ToolboxController::initialize( aArguments );
1365  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(static_cast< ::cppu::OWeakObject* >(this), css::uno::UNO_QUERY), m_aCommandURL);
1366 }
1367 
1368 // XStatusListener
1369 void SAL_CALL SearchLabelToolboxController::statusChanged( const css::frame::FeatureStateEvent& )
1370 {
1371  if (m_xSL)
1372  {
1374  m_xSL->set_label(aStr);
1375  m_xSL->SetOptimalSize();
1376  Size aSize(m_xSL->GetSizePixel());
1377  long nWidth = !aStr.isEmpty() ? aSize.getWidth() : 16;
1378  m_xSL->SetSizePixel(Size(nWidth, aSize.Height()));
1379  }
1380 }
1381 
1382 css::uno::Reference< css::awt::XWindow > SAL_CALL SearchLabelToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent )
1383 {
1384  ToolBox* pToolBox = nullptr;
1385  sal_uInt16 nId = 0;
1386  if (getToolboxId(nId, &pToolBox))
1387  pToolBox->SetItemWindowNonInteractive(nId, true);
1388 
1390  m_xSL->SetSizePixel(Size(16, m_xSL->GetSizePixel().Height()));
1391  return VCLUnoHelper::GetInterface(m_xSL);
1392 }
1393 
1394 // protocol handler for "vnd.sun.star.findbar:*" URLs
1395 // The dispatch object will be used for shortcut commands for findbar
1396 class FindbarDispatcher : public css::lang::XServiceInfo,
1397  public css::lang::XInitialization,
1398  public css::frame::XDispatchProvider,
1399  public css::frame::XDispatch,
1400  public ::cppu::OWeakObject
1401 {
1402 public:
1403 
1404  FindbarDispatcher();
1405  virtual ~FindbarDispatcher() override;
1406 
1407  // XInterface
1408  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
1409  virtual void SAL_CALL acquire() throw() override;
1410  virtual void SAL_CALL release() throw() override;
1411 
1412  // XServiceInfo
1413  virtual OUString SAL_CALL getImplementationName() override;
1414  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1415  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1416 
1417  // XInitialization
1418  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
1419 
1420  // XDispatchProvider
1421  virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL, const OUString& sTargetFrameName , sal_Int32 nSearchFlags ) override;
1422  virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptions ) override;
1423 
1424  // XDispatch
1425  virtual void SAL_CALL dispatch( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) override;
1426  virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener, const css::util::URL& aURL ) override;
1427  virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener, const css::util::URL& aURL ) override;
1428 
1429 private:
1430 
1431  css::uno::Reference< css::frame::XFrame > m_xFrame;
1432 
1433 };
1434 
1435 FindbarDispatcher::FindbarDispatcher()
1436 {
1437 }
1438 
1439 FindbarDispatcher::~FindbarDispatcher()
1440 {
1441  m_xFrame = nullptr;
1442 }
1443 
1444 // XInterface
1445 css::uno::Any SAL_CALL FindbarDispatcher::queryInterface( const css::uno::Type& aType )
1446 {
1447  css::uno::Any aReturn( ::cppu::queryInterface( aType,
1448  static_cast< css::lang::XServiceInfo* >(this),
1449  static_cast< css::lang::XInitialization* >(this),
1450  static_cast< css::frame::XDispatchProvider* >(this),
1451  static_cast< css::frame::XDispatch* >(this)) );
1452 
1453  if ( aReturn.hasValue() )
1454  return aReturn;
1455 
1456  return OWeakObject::queryInterface( aType );
1457 }
1458 
1459 void SAL_CALL FindbarDispatcher::acquire() throw()
1460 {
1461  OWeakObject::acquire();
1462 }
1463 
1464 void SAL_CALL FindbarDispatcher::release() throw()
1465 {
1466  OWeakObject::release();
1467 }
1468 
1469 // XServiceInfo
1470 OUString SAL_CALL FindbarDispatcher::getImplementationName()
1471 {
1472  return "com.sun.star.comp.svx.Impl.FindbarDispatcher";
1473 }
1474 
1475 sal_Bool SAL_CALL FindbarDispatcher::supportsService( const OUString& ServiceName )
1476 {
1477  return cppu::supportsService(this, ServiceName);
1478 }
1479 
1480 css::uno::Sequence< OUString > SAL_CALL FindbarDispatcher::getSupportedServiceNames()
1481 {
1482  return { "com.sun.star.comp.svx.FindbarDispatcher", "com.sun.star.frame.ProtocolHandler" };
1483 }
1484 
1485 // XInitialization
1486 void SAL_CALL FindbarDispatcher::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
1487 {
1488  if ( aArguments.hasElements() )
1489  aArguments[0] >>= m_xFrame;
1490 }
1491 
1492 // XDispatchProvider
1493 css::uno::Reference< css::frame::XDispatch > SAL_CALL FindbarDispatcher::queryDispatch( const css::util::URL& aURL, const OUString& /*sTargetFrameName*/, sal_Int32 /*nSearchFlags*/ )
1494 {
1495  css::uno::Reference< css::frame::XDispatch > xDispatch;
1496 
1497  if ( aURL.Protocol == "vnd.sun.star.findbar:" )
1498  xDispatch = this;
1499 
1500  return xDispatch;
1501 }
1502 
1503 css::uno::Sequence < css::uno::Reference< css::frame::XDispatch > > SAL_CALL FindbarDispatcher::queryDispatches( const css::uno::Sequence < css::frame::DispatchDescriptor >& seqDescripts )
1504 {
1505  sal_Int32 nCount = seqDescripts.getLength();
1506  css::uno::Sequence < css::uno::Reference < XDispatch > > lDispatcher( nCount );
1507 
1508  std::transform(seqDescripts.begin(), seqDescripts.end(), lDispatcher.begin(),
1509  [this](const css::frame::DispatchDescriptor& rDescript) -> css::uno::Reference < XDispatch > {
1510  return queryDispatch( rDescript.FeatureURL, rDescript.FrameName, rDescript.SearchFlags ); });
1511 
1512  return lDispatcher;
1513 }
1514 
1515 // XDispatch
1516 void SAL_CALL FindbarDispatcher::dispatch( const css::util::URL& aURL, const css::uno::Sequence < css::beans::PropertyValue >& /*lArgs*/ )
1517 {
1518  //vnd.sun.star.findbar:FocusToFindbar - set cursor to the FindTextFieldControl of the findbar
1519  if ( aURL.Path != "FocusToFindbar" )
1520  return;
1521 
1522  css::uno::Reference< css::beans::XPropertySet > xPropSet(m_xFrame, css::uno::UNO_QUERY);
1523  if(!xPropSet.is())
1524  return;
1525 
1526  css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
1527  css::uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
1528  aValue >>= xLayoutManager;
1529  if (!xLayoutManager.is())
1530  return;
1531 
1532  const OUString sResourceURL( "private:resource/toolbar/findbar" );
1533  css::uno::Reference< css::ui::XUIElement > xUIElement = xLayoutManager->getElement(sResourceURL);
1534  if (!xUIElement.is())
1535  {
1536  // show the findbar if necessary
1537  xLayoutManager->createElement( sResourceURL );
1538  xLayoutManager->showElement( sResourceURL );
1539  xUIElement = xLayoutManager->getElement( sResourceURL );
1540  if ( !xUIElement.is() )
1541  return;
1542  }
1543 
1544  css::uno::Reference< css::awt::XWindow > xWindow(xUIElement->getRealInterface(), css::uno::UNO_QUERY);
1545  VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow );
1546  ToolBox* pToolBox = static_cast<ToolBox*>(pWindow.get());
1547  if ( pToolBox )
1548  {
1549  ToolBox::ImplToolItems::size_type nItemCount = pToolBox->GetItemCount();
1550  for ( ToolBox::ImplToolItems::size_type i=0; i<nItemCount; ++i )
1551  {
1552  sal_uInt16 id = pToolBox->GetItemId(i);
1553  OUString sItemCommand = pToolBox->GetItemCommand(id);
1554  if ( sItemCommand == COMMAND_FINDTEXT )
1555  {
1556  vcl::Window* pItemWin = pToolBox->GetItemWindow( id );
1557  if ( pItemWin )
1558  {
1559  SolarMutexGuard aSolarMutexGuard;
1560  FindTextFieldControl* pFindTextFieldControl = dynamic_cast<FindTextFieldControl*>(pItemWin);
1561  if ( pFindTextFieldControl )
1562  pFindTextFieldControl->SetTextToSelected_Impl();
1563  pItemWin->GrabFocus();
1564  return;
1565  }
1566  }
1567  }
1568  }
1569 }
1570 
1571 void SAL_CALL FindbarDispatcher::addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& /*xControl*/, const css::util::URL& /*aURL*/ )
1572 {
1573 }
1574 
1575 void SAL_CALL FindbarDispatcher::removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& /*xControl*/, const css::util::URL& /*aURL*/ )
1576 {
1577 }
1578 
1579 }
1580 
1581 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1583  css::uno::XComponentContext *context,
1584  css::uno::Sequence<css::uno::Any> const &)
1585 {
1586  return cppu::acquire(new FindTextToolbarController(context));
1587 }
1588 
1589 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1591  css::uno::XComponentContext *context,
1592  css::uno::Sequence<css::uno::Any> const &)
1593 {
1594  return cppu::acquire(new ExitSearchToolboxController(context));
1595 }
1596 
1597 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1599  css::uno::XComponentContext *context,
1600  css::uno::Sequence<css::uno::Any> const &)
1601 {
1602  return cppu::acquire(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::UP));
1603 }
1604 
1605 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1607  css::uno::XComponentContext *context,
1608  css::uno::Sequence<css::uno::Any> const &)
1609 {
1610  return cppu::acquire(new UpDownSearchToolboxController(context, UpDownSearchToolboxController::DOWN));
1611 }
1612 
1613 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1615  css::uno::XComponentContext *context,
1616  css::uno::Sequence<css::uno::Any> const &)
1617 {
1618  return cppu::acquire(new MatchCaseToolboxController(context));
1619 }
1620 
1621 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1623  css::uno::XComponentContext *context,
1624  css::uno::Sequence<css::uno::Any> const &)
1625 {
1626  return cppu::acquire(new SearchFormattedToolboxController(context));
1627 }
1628 
1629 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1631  css::uno::XComponentContext *context,
1632  css::uno::Sequence<css::uno::Any> const &)
1633 {
1634  return cppu::acquire(new FindAllToolboxController(context));
1635 }
1636 
1637 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1639  css::uno::XComponentContext *context,
1640  css::uno::Sequence<css::uno::Any> const &)
1641 {
1642  return cppu::acquire(new SearchLabelToolboxController(context));
1643 }
1644 
1645 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
1647  SAL_UNUSED_PARAMETER css::uno::XComponentContext *,
1648  css::uno::Sequence<css::uno::Any> const &)
1649 {
1650  return cppu::acquire(new FindbarDispatcher);
1651 }
1652 
1653 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString get_text(int nIndex) const
Type
URL aURL
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_svx_SearchLabelToolboxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
css::uno::Reference< css::frame::XFrame > m_xFrame
virtual void SAL_CALL dispose() override
Link< weld::ComboBox &, void > m_aChangeHdl
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_svx_FindAllToolboxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
IMPL_LINK_NOARG(OCommonPicker, OnCancelPicker, void *, void)
void set_entry_message_type(weld::EntryMessageType eType)
IMPL_LINK_NOARG(FindTextFieldControl, ActivateHdl, weld::ComboBox &, bool)
constexpr sal_uInt16 KEY_F3
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_svx_MatchCaseToolboxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
static VclPtr< vcl::Window > GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
static css::awt::KeyEvent st_VCLKey2AWTKey(const vcl::KeyCode &aKey)
IMPL_LINK(FindTextFieldControl, KeyInputHdl, const KeyEvent &, rKeyEvent, bool)
css::uno::Reference< css::lang::XComponent > m_xFrame
css::uno::Reference< css::uno::XComponentContext > m_xContext
sal_Int16 nId
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &aType) override
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
bool IsCTLFontEnabled() const
void Remember_Impl(const OUString &rStr)
virtual void GetFocus() override
Reference< XController > xController
EntryMessageType
void SetItemWindowNonInteractive(sal_uInt16 nItemId, bool bNonInteractive)
OUString SvxResId(const char *pId)
Definition: dialmgr.cxx:28
virtual void SAL_CALL acquire() override
int nCount
virtual void GetFocus() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
void EnableItem(sal_uInt16 nItemId, bool bEnable=true)
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
sal_uInt16 nCode
TransliterationFlags
virtual ~FindTextFieldControl() override
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
DocumentType eType
virtual void SAL_CALL release() override
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
std::unique_ptr< svt::AcceleratorExecute > m_pAcc
virtual void dispose() override
static OUString GetSearchLabel()
Definition: srchdlg.cxx:2427
int i
uno_Any a
unsigned char sal_Bool
void GrabFocusToDocument()
SearchLabel
Definition: srchdlg.hxx:71
vcl::Window * GetItemWindow(sal_uInt16 nItemId) const
std::unique_ptr< weld::ComboBox > m_xWidget
void GrabFocus()
static void SetSearchLabel(const SearchLabel &rSL)
Definition: srchdlg.cxx:2456
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_svx_DownSearchToolboxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
constexpr sal_uInt16 KEY_RETURN
const css::uno::Reference< css::awt::XWindow > & getParent() const
static vcl::Window * GetFocusWindow()
FindTextFieldControl(vcl::Window *pParent, css::uno::Reference< css::frame::XFrame > const &xFrame, const css::uno::Reference< css::uno::XComponentContext > &xContext)
OUString GetItemCommand(sal_uInt16 nItemId) const
Reference< XDispatch > xDispatch
constexpr sal_uInt16 KEY_G
OUString get_active_text() const
constexpr sal_uInt16 KEY_ESCAPE
virtual void dispose() override
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_svx_SearchFormattedToolboxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
constexpr sal_uInt16 KEY_F
static VclPtr< reference_type > Create(Arg &&...arg)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_Impl_FindbarDispatcher_get_implementation(SAL_UNUSED_PARAMETER css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_svx_FindTextToolboxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
void connect_changed(const Link< weld::ComboBox &, void > &rLink)
sal_uInt16 GetItemId(ImplToolItems::size_type nPos) const
vcl::Window * get() const
void append_text(const OUString &rText)
Reference< XModel > xModel
OUString aCommand
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_svx_ExitFindbarToolboxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Reference< XComponentContext > m_xContext
void dispose()
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_svx_UpSearchToolboxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
long getWidth() const
RedlineType meType
ImplSVEvent * m_nAsyncGetFocusId
aStr
ImplToolItems::size_type GetItemCount() const
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)
AnyEventRef aEvent