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 <svx/labelitemwindow.hxx>
59 #include <svx/srchdlg.hxx>
60 #include <vcl/event.hxx>
61 
62 #include <findtextfield.hxx>
63 
64 using namespace css;
65 
66 namespace {
67 
68 constexpr OUStringLiteral COMMAND_FINDTEXT = u".uno:FindText";
69 constexpr OUStringLiteral COMMAND_DOWNSEARCH = u".uno:DownSearch";
70 constexpr OUStringLiteral COMMAND_UPSEARCH = u".uno:UpSearch";
71 constexpr OUStringLiteral COMMAND_FINDALL = u".uno:FindAll";
72 constexpr OUStringLiteral COMMAND_MATCHCASE = u".uno:MatchCase";
73 constexpr OUStringLiteral COMMAND_SEARCHFORMATTED = u".uno:SearchFormattedDisplayString";
74 
75 const sal_Int32 REMEMBER_SIZE = 10;
76 
77 class CheckButtonItemWindow final : public InterimItemWindow
78 {
79 public:
80  CheckButtonItemWindow(vcl::Window* pParent, const OUString& rLabel)
81  : InterimItemWindow(pParent, "svx/ui/checkbuttonbox.ui", "CheckButtonBox")
82  , m_xWidget(m_xBuilder->weld_check_button("checkbutton"))
83  {
84  InitControlBase(m_xWidget.get());
85 
86  m_xWidget->connect_key_press(LINK(this, CheckButtonItemWindow, KeyInputHdl));
87  m_xWidget->set_label(rLabel);
88  SetSizePixel(m_xWidget->get_preferred_size());
89  }
90 
91  bool get_active() const
92  {
93  return m_xWidget->get_active();
94  }
95 
96  virtual void dispose() override
97  {
98  m_xWidget.reset();
100  }
101 
102  virtual ~CheckButtonItemWindow() override
103  {
104  disposeOnce();
105  }
106 
107 private:
108  std::unique_ptr<weld::CheckButton> m_xWidget;
109 
110  DECL_LINK(KeyInputHdl, const KeyEvent&, bool);
111 };
112 
113 IMPL_LINK(CheckButtonItemWindow, KeyInputHdl, const KeyEvent&, rKeyEvent, bool)
114 {
115  return ChildKeyInput(rKeyEvent);
116 }
117 
118 void impl_executeSearch( const css::uno::Reference< css::uno::XComponentContext >& rxContext,
119  const css::uno::Reference< css::frame::XFrame >& xFrame,
120  const ToolBox* pToolBox,
121  const bool aSearchBackwards,
122  const bool aFindAll = false )
123 {
124  css::uno::Reference< css::util::XURLTransformer > xURLTransformer( css::util::URLTransformer::create( rxContext ) );
125  css::util::URL aURL;
126  aURL.Complete = ".uno:ExecuteSearch";
127  xURLTransformer->parseStrict(aURL);
128 
129  OUString sFindText;
130  bool aMatchCase = false;
131  bool bSearchFormatted = false;
132  if ( pToolBox )
133  {
134  ToolBox::ImplToolItems::size_type nItemCount = pToolBox->GetItemCount();
135  for ( ToolBox::ImplToolItems::size_type i=0; i<nItemCount; ++i )
136  {
137  ToolBoxItemId id = pToolBox->GetItemId(i);
138  OUString sItemCommand = pToolBox->GetItemCommand(id);
139  if ( sItemCommand == COMMAND_FINDTEXT )
140  {
141  FindTextFieldControl* pItemWin = static_cast<FindTextFieldControl*>(pToolBox->GetItemWindow(id));
142  if (pItemWin)
143  {
144  sFindText = pItemWin->get_active_text();
145  if (aFindAll && !pItemWin->ControlHasFocus())
146  pItemWin->GetFocus();
147  }
148  } else if ( sItemCommand == COMMAND_MATCHCASE )
149  {
150  CheckButtonItemWindow* pItemWin = static_cast<CheckButtonItemWindow*>(pToolBox->GetItemWindow(id));
151  if (pItemWin)
152  aMatchCase = pItemWin->get_active();
153  } else if ( sItemCommand == COMMAND_SEARCHFORMATTED )
154  {
155  CheckButtonItemWindow* pItemWin = static_cast<CheckButtonItemWindow*>(pToolBox->GetItemWindow(id));
156  if (pItemWin)
157  bSearchFormatted = pItemWin->get_active();
158  }
159  }
160  }
161 
162  SvtCTLOptions aCTLOptions;
163  TransliterationFlags nFlags = TransliterationFlags::NONE;
164  if (!aMatchCase)
165  nFlags |= TransliterationFlags::IGNORE_CASE;
166  if (aCTLOptions.IsCTLFontEnabled())
167  nFlags |= TransliterationFlags::IGNORE_DIACRITICS_CTL
168  | TransliterationFlags::IGNORE_KASHIDA_CTL;
169 
170  auto aArgs( comphelper::InitPropertySequence( {
171  { "SearchItem.SearchString", css::uno::makeAny( sFindText ) },
172  { "SearchItem.Backward", css::uno::makeAny( aSearchBackwards ) },
173  { "SearchItem.SearchFlags", css::uno::makeAny( sal_Int32(0) ) },
174  { "SearchItem.TransliterateFlags", css::uno::makeAny( static_cast<sal_Int32>(nFlags) ) },
175  { "SearchItem.Command", css::uno::makeAny( static_cast<sal_Int16>(aFindAll ?SvxSearchCmd::FIND_ALL : SvxSearchCmd::FIND ) ) },
176  { "SearchItem.AlgorithmType", css::uno::makeAny( sal_Int16(css::util::SearchAlgorithms_ABSOLUTE) ) },
177  { "SearchItem.AlgorithmType2", css::uno::makeAny( sal_Int16(css::util::SearchAlgorithms2::ABSOLUTE) ) },
178  { "SearchItem.SearchFormatted", css::uno::makeAny( bSearchFormatted ) }
179  } ) );
180 
181  css::uno::Reference< css::frame::XDispatchProvider > xDispatchProvider(xFrame, css::uno::UNO_QUERY);
182  if ( xDispatchProvider.is() )
183  {
184  css::uno::Reference< css::frame::XDispatch > xDispatch = xDispatchProvider->queryDispatch( aURL, OUString(), 0 );
185  if ( xDispatch.is() && !aURL.Complete.isEmpty() )
186  xDispatch->dispatch( aURL, aArgs );
187  }
188 }
189 
190 }
191 
193  css::uno::Reference< css::frame::XFrame > const & xFrame,
194  const css::uno::Reference< css::uno::XComponentContext >& xContext) :
195  InterimItemWindow(pParent, "svx/ui/findbox.ui", "FindBox"),
196  m_nAsyncGetFocusId(nullptr),
197  m_xWidget(m_xBuilder->weld_combo_box("find")),
198  m_xFrame(xFrame),
199  m_xContext(xContext),
200  m_pAcc(svt::AcceleratorExecute::createAcceleratorHelper())
201 {
202  InitControlBase(m_xWidget.get());
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  static const OUStringLiteral sResourceURL( u"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 Ctrl-G, F3 and Shift-RETURN pressed (in addition to ActivateHdl condition which handles bare RETURN)
301  else if ( (bMod1 && KEY_G == nCode) || (bShift && KEY_RETURN == 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  m_xWidget->grab_focus();
327 }
328 
329 // Execute the search when activated, typically due to "Return"
331 {
332  if (isDisposed())
333  return true;
334 
335  ActivateFind(false);
336 
337  return true;
338 }
339 
340 IMPL_LINK_NOARG(FindTextFieldControl, OnAsyncGetFocus, void*, void)
341 {
342  m_nAsyncGetFocusId = nullptr;
343  m_xWidget->select_entry_region(0, -1);
344 }
345 
347 {
349  return;
350 
351  // do it async to defeat entry in combobox having its own ideas about the focus
353 
354  GrabFocus(); // tdf#137993 ensure the toplevel vcl::Window is activated so SfxViewFrame::Current is valid
355 }
356 
358 {
359  FocusIn();
360 }
361 
363 {
364  if (m_nAsyncGetFocusId)
365  {
367  m_nAsyncGetFocusId = nullptr;
368  }
369  m_xWidget.reset();
371 }
372 
374 {
375  disposeOnce();
376 }
377 
379 {
380  m_aChangeHdl = rLink;
381  m_xWidget->connect_changed(rLink);
382 }
383 
385 {
386  return m_xWidget->get_count();
387 }
388 
389 OUString FindTextFieldControl::get_text(int nIndex) const
390 {
391  return m_xWidget->get_text(nIndex);
392 }
393 
395 {
396  return m_xWidget->get_active_text();
397 }
398 
399 void FindTextFieldControl::append_text(const OUString& rText)
400 {
401  m_xWidget->append_text(rText);
402 }
403 
405 {
406  m_xWidget->set_entry_message_type(eType);
407 }
408 
409 namespace {
410 
411 class SearchToolbarControllersManager
412 {
413 public:
414 
415  SearchToolbarControllersManager();
416 
417  static SearchToolbarControllersManager& createControllersManager();
418 
419  void registryController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const OUString& sCommandURL );
420  void freeController ( const css::uno::Reference< css::frame::XFrame >& xFrame, const OUString& sCommandURL );
421  css::uno::Reference< css::frame::XStatusListener > findController( const css::uno::Reference< css::frame::XFrame >& xFrame, const OUString& sCommandURL );
422 
423  void saveSearchHistory(const FindTextFieldControl* m_pFindTextFieldControl);
424  void loadSearchHistory(FindTextFieldControl* m_pFindTextFieldControl);
425 
426 private:
427 
428  typedef ::std::vector< css::beans::PropertyValue > SearchToolbarControllersVec;
429  typedef ::std::map< css::uno::Reference< css::frame::XFrame >, SearchToolbarControllersVec > SearchToolbarControllersMap;
430  SearchToolbarControllersMap aSearchToolbarControllersMap;
431  std::vector<OUString> m_aSearchStrings;
432 
433 };
434 
435 SearchToolbarControllersManager::SearchToolbarControllersManager()
436 {
437 }
438 
439 SearchToolbarControllersManager& SearchToolbarControllersManager::createControllersManager()
440 {
441  static SearchToolbarControllersManager theSearchToolbarControllersManager;
442  return theSearchToolbarControllersManager;
443 }
444 
445 void SearchToolbarControllersManager::saveSearchHistory(const FindTextFieldControl* pFindTextFieldControl)
446 {
447  const sal_Int32 nECount( pFindTextFieldControl->get_count() );
448  m_aSearchStrings.resize( nECount );
449  for( sal_Int32 i=0; i<nECount; ++i )
450  {
451  m_aSearchStrings[i] = pFindTextFieldControl->get_text(i);
452  }
453 }
454 
455 void SearchToolbarControllersManager::loadSearchHistory(FindTextFieldControl* pFindTextFieldControl)
456 {
457  for( size_t i=0; i<m_aSearchStrings.size(); ++i )
458  {
459  pFindTextFieldControl->append_text(m_aSearchStrings[i]);
460  }
461 }
462 
463 void SearchToolbarControllersManager::registryController( const css::uno::Reference< css::frame::XFrame >& xFrame, const css::uno::Reference< css::frame::XStatusListener >& xStatusListener, const OUString& sCommandURL )
464 {
465  SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame);
466  if (pIt == aSearchToolbarControllersMap.end())
467  {
468  SearchToolbarControllersVec lControllers(1);
469  lControllers[0].Name = sCommandURL;
470  lControllers[0].Value <<= xStatusListener;
471  aSearchToolbarControllersMap.emplace(xFrame, lControllers);
472  }
473  else
474  {
475  sal_Int32 nSize = pIt->second.size();
476  for (sal_Int32 i=0; i<nSize; ++i)
477  {
478  if (pIt->second[i].Name == sCommandURL)
479  return;
480  }
481 
482  pIt->second.resize(nSize+1);
483  pIt->second[nSize].Name = sCommandURL;
484  pIt->second[nSize].Value <<= xStatusListener;
485  }
486 }
487 
488 void SearchToolbarControllersManager::freeController( const css::uno::Reference< css::frame::XFrame >& xFrame, const OUString& sCommandURL )
489 {
490  SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame);
491  if (pIt != aSearchToolbarControllersMap.end())
492  {
493  auto pItCtrl = std::find_if(pIt->second.begin(), pIt->second.end(),
494  [&sCommandURL](const css::beans::PropertyValue& rCtrl) { return rCtrl.Name == sCommandURL; });
495  if (pItCtrl != pIt->second.end())
496  pIt->second.erase(pItCtrl);
497 
498  if (pIt->second.empty())
499  aSearchToolbarControllersMap.erase(pIt);
500  }
501 }
502 
503 css::uno::Reference< css::frame::XStatusListener > SearchToolbarControllersManager::findController( const css::uno::Reference< css::frame::XFrame >& xFrame, const OUString& sCommandURL )
504 {
505  css::uno::Reference< css::frame::XStatusListener > xStatusListener;
506 
507  SearchToolbarControllersMap::iterator pIt = aSearchToolbarControllersMap.find(xFrame);
508  if (pIt != aSearchToolbarControllersMap.end())
509  {
510  auto pItCtrl = std::find_if(pIt->second.begin(), pIt->second.end(),
511  [&sCommandURL](const css::beans::PropertyValue& rCtrl) { return rCtrl.Name == sCommandURL; });
512  if (pItCtrl != pIt->second.end())
513  pItCtrl->Value >>= xStatusListener;
514  }
515 
516  return xStatusListener;
517 }
518 
519 class FindTextToolbarController : public svt::ToolboxController,
520  public css::lang::XServiceInfo
521 {
522 public:
523 
524  FindTextToolbarController( const css::uno::Reference< css::uno::XComponentContext > & rxContext );
525 
526  // XInterface
527  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
528  virtual void SAL_CALL acquire() noexcept override;
529  virtual void SAL_CALL release() noexcept override;
530 
531  // XServiceInfo
532  virtual OUString SAL_CALL getImplementationName() override;
533  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
534  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
535 
536  // XComponent
537  virtual void SAL_CALL dispose() override;
538 
539  // XInitialization
540  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
541 
542  // XToolbarController
543  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
544 
545  // XStatusListener
546  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& Event ) override;
547 
548  DECL_LINK(EditModifyHdl, weld::ComboBox&, void);
549 
550 private:
551 
552  void textfieldChanged();
553 
554  VclPtr<FindTextFieldControl> m_pFindTextFieldControl;
555 
556  ToolBoxItemId m_nDownSearchId;
557  ToolBoxItemId m_nUpSearchId;
558  ToolBoxItemId m_nFindAllId;
559 
560 };
561 
562 FindTextToolbarController::FindTextToolbarController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
563  : svt::ToolboxController(rxContext, css::uno::Reference< css::frame::XFrame >(), COMMAND_FINDTEXT)
564  , m_pFindTextFieldControl(nullptr)
565  , m_nDownSearchId(0)
566  , m_nUpSearchId(0)
567  , m_nFindAllId(0)
568 {
569 }
570 
571 // XInterface
572 css::uno::Any SAL_CALL FindTextToolbarController::queryInterface( const css::uno::Type& aType )
573 {
574  css::uno::Any a = ToolboxController::queryInterface( aType );
575  if ( a.hasValue() )
576  return a;
577 
578  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
579 }
580 
581 void SAL_CALL FindTextToolbarController::acquire() noexcept
582 {
584 }
585 
586 void SAL_CALL FindTextToolbarController::release() noexcept
587 {
589 }
590 
591 // XServiceInfo
592 OUString SAL_CALL FindTextToolbarController::getImplementationName()
593 {
594  return "com.sun.star.svx.FindTextToolboxController";
595 }
596 
597 sal_Bool SAL_CALL FindTextToolbarController::supportsService( const OUString& ServiceName )
598 {
599  return cppu::supportsService(this, ServiceName);
600 }
601 
602 css::uno::Sequence< OUString > SAL_CALL FindTextToolbarController::getSupportedServiceNames()
603 {
604  return { "com.sun.star.frame.ToolbarController" };
605 }
606 
607 // XComponent
608 void SAL_CALL FindTextToolbarController::dispose()
609 {
610  SolarMutexGuard aSolarMutexGuard;
611 
612  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
613 
615  if (m_pFindTextFieldControl != nullptr) {
616  SearchToolbarControllersManager::createControllersManager()
617  .saveSearchHistory(m_pFindTextFieldControl);
618  m_pFindTextFieldControl.disposeAndClear();
619  }
620 }
621 
622 // XInitialization
623 void SAL_CALL FindTextToolbarController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
624 {
626 
628  ToolBox* pToolBox = static_cast<ToolBox*>(pWindow.get());
629  if ( pToolBox )
630  {
631  m_nDownSearchId = pToolBox->GetItemId(COMMAND_DOWNSEARCH);
632  m_nUpSearchId = pToolBox->GetItemId(COMMAND_UPSEARCH);
633  m_nFindAllId = pToolBox->GetItemId(COMMAND_FINDALL);
634  }
635 
636  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
637 }
638 
639 css::uno::Reference< css::awt::XWindow > SAL_CALL FindTextToolbarController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent )
640 {
641  css::uno::Reference< css::awt::XWindow > xItemWindow;
642 
643  VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xParent );
644  if ( pParent )
645  {
646  ToolBox* pToolbar = static_cast<ToolBox*>(pParent.get());
647  m_pFindTextFieldControl = VclPtr<FindTextFieldControl>::Create(pToolbar, m_xFrame, m_xContext);
648 
649  m_pFindTextFieldControl->connect_changed(LINK(this, FindTextToolbarController, EditModifyHdl));
650  SearchToolbarControllersManager::createControllersManager().loadSearchHistory(m_pFindTextFieldControl);
651  }
652  xItemWindow = VCLUnoHelper::GetInterface( m_pFindTextFieldControl );
653 
654  return xItemWindow;
655 }
656 
657 // XStatusListener
658 void SAL_CALL FindTextToolbarController::statusChanged( const css::frame::FeatureStateEvent& rEvent )
659 {
660  SolarMutexGuard aSolarMutexGuard;
661  if ( m_bDisposed )
662  return;
663 
664  OUString aFeatureURL = rEvent.FeatureURL.Complete;
665  if ( aFeatureURL == "AppendSearchHistory" )
666  {
667  m_pFindTextFieldControl->Remember_Impl(m_pFindTextFieldControl->get_active_text());
668  }
669  // enable up/down buttons in case there is already text (from the search history)
670  textfieldChanged();
671 }
672 
673 IMPL_LINK_NOARG(FindTextToolbarController, EditModifyHdl, weld::ComboBox&, void)
674 {
675  // Clear SearchLabel when search string altered
676  #if HAVE_FEATURE_DESKTOP
678  #endif
679 
680  textfieldChanged();
681 }
682 
683 void FindTextToolbarController::textfieldChanged() {
684  // enable or disable item DownSearch/UpSearch/FindAll of findbar
686  ToolBox* pToolBox = static_cast<ToolBox*>(pWindow.get());
687  if ( pToolBox && m_pFindTextFieldControl )
688  {
689  bool enableButtons = !m_pFindTextFieldControl->get_active_text().isEmpty();
690  pToolBox->EnableItem(m_nDownSearchId, enableButtons);
691  pToolBox->EnableItem(m_nUpSearchId, enableButtons);
692  pToolBox->EnableItem(m_nFindAllId, enableButtons);
693  }
694 }
695 
696 class UpDownSearchToolboxController : public svt::ToolboxController,
697  public css::lang::XServiceInfo
698 {
699 public:
700  enum Type { UP, DOWN };
701 
702  UpDownSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext, Type eType );
703 
704  // XInterface
705  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
706  virtual void SAL_CALL acquire() noexcept override;
707  virtual void SAL_CALL release() noexcept override;
708 
709  // XServiceInfo
710  virtual OUString SAL_CALL getImplementationName() override;
711  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
712  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
713 
714  // XComponent
715  virtual void SAL_CALL dispose() override;
716 
717  // XInitialization
718  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
719 
720  // XToolbarController
721  virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
722 
723  // XStatusListener
724  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
725 
726 private:
727  Type meType;
728 };
729 
730 UpDownSearchToolboxController::UpDownSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext, Type eType )
731  : svt::ToolboxController( rxContext,
732  css::uno::Reference< css::frame::XFrame >(),
733  (eType == UP) ? OUString( COMMAND_UPSEARCH ): OUString( COMMAND_DOWNSEARCH ) ),
734  meType( eType )
735 {
736 }
737 
738 // XInterface
739 css::uno::Any SAL_CALL UpDownSearchToolboxController::queryInterface( const css::uno::Type& aType )
740 {
741  css::uno::Any a = ToolboxController::queryInterface( aType );
742  if ( a.hasValue() )
743  return a;
744 
745  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
746 }
747 
748 void SAL_CALL UpDownSearchToolboxController::acquire() noexcept
749 {
750  ToolboxController::acquire();
751 }
752 
753 void SAL_CALL UpDownSearchToolboxController::release() noexcept
754 {
755  ToolboxController::release();
756 }
757 
758 // XServiceInfo
759 OUString SAL_CALL UpDownSearchToolboxController::getImplementationName()
760 {
761  return meType == UpDownSearchToolboxController::UP?
762  OUString( "com.sun.star.svx.UpSearchToolboxController" ) :
763  OUString( "com.sun.star.svx.DownSearchToolboxController" );
764 }
765 
766 sal_Bool SAL_CALL UpDownSearchToolboxController::supportsService( const OUString& ServiceName )
767 {
768  return cppu::supportsService(this, ServiceName);
769 }
770 
771 css::uno::Sequence< OUString > SAL_CALL UpDownSearchToolboxController::getSupportedServiceNames()
772 {
773  return { "com.sun.star.frame.ToolbarController" };
774 }
775 
776 // XComponent
777 void SAL_CALL UpDownSearchToolboxController::dispose()
778 {
779  SolarMutexGuard aSolarMutexGuard;
780 
781  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
782 
784 }
785 
786 // XInitialization
787 void SAL_CALL UpDownSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
788 {
790  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
791 }
792 
793 // XToolbarController
794 void SAL_CALL UpDownSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ )
795 {
796  if ( m_bDisposed )
797  throw css::lang::DisposedException();
798 
799  VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( getParent() );
800  ToolBox* pToolBox = static_cast<ToolBox*>(pWindow.get());
801 
802  impl_executeSearch(m_xContext, m_xFrame, pToolBox, meType == UP );
803 
804  css::frame::FeatureStateEvent aEvent;
805  aEvent.FeatureURL.Complete = "AppendSearchHistory";
806  css::uno::Reference< css::frame::XStatusListener > xStatusListener = SearchToolbarControllersManager::createControllersManager().findController(m_xFrame, COMMAND_FINDTEXT);
807  if (xStatusListener.is())
808  xStatusListener->statusChanged( aEvent );
809 }
810 
811 // XStatusListener
812 void SAL_CALL UpDownSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ )
813 {
814 }
815 
816 class MatchCaseToolboxController : public svt::ToolboxController,
817  public css::lang::XServiceInfo
818 {
819 public:
820  MatchCaseToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
821 
822  // XInterface
823  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
824  virtual void SAL_CALL acquire() noexcept override;
825  virtual void SAL_CALL release() noexcept override;
826 
827  // XServiceInfo
828  virtual OUString SAL_CALL getImplementationName() override;
829  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
830  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
831 
832  // XComponent
833  virtual void SAL_CALL dispose() override;
834 
835  // XInitialization
836  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
837 
838  // XToolbarController
839  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
840 
841  // XStatusListener
842  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
843 
844 private:
845  VclPtr<CheckButtonItemWindow> m_xMatchCaseControl;
846 };
847 
848 MatchCaseToolboxController::MatchCaseToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
849  : svt::ToolboxController( rxContext,
850  css::uno::Reference< css::frame::XFrame >(),
851  COMMAND_MATCHCASE )
852  , m_xMatchCaseControl(nullptr)
853 {
854 }
855 
856 // XInterface
857 css::uno::Any SAL_CALL MatchCaseToolboxController::queryInterface( const css::uno::Type& aType )
858 {
859  css::uno::Any a = ToolboxController::queryInterface( aType );
860  if ( a.hasValue() )
861  return a;
862 
863  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
864 }
865 
866 void SAL_CALL MatchCaseToolboxController::acquire() noexcept
867 {
868  ToolboxController::acquire();
869 }
870 
871 void SAL_CALL MatchCaseToolboxController::release() noexcept
872 {
873  ToolboxController::release();
874 }
875 
876 // XServiceInfo
877 OUString SAL_CALL MatchCaseToolboxController::getImplementationName()
878 {
879  return "com.sun.star.svx.MatchCaseToolboxController";
880 }
881 
882 sal_Bool SAL_CALL MatchCaseToolboxController::supportsService( const OUString& ServiceName )
883 {
884  return cppu::supportsService(this, ServiceName);
885 }
886 
887 css::uno::Sequence< OUString > SAL_CALL MatchCaseToolboxController::getSupportedServiceNames()
888 {
889  return { "com.sun.star.frame.ToolbarController" };
890 }
891 
892 // XComponent
893 void SAL_CALL MatchCaseToolboxController::dispose()
894 {
895  SolarMutexGuard aSolarMutexGuard;
896 
897  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
898 
900 
901  m_xMatchCaseControl.disposeAndClear();
902 }
903 
904 // XInitialization
905 void SAL_CALL MatchCaseToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
906 {
908 
909  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
910 }
911 
912 css::uno::Reference< css::awt::XWindow > SAL_CALL MatchCaseToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent )
913 {
914  css::uno::Reference< css::awt::XWindow > xItemWindow;
915 
916  VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xParent );
917  if ( pParent )
918  {
919  ToolBox* pToolbar = static_cast<ToolBox*>(pParent.get());
920  m_xMatchCaseControl = VclPtr<CheckButtonItemWindow>::Create(pToolbar, SvxResId(RID_SVXSTR_FINDBAR_MATCHCASE));
921  }
922  xItemWindow = VCLUnoHelper::GetInterface(m_xMatchCaseControl);
923 
924  return xItemWindow;
925 }
926 
927 // XStatusListener
928 void SAL_CALL MatchCaseToolboxController::statusChanged( const css::frame::FeatureStateEvent& )
929 {
930 }
931 
932 class SearchFormattedToolboxController : public svt::ToolboxController,
933  public css::lang::XServiceInfo
934 {
935 public:
936  SearchFormattedToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
937 
938  // XInterface
939  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
940  virtual void SAL_CALL acquire() noexcept override;
941  virtual void SAL_CALL release() noexcept override;
942 
943  // XServiceInfo
944  virtual OUString SAL_CALL getImplementationName() override;
945  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
946  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
947 
948  // XComponent
949  virtual void SAL_CALL dispose() override;
950 
951  // XInitialization
952  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
953 
954  // XToolbarController
955  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
956 
957  // XStatusListener
958  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
959 
960 private:
961  VclPtr<CheckButtonItemWindow> m_xSearchFormattedControl;
962 };
963 
964 SearchFormattedToolboxController::SearchFormattedToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext )
965  : svt::ToolboxController( rxContext,
966  css::uno::Reference< css::frame::XFrame >(),
967  COMMAND_SEARCHFORMATTED )
968  , m_xSearchFormattedControl(nullptr)
969 {
970 }
971 
972 // XInterface
973 css::uno::Any SAL_CALL SearchFormattedToolboxController::queryInterface( const css::uno::Type& aType )
974 {
975  css::uno::Any a = ToolboxController::queryInterface( aType );
976  if ( a.hasValue() )
977  return a;
978 
979  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
980 }
981 
982 void SAL_CALL SearchFormattedToolboxController::acquire() noexcept
983 {
984  ToolboxController::acquire();
985 }
986 
987 void SAL_CALL SearchFormattedToolboxController::release() noexcept
988 {
989  ToolboxController::release();
990 }
991 
992 // XServiceInfo
993 OUString SAL_CALL SearchFormattedToolboxController::getImplementationName()
994 {
995  return "com.sun.star.svx.SearchFormattedToolboxController";
996 }
997 
998 sal_Bool SAL_CALL SearchFormattedToolboxController::supportsService( const OUString& ServiceName )
999 {
1000  return cppu::supportsService(this, ServiceName);
1001 }
1002 
1003 css::uno::Sequence< OUString > SAL_CALL SearchFormattedToolboxController::getSupportedServiceNames()
1004 {
1005  return { "com.sun.star.frame.ToolbarController" };
1006 }
1007 
1008 // XComponent
1009 void SAL_CALL SearchFormattedToolboxController::dispose()
1010 {
1011  SolarMutexGuard aSolarMutexGuard;
1012 
1013  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
1014 
1016 
1017  m_xSearchFormattedControl.disposeAndClear();
1018 }
1019 
1020 // XInitialization
1021 void SAL_CALL SearchFormattedToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
1022 {
1024 
1025  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
1026 }
1027 
1028 css::uno::Reference< css::awt::XWindow > SAL_CALL SearchFormattedToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& xParent )
1029 {
1030  css::uno::Reference< css::awt::XWindow > xItemWindow;
1031 
1032  VclPtr<vcl::Window> pParent = VCLUnoHelper::GetWindow( xParent );
1033  if ( pParent )
1034  {
1035  ToolBox* pToolbar = static_cast<ToolBox*>(pParent.get());
1036  m_xSearchFormattedControl = VclPtr<CheckButtonItemWindow>::Create(pToolbar, SvxResId(RID_SVXSTR_FINDBAR_SEARCHFORMATTED));
1037  }
1038  xItemWindow = VCLUnoHelper::GetInterface(m_xSearchFormattedControl);
1039 
1040  return xItemWindow;
1041 }
1042 
1043 // XStatusListener
1044 void SAL_CALL SearchFormattedToolboxController::statusChanged( const css::frame::FeatureStateEvent& )
1045 {
1046 }
1047 
1048 class FindAllToolboxController : public svt::ToolboxController,
1049  public css::lang::XServiceInfo
1050 {
1051 public:
1052  FindAllToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1053 
1054  // XInterface
1055  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
1056  virtual void SAL_CALL acquire() noexcept override;
1057  virtual void SAL_CALL release() noexcept override;
1058 
1059  // XServiceInfo
1060  virtual OUString SAL_CALL getImplementationName() override;
1061  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1062  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1063 
1064  // XComponent
1065  virtual void SAL_CALL dispose() override;
1066 
1067  // XInitialization
1068  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
1069 
1070  // XToolbarController
1071  virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
1072 
1073  // XStatusListener
1074  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
1075 };
1076 
1077 FindAllToolboxController::FindAllToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
1078  : svt::ToolboxController( rxContext,
1079  css::uno::Reference< css::frame::XFrame >(),
1080  ".uno:FindAll" )
1081 {
1082 }
1083 
1084 // XInterface
1085 css::uno::Any SAL_CALL FindAllToolboxController::queryInterface( const css::uno::Type& aType )
1086 {
1087  css::uno::Any a = ToolboxController::queryInterface( aType );
1088  if ( a.hasValue() )
1089  return a;
1090 
1091  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
1092 }
1093 
1094 void SAL_CALL FindAllToolboxController::acquire() noexcept
1095 {
1096  ToolboxController::acquire();
1097 }
1098 
1099 void SAL_CALL FindAllToolboxController::release() noexcept
1100 {
1101  ToolboxController::release();
1102 }
1103 
1104 // XServiceInfo
1105 OUString SAL_CALL FindAllToolboxController::getImplementationName()
1106 {
1107  return "com.sun.star.svx.FindAllToolboxController";
1108 }
1109 
1110 
1111 sal_Bool SAL_CALL FindAllToolboxController::supportsService( const OUString& ServiceName )
1112 {
1113  return cppu::supportsService(this, ServiceName);
1114 }
1115 
1116 css::uno::Sequence< OUString > SAL_CALL FindAllToolboxController::getSupportedServiceNames()
1117 {
1118  return { "com.sun.star.frame.ToolbarController" };
1119 }
1120 
1121 // XComponent
1122 void SAL_CALL FindAllToolboxController::dispose()
1123 {
1124  SolarMutexGuard aSolarMutexGuard;
1125 
1126  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
1127 
1129 }
1130 
1131 // XInitialization
1132 void SAL_CALL FindAllToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
1133 {
1134  svt::ToolboxController::initialize( aArguments );
1135  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
1136 }
1137 
1138 // XToolbarController
1139 void SAL_CALL FindAllToolboxController::execute( sal_Int16 /*KeyModifier*/ )
1140 {
1141  if ( m_bDisposed )
1142  throw css::lang::DisposedException();
1143 
1144  VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( getParent() );
1145  ToolBox* pToolBox = static_cast<ToolBox*>(pWindow.get());
1146 
1147  impl_executeSearch(m_xContext, m_xFrame, pToolBox, false, true);
1148 }
1149 
1150 // XStatusListener
1151 void SAL_CALL FindAllToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ )
1152 {
1153 }
1154 
1155 class ExitSearchToolboxController : public svt::ToolboxController,
1156  public css::lang::XServiceInfo
1157 {
1158 public:
1159  ExitSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1160 
1161  // XInterface
1162  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
1163  virtual void SAL_CALL acquire() noexcept override;
1164  virtual void SAL_CALL release() noexcept override;
1165 
1166  // XServiceInfo
1167  virtual OUString SAL_CALL getImplementationName() override;
1168  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1169  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1170 
1171  // XComponent
1172  virtual void SAL_CALL dispose() override;
1173 
1174  // XInitialization
1175  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
1176 
1177  // XToolbarController
1178  virtual void SAL_CALL execute( sal_Int16 KeyModifier ) override;
1179 
1180  // XStatusListener
1181  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
1182 };
1183 
1184 ExitSearchToolboxController::ExitSearchToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
1185  : svt::ToolboxController( rxContext,
1186  css::uno::Reference< css::frame::XFrame >(),
1187  ".uno:ExitSearch" )
1188 {
1189 }
1190 
1191 // XInterface
1192 css::uno::Any SAL_CALL ExitSearchToolboxController::queryInterface( const css::uno::Type& aType )
1193 {
1194  css::uno::Any a = ToolboxController::queryInterface( aType );
1195  if ( a.hasValue() )
1196  return a;
1197 
1198  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
1199 }
1200 
1201 void SAL_CALL ExitSearchToolboxController::acquire() noexcept
1202 {
1203  ToolboxController::acquire();
1204 }
1205 
1206 void SAL_CALL ExitSearchToolboxController::release() noexcept
1207 {
1208  ToolboxController::release();
1209 }
1210 
1211 // XServiceInfo
1212 OUString SAL_CALL ExitSearchToolboxController::getImplementationName()
1213 {
1214  return "com.sun.star.svx.ExitFindbarToolboxController";
1215 }
1216 
1217 
1218 sal_Bool SAL_CALL ExitSearchToolboxController::supportsService( const OUString& ServiceName )
1219 {
1220  return cppu::supportsService(this, ServiceName);
1221 }
1222 
1223 css::uno::Sequence< OUString > SAL_CALL ExitSearchToolboxController::getSupportedServiceNames()
1224 {
1225  return { "com.sun.star.frame.ToolbarController" };
1226 }
1227 
1228 // XComponent
1229 void SAL_CALL ExitSearchToolboxController::dispose()
1230 {
1231  SolarMutexGuard aSolarMutexGuard;
1232 
1233  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
1234 
1236 }
1237 
1238 // XInitialization
1239 void SAL_CALL ExitSearchToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
1240 {
1241  svt::ToolboxController::initialize( aArguments );
1242  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
1243 }
1244 
1245 // XToolbarController
1246 void SAL_CALL ExitSearchToolboxController::execute( sal_Int16 /*KeyModifier*/ )
1247 {
1248  vcl::Window *pFocusWindow = Application::GetFocusWindow();
1249  if ( pFocusWindow )
1250  pFocusWindow->GrabFocusToDocument();
1251 
1252  // hide the findbar
1253  css::uno::Reference< css::beans::XPropertySet > xPropSet(m_xFrame, css::uno::UNO_QUERY);
1254  if (xPropSet.is())
1255  {
1256  css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
1257  css::uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
1258  aValue >>= xLayoutManager;
1259  if (xLayoutManager.is())
1260  {
1261  static const OUStringLiteral sResourceURL( u"private:resource/toolbar/findbar" );
1262  xLayoutManager->hideElement( sResourceURL );
1263  xLayoutManager->destroyElement( sResourceURL );
1264  }
1265  }
1266 }
1267 
1268 // XStatusListener
1269 void SAL_CALL ExitSearchToolboxController::statusChanged( const css::frame::FeatureStateEvent& /*rEvent*/ )
1270 {
1271 }
1272 
1273 class SearchLabelToolboxController : public svt::ToolboxController,
1274  public css::lang::XServiceInfo
1275 {
1276 public:
1277  SearchLabelToolboxController( const css::uno::Reference< css::uno::XComponentContext >& rxContext );
1278 
1279  // XInterface
1280  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
1281  virtual void SAL_CALL acquire() noexcept override;
1282  virtual void SAL_CALL release() noexcept override;
1283 
1284  // XServiceInfo
1285  virtual OUString SAL_CALL getImplementationName() override;
1286  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1287  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1288 
1289  // XComponent
1290  virtual void SAL_CALL dispose() override;
1291 
1292  // XInitialization
1293  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
1294 
1295  // XToolbarController
1296  virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent ) override;
1297 
1298  // XStatusListener
1299  virtual void SAL_CALL statusChanged( const css::frame::FeatureStateEvent& rEvent ) override;
1300 
1301 private:
1302  VclPtr<LabelItemWindow> m_xSL;
1303 };
1304 
1305 SearchLabelToolboxController::SearchLabelToolboxController( const css::uno::Reference< css::uno::XComponentContext > & rxContext )
1306  : svt::ToolboxController( rxContext,
1307  css::uno::Reference< css::frame::XFrame >(),
1308  ".uno:SearchLabel" )
1309 {
1310 }
1311 
1312 // XInterface
1313 css::uno::Any SAL_CALL SearchLabelToolboxController::queryInterface( const css::uno::Type& aType )
1314 {
1315  css::uno::Any a = ToolboxController::queryInterface( aType );
1316  if ( a.hasValue() )
1317  return a;
1318 
1319  return ::cppu::queryInterface( aType, static_cast< css::lang::XServiceInfo* >( this ) );
1320 }
1321 
1322 void SAL_CALL SearchLabelToolboxController::acquire() noexcept
1323 {
1324  ToolboxController::acquire();
1325 }
1326 
1327 void SAL_CALL SearchLabelToolboxController::release() noexcept
1328 {
1329  ToolboxController::release();
1330 }
1331 
1332 // XServiceInfo
1333 OUString SAL_CALL SearchLabelToolboxController::getImplementationName()
1334 {
1335  return "com.sun.star.svx.SearchLabelToolboxController";
1336 }
1337 
1338 
1339 sal_Bool SAL_CALL SearchLabelToolboxController::supportsService( const OUString& ServiceName )
1340 {
1341  return cppu::supportsService(this, ServiceName);
1342 }
1343 
1344 css::uno::Sequence< OUString > SAL_CALL SearchLabelToolboxController::getSupportedServiceNames()
1345 {
1346  return { "com.sun.star.frame.ToolbarController" };
1347 }
1348 
1349 // XComponent
1350 void SAL_CALL SearchLabelToolboxController::dispose()
1351 {
1352  SolarMutexGuard aSolarMutexGuard;
1353 
1354  SearchToolbarControllersManager::createControllersManager().freeController(m_xFrame, m_aCommandURL);
1355 
1357  m_xSL.disposeAndClear();
1358 }
1359 
1360 // XInitialization
1361 void SAL_CALL SearchLabelToolboxController::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
1362 {
1363  svt::ToolboxController::initialize( aArguments );
1364  SearchToolbarControllersManager::createControllersManager().registryController(m_xFrame, css::uno::Reference< css::frame::XStatusListener >(this), m_aCommandURL);
1365 }
1366 
1367 // XStatusListener
1368 void SAL_CALL SearchLabelToolboxController::statusChanged( const css::frame::FeatureStateEvent& )
1369 {
1370  if (m_xSL)
1371  {
1373  m_xSL->set_label(aStr);
1374  m_xSL->SetOptimalSize();
1375  Size aSize(m_xSL->GetSizePixel());
1376  tools::Long nWidth = !aStr.isEmpty() ? aSize.getWidth() : 16;
1377  m_xSL->SetSizePixel(Size(nWidth, aSize.Height()));
1378  }
1379 }
1380 
1381 css::uno::Reference< css::awt::XWindow > SAL_CALL SearchLabelToolboxController::createItemWindow( const css::uno::Reference< css::awt::XWindow >& Parent )
1382 {
1383  ToolBox* pToolBox = nullptr;
1385  if (getToolboxId(nId, &pToolBox))
1386  pToolBox->SetItemWindowNonInteractive(nId, true);
1387 
1389  m_xSL->SetSizePixel(Size(16, m_xSL->GetSizePixel().Height()));
1390  return VCLUnoHelper::GetInterface(m_xSL);
1391 }
1392 
1393 // protocol handler for "vnd.sun.star.findbar:*" URLs
1394 // The dispatch object will be used for shortcut commands for findbar
1395 class FindbarDispatcher : public css::lang::XServiceInfo,
1396  public css::lang::XInitialization,
1397  public css::frame::XDispatchProvider,
1398  public css::frame::XDispatch,
1399  public ::cppu::OWeakObject
1400 {
1401 public:
1402 
1403  FindbarDispatcher();
1404  virtual ~FindbarDispatcher() override;
1405 
1406  // XInterface
1407  virtual css::uno::Any SAL_CALL queryInterface( const css::uno::Type& aType ) override;
1408  virtual void SAL_CALL acquire() noexcept override;
1409  virtual void SAL_CALL release() noexcept override;
1410 
1411  // XServiceInfo
1412  virtual OUString SAL_CALL getImplementationName() override;
1413  virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
1414  virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
1415 
1416  // XInitialization
1417  virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& aArguments ) override;
1418 
1419  // XDispatchProvider
1420  virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch( const css::util::URL& aURL, const OUString& sTargetFrameName , sal_Int32 nSearchFlags ) override;
1421  virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches( const css::uno::Sequence< css::frame::DispatchDescriptor >& lDescriptions ) override;
1422 
1423  // XDispatch
1424  virtual void SAL_CALL dispatch( const css::util::URL& aURL, const css::uno::Sequence< css::beans::PropertyValue >& lArguments ) override;
1425  virtual void SAL_CALL addStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener, const css::util::URL& aURL ) override;
1426  virtual void SAL_CALL removeStatusListener( const css::uno::Reference< css::frame::XStatusListener >& xListener, const css::util::URL& aURL ) override;
1427 
1428 private:
1429 
1430  css::uno::Reference< css::frame::XFrame > m_xFrame;
1431 
1432 };
1433 
1434 FindbarDispatcher::FindbarDispatcher()
1435 {
1436 }
1437 
1438 FindbarDispatcher::~FindbarDispatcher()
1439 {
1440  m_xFrame = nullptr;
1441 }
1442 
1443 // XInterface
1444 css::uno::Any SAL_CALL FindbarDispatcher::queryInterface( const css::uno::Type& aType )
1445 {
1446  css::uno::Any aReturn( ::cppu::queryInterface( aType,
1447  static_cast< css::lang::XServiceInfo* >(this),
1448  static_cast< css::lang::XInitialization* >(this),
1449  static_cast< css::frame::XDispatchProvider* >(this),
1450  static_cast< css::frame::XDispatch* >(this)) );
1451 
1452  if ( aReturn.hasValue() )
1453  return aReturn;
1454 
1455  return OWeakObject::queryInterface( aType );
1456 }
1457 
1458 void SAL_CALL FindbarDispatcher::acquire() noexcept
1459 {
1460  OWeakObject::acquire();
1461 }
1462 
1463 void SAL_CALL FindbarDispatcher::release() noexcept
1464 {
1465  OWeakObject::release();
1466 }
1467 
1468 // XServiceInfo
1469 OUString SAL_CALL FindbarDispatcher::getImplementationName()
1470 {
1471  return "com.sun.star.comp.svx.Impl.FindbarDispatcher";
1472 }
1473 
1474 sal_Bool SAL_CALL FindbarDispatcher::supportsService( const OUString& ServiceName )
1475 {
1476  return cppu::supportsService(this, ServiceName);
1477 }
1478 
1479 css::uno::Sequence< OUString > SAL_CALL FindbarDispatcher::getSupportedServiceNames()
1480 {
1481  return { "com.sun.star.comp.svx.FindbarDispatcher", "com.sun.star.frame.ProtocolHandler" };
1482 }
1483 
1484 // XInitialization
1485 void SAL_CALL FindbarDispatcher::initialize( const css::uno::Sequence< css::uno::Any >& aArguments )
1486 {
1487  if ( aArguments.hasElements() )
1488  aArguments[0] >>= m_xFrame;
1489 }
1490 
1491 // XDispatchProvider
1492 css::uno::Reference< css::frame::XDispatch > SAL_CALL FindbarDispatcher::queryDispatch( const css::util::URL& aURL, const OUString& /*sTargetFrameName*/, sal_Int32 /*nSearchFlags*/ )
1493 {
1494  css::uno::Reference< css::frame::XDispatch > xDispatch;
1495 
1496  if ( aURL.Protocol == "vnd.sun.star.findbar:" )
1497  xDispatch = this;
1498 
1499  return xDispatch;
1500 }
1501 
1502 css::uno::Sequence < css::uno::Reference< css::frame::XDispatch > > SAL_CALL FindbarDispatcher::queryDispatches( const css::uno::Sequence < css::frame::DispatchDescriptor >& seqDescripts )
1503 {
1504  sal_Int32 nCount = seqDescripts.getLength();
1505  css::uno::Sequence < css::uno::Reference < XDispatch > > lDispatcher( nCount );
1506 
1507  std::transform(seqDescripts.begin(), seqDescripts.end(), lDispatcher.getArray(),
1508  [this](const css::frame::DispatchDescriptor& rDescript) -> css::uno::Reference < XDispatch > {
1509  return queryDispatch( rDescript.FeatureURL, rDescript.FrameName, rDescript.SearchFlags ); });
1510 
1511  return lDispatcher;
1512 }
1513 
1514 // XDispatch
1515 void SAL_CALL FindbarDispatcher::dispatch( const css::util::URL& aURL, const css::uno::Sequence < css::beans::PropertyValue >& /*lArgs*/ )
1516 {
1517  //vnd.sun.star.findbar:FocusToFindbar - set cursor to the FindTextFieldControl of the findbar
1518  if ( aURL.Path != "FocusToFindbar" )
1519  return;
1520 
1521  css::uno::Reference< css::beans::XPropertySet > xPropSet(m_xFrame, css::uno::UNO_QUERY);
1522  if(!xPropSet.is())
1523  return;
1524 
1525  css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
1526  css::uno::Any aValue = xPropSet->getPropertyValue("LayoutManager");
1527  aValue >>= xLayoutManager;
1528  if (!xLayoutManager.is())
1529  return;
1530 
1531  static const OUStringLiteral sResourceURL( u"private:resource/toolbar/findbar" );
1532  css::uno::Reference< css::ui::XUIElement > xUIElement = xLayoutManager->getElement(sResourceURL);
1533  if (!xUIElement.is())
1534  {
1535  // show the findbar if necessary
1536  xLayoutManager->createElement( sResourceURL );
1537  xLayoutManager->showElement( sResourceURL );
1538  xUIElement = xLayoutManager->getElement( sResourceURL );
1539  if ( !xUIElement.is() )
1540  return;
1541  }
1542 
1543  css::uno::Reference< css::awt::XWindow > xWindow(xUIElement->getRealInterface(), css::uno::UNO_QUERY);
1544  VclPtr<vcl::Window> pWindow = VCLUnoHelper::GetWindow( xWindow );
1545  ToolBox* pToolBox = static_cast<ToolBox*>(pWindow.get());
1546  pToolBox->set_id("FindBar");
1547  if ( !pToolBox )
1548  return;
1549 
1550  ToolBox::ImplToolItems::size_type nItemCount = pToolBox->GetItemCount();
1551  for ( ToolBox::ImplToolItems::size_type i=0; i<nItemCount; ++i )
1552  {
1553  ToolBoxItemId id = pToolBox->GetItemId(i);
1554  OUString sItemCommand = pToolBox->GetItemCommand(id);
1555  if ( sItemCommand == COMMAND_FINDTEXT )
1556  {
1557  vcl::Window* pItemWin = pToolBox->GetItemWindow( id );
1558  if ( pItemWin )
1559  {
1560  SolarMutexGuard aSolarMutexGuard;
1561  FindTextFieldControl* pFindTextFieldControl = dynamic_cast<FindTextFieldControl*>(pItemWin);
1562  if ( pFindTextFieldControl )
1563  pFindTextFieldControl->SetTextToSelected_Impl();
1564  pItemWin->GrabFocus();
1565  return;
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: */
void SetItemWindowNonInteractive(ToolBoxItemId nItemId, bool bNonInteractive)
OUString get_text(int nIndex) const
Type
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
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
vcl::Window * GetItemWindow(ToolBoxItemId nItemId) const
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)
OUString GetItemCommand(ToolBoxItemId nItemId) const
IMPL_LINK_NOARG(FindTextFieldControl, ActivateHdl, weld::ComboBox &, bool)
constexpr sal_uInt16 KEY_F3
virtual void SAL_CALL acquire() noexcept override
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_svx_MatchCaseToolboxController_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
long Long
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
virtual void SetSizePixel(const Size &rNewSize)
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)
bool ControlHasFocus() const
Reference< XController > xController
EntryMessageType
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
int nCount
OUString SvxResId(TranslateId aId)
Definition: dialmgr.cxx:24
virtual void GetFocus() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
virtual void SAL_CALL release() noexcept override
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
static void RemoveUserEvent(ImplSVEvent *nUserEvent)
std::unique_ptr< svt::AcceleratorExecute > m_pAcc
virtual void dispose() override
static OUString GetSearchLabel()
Definition: srchdlg.cxx:2394
int i
uno_Any a
float u
unsigned char sal_Bool
void GrabFocusToDocument()
SearchLabel
Definition: srchdlg.hxx:73
std::unique_ptr< weld::ComboBox > m_xWidget
void GrabFocus()
vcl::Window * GetParent() const
static void SetSearchLabel(const SearchLabel &rSL)
Definition: srchdlg.cxx:2425
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
void EnableItem(ToolBoxItemId nItemId, bool bEnable=true)
void set_id(const OUString &rID)
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)
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)
vcl::Window * get() const
void append_text(const OUString &rText)
Reference< XModel > xModel
OUString aCommand
constexpr tools::Long getWidth() const
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
std::unique_ptr< weld::Image > m_xWidget
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)
ToolBoxItemId GetItemId(ImplToolItems::size_type nPos) 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
void InitControlBase(weld::Widget *pWidget)