Revert "tdf#158280 Replace usage of InputDialog with SvxNameDialog"
[LibreOffice.git] / sw / source / uibase / inc / mailmrge.hxx
blob5d5363222cccc6e0424591bd4044974b1de550ee
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_MAILMRGE_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_MAILMRGE_HXX
22 #include <memory>
23 #include <sfx2/basedlgs.hxx>
25 #include <com/sun/star/uno/Sequence.h>
26 #include <com/sun/star/uno/Reference.h>
28 #include <dbmgr.hxx>
30 class SwWrtShell;
31 class SwModuleOptions;
32 class SwXSelChgLstnr_Impl;
33 struct SwMailMergeDlg_Impl;
34 namespace com::sun::star{
35 namespace frame{
36 class XFrame2;
38 namespace sdbc{
39 class XResultSet;
40 class XConnection;
44 class SwMailMergeDlg final : public SfxDialogController
46 friend class SwXSelChgLstnr_Impl;
48 std::unique_ptr<SwMailMergeDlg_Impl> m_pImpl;
50 SwWrtShell& m_rSh;
51 SwModuleOptions* m_pModOpt;
53 DBManagerOptions m_nMergeType;
54 css::uno::Sequence< css::uno::Any > m_aSelection;
55 css::uno::Reference< css::frame::XFrame2 > m_xFrame;
57 OUString m_sSaveFilter;
58 OUString m_sFilename;
60 std::unique_ptr<weld::Container> m_xBeamerWin;
62 std::unique_ptr<weld::RadioButton> m_xAllRB;
63 std::unique_ptr<weld::RadioButton> m_xMarkedRB;
64 std::unique_ptr<weld::RadioButton> m_xFromRB;
65 std::unique_ptr<weld::SpinButton> m_xFromNF;
66 std::unique_ptr<weld::SpinButton> m_xToNF;
68 std::unique_ptr<weld::RadioButton> m_xPrinterRB;
69 std::unique_ptr<weld::RadioButton> m_xMailingRB;
70 std::unique_ptr<weld::RadioButton> m_xFileRB;
72 std::unique_ptr<weld::CheckButton> m_xPasswordCB;
74 std::unique_ptr<weld::Label> m_xSaveMergedDocumentFT;
75 std::unique_ptr<weld::RadioButton> m_xSaveSingleDocRB;
76 std::unique_ptr<weld::RadioButton> m_xSaveIndividualRB;
78 std::unique_ptr<weld::CheckButton> m_xGenerateFromDataBaseCB;
80 std::unique_ptr<weld::Label> m_xColumnFT;
81 std::unique_ptr<weld::ComboBox> m_xColumnLB;
82 std::unique_ptr<weld::Label> m_xPasswordFT;
83 std::unique_ptr<weld::ComboBox> m_xPasswordLB;
84 std::unique_ptr<weld::Label> m_xPathFT;
85 std::unique_ptr<weld::Entry> m_xPathED;
86 std::unique_ptr<weld::Button> m_xPathPB;
87 std::unique_ptr<weld::Label> m_xFilterFT;
88 std::unique_ptr<weld::ComboBox> m_xFilterLB;
90 std::unique_ptr<weld::ComboBox> m_xAddressFieldLB;
91 std::unique_ptr<weld::Label> m_xSubjectFT;
92 std::unique_ptr<weld::Entry> m_xSubjectED;
93 std::unique_ptr<weld::Label> m_xFormatFT;
94 std::unique_ptr<weld::Label> m_xAttachFT;
95 std::unique_ptr<weld::Entry> m_xAttachED;
96 std::unique_ptr<weld::Button> m_xAttachPB;
97 std::unique_ptr<weld::CheckButton> m_xFormatHtmlCB;
98 std::unique_ptr<weld::CheckButton> m_xFormatRtfCB;
99 std::unique_ptr<weld::CheckButton> m_xFormatSwCB;
101 std::unique_ptr<weld::Button> m_xOkBTN;
103 DECL_LINK( ButtonHdl, weld::Button&, void );
104 DECL_LINK( InsertPathHdl, weld::Button&, void );
105 DECL_LINK( OutputTypeHdl, weld::Toggleable&, void );
106 DECL_LINK( FilenameHdl, weld::Toggleable&, void );
107 DECL_LINK( ModifyHdl, weld::SpinButton&, void );
108 DECL_LINK( SaveTypeHdl, weld::Toggleable&, void );
109 DECL_LINK( FileFormatHdl, weld::ComboBox&, void );
111 bool ExecQryShell();
112 bool AskUserFilename() const;
113 OUString GetURLfromPath() const;
115 public:
116 SwMailMergeDlg(weld::Window* pParent, SwWrtShell& rSh,
117 const OUString& rSourceName,
118 const OUString& rTableName,
119 sal_Int32 nCommandType,
120 const css::uno::Reference< css::sdbc::XConnection>& xConnection,
121 css::uno::Sequence< css::uno::Any > const * pSelection);
122 virtual ~SwMailMergeDlg() override;
124 DBManagerOptions GetMergeType() const { return m_nMergeType; }
126 bool IsSaveSingleDoc() const { return m_xSaveSingleDocRB->get_active(); }
127 bool IsGenerateFromDataBase() const { return m_xGenerateFromDataBaseCB->get_active(); }
128 bool IsFileEncryptedFromDataBase() const { return m_xPasswordCB->get_active(); }
129 OUString GetColumnName() const { return m_xColumnLB->get_active_text(); }
130 OUString GetPasswordColumnName() const { return m_xPasswordLB->get_active_text(); }
131 OUString GetTargetURL() const;
133 const OUString& GetSaveFilter() const {return m_sSaveFilter;}
134 const css::uno::Sequence< css::uno::Any >& GetSelection() const { return m_aSelection; }
135 css::uno::Reference< css::sdbc::XResultSet> GetResultSet() const;
139 class SwMailMergeCreateFromDlg final : public weld::GenericDialogController
141 std::unique_ptr<weld::RadioButton> m_xThisDocRB;
142 public:
143 SwMailMergeCreateFromDlg(weld::Window* pParent);
144 virtual ~SwMailMergeCreateFromDlg() override;
145 bool IsThisDocument() const
147 return m_xThisDocRB->get_active();
151 class SwMailMergeFieldConnectionsDlg final : public weld::GenericDialogController
153 std::unique_ptr<weld::RadioButton> m_xUseExistingRB;
154 public:
155 SwMailMergeFieldConnectionsDlg(weld::Window* pParent);
156 virtual ~SwMailMergeFieldConnectionsDlg() override;
158 bool IsUseExistingConnections() const
160 return m_xUseExistingRB->get_active();
164 #endif
166 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */