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