LibreOffice Module sw (master)  1
mailmrge.hxx
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 #ifndef INCLUDED_SW_SOURCE_UIBASE_INC_MAILMRGE_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_MAILMRGE_HXX
21 
22 #include <memory>
23 #include <sfx2/basedlgs.hxx>
24 
25 #include <com/sun/star/uno/Sequence.h>
26 #include <com/sun/star/uno/Reference.h>
27 
28 #include <dbmgr.hxx>
29 
30 class SwWrtShell;
31 class SwModuleOptions;
33 struct SwMailMergeDlg_Impl;
34 namespace com::sun::star{
35  namespace frame{
36  class XFrame2;
37  }
38  namespace sdbc{
39  class XResultSet;
40  class XConnection;
41  }
42 }
43 
45 {
46  friend class SwXSelChgLstnr_Impl;
47 
48  std::unique_ptr<SwMailMergeDlg_Impl> pImpl;
49 
52 
54  css::uno::Sequence< css::uno::Any > m_aSelection;
55  css::uno::Reference< css::frame::XFrame2 > m_xFrame;
56 
57  OUString m_sSaveFilter;
58  OUString m_sFilename;
59 
60  std::unique_ptr<weld::Container> m_xBeamerWin;
61 
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;
67 
68  std::unique_ptr<weld::RadioButton> m_xPrinterRB;
69  std::unique_ptr<weld::RadioButton> m_xMailingRB;
70  std::unique_ptr<weld::RadioButton> m_xFileRB;
71 
72  std::unique_ptr<weld::CheckButton> m_xSingleJobsCB;
73  std::unique_ptr<weld::CheckButton> m_xPasswordCB;
74 
75  std::unique_ptr<weld::Label> m_xSaveMergedDocumentFT;
76  std::unique_ptr<weld::RadioButton> m_xSaveSingleDocRB;
77  std::unique_ptr<weld::RadioButton> m_xSaveIndividualRB;
78 
79  std::unique_ptr<weld::CheckButton> m_xGenerateFromDataBaseCB;
80 
81  std::unique_ptr<weld::Label> m_xColumnFT;
82  std::unique_ptr<weld::ComboBox> m_xColumnLB;
83  std::unique_ptr<weld::Label> m_xPasswordFT;
84  std::unique_ptr<weld::ComboBox> m_xPasswordLB;
85  std::unique_ptr<weld::Label> m_xPathFT;
86  std::unique_ptr<weld::Entry> m_xPathED;
87  std::unique_ptr<weld::Button> m_xPathPB;
88  std::unique_ptr<weld::Label> m_xFilterFT;
89  std::unique_ptr<weld::ComboBox> m_xFilterLB;
90 
91  std::unique_ptr<weld::ComboBox> m_xAddressFieldLB;
92  std::unique_ptr<weld::Label> m_xSubjectFT;
93  std::unique_ptr<weld::Entry> m_xSubjectED;
94  std::unique_ptr<weld::Label> m_xFormatFT;
95  std::unique_ptr<weld::Label> m_xAttachFT;
96  std::unique_ptr<weld::Entry> m_xAttachED;
97  std::unique_ptr<weld::Button> m_xAttachPB;
98  std::unique_ptr<weld::CheckButton> m_xFormatHtmlCB;
99  std::unique_ptr<weld::CheckButton> m_xFormatRtfCB;
100  std::unique_ptr<weld::CheckButton> m_xFormatSwCB;
101 
102  std::unique_ptr<weld::Button> m_xOkBTN;
103 
104  DECL_LINK( ButtonHdl, weld::Button&, void );
105  DECL_LINK( InsertPathHdl, weld::Button&, void );
106  DECL_LINK( OutputTypeHdl, weld::ToggleButton&, void );
107  DECL_LINK( FilenameHdl, weld::ToggleButton&, void );
108  DECL_LINK( ModifyHdl, weld::SpinButton&, void );
109  DECL_LINK( SaveTypeHdl, weld::ToggleButton&, void );
110  DECL_LINK( FileFormatHdl, weld::ComboBox&, void );
111 
112  bool ExecQryShell();
113  bool AskUserFilename() const;
114  OUString GetURLfromPath() const;
115 
116 public:
117  SwMailMergeDlg(weld::Window* pParent, SwWrtShell& rSh,
118  const OUString& rSourceName,
119  const OUString& rTableName,
120  sal_Int32 nCommandType,
121  const css::uno::Reference< css::sdbc::XConnection>& xConnection,
122  css::uno::Sequence< css::uno::Any > const * pSelection);
123  virtual ~SwMailMergeDlg() override;
124 
126 
127  bool IsSaveSingleDoc() const { return m_xSaveSingleDocRB->get_active(); }
128  bool IsGenerateFromDataBase() const { return m_xGenerateFromDataBaseCB->get_active(); }
129  bool IsFileEncryptedFromDataBase() const { return m_xPasswordCB->get_active(); }
130  OUString GetColumnName() const { return m_xColumnLB->get_active_text(); }
131  OUString GetPasswordColumnName() const { return m_xPasswordLB->get_active_text(); }
132  OUString GetTargetURL() const;
133 
134  const OUString& GetSaveFilter() const {return m_sSaveFilter;}
135  const css::uno::Sequence< css::uno::Any >& GetSelection() const { return m_aSelection; }
136  css::uno::Reference< css::sdbc::XResultSet> GetResultSet() const;
137 
138 };
139 
141 {
142  std::unique_ptr<weld::RadioButton> m_xThisDocRB;
143 public:
145  virtual ~SwMailMergeCreateFromDlg() override;
146  bool IsThisDocument() const
147  {
148  return m_xThisDocRB->get_active();
149  }
150 };
151 
153 {
154  std::unique_ptr<weld::RadioButton> m_xUseExistingRB;
155 public:
157  virtual ~SwMailMergeFieldConnectionsDlg() override;
158 
160  {
161  return m_xUseExistingRB->get_active();
162  }
163 };
164 
165 #endif
166 
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwMailMergeCreateFromDlg(weld::Window *pParent)
Definition: mailmrge.cxx:596
std::unique_ptr< weld::Label > m_xSubjectFT
Definition: mailmrge.hxx:92
std::unique_ptr< weld::Container > m_xBeamerWin
Definition: mailmrge.hxx:60
std::unique_ptr< weld::Entry > m_xSubjectED
Definition: mailmrge.hxx:93
std::unique_ptr< weld::CheckButton > m_xPasswordCB
Definition: mailmrge.hxx:73
exports com.sun.star. sdbc
std::unique_ptr< weld::ComboBox > m_xFilterLB
Definition: mailmrge.hxx:89
std::unique_ptr< weld::SpinButton > m_xToNF
Definition: mailmrge.hxx:66
std::unique_ptr< weld::Label > m_xColumnFT
Definition: mailmrge.hxx:81
css::uno::Sequence< css::uno::Any > m_aSelection
Definition: mailmrge.hxx:54
std::unique_ptr< weld::RadioButton > m_xMarkedRB
Definition: mailmrge.hxx:63
std::unique_ptr< weld::Label > m_xFormatFT
Definition: mailmrge.hxx:94
css::uno::Reference< css::sdbc::XResultSet > GetResultSet() const
Definition: mailmrge.cxx:584
std::unique_ptr< weld::CheckButton > m_xSingleJobsCB
Definition: mailmrge.hxx:72
bool IsGenerateFromDataBase() const
Definition: mailmrge.hxx:128
std::unique_ptr< SwMailMergeDlg_Impl > pImpl
Definition: mailmrge.hxx:48
std::unique_ptr< weld::CheckButton > m_xFormatRtfCB
Definition: mailmrge.hxx:99
std::unique_ptr< weld::Label > m_xSaveMergedDocumentFT
Definition: mailmrge.hxx:75
bool AskUserFilename() const
Definition: mailmrge.cxx:455
std::unique_ptr< weld::Label > m_xPathFT
Definition: mailmrge.hxx:85
std::unique_ptr< weld::Entry > m_xPathED
Definition: mailmrge.hxx:86
OUString GetColumnName() const
Definition: mailmrge.hxx:130
bool IsThisDocument() const
Definition: mailmrge.hxx:146
std::unique_ptr< weld::Entry > m_xAttachED
Definition: mailmrge.hxx:96
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
std::unique_ptr< weld::RadioButton > m_xUseExistingRB
Definition: mailmrge.hxx:154
std::unique_ptr< weld::RadioButton > m_xSaveSingleDocRB
Definition: mailmrge.hxx:76
exports com.sun.star. frame
std::unique_ptr< weld::Button > m_xOkBTN
Definition: mailmrge.hxx:102
DBManagerOptions
Definition: dbmgr.hxx:85
virtual ~SwMailMergeCreateFromDlg() override
Definition: mailmrge.cxx:602
OUString GetPasswordColumnName() const
Definition: mailmrge.hxx:131
std::unique_ptr< weld::CheckButton > m_xFormatHtmlCB
Definition: mailmrge.hxx:98
std::unique_ptr< weld::RadioButton > m_xMailingRB
Definition: mailmrge.hxx:69
std::unique_ptr< weld::RadioButton > m_xAllRB
Definition: mailmrge.hxx:62
SwModuleOptions * pModOpt
Definition: mailmrge.hxx:51
css::uno::Reference< css::frame::XFrame2 > m_xFrame
Definition: mailmrge.hxx:55
std::unique_ptr< weld::ComboBox > m_xAddressFieldLB
Definition: mailmrge.hxx:91
bool IsUseExistingConnections() const
Definition: mailmrge.hxx:159
virtual ~SwMailMergeFieldConnectionsDlg() override
Definition: mailmrge.cxx:612
std::unique_ptr< weld::ComboBox > m_xColumnLB
Definition: mailmrge.hxx:82
SwWrtShell & rSh
Definition: mailmrge.hxx:50
OUString GetURLfromPath() const
Definition: mailmrge.cxx:460
virtual ~SwMailMergeDlg() override
Definition: mailmrge.cxx:343
std::unique_ptr< weld::RadioButton > m_xFromRB
Definition: mailmrge.hxx:64
std::unique_ptr< weld::RadioButton > m_xFileRB
Definition: mailmrge.hxx:70
OUString m_sFilename
Definition: mailmrge.hxx:58
const css::uno::Sequence< css::uno::Any > & GetSelection() const
Definition: mailmrge.hxx:135
std::unique_ptr< weld::RadioButton > m_xThisDocRB
Definition: mailmrge.hxx:142
DBManagerOptions GetMergeType() const
Definition: mailmrge.hxx:125
std::unique_ptr< weld::Label > m_xAttachFT
Definition: mailmrge.hxx:95
std::unique_ptr< weld::CheckButton > m_xFormatSwCB
Definition: mailmrge.hxx:100
OUString GetTargetURL() const
Definition: mailmrge.cxx:556
SwMailMergeDlg(weld::Window *pParent, SwWrtShell &rSh, const OUString &rSourceName, const OUString &rTableName, sal_Int32 nCommandType, const css::uno::Reference< css::sdbc::XConnection > &xConnection, css::uno::Sequence< css::uno::Any > const *pSelection)
Definition: mailmrge.cxx:112
OUString m_sSaveFilter
Definition: mailmrge.hxx:57
bool ExecQryShell()
Definition: mailmrge.cxx:475
std::unique_ptr< weld::Label > m_xFilterFT
Definition: mailmrge.hxx:88
std::unique_ptr< weld::Button > m_xPathPB
Definition: mailmrge.hxx:87
bool IsSaveSingleDoc() const
Definition: mailmrge.hxx:127
DECL_LINK(ButtonHdl, weld::Button &, void)
std::unique_ptr< weld::Label > m_xPasswordFT
Definition: mailmrge.hxx:83
std::unique_ptr< weld::SpinButton > m_xFromNF
Definition: mailmrge.hxx:65
std::unique_ptr< weld::ComboBox > m_xPasswordLB
Definition: mailmrge.hxx:84
SwMailMergeFieldConnectionsDlg(weld::Window *pParent)
Definition: mailmrge.cxx:606
bool IsFileEncryptedFromDataBase() const
Definition: mailmrge.hxx:129
std::unique_ptr< weld::RadioButton > m_xPrinterRB
Definition: mailmrge.hxx:68
const OUString & GetSaveFilter() const
Definition: mailmrge.hxx:134
std::unique_ptr< weld::Button > m_xAttachPB
Definition: mailmrge.hxx:97
std::unique_ptr< weld::CheckButton > m_xGenerateFromDataBaseCB
Definition: mailmrge.hxx:79
std::unique_ptr< weld::RadioButton > m_xSaveIndividualRB
Definition: mailmrge.hxx:77
DBManagerOptions nMergeType
Definition: mailmrge.hxx:53