Line data Source code
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 _MAILMERGEWIZARD_HXX
20 : #define _MAILMERGEWIZARD_HXX
21 :
22 : #include <svtools/roadmapwizard.hxx>
23 :
24 : class SwView;
25 : class SwMailMergeConfigItem;
26 :
27 : #define MM_DOCUMENTSELECTPAGE 0
28 : #define MM_OUTPUTTYPETPAGE 1
29 : #define MM_ADDRESSBLOCKPAGE 2
30 : #define MM_GREETINGSPAGE 3
31 : #define MM_LAYOUTPAGE 4
32 : #define MM_PREPAREMERGEPAGE 5
33 : #define MM_MERGEPAGE 6
34 : #define MM_OUTPUTPAGE 7
35 :
36 : class SwMailMergeWizard : public ::svt::RoadmapWizard
37 : {
38 : SwView* m_pSwView;
39 : String sDocumentURL;
40 : bool m_bDocumentLoad;
41 :
42 : SwMailMergeConfigItem& m_rConfigItem;
43 :
44 : String m_sStarting;
45 : String m_sDocumentType;
46 : String m_sAddressBlock;
47 : String m_sAddressList;
48 : String m_sGreetingsLine;
49 : String m_sLayout;
50 : String m_sPrepareMerge;
51 : String m_sMerge;
52 : String m_sOutput;
53 : String m_sFinish;
54 :
55 : sal_uInt16 m_nRestartPage;
56 :
57 : using svt::OWizardMachine::skipUntil;
58 :
59 : protected:
60 : virtual svt::OWizardPage* createPage(WizardState _nState);
61 : virtual void enterState( WizardState _nState );
62 :
63 : // roadmap feature ??
64 : // virtual sal_Bool prepareLeaveCurrentState( CommitPageReason _eReason );
65 : virtual String getStateDisplayName( WizardState _nState ) const;
66 :
67 : public:
68 : SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rConfigItem);
69 : ~SwMailMergeWizard();
70 :
71 0 : SwView* GetSwView() {return m_pSwView;}
72 0 : SwMailMergeConfigItem& GetConfigItem() { return m_rConfigItem;}
73 :
74 0 : void SetReloadDocument(const String& rURL){sDocumentURL = rURL;}
75 0 : const String& GetReloadDocument() const {return sDocumentURL;}
76 :
77 : //next step requires loading of document
78 0 : void SetDocumentLoad(bool bSet) {m_bDocumentLoad = bSet;}
79 :
80 : void UpdateRoadmap();
81 : void CreateTargetDocument();
82 :
83 0 : sal_uInt16 GetRestartPage() const {return m_nRestartPage;}
84 0 : void SetRestartPage(sal_uInt16 nPage) { m_nRestartPage = nPage;}
85 :
86 0 : sal_Bool skipUntil( sal_uInt16 nPage)
87 0 : {return ::svt::RoadmapWizard::skipUntil(WizardState(nPage));}
88 :
89 : void updateRoadmapItemLabel( WizardState _nState );
90 :
91 : virtual short Execute();
92 : virtual void StartExecuteModal( const Link& rEndDialogHdl );
93 : };
94 : #endif
95 :
96 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|