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