1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_UI_DBUI_MMLAYOUTPAGE_HXX
20 #define INCLUDED_SW_SOURCE_UI_DBUI_MMLAYOUTPAGE_HXX
22 #include <vcl/wizardmachine.hxx>
23 #include <mailmergehelper.hxx>
24 #include <com/sun/star/uno/Reference.h>
26 class SwMailMergeWizard
;
28 class SwOneExampleFrame
;
32 namespace com::sun::star::beans
{ class XPropertySet
;}
34 class SwMailMergeLayoutPage
: public vcl::OWizardPage
36 SwWrtShell
* m_pExampleWrtShell
;
38 OUString m_sExampleURL
;
39 SwFrameFormat
* m_pAddressBlockFormat
;
41 bool m_bIsGreetingInserted
;
43 SwMailMergeWizard
* m_pWizard
;
45 css::uno::Reference
< css::beans::XPropertySet
> m_xViewProperties
;
47 std::unique_ptr
<weld::Container
> m_xPosition
;
48 std::unique_ptr
<weld::CheckButton
> m_xAlignToBodyCB
;
49 std::unique_ptr
<weld::Label
> m_xLeftFT
;
50 std::unique_ptr
<weld::MetricSpinButton
> m_xLeftMF
;
51 std::unique_ptr
<weld::MetricSpinButton
> m_xTopMF
;
52 std::unique_ptr
<weld::Container
> m_xGreetingLine
;
53 std::unique_ptr
<weld::Button
> m_xUpPB
;
54 std::unique_ptr
<weld::Button
> m_xDownPB
;
55 std::unique_ptr
<weld::ComboBox
> m_xZoomLB
;
56 std::unique_ptr
<SwOneExampleFrame
> m_xExampleFrame
;
57 std::unique_ptr
<weld::CustomWeld
> m_xExampleContainerWIN
;
59 DECL_LINK(PreviewLoadedHdl_Impl
, SwOneExampleFrame
&, void);
60 DECL_LINK(ZoomHdl_Impl
, weld::ComboBox
&, void);
61 DECL_LINK(ChangeAddressHdl_Impl
, weld::MetricSpinButton
&, void);
62 DECL_LINK(GreetingsHdl_Impl
, weld::Button
&, void);
63 DECL_LINK(AlignToTextHdl_Impl
, weld::Toggleable
&, void);
65 static SwFrameFormat
* InsertAddressFrame(
67 SwMailMergeConfigItem
const & rConfigItem
,
68 const Point
& rDestination
,
71 static void InsertGreeting(SwWrtShell
& rShell
, SwMailMergeConfigItem
const & rConfigItem
, bool bExample
);
73 virtual void Activate() override
;
74 virtual bool commitPage(::vcl::WizardTypes::CommitPageReason _eReason
) override
;
76 SwMailMergeLayoutPage(weld::Container
* pPage
, SwMailMergeWizard
* pWizard
);
77 virtual ~SwMailMergeLayoutPage() override
;
79 static SwFrameFormat
* InsertAddressAndGreeting(SwView
const * pView
,
80 SwMailMergeConfigItem
& rConfigItem
,
81 const Point
& rAddressPos
,
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */