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_UIBASE_INC_MAILMERGEWIZARD_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_MAILMERGEWIZARD_HXX
22 #include <vcl/roadmapwizard.hxx>
23 #include <rtl/ustring.hxx>
26 class SwMailMergeConfigItem
;
28 using vcl::WizardTypes::WizardState
;
30 #define MM_DOCUMENTSELECTPAGE 0
31 #define MM_OUTPUTTYPETPAGE 1
32 #define MM_ADDRESSBLOCKPAGE 2
33 #define MM_GREETINGSPAGE 3
34 #define MM_LAYOUTPAGE 4
36 class SwMailMergeWizard final
: public ::vcl::RoadmapWizardMachine
39 OUString m_sDocumentURL
;
42 std::shared_ptr
<SwMailMergeConfigItem
> m_xConfigItem
;
45 OUString m_sDocumentType
;
46 OUString m_sAddressBlock
;
47 OUString m_sAddressList
;
48 OUString m_sGreetingsLine
;
51 sal_uInt16 m_nRestartPage
;
53 using vcl::WizardMachine::skipUntil
;
55 virtual std::unique_ptr
<BuilderPage
> createPage( WizardState _nState
) override
;
56 virtual void enterState( WizardState _nState
) override
;
58 virtual OUString
getStateDisplayName( WizardState _nState
) const override
;
61 SwMailMergeWizard(SwView
& rView
, std::shared_ptr
<SwMailMergeConfigItem
> xConfigItem
);
62 virtual ~SwMailMergeWizard() override
;
64 SwView
* GetSwView() {return m_pSwView
;}
65 SwMailMergeConfigItem
& GetConfigItem() { return *m_xConfigItem
;}
67 void SetReloadDocument(const OUString
& rURL
) {m_sDocumentURL
= rURL
;}
68 const OUString
& GetReloadDocument() const {return m_sDocumentURL
;}
70 //next step requires loading of document
71 void SetDocumentLoad(bool bSet
) {m_bDocumentLoad
= bSet
;}
75 sal_uInt16
GetRestartPage() const {return m_nRestartPage
;}
76 void SetRestartPage(sal_uInt16 nPage
) { m_nRestartPage
= nPage
;}
78 bool skipUntil( sal_uInt16 nPage
)
79 {return ::vcl::RoadmapWizardMachine::skipUntil(WizardState(nPage
));}
81 virtual short run() override
;
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */