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