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{namespace sun{namespace 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 
74  std::unique_ptr<weld::Label> m_xSaveMergedDocumentFT;
75  std::unique_ptr<weld::RadioButton> m_xSaveSingleDocRB;
76  std::unique_ptr<weld::RadioButton> m_xSaveIndividualRB;
77 
78  std::unique_ptr<weld::CheckButton> m_xGenerateFromDataBaseCB;
79 
80  std::unique_ptr<weld::Label> m_xColumnFT;
81  std::unique_ptr<weld::ComboBox> m_xColumnLB;
82  std::unique_ptr<weld::Label> m_xPathFT;
83  std::unique_ptr<weld::Entry> m_xPathED;
84  std::unique_ptr<weld::Button> m_xPathPB;
85  std::unique_ptr<weld::Label> m_xFilterFT;
86  std::unique_ptr<weld::ComboBox> m_xFilterLB;
87 
88  std::unique_ptr<weld::ComboBox> m_xAddressFieldLB;
89  std::unique_ptr<weld::Label> m_xSubjectFT;
90  std::unique_ptr<weld::Entry> m_xSubjectED;
91  std::unique_ptr<weld::Label> m_xFormatFT;
92  std::unique_ptr<weld::Label> m_xAttachFT;
93  std::unique_ptr<weld::Entry> m_xAttachED;
94  std::unique_ptr<weld::Button> m_xAttachPB;
95  std::unique_ptr<weld::CheckButton> m_xFormatHtmlCB;
96  std::unique_ptr<weld::CheckButton> m_xFormatRtfCB;
97  std::unique_ptr<weld::CheckButton> m_xFormatSwCB;
98 
99  std::unique_ptr<weld::Button> m_xOkBTN;
100 
101  DECL_LINK( ButtonHdl, weld::Button&, void );
102  DECL_LINK( InsertPathHdl, weld::Button&, void );
103  DECL_LINK( OutputTypeHdl, weld::ToggleButton&, void );
104  DECL_LINK( FilenameHdl, weld::ToggleButton&, void );
105  DECL_LINK( ModifyHdl, weld::SpinButton&, void );
106  DECL_LINK( SaveTypeHdl, weld::ToggleButton&, void );
107 
108  bool ExecQryShell();
109  bool AskUserFilename() const;
110  OUString GetURLfromPath() const;
111 
112 public:
113  SwMailMergeDlg(weld::Window* pParent, SwWrtShell& rSh,
114  const OUString& rSourceName,
115  const OUString& rTableName,
116  sal_Int32 nCommandType,
117  const css::uno::Reference< css::sdbc::XConnection>& xConnection,
118  css::uno::Sequence< css::uno::Any > const * pSelection);
119  virtual ~SwMailMergeDlg() override;
120 
122 
123  bool IsSaveSingleDoc() const { return m_xSaveSingleDocRB->get_active(); }
124  bool IsGenerateFromDataBase() const { return m_xGenerateFromDataBaseCB->get_active(); }
125  OUString GetColumnName() const { return m_xColumnLB->get_active_text(); }
126  OUString GetTargetURL() const;
127 
128  const OUString& GetSaveFilter() const {return m_sSaveFilter;}
129  const css::uno::Sequence< css::uno::Any >& GetSelection() const { return m_aSelection; }
130  css::uno::Reference< css::sdbc::XResultSet> GetResultSet() const;
131 
132 };
133 
135 {
136  std::unique_ptr<weld::RadioButton> m_xThisDocRB;
137 public:
139  virtual ~SwMailMergeCreateFromDlg() override;
140  bool IsThisDocument() const
141  {
142  return m_xThisDocRB->get_active();
143  }
144 };
145 
147 {
148  std::unique_ptr<weld::RadioButton> m_xUseExistingRB;
149 public:
151  virtual ~SwMailMergeFieldConnectionsDlg() override;
152 
154  {
155  return m_xUseExistingRB->get_active();
156  }
157 };
158 
159 #endif
160 
161 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwMailMergeCreateFromDlg(weld::Window *pParent)
Definition: mailmrge.cxx:542
std::unique_ptr< weld::Label > m_xSubjectFT
Definition: mailmrge.hxx:89
std::unique_ptr< weld::Container > m_xBeamerWin
Definition: mailmrge.hxx:60
std::unique_ptr< weld::Entry > m_xSubjectED
Definition: mailmrge.hxx:90
std::unique_ptr< weld::ComboBox > m_xFilterLB
Definition: mailmrge.hxx:86
std::unique_ptr< weld::SpinButton > m_xToNF
Definition: mailmrge.hxx:66
std::unique_ptr< weld::Label > m_xColumnFT
Definition: mailmrge.hxx:80
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:91
css::uno::Reference< css::sdbc::XResultSet > GetResultSet() const
Definition: mailmrge.cxx:530
std::unique_ptr< weld::CheckButton > m_xSingleJobsCB
Definition: mailmrge.hxx:72
bool IsGenerateFromDataBase() const
Definition: mailmrge.hxx:124
std::unique_ptr< SwMailMergeDlg_Impl > pImpl
Definition: mailmrge.hxx:48
std::unique_ptr< weld::CheckButton > m_xFormatRtfCB
Definition: mailmrge.hxx:96
std::unique_ptr< weld::Label > m_xSaveMergedDocumentFT
Definition: mailmrge.hxx:74
bool AskUserFilename() const
Definition: mailmrge.cxx:405
std::unique_ptr< weld::Label > m_xPathFT
Definition: mailmrge.hxx:82
std::unique_ptr< weld::Entry > m_xPathED
Definition: mailmrge.hxx:83
OUString GetColumnName() const
Definition: mailmrge.hxx:125
bool IsThisDocument() const
Definition: mailmrge.hxx:140
std::unique_ptr< weld::Entry > m_xAttachED
Definition: mailmrge.hxx:93
Used by the UI to modify the document model.
Definition: wrtsh.hxx:90
std::unique_ptr< weld::RadioButton > m_xUseExistingRB
Definition: mailmrge.hxx:148
std::unique_ptr< weld::RadioButton > m_xSaveSingleDocRB
Definition: mailmrge.hxx:75
std::unique_ptr< weld::Button > m_xOkBTN
Definition: mailmrge.hxx:99
DBManagerOptions
Definition: dbmgr.hxx:85
virtual ~SwMailMergeCreateFromDlg() override
Definition: mailmrge.cxx:548
std::unique_ptr< weld::CheckButton > m_xFormatHtmlCB
Definition: mailmrge.hxx:95
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:88
bool IsUseExistingConnections() const
Definition: mailmrge.hxx:153
virtual ~SwMailMergeFieldConnectionsDlg() override
Definition: mailmrge.cxx:558
std::unique_ptr< weld::ComboBox > m_xColumnLB
Definition: mailmrge.hxx:81
SwWrtShell & rSh
Definition: mailmrge.hxx:50
OUString GetURLfromPath() const
Definition: mailmrge.cxx:410
virtual ~SwMailMergeDlg() override
Definition: mailmrge.cxx:333
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:129
std::unique_ptr< weld::RadioButton > m_xThisDocRB
Definition: mailmrge.hxx:136
DBManagerOptions GetMergeType() const
Definition: mailmrge.hxx:121
std::unique_ptr< weld::Label > m_xAttachFT
Definition: mailmrge.hxx:92
std::unique_ptr< weld::CheckButton > m_xFormatSwCB
Definition: mailmrge.hxx:97
OUString GetTargetURL() const
Definition: mailmrge.cxx:502
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:121
OUString m_sSaveFilter
Definition: mailmrge.hxx:57
bool ExecQryShell()
Definition: mailmrge.cxx:425
std::unique_ptr< weld::Label > m_xFilterFT
Definition: mailmrge.hxx:85
std::unique_ptr< weld::Button > m_xPathPB
Definition: mailmrge.hxx:84
bool IsSaveSingleDoc() const
Definition: mailmrge.hxx:123
DECL_LINK(ButtonHdl, weld::Button &, void)
std::unique_ptr< weld::SpinButton > m_xFromNF
Definition: mailmrge.hxx:65
SwMailMergeFieldConnectionsDlg(weld::Window *pParent)
Definition: mailmrge.cxx:552
std::unique_ptr< weld::RadioButton > m_xPrinterRB
Definition: mailmrge.hxx:68
const OUString & GetSaveFilter() const
Definition: mailmrge.hxx:128
std::unique_ptr< weld::Button > m_xAttachPB
Definition: mailmrge.hxx:94
std::unique_ptr< weld::CheckButton > m_xGenerateFromDataBaseCB
Definition: mailmrge.hxx:78
std::unique_ptr< weld::RadioButton > m_xSaveIndividualRB
Definition: mailmrge.hxx:76
DBManagerOptions nMergeType
Definition: mailmrge.hxx:53