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