LibreOffice Module sw (master)  1
apphdl.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 <config_features.h>
21 
22 #include <sal/log.hxx>
24 #include <sfx2/dispatch.hxx>
25 #include <sfx2/event.hxx>
26 #include <sfx2/objitem.hxx>
29 #include <svl/eitem.hxx>
30 #include <svl/whiter.hxx>
31 #include <svl/isethint.hxx>
32 #include <svl/stritem.hxx>
33 #include <sfx2/request.hxx>
34 #include <sfx2/fcontnr.hxx>
35 #include <svl/ctloptions.hxx>
36 #include <svtools/colorcfg.hxx>
38 #include <tools/diagnose_ex.h>
39 #include <unotools/useroptions.hxx>
40 #include <com/sun/star/document/UpdateDocMode.hpp>
41 #include <sfx2/docfile.hxx>
42 #include <sfx2/objface.hxx>
43 #include <vcl/settings.hxx>
44 #include <vcl/svapp.hxx>
45 
46 #include <view.hxx>
47 #include <pview.hxx>
48 #include <srcview.hxx>
49 #include <wrtsh.hxx>
50 #include <docsh.hxx>
51 #include <cmdid.h>
52 #include <initui.hxx>
53 #include <uitool.hxx>
54 #include <swmodule.hxx>
55 #include <wview.hxx>
56 #include <usrpref.hxx>
57 #include <gloslst.hxx>
58 #include <glosdoc.hxx>
59 #include <doc.hxx>
62 #include <prtopt.hxx>
63 #include <modcfg.hxx>
64 #include <fontcfg.hxx>
65 #include <barcfg.hxx>
66 #include <navicfg.hxx>
67 #include <uinums.hxx>
68 #include <dbconfig.hxx>
69 #include <mmconfigitem.hxx>
70 #include <strings.hrc>
71 #include <com/sun/star/container/XChild.hpp>
72 #include <com/sun/star/sdbc/XConnection.hpp>
73 #include <com/sun/star/sdb/TextConnectionSettings.hpp>
74 #include <com/sun/star/sdbc/XDataSource.hpp>
75 #include <com/sun/star/task/OfficeRestartManager.hpp>
76 #include <org/freedesktop/PackageKit/SyncDbusSessionHelper.hpp>
77 #include <swabstdlg.hxx>
80 
82 #include <rtl/ref.hxx>
83 
84 using namespace ::com::sun::star;
85 
86 // Slotmaps for the application's methods
87 
88 // here are the SlotID's being included
89 // see Idl-file
90 #define ShellClass_SwModule
91 #include <sfx2/msg.hxx>
92 #include <swslots.hxx>
93 
95 
96 void SwModule::InitInterface_Impl()
97 {
98  GetStaticInterface()->RegisterStatusBar(StatusBarId::WriterStatusBar);
99 
100  GetStaticInterface()->RegisterObjectBar(SFX_OBJECTBAR_APPLICATION,
101  SfxVisibilityFlags::Standard | SfxVisibilityFlags::Client | SfxVisibilityFlags::Viewer,
102  ToolbarId::Module_Toolbox);
103 }
104 
105 // other states
107 {
108  SfxWhichIter aIter(rSet);
109  sal_uInt16 nWhich = aIter.FirstWhich();
110 
111  SwView* pActView = ::GetActiveView();
112  bool bWebView = dynamic_cast<SwWebView*>( pActView ) != nullptr;
113 
114  while(nWhich)
115  {
116  switch(nWhich)
117  {
118  case FN_BUSINESS_CARD:
119  case FN_LABEL:
120  case FN_ENVELOP:
121  {
122  bool bDisable = false;
123  SfxViewShell* pCurrView = SfxViewShell::Current();
124  if( !pCurrView || dynamic_cast< const SwView *>( pCurrView ) == nullptr )
125  bDisable = true;
126  SwDocShell *pDocSh = static_cast<SwDocShell*>( SfxObjectShell::Current());
127  if ( bDisable ||
128  (pDocSh && (pDocSh->IsReadOnly() ||
129  pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED)) )
130  rSet.DisableItem( nWhich );
131 
132  }
133  break;
134  case FN_XFORMS_INIT:
135  // slot is always active!
136  break;
137  case FN_EDIT_FORMULA:
138  {
139  SwWrtShell* pSh = nullptr;
140  SelectionType nSelection = SelectionType::NONE;
141  if( pActView )
142  pSh = &pActView->GetWrtShell();
143  if( pSh )
144  nSelection = pSh->GetSelectionType();
145 
146  if( (pSh && pSh->HasSelection()) ||
147  !(nSelection & (SelectionType::Text | SelectionType::Table)))
148  rSet.DisableItem(nWhich);
149  }
150  break;
151  case SID_ATTR_METRIC:
152  rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, static_cast< sal_uInt16 >(::GetDfltMetric(bWebView))));
153  break;
155  rSet.Put( SfxBoolItem( nWhich, m_pModuleConfig->
156  IsInsTableFormatNum( bWebView )));
157  break;
162  {
163  SwView* pView = ::GetActiveView();
164  std::shared_ptr<SwMailMergeConfigItem> xConfigItem;
165  if (pView)
166  xConfigItem = pView->GetMailMergeConfigItem();
167  if (!xConfigItem)
168  rSet.DisableItem(nWhich);
169  else if (xConfigItem->GetConnection().is()
170  && !xConfigItem->GetConnection()->isClosed())
171  {
172  bool bFirst, bLast;
173  bool bValid = xConfigItem->IsResultSetFirstLast(bFirst, bLast);
174 
175  if (!bValid ||
176  (bFirst && (nWhich == FN_MAILMERGE_FIRST_ENTRY || nWhich == FN_MAILMERGE_PREV_ENTRY)) ||
177  (bLast && (nWhich == FN_MAILMERGE_LAST_ENTRY || nWhich == FN_MAILMERGE_NEXT_ENTRY)))
178  {
179  rSet.DisableItem(nWhich);
180  }
181  }
182  }
183  break;
186  {
187  // just trigger calling statusChanged() of MMExcludeEntryController
188  // resp. MMCurrentEntryController
189  rSet.InvalidateItem(nWhich);
190  }
191  break;
196  {
197  SwView* pView = ::GetActiveView();
198  std::shared_ptr<SwMailMergeConfigItem> xConfigItem;
199  bool bUnLockDispatcher = false;
200  SfxDispatcher* pDispatcher = nullptr;
201  if (pView)
202  {
203  xConfigItem = pView->EnsureMailMergeConfigItem();
204 
205  // tdf#121607 lock the dispatcher while processing
206  // this request, and release it afterwards,
207  // that means that if this request pops up a dialog
208  // any other pending requests will be deferred
209  // until this request is finished, i.e. they won't
210  // be dispatched by the dispatcher timeout until
211  // unlock is called, serializing the password dialogs
212  pDispatcher = pView->GetViewFrame()->GetDispatcher();
213  if (!pDispatcher->IsLocked())
214  {
215  pDispatcher->Lock(true);
216  bUnLockDispatcher = true;
217  }
218  }
219 
220  // #i51949# hide e-Mail option if e-Mail is not supported
221  // #i63267# printing might be disabled
222  if (!xConfigItem ||
223  !xConfigItem->GetConnection().is() ||
224  xConfigItem->GetConnection()->isClosed() ||
225  !xConfigItem->GetResultSet().is() ||
226  xConfigItem->GetCurrentDBData().sDataSource.isEmpty() ||
227  xConfigItem->GetCurrentDBData().sCommand.isEmpty() ||
229  (nWhich == FN_MAILMERGE_EMAIL_DOCUMENTS && !xConfigItem->IsMailAvailable()))
230  {
231  rSet.DisableItem(nWhich);
232  }
233 
234  if (bUnLockDispatcher)
235  pDispatcher->Lock(false);
236  }
237  break;
238  default:
239  OSL_FAIL("::StateOther: default");
240  }
241  nWhich = aIter.NextWhich();
242  }
243 }
244 
245 // start field dialog
246 static void NewXForms( SfxRequest& rReq ); // implementation: below
247 
248 std::shared_ptr<SwMailMergeConfigItem> SwView::EnsureMailMergeConfigItem(const SfxItemSet* pArgs)
249 {
250  // create if it does not exist yet
251  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = GetMailMergeConfigItem();
252  if (!xMMConfig)
253  {
254  xMMConfig.reset(new SwMailMergeConfigItem);
255  xMMConfig->SetSourceView(this);
256 
257  //set the first used database as default source on the config item
258  const SfxPoolItem* pItem = nullptr;
259  if (pArgs && SfxItemState::SET == pArgs->GetItemState(
260  FN_PARAM_DATABASE_PROPERTIES, false, &pItem))
261  {
262  //mailmerge has been called from the database beamer
263  uno::Sequence< beans::PropertyValue> aDBValues;
264  if (static_cast<const SfxUnoAnyItem*>(pItem)->GetValue() >>= aDBValues)
265  {
266  SwDBData aDBData;
267  svx::ODataAccessDescriptor aDescriptor(aDBValues);
269  aDescriptor[svx::DataAccessDescriptorProperty::Command] >>= aDBData.sCommand;
271 
272  uno::Reference< sdbc::XConnection> xConnection;
273  uno::Reference< sdbc::XDataSource> xSource;
274  uno::Reference< sdbcx::XColumnsSupplier> xColumnsSupplier;
276  aDescriptor[svx::DataAccessDescriptorProperty::Connection] >>= xConnection;
277  uno::Reference<container::XChild> xChild(xConnection, uno::UNO_QUERY);
278  if (xChild.is())
279  xSource.set(xChild->getParent(), uno::UNO_QUERY);
280  xMMConfig->SetCurrentConnection(
282  xColumnsSupplier, aDBData);
283  }
284  }
285  else
286  {
287  std::vector<OUString> aDBNameList;
288  std::vector<OUString> aAllDBNames;
289  GetWrtShell().GetAllUsedDB(aDBNameList, &aAllDBNames);
290  if (!aDBNameList.empty())
291  {
292  OUString sDBName(aDBNameList[0]);
293  SwDBData aDBData;
294  sal_Int32 nIdx{ 0 };
295  aDBData.sDataSource = sDBName.getToken(0, DB_DELIM, nIdx);
296  aDBData.sCommand = sDBName.getToken(0, DB_DELIM, nIdx);
297  aDBData.nCommandType = sDBName.getToken(0, DB_DELIM, nIdx).toInt32();
298  //set the currently used database for the wizard
299  xMMConfig->SetCurrentDBData(aDBData);
300  }
301  }
302 
303  SetMailMergeConfigItem(xMMConfig);
304  }
305  return xMMConfig;
306 }
307 
308 #if HAVE_FEATURE_DBCONNECTIVITY
309 
310 namespace
311 {
312 
313 SwView* lcl_LoadDoc(SwView* pView, const OUString& rURL)
314 {
315  SwView* pNewView = nullptr;
316  if(!rURL.isEmpty())
317  {
318  SfxStringItem aURL(SID_FILE_NAME, rURL);
319  SfxStringItem aTargetFrameName( SID_TARGETNAME, "_blank" );
320  SfxBoolItem aHidden( SID_HIDDEN, true );
321  SfxStringItem aReferer(SID_REFERER, pView->GetDocShell()->GetTitle());
322  const SfxObjectItem* pItem = static_cast<const SfxObjectItem*>(
323  pView->GetViewFrame()->GetDispatcher()->ExecuteList(SID_OPENDOC,
324  SfxCallMode::SYNCHRON,
325  { &aURL, &aHidden, &aReferer, &aTargetFrameName }));
326  SfxShell* pShell = pItem ? pItem->GetShell() : nullptr;
327 
328  if(pShell)
329  {
330  SfxViewShell* pViewShell = pShell->GetViewShell();
331  if(pViewShell)
332  {
333  if ((pNewView = dynamic_cast<SwView*>(pViewShell)))
334  {
335  pNewView->GetViewFrame()->GetFrame().Appear();
336  }
337  else
338  {
339  pViewShell->GetViewFrame()->DoClose();
340  }
341  }
342  }
343  }
344  else
345  {
346  SfxStringItem aFactory(SID_NEWDOCDIRECT, SwDocShell::Factory().GetFilterContainer()->GetName());
347  const SfxFrameItem* pItem = static_cast<const SfxFrameItem*>(
349  SID_NEWDOCDIRECT, SfxCallMode::SYNCHRON, { &aFactory }));
350  SfxFrame* pFrame = pItem ? pItem->GetFrame() : nullptr;
351  SfxViewFrame* pViewFrame = pFrame ? pFrame->GetCurrentViewFrame() : nullptr;
352  pNewView = pViewFrame ? dynamic_cast<SwView*>( pViewFrame->GetViewShell() ) : nullptr;
353  }
354 
355  return pNewView;
356 }
357 
358 class SwMailMergeWizardExecutor : public salhelper::SimpleReferenceObject
359 {
360  SwView* m_pView; // never owner
361  SwView* m_pView2Close; // never owner
362  VclPtr<AbstractMailMergeWizard> m_pWizard; // always owner
363  VclPtr<AbstractMailMergeWizard> m_pWizardToDestroyInCallback;
364 
365  void EndDialogHdl(sal_Int32 nResponse);
366  DECL_LINK( DestroyDialogHdl, void*, void );
367  DECL_LINK( DestroyWizardHdl, void*, void );
368  DECL_LINK( CancelHdl, void*, void );
369  DECL_LINK( CloseFrameHdl, void*, void );
370 
371  void ExecutionFinished();
372  void ExecuteWizard();
373 
374 public:
375  SwMailMergeWizardExecutor();
376  virtual ~SwMailMergeWizardExecutor() override;
377 
378  void ExecuteMailMergeWizard( const SfxItemSet * pArgs );
379 };
380 
381 SwMailMergeWizardExecutor::SwMailMergeWizardExecutor()
382  : m_pView( nullptr ),
383  m_pView2Close( nullptr ),
384  m_pWizard( nullptr )
385 {
386 }
387 
388 SwMailMergeWizardExecutor::~SwMailMergeWizardExecutor()
389 {
390  OSL_ENSURE( m_pWizard == nullptr, "SwMailMergeWizardExecutor: m_pWizard must be Null!" );
391 }
392 
393 bool lcl_hasAllComponentsAvailable()
394 {
395  try
396  {
397  return css::sdb::TextConnectionSettings::create(comphelper::getProcessComponentContext()).is();
398  }
399  catch (const css::uno::Exception &)
400  {
402  "sw.core", "assuming Base to be missing; caught ");
403  return false;
404  }
405 }
406 
407 void SwMailMergeWizardExecutor::ExecuteMailMergeWizard( const SfxItemSet * pArgs )
408 {
409  if(!lcl_hasAllComponentsAvailable())
410  {
411  try
412  {
413  using namespace org::freedesktop::PackageKit;
414  using namespace svtools;
415  css::uno::Reference< XSyncDbusSessionHelper > xSyncDbusSessionHelper(SyncDbusSessionHelper::create(comphelper::getProcessComponentContext()));
416  const css::uno::Sequence< OUString > vPackages{ "libreoffice-base" };
417  xSyncDbusSessionHelper->InstallPackageNames(vPackages, OUString());
418  SolarMutexGuard aGuard;
419  executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, RESTART_REASON_MAILMERGE_INSTALL);
420  }
421  catch (const css::uno::Exception &)
422  {
424  "sw.core",
425  "trying to install LibreOffice Base, caught");
426  auto xRestartManager
428  if (!xRestartManager->isRestartRequested(false))
429  {
430  // Base is absent, and could not initiate its install - ask user to do that manually
431  // Only show the dialog if restart is not initiated yet
432  std::unique_ptr<weld::MessageDialog> xWarnBox(Application::CreateMessageDialog(
433  nullptr, VclMessageType::Info, VclButtonsType::Ok,
434  SwResId(STR_NO_BASE_FOR_MERGE)));
435  xWarnBox->run();
436  }
437  }
438  return;
439  }
440  if ( m_pView )
441  {
442  OSL_FAIL("SwMailMergeWizardExecutor::ExecuteMailMergeWizard: Already executing the wizard!" );
443  return;
444  }
445 
446  m_pView = ::GetActiveView();
447  if (!m_pView)
448  return;
449 
450  // keep self alive until done.
451  acquire();
452 
453  // create if it does not exist yet
454  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->EnsureMailMergeConfigItem(pArgs);
455 
457  m_pWizard = pFact->CreateMailMergeWizard(*m_pView, xMMConfig);
458 
459  ExecuteWizard();
460 }
461 
462 void SwMailMergeWizardExecutor::ExecutionFinished()
463 {
464  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
465  if (xMMConfig)
466  xMMConfig->Commit();
467 
468  SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
469  if (pDoc)
470  {
471  SwDBManager* pDbManager = pDoc->GetDBManager();
472  if (pDbManager)
473  pDbManager->CommitLastRegistrations();
474 
475  // Show the toolbar
476  m_pView->ShowUIElement("private:resource/toolbar/mailmerge");
477 
478  // Update Mail Merge controls
479  const sal_uInt16 slotIds[] = { FN_MAILMERGE_FIRST_ENTRY,
489  0 };
490  m_pView->GetViewFrame()->GetBindings().Invalidate(slotIds);
491  }
492 
493  // release/destroy asynchronously
494  Application::PostUserEvent( LINK( this, SwMailMergeWizardExecutor, DestroyDialogHdl ) );
495 }
496 
497 void SwMailMergeWizardExecutor::ExecuteWizard()
498 {
499  m_pWizard->StartExecuteAsync([this](sal_Int32 nResult){
500  EndDialogHdl(nResult);
501  });
502 }
503 
504 void SwMailMergeWizardExecutor::EndDialogHdl(sal_Int32 nRet)
505 {
506  sal_uInt16 nRestartPage = m_pWizard->GetRestartPage();
507 
508  switch ( nRet )
509  {
510  case RET_LOAD_DOC:
511  {
512  SwView* pNewView = lcl_LoadDoc(m_pView, m_pWizard->GetReloadDocument());
513 
514  // Destroy wizard asynchronously, since we are deep inside the wizard and dialog
515  // machinery code here
516  m_pWizardToDestroyInCallback = m_pWizard;
518  LINK( this, SwMailMergeWizardExecutor, DestroyWizardHdl ), nullptr );
519 
521  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
522  if (pNewView)
523  {
524  pNewView->SetMailMergeConfigItem(xMMConfig);
525  m_pView = pNewView;
526  xMMConfig->DocumentReloaded();
527  //new source view!
528  xMMConfig->SetSourceView( m_pView );
529  m_pWizard = pFact->CreateMailMergeWizard(*m_pView, xMMConfig);
530  m_pWizard->ShowPage( nRestartPage );
531  }
532  else
533  {
534  m_pWizard = pFact->CreateMailMergeWizard(*m_pView, xMMConfig);
535  }
536 
537  // execute the wizard again
538  ExecuteWizard();
539  break;
540  }
541  case RET_TARGET_CREATED:
542  {
543  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
544  SwView* pTargetView = xMMConfig->GetTargetView();
545  OSL_ENSURE(pTargetView, "No target view has been created");
546  if(pTargetView)
547  {
548  // destroy wizard asynchronously
549  m_pWizardToDestroyInCallback = m_pWizard;
551  LINK( this, SwMailMergeWizardExecutor, DestroyWizardHdl ), nullptr );
552 
554  m_pWizard = pFact->CreateMailMergeWizard(*pTargetView, xMMConfig);
555  m_pWizard->ShowPage( nRestartPage );
556 
557  // execute the wizard again
558  ExecuteWizard();
559  }
560  else
561  {
562  // should not happen - just in case no target view has been created
563  ExecutionFinished();
564  }
565  break;
566  }
567  case RET_REMOVE_TARGET:
568  {
569  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
570  SwView* pTargetView = xMMConfig->GetTargetView();
571  SwView* pSourceView = xMMConfig->GetSourceView();
572  OSL_ENSURE(pTargetView && pSourceView, "source or target view not available" );
573  if(pTargetView && pSourceView)
574  {
575  m_pView2Close = pTargetView;
576  pTargetView->GetViewFrame()->GetTopViewFrame()->GetWindow().Hide();
577  pSourceView->GetViewFrame()->GetFrame().AppearWithUpdate();
578  // the current view has be set when the target is destroyed
579  m_pView = pSourceView;
580  xMMConfig->SetTargetView(nullptr);
581 
582  // destroy wizard asynchronously
583  m_pWizardToDestroyInCallback = m_pWizard;
585  LINK( this, SwMailMergeWizardExecutor, CloseFrameHdl ), m_pWizard );
586 
588  m_pWizard = pFact->CreateMailMergeWizard(*pSourceView, xMMConfig);
589  m_pWizard->ShowPage( nRestartPage );
590 
591  // execute the wizard again
592  ExecuteWizard();
593  }
594  else
595  {
596  // should not happen - just in case no target view has been created
597  ExecutionFinished();
598  }
599  break;
600  }
601  case RET_CANCEL:
602  {
603  // close frame and destroy wizard asynchronously
605  LINK( this, SwMailMergeWizardExecutor, CancelHdl ), m_pWizard );
606  break;
607  }
608  default: // finish
609  {
610  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
611  SwView* pSourceView = xMMConfig.get() ? xMMConfig->GetSourceView() : nullptr;
612  if(pSourceView)
613  {
614  xMMConfig->GetSourceView()->GetViewFrame()->GetFrame().Appear();
615  }
616  ExecutionFinished();
617  break;
618  }
619 
620  } // switch
621 }
622 
623 IMPL_LINK_NOARG(SwMailMergeWizardExecutor, DestroyDialogHdl, void*, void)
624 {
625  m_pWizard.disposeAndClear();
626 
627  release();
628 }
629 
630 IMPL_LINK_NOARG(SwMailMergeWizardExecutor, DestroyWizardHdl, void*, void)
631 {
632  m_pWizardToDestroyInCallback.disposeAndClear();
633 }
634 
635 IMPL_LINK_NOARG(SwMailMergeWizardExecutor, CancelHdl, void*, void)
636 {
637  std::shared_ptr<SwMailMergeConfigItem> xMMConfig = m_pView->GetMailMergeConfigItem();
638  if (xMMConfig)
639  {
640  if (xMMConfig->GetTargetView())
641  {
642  xMMConfig->GetTargetView()->GetViewFrame()->DoClose();
643  xMMConfig->SetTargetView(nullptr);
644  }
645  if (xMMConfig->GetSourceView())
646  {
647  auto pViewFrame(xMMConfig->GetSourceView()->GetViewFrame());
648  pViewFrame->GetFrame().AppearWithUpdate();
649  }
650  xMMConfig->Commit();
651  }
652 
653  // Revoke created connections
654  SwDoc* pDoc = m_pView->GetDocShell()->GetDoc();
655  SwDBManager* pDbManager = pDoc->GetDBManager();
656  if (pDbManager)
657  pDbManager->RevokeLastRegistrations();
658 
659  m_pWizard.disposeAndClear();
660  release();
661 }
662 
663 IMPL_LINK_NOARG(SwMailMergeWizardExecutor, CloseFrameHdl, void*, void)
664 {
665  if ( m_pView2Close )
666  {
667  m_pView2Close->GetViewFrame()->DoClose();
668  m_pView2Close = nullptr;
669  }
670  m_pWizardToDestroyInCallback.disposeAndClear();
671 }
672 } // namespace
673 
674 #endif // HAVE_FEATURE_DBCONNECTIVITY
675 
677 {
678  const SfxItemSet *pArgs = rReq.GetArgs();
679  const SfxPoolItem* pItem = nullptr;
680 
681  sal_uInt16 nWhich = rReq.GetSlot();
682  switch (nWhich)
683  {
684  case FN_ENVELOP:
685  InsertEnv( rReq );
686  break;
687 
688  case FN_BUSINESS_CARD:
689  case FN_LABEL:
690  InsertLab(rReq, nWhich == FN_LABEL);
691  break;
692 
693  case FN_XFORMS_INIT:
694  NewXForms( rReq );
695  break;
696 
697  case SID_ATTR_METRIC:
698  if(pArgs && SfxItemState::SET == pArgs->GetItemState(nWhich, false, &pItem))
699  {
700  FieldUnit eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
701  switch( eUnit )
702  {
703  case FieldUnit::MM:
704  case FieldUnit::CM:
705  case FieldUnit::INCH:
706  case FieldUnit::PICA:
707  case FieldUnit::POINT:
708  {
709  SwView* pActView = ::GetActiveView();
710  bool bWebView = dynamic_cast<SwWebView*>( pActView ) != nullptr;
711  ::SetDfltMetric(eUnit, bWebView);
712  }
713  break;
714  default:;//prevent warning
715  }
716  }
717  break;
718 
720  {
721  bool bWebView = dynamic_cast<SwWebView*>( ::GetActiveView() )!= nullptr ,
722  bSet;
723 
724  if( pArgs && SfxItemState::SET == pArgs->GetItemState(
725  nWhich, false, &pItem ))
726  bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue();
727  else
728  bSet = !m_pModuleConfig->IsInsTableFormatNum( bWebView );
729 
730  m_pModuleConfig->SetInsTableFormatNum( bWebView, bSet );
731  }
732  break;
733 #if HAVE_FEATURE_DBCONNECTIVITY
734  case FN_MAILMERGE_WIZARD:
735  {
736  // show the mailmerge wizard
737  rtl::Reference< SwMailMergeWizardExecutor > xEx( new SwMailMergeWizardExecutor );
738  xEx->ExecuteMailMergeWizard( pArgs );
739  }
740  break;
746  {
747  SwView* pView = ::GetActiveView();
748  const std::shared_ptr<SwMailMergeConfigItem>& xConfigItem = pView->GetMailMergeConfigItem();
749  if (!xConfigItem)
750  return;
751 
752  const bool bHadConnection
753  = xConfigItem->GetConnection().is() && !xConfigItem->GetConnection()->isClosed();
754 
755  sal_Int32 nPos = xConfigItem->GetResultSetPosition();
756  switch (nWhich)
757  {
758  case FN_MAILMERGE_FIRST_ENTRY: xConfigItem->MoveResultSet(1); break;
759  case FN_MAILMERGE_PREV_ENTRY: xConfigItem->MoveResultSet(nPos - 1); break;
760  case FN_MAILMERGE_NEXT_ENTRY: xConfigItem->MoveResultSet(nPos + 1); break;
761  case FN_MAILMERGE_LAST_ENTRY: xConfigItem->MoveResultSet(-1); break;
762  case FN_MAILMERGE_CURRENT_ENTRY: /* don't move the result set, just update the document */ break;
763  default: break;
764  }
765 
766  // now the record has to be merged into the source document
767  // TODO can we re-use PerformMailMerge() here somehow?
768  const SwDBData& rDBData = xConfigItem->GetCurrentDBData();
769  uno::Sequence<uno::Any> vSelection({ uno::makeAny(xConfigItem->GetResultSetPosition()) });
771  {"Selection", uno::makeAny(vSelection)},
772  {"DataSourceName", uno::makeAny(rDBData.sDataSource)},
773  {"Command", uno::makeAny(rDBData.sCommand)},
774  {"CommandType", uno::makeAny(rDBData.nCommandType)},
775  {"ActiveConnection", uno::makeAny(xConfigItem->GetConnection().getTyped())},
776  {"Filter", uno::makeAny(xConfigItem->GetFilter())},
777  {"Cursor", uno::makeAny(xConfigItem->GetResultSet())}
778  }));
779 
780  SwWrtShell& rSh = pView->GetWrtShell();
781  SwMergeDescriptor aMergeDesc(DBMGR_MERGE, rSh, aDescriptor);
782  rSh.GetDBManager()->Merge(aMergeDesc);
783 
784  // update enabled / disabled status of the buttons in the toolbar
785  SfxBindings& rBindings = rSh.GetView().GetViewFrame()->GetBindings();
792  if (!bHadConnection && xConfigItem->GetConnection().is()
793  && !xConfigItem->GetConnection()->isClosed())
794  {
795  // The connection has been activated. Update controls that were disabled
800  }
801  rBindings.Update();
802  }
803  break;
805  {
806  std::shared_ptr<SwMailMergeConfigItem> xConfigItem = SwDBManager::PerformMailMerge(GetActiveView());
807 
808  if (xConfigItem && xConfigItem->GetTargetView())
809  xConfigItem->GetTargetView()->GetViewFrame()->GetFrame().Appear();
810  }
811  break;
815  {
816  std::shared_ptr<SwMailMergeConfigItem> xConfigItem = GetActiveView()->GetMailMergeConfigItem();
817  if(!xConfigItem)
818  return;
819  xConfigItem->SetTargetView(nullptr);
821  switch (nWhich)
822  {
826  }
827  }
828  break;
829 #endif
830  }
831 }
832 
833 // Catch notifications
834 
835 // Catch hint for DocInfo
836 void SwModule::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
837 {
838  if( const SfxEventHint* pEvHint = dynamic_cast<const SfxEventHint*>( &rHint) )
839  {
840  SwDocShell* pDocSh = dynamic_cast<SwDocShell*>( pEvHint->GetObjShell() );
841  if( pDocSh )
842  {
843  SwWrtShell* pWrtSh = pDocSh->GetWrtShell();
844  switch( pEvHint->GetEventId() )
845  {
846  case SfxEventHintId::LoadFinished:
847  // if it is a new document created from a template,
848  // update fixed fields
849  if (pDocSh->GetMedium())
850  {
851  const SfxBoolItem* pTemplateItem = SfxItemSet::GetItem<SfxBoolItem>(pDocSh->GetMedium()->GetItemSet(), SID_TEMPLATE, false);
852  if (pTemplateItem && pTemplateItem->GetValue())
853  {
854  // assume that not calling via SwEditShell::SetFixFields
855  // is allowed, because the shell hasn't been created yet
856  assert(!pWrtSh);
857  pDocSh->GetDoc()->getIDocumentFieldsAccess().SetFixFields(nullptr);
858  }
859  }
860  break;
861  case SfxEventHintId::CreateDoc:
862  // Update all FIX-Date/Time fields
863  if( pWrtSh )
864  {
865  const SfxUInt16Item* pUpdateDocItem = SfxItemSet::GetItem<SfxUInt16Item>(pDocSh->GetMedium()->GetItemSet(), SID_UPDATEDOCMODE, false);
866  bool bUpdateFields = true;
867  if( pUpdateDocItem && pUpdateDocItem->GetValue() == document::UpdateDocMode::NO_UPDATE)
868  bUpdateFields = false;
869  if(bUpdateFields)
870  {
871  comphelper::dispatchCommand(".uno:UpdateInputFields", {});
872 
873  // Are database fields contained?
874  // Get all used databases for the first time
875  SwDoc *pDoc = pDocSh->GetDoc();
876  std::vector<OUString> aDBNameList;
877  pDoc->GetAllUsedDB( aDBNameList );
878  if(!aDBNameList.empty())
879  { // Open database beamer
880  ShowDBObj(pWrtSh->GetView(), pDoc->GetDBData());
881  }
882  }
883  }
884  break;
885  default: break;
886  }
887  }
888  }
889  else if(const SfxItemSetHint* pSfxItemSetHint = dynamic_cast<const SfxItemSetHint*>(&rHint))
890  {
891  if( SfxItemState::SET == pSfxItemSetHint->GetItemSet().GetItemState(SID_ATTR_PATHNAME))
892  {
893  ::GetGlossaries()->UpdateGlosPath( false );
895  if(pList->IsActive())
896  pList->Update();
897  }
898  }
899  else
900  {
901  if (rHint.GetId() == SfxHintId::Deinitializing)
902  {
903  m_pWebUsrPref.reset();
904  m_pUsrPref.reset();
905  m_pModuleConfig.reset();
906  m_pPrintOptions.reset();
907  m_pWebPrintOptions.reset();
908  m_pChapterNumRules.reset();
909  m_pStdFontConfig.reset();
910  m_pNavigationConfig.reset();
911  m_pToolbarConfig.reset();
912  m_pWebToolbarConfig.reset();
913  m_pDBConfig.reset();
914  if( m_pColorConfig )
915  {
916  m_pColorConfig->RemoveListener(this);
917  m_pColorConfig.reset();
918  }
920  {
921  m_pAccessibilityOptions->RemoveListener(this);
922  m_pAccessibilityOptions.reset();
923  }
924  if( m_pCTLOptions )
925  {
926  m_pCTLOptions->RemoveListener(this);
927  m_pCTLOptions.reset();
928  }
929  if( m_pUserOptions )
930  {
931  m_pUserOptions->RemoveListener(this);
932  m_pUserOptions.reset();
933  }
934  }
935  }
936 }
937 
939 {
940  if( pBrdCst == m_pUserOptions.get() )
941  {
942  m_bAuthorInitialised = false;
943  }
944  else if ( pBrdCst == m_pColorConfig.get() || pBrdCst == m_pAccessibilityOptions.get() )
945  {
946  bool bAccessibility = false;
947  if( pBrdCst == m_pColorConfig.get() )
949  else
950  bAccessibility = true;
951 
952  //invalidate all edit windows
953  SfxViewShell* pViewShell = SfxViewShell::GetFirst();
954  while(pViewShell)
955  {
956  if(pViewShell->GetWindow())
957  {
958  if(dynamic_cast< const SwView *>( pViewShell ) != nullptr ||
959  dynamic_cast< const SwPagePreview *>( pViewShell ) != nullptr ||
960  dynamic_cast< const SwSrcView *>( pViewShell ) != nullptr)
961  {
962  if(bAccessibility)
963  {
964  if(dynamic_cast< const SwView *>( pViewShell ) != nullptr)
965  static_cast<SwView*>(pViewShell)->ApplyAccessibilityOptions(*m_pAccessibilityOptions);
966  else if(dynamic_cast< const SwPagePreview *>( pViewShell ) != nullptr)
967  static_cast<SwPagePreview*>(pViewShell)->ApplyAccessibilityOptions(*m_pAccessibilityOptions);
968  }
969  pViewShell->GetWindow()->Invalidate();
970  }
971  }
972  pViewShell = SfxViewShell::GetNext( *pViewShell );
973  }
974  }
975  else if( pBrdCst == m_pCTLOptions.get() )
976  {
977  const SfxObjectShell* pObjSh = SfxObjectShell::GetFirst();
978  while( pObjSh )
979  {
980  if( auto pDocShell = dynamic_cast<const SwDocShell*>(pObjSh) )
981  {
982  SwDoc* pDoc = const_cast<SwDocShell*>(pDocShell)->GetDoc();
984  if ( pVSh )
985  pVSh->ChgNumberDigits();
986  }
987  pObjSh = SfxObjectShell::GetNext(*pObjSh);
988  }
989  }
990 
991 }
992 
994 {
995  if(!m_pDBConfig)
996  m_pDBConfig.reset(new SwDBConfig);
997  return m_pDBConfig.get();
998 }
999 
1001 {
1002  if(!m_pColorConfig)
1003  {
1006  m_pColorConfig->AddListener(this);
1007  }
1008  return *m_pColorConfig;
1009 }
1010 
1012 {
1014  {
1016  m_pAccessibilityOptions->AddListener(this);
1017  }
1018  return *m_pAccessibilityOptions;
1019 }
1020 
1022 {
1023  if(!m_pCTLOptions)
1024  {
1025  m_pCTLOptions.reset(new SvtCTLOptions);
1026  m_pCTLOptions->AddListener(this);
1027  }
1028  return *m_pCTLOptions;
1029 }
1030 
1032 {
1033  if(!m_pUserOptions)
1034  {
1035  m_pUserOptions.reset(new SvtUserOptions);
1036  m_pUserOptions->AddListener(this);
1037  }
1038  return *m_pUserOptions;
1039 }
1040 
1041 const SwMasterUsrPref *SwModule::GetUsrPref(bool bWeb) const
1042 {
1043  SwModule* pNonConstModule = const_cast<SwModule*>(this);
1044  if(bWeb && !m_pWebUsrPref)
1045  {
1046  // The SpellChecker is needed in SwMasterUsrPref's Load, but it must not
1047  // be created there #58256#
1048  pNonConstModule->m_pWebUsrPref.reset(new SwMasterUsrPref(true));
1049  }
1050  else if(!bWeb && !m_pUsrPref)
1051  {
1052  pNonConstModule->m_pUsrPref.reset(new SwMasterUsrPref(false));
1053  }
1054  return bWeb ? m_pWebUsrPref.get() : m_pUsrPref.get();
1055 }
1056 
1057 void NewXForms( SfxRequest& rReq )
1058 {
1059  // copied & excerpted from SwModule::InsertLab(..)
1060 
1061  // create new document
1062  SfxObjectShellLock xDocSh( new SwDocShell( SfxObjectCreateMode::STANDARD) );
1063  xDocSh->DoInitNew();
1064 
1065  // initialize XForms
1066  static_cast<SwDocShell*>( &xDocSh )->GetDoc()->initXForms( true );
1067 
1068  // load document into frame
1069  SfxViewFrame::DisplayNewDocument( *xDocSh, rReq );
1070 
1071  // set return value
1072  rReq.SetReturnValue( SfxVoidItem( rReq.GetSlot() ) );
1073 }
1074 
1075 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SfxViewFrame * GetViewFrame() const
bool GetValue() const
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
Definition: swmodul1.cxx:373
ConfigurationHints
void Appear()
SvtAccessibilityOptions & GetAccessibilityOptions()
Definition: apphdl.cxx:1011
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
void RevokeLastRegistrations()
Revoke not committed registrations in case of mail merge cancel.
Definition: dbmgr.cxx:3320
FieldUnit
sal_Int32 nCommandType
Definition: swdbdata.hxx:32
#define FN_MAILMERGE_EXCLUDE_ENTRY
Definition: cmdid.h:230
#define FN_MAILMERGE_SAVE_DOCUMENTS
Definition: cmdid.h:235
void SetMailMergeConfigItem(std::shared_ptr< SwMailMergeConfigItem > const &rConfigItem)
Definition: view0.cxx:133
#define SFX_IMPL_INTERFACE(Class, SuperClass)
std::shared_ptr< SwMailMergeConfigItem > EnsureMailMergeConfigItem(const SfxItemSet *pArgs=nullptr)
Definition: apphdl.cxx:248
OUString GetTitle(sal_uInt16 nMaxLen=0) const
SwView * GetActiveView()
Definition: swmodul1.cxx:123
#define FN_ENVELOP
Definition: cmdid.h:723
#define RET_TARGET_CREATED
Definition: swabstdlg.hxx:345
std::unique_ptr< SwDBConfig > m_pDBConfig
Definition: swmodule.hxx:90
SwDocShell * GetDocShell()
Definition: doc.hxx:1341
SfxFrame * GetFrame() const
std::shared_ptr< SwMailMergeConfigItem > const & GetMailMergeConfigItem() const
Definition: view0.cxx:139
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
Definition: apphdl.cxx:836
std::string GetValue
View of a document.
Definition: pview.hxx:161
SfxDispatcher * GetDispatcher()
void Update()
Definition: gloslst.cxx:226
#define RET_LOAD_DOC
Definition: swabstdlg.hxx:344
OUString sDataSource
Definition: swdbdata.hxx:30
static const AllSettings & GetSettings()
static void NewXForms(SfxRequest &rReq)
Definition: apphdl.cxx:1057
#define FN_MAILMERGE_NEXT_ENTRY
Definition: cmdid.h:227
Definition: doc.hxx:185
sal_uInt16 GetValue() const
void InvalidateItem(sal_uInt16 nWhich)
sal_uInt16 FirstWhich()
static ImplSVEvent * PostUserEvent(const Link< void *, void > &rLink, void *pCaller=nullptr, bool bReferenceLink=false)
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pWebUsrPref
Definition: swmodule.hxx:82
Data records in fields.
Definition: dbmgr.hxx:87
static SfxObjectShell * Current()
const SwMasterUsrPref * GetUsrPref(bool bWeb) const
Definition: apphdl.cxx:1041
::utl::SharedUNOComponent< css::sdbc::XConnection > SharedConnection
#define FN_EDIT_FORMULA
Definition: cmdid.h:76
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
std::unique_ptr< SwChapterNumRules > m_pChapterNumRules
Definition: swmodule.hxx:85
static SfxViewFrame * DisplayNewDocument(SfxObjectShell const &i_rDoc, const SfxRequest &i_rCreateDocRequest)
RET_CANCEL
SwDBConfig * GetDBConfig()
Definition: apphdl.cxx:993
SfxHintId GetId() const
sal_uInt16 NextWhich()
SwWrtShell & GetWrtShell() const
Definition: view.hxx:400
#define FN_PARAM_DATABASE_PROPERTIES
Definition: cmdid.h:795
bool IsActive() const
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
virtual void ConfigurationChanged(utl::ConfigurationBroadcaster *, ConfigurationHints) override
Definition: apphdl.cxx:938
IDocumentFieldsAccess const & getIDocumentFieldsAccess() const
Definition: doc.cxx:389
vcl::Window & GetWindow() const
const SwView & GetView() const
Definition: wrtsh.hxx:426
#define FN_MAILMERGE_EMAIL_DOCUMENTS
Definition: cmdid.h:237
virtual void ExecuteMMResultPrintDialog(weld::Window *pParent)=0
void StateOther(SfxItemSet &)
Definition: apphdl.cxx:106
void InsertEnv(SfxRequest &)
Definition: appenv.cxx:143
bool dispatchCommand(const OUString &rCommand, const uno::Reference< css::frame::XFrame > &rFrame, const css::uno::Sequence< css::beans::PropertyValue > &rArguments, const uno::Reference< css::frame::XDispatchResultListener > &rListener)
std::unique_ptr< SwPrintOptions > m_pWebPrintOptions
Definition: swmodule.hxx:84
SfxFrame & GetFrame() const
static SfxViewShell * GetNext(const SfxViewShell &rPrev, bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
static SfxViewShell * Current()
SfxViewFrame * GetCurrentViewFrame() const
SW_DLLPUBLIC SwGlossaries * GetGlossaries()
Definition: initui.cxx:165
void CommitLastRegistrations()
Accept not committed registrations.
Definition: dbmgr.cxx:3348
virtual void ExecuteMMResultSaveDialog(weld::Window *pParent)=0
SfxObjectCreateMode GetCreateMode() const
css::uno::Sequence< css::beans::PropertyValue > InitPropertySequence(::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
bool m_bAuthorInitialised
Definition: swmodule.hxx:113
virtual void ExecuteMMResultEmailDialog(weld::Window *pParent)=0
std::unique_ptr< SvtAccessibilityOptions > m_pAccessibilityOptions
Definition: swmodule.hxx:92
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:203
SVT_DLLPUBLIC bool executeRestartDialog(css::uno::Reference< css::uno::XComponentContext > const &context, weld::Window *parent, RestartReason reason)
bool HasSelection() const
Definition: wrtsh.hxx:139
void GetAllUsedDB(std::vector< OUString > &rDBNameList, std::vector< OUString > const *pAllDBNames)
Definition: edfld.cxx:313
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:710
#define FN_MAILMERGE_CURRENT_ENTRY
Definition: cmdid.h:229
std::unique_ptr< SwStdFontConfig > m_pStdFontConfig
Definition: swmodule.hxx:86
void GetAllUsedDB(std::vector< OUString > &rDBNameList, const std::vector< OUString > *pAllDBNames=nullptr)
Definition: docfld.cxx:424
void AppearWithUpdate()
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
bool IsInsTableFormatNum(bool bHTML) const
Definition: swmodul1.cxx:562
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
Definition: docsh.hxx:224
SvtUserOptions & GetUserOptions()
Definition: apphdl.cxx:1031
SfxItemSet * GetItemSet() const
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
SfxViewFrame * GetTopViewFrame() const
#define FN_MAILMERGE_PRINT_DOCUMENTS
Definition: cmdid.h:236
void Lock(bool bLock)
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
virtual VclPtr< AbstractMailMergeWizard > CreateMailMergeWizard(SwView &rView, std::shared_ptr< SwMailMergeConfigItem > &rConfigItem)=0
void ChgNumberDigits()
Definition: viewsh.cxx:974
static void ApplyColorConfigValues(const svtools::ColorConfig &rConfig)
Definition: viewopt.cxx:453
static SfxViewShell * GetFirst(bool bOnlyVisible=true, const std::function< bool(const SfxViewShell *)> &isViewShell=nullptr)
#define FN_MAILMERGE_LAST_ENTRY
Definition: cmdid.h:228
#define DB_DELIM
Definition: swtypes.hxx:141
SfxViewShell * GetViewShell() const
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
void UpdateGlosPath(bool bFull)
Definition: glosdoc.cxx:348
SwDocShell * GetDocShell()
Definition: view.cxx:1127
bool IsReadOnly() const
std::unique_ptr< svtools::ColorConfig > m_pColorConfig
Definition: swmodule.hxx:91
void InsertLab(SfxRequest &, bool bLabel)
Definition: applab.cxx:152
SelectionType
Definition: wrtsh.hxx:58
void SetReturnValue(const SfxPoolItem &)
weld::Window * GetFrameWeld() const
void Update(sal_uInt16 nId)
#define TOOLS_INFO_EXCEPTION(area, stream)
#define RET_REMOVE_TARGET
Definition: swabstdlg.hxx:346
static std::shared_ptr< SwMailMergeConfigItem > PerformMailMerge(SwView const *pView)
Definition: dbmgr.cxx:3295
std::unique_ptr< SwModuleOptions, o3tl::default_delete< SwModuleOptions > > m_pModuleConfig
Definition: swmodule.hxx:80
std::unique_ptr< SwToolbarConfigItem > m_pWebToolbarConfig
Definition: swmodule.hxx:89
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
#define FN_MAILMERGE_PREV_ENTRY
Definition: cmdid.h:226
void DisableItem(sal_uInt16 nWhich)
bool has(DataAccessDescriptorProperty _eWhich) const
static SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
#define FN_MAILMERGE_FIRST_ENTRY
Definition: cmdid.h:225
#define FN_MAILMERGE_CREATE_DOCUMENTS
Definition: cmdid.h:234
virtual void SetFixFields(const DateTime *pNewDateTime)=0
bool DoInitNew(SfxMedium *pMedium=nullptr)
std::unique_ptr< SwMasterUsrPref, o3tl::default_delete< SwMasterUsrPref > > m_pUsrPref
Definition: swmodule.hxx:81
Reference< XComponentContext > getProcessComponentContext()
std::unique_ptr< SwPrintOptions > m_pPrintOptions
Definition: swmodule.hxx:83
std::unique_ptr< SvtCTLOptions > m_pCTLOptions
Definition: swmodule.hxx:93
svtools::ColorConfig & GetColorConfig()
Definition: apphdl.cxx:1000
vcl::Window * GetWindow() const
bool DoClose()
std::unique_ptr< SwNavigationConfig > m_pNavigationConfig
Definition: swmodule.hxx:87
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage)
std::unique_ptr< SwToolbarConfigItem > m_pToolbarConfig
Definition: swmodule.hxx:88
bool IsLocked() const
void ExecOther(SfxRequest &)
Definition: apphdl.cxx:676
std::unique_ptr< SvtUserOptions > m_pUserOptions
Definition: swmodule.hxx:94
const MiscSettings & GetMiscSettings() const
static SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
SvtCTLOptions & GetCTLOptions()
Definition: apphdl.cxx:1021
bool GetDisablePrinting() const
SelectionType GetSelectionType() const
Definition: wrtsh1.cxx:1404
sal_Int32 nPos
void SetDfltMetric(FieldUnit eMetric, bool bWeb)
Definition: uitool.cxx:717
OUString sCommand
Definition: swdbdata.hxx:31
#define FN_SET_MODOPT_TBLNUMFMT
Definition: cmdid.h:176
#define FN_MAILMERGE_WIZARD
Definition: cmdid.h:220
SwDBManager * GetDBManager() const
Definition: doc.hxx:663
Definition: view.hxx:146
IMPL_LINK_NOARG(FormFieldButton, FieldPopupModeEndHdl, FloatingWindow *, void)
#define SFX_OBJECTBAR_APPLICATION
SfxMedium * GetMedium() const
SwGlossaryList * GetGlossaryList()
Definition: initui.cxx:177