LibreOffice Module sw (master)  1
mmconfigitem.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_MMCONFIGITEM_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_MMCONFIGITEM_HXX
21 
22 #include <com/sun/star/uno/Sequence.hxx>
23 #include <com/sun/star/uno/Reference.hxx>
24 #include <com/sun/star/view/XSelectionChangeListener.hpp>
25 #include <tools/long.hxx>
26 #include <memory>
27 #include <set>
28 #include <vector>
29 #include <swdbdata.hxx>
30 #include <swdllapi.h>
31 #include "sharedconnection.hxx"
32 
33 namespace com::sun::star{
34  namespace sdbc{
35  class XDataSource;
36  class XResultSet;
37  }
38  namespace sdbcx{
39  class XColumnsSupplier;
40  }
41 }
42 
44 class SwView;
45 namespace sw::mark { class IMark; }
46 
48 {
50  sal_Int32 nDBRow;
51 };
52 
54 {
55  std::unique_ptr<SwMailMergeConfigItem_Impl> m_pImpl;
56  //session information - not stored in configuration
59  sal_Int32 m_nGreetingMoves;
60  std::set<sal_Int32> m_aExcludedRecords;
61  css::uno::Reference<css::view::XSelectionChangeListener> m_xDBChangedListener;
62 
64 
67 public:
70 
71  enum Gender
72  {
75  NEUTRAL
76  };
77 
78  void Commit();
79 
80  const std::vector<std::pair<OUString, int>>& GetDefaultAddressHeaders() const;
81 
82  void SetCurrentConnection(
83  css::uno::Reference< css::sdbc::XDataSource> const & xSource,
84  const SharedConnection& rConnection,
85  css::uno::Reference< css::sdbcx::XColumnsSupplier> const & xColumnsSupplier,
86  const SwDBData& rDBData);
87 
88  css::uno::Reference< css::sdbc::XDataSource> const & GetSource() const;
89 
90  SharedConnection const & GetConnection() const;
91 
92  css::uno::Reference< css::sdbcx::XColumnsSupplier> const & GetColumnsSupplier();
93 
94  css::uno::Reference< css::sdbc::XResultSet> const & GetResultSet() const;
95 
96  void DisposeResultSet();
97 
98  OUString& GetFilter() const;
99  void SetFilter(OUString const &);
100 
101  void SetCurrentDBData( const SwDBData& rDBData);
102  const SwDBData& GetCurrentDBData() const;
103 
104  // move absolute, nTarget == -1 -> goto last record
105  sal_Int32 MoveResultSet(sal_Int32 nTarget);
106  sal_Int32 GetResultSetPosition()const;
107  bool IsResultSetFirstLast(bool& bIsFirst, bool& bIsLast);
108 
109  bool IsRecordExcluded(sal_Int32 nRecord) const;
110  void ExcludeRecord(sal_Int32 nRecord, bool bExclude);
111  css::uno::Sequence< css::uno::Any> GetSelection() const;
112 
113  const css::uno::Sequence<OUString>& GetSavedDocuments() const;
114 
115  bool IsOutputToLetter()const;
116  void SetOutputToLetter(bool bSet);
117 
118  bool IsAddressBlock()const;
119  void SetAddressBlock(bool bSet);
120 
121  bool IsHideEmptyParagraphs() const;
122  void SetHideEmptyParagraphs(bool bSet);
123 
124  css::uno::Sequence<OUString> GetAddressBlocks() const;
125  void SetAddressBlocks(const css::uno::Sequence< OUString>& rBlocks);
126 
127  void SetCurrentAddressBlockIndex( sal_Int32 nSet );
128  sal_Int32 GetCurrentAddressBlockIndex() const;
129 
130  bool IsIncludeCountry() const;
131  OUString& GetExcludeCountry() const;
132  void SetCountrySettings(bool bSet, const OUString& sCountry);
133 
134  bool IsIndividualGreeting(bool bInEMail) const;
135  void SetIndividualGreeting(bool bSet, bool bInEMail);
136 
137  bool IsGreetingLine(bool bInEMail) const;
138  void SetGreetingLine(bool bSet, bool bInEMail);
139 
140  css::uno::Sequence<OUString> GetGreetings(Gender eType) const;
141  void SetGreetings(Gender eType, const css::uno::Sequence< OUString>& rBlocks);
142 
143  sal_Int32 GetCurrentGreeting(Gender eType) const;
144  void SetCurrentGreeting(Gender eType, sal_Int32 nIndex);
145 
146  //the content of the gender column that marks it as female
147  const OUString& GetFemaleGenderValue() const;
148  void SetFemaleGenderValue(const OUString& rValue);
149 
150  //returns the assignment in the order of the default headers (GetDefaultAddressHeaders())
151  css::uno::Sequence<OUString> GetColumnAssignment( const SwDBData& rDBData ) const;
152  void SetColumnAssignment(
153  const SwDBData& rDBData,
154  const css::uno::Sequence< OUString>& );
155 
156  bool IsAddressFieldsAssigned() const;
157  bool IsGreetingFieldsAssigned() const;
158 
159  //e-Mail settings:
160  OUString const & GetMailDisplayName() const;
161  void SetMailDisplayName(const OUString& rName);
162 
163  OUString const & GetMailAddress() const;
164  void SetMailAddress(const OUString& rAddress);
165 
166  bool IsMailReplyTo() const;
167  void SetMailReplyTo(bool bSet);
168 
169  OUString const & GetMailReplyTo() const;
170  void SetMailReplyTo(const OUString& rReplyTo);
171 
172  OUString const & GetMailServer() const;
173  void SetMailServer(const OUString& rAddress);
174 
175  sal_Int16 GetMailPort() const;
176  void SetMailPort(sal_Int16 nSet);
177 
178  bool IsSecureConnection() const;
179  void SetSecureConnection(bool bSet);
180 
181  bool IsAuthentication() const;
182  void SetAuthentication(bool bSet);
183 
184  OUString const & GetMailUserName() const;
185  void SetMailUserName(const OUString& rName);
186 
187  OUString const & GetMailPassword() const;
188  void SetMailPassword(const OUString& rPassword);
189 
190  bool IsSMTPAfterPOP() const;
191  void SetSMTPAfterPOP(bool bSet);
192 
193  OUString const & GetInServerName() const;
194  void SetInServerName(const OUString& rServer);
195 
196  sal_Int16 GetInServerPort() const;
197  void SetInServerPort(sal_Int16 nSet);
198 
199  bool IsInServerPOP() const;
200  void SetInServerPOP(bool bSet);
201 
202  OUString const & GetInServerUserName() const;
203  void SetInServerUserName(const OUString& rName);
204 
205  OUString const & GetInServerPassword() const;
206  void SetInServerPassword(const OUString& rPassword);
207 
208  //session information
209  bool IsAddressInserted() const { return m_bAddressInserted; }
211  {
212  m_bAddressInserted = true;
213  }
214 
215  bool IsGreetingInserted() const
216  { return m_bGreetingInserted; }
218  { m_bGreetingInserted = true; }
219 
220  // counts the moves in the layout page
221  void MoveGreeting( sal_Int32 nMove) { m_nGreetingMoves += nMove;}
222  sal_Int32 GetGreetingMoves() const { return m_nGreetingMoves;}
223 
224  // new source document - reset some flags
225  void DocumentReloaded();
226 
227  bool IsMailAvailable() const;
228 
229  // notify a completed merge, provide the appropriate e-Mail address if available
230  void AddMergedDocument(SwDocMergeInfo const & rInfo);
231  //returns the page and database cursor information of each merged document
232  SwDocMergeInfo& GetDocumentMergeInfo(sal_uInt32 nDocument);
233  sal_uInt32 GetMergedDocumentCount();
234 
235  const OUString& GetSelectedPrinter() const
236  { return m_sSelectedPrinter; }
237  void SetSelectedPrinter(const OUString& rSet)
238  { m_sSelectedPrinter = rSet; }
239 
240  SwView* GetTargetView();
241  void SetTargetView(SwView* pView);
242 
243  SwView* GetSourceView();
244  void SetSourceView(SwView* pView);
245 
246  //helper methods
247  OUString GetAssignedColumn(sal_uInt32 nColumn) const;
248  void stopDBChangeListening();
249  void updateCurrentDBDataFromDocument();
250 };
251 
252 #endif
253 
254 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
void SetSelectedPrinter(const OUString &rSet)
bool IsAddressInserted() const
void GetSelection(struct ESelection &rSel, SvxTextForwarder const *pForwarder)
exports com.sun.star. sdbc
sal_Int32 nDBRow
css::uno::Reference< css::view::XSelectionChangeListener > m_xDBChangedListener
sal_Int32 GetGreetingMoves() const
sw::mark::IMark * startPageInTarget
std::set< sal_Int32 > m_aExcludedRecords
bool IsGreetingInserted() const
#define SW_DLLPUBLIC
Definition: swdllapi.h:28
const OUString & GetSelectedPrinter() const
exports com.sun.star. sdbcx
std::unique_ptr< SwMailMergeConfigItem_Impl > m_pImpl
Definition: view.hxx:144
void MoveGreeting(sal_Int32 nMove)