1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _MAILMERGEWIZARD_HXX
24 #define _MAILMERGEWIZARD_HXX
25 
26 #include <svtools/roadmapwizard.hxx>
27 
28 class SwView;
29 class SwMailMergeConfigItem;
30 
31 #define MM_DOCUMENTSELECTPAGE   0
32 #define MM_OUTPUTTYPETPAGE      1
33 #define MM_ADDRESSBLOCKPAGE     2
34 #define MM_GREETINGSPAGE        3
35 #define MM_LAYOUTPAGE           4
36 #define MM_PREPAREMERGEPAGE     5
37 #define MM_MERGEPAGE            6
38 #define MM_OUTPUTPAGE           7
39 
40 class SwMailMergeWizard : public ::svt::RoadmapWizard
41 {
42     SwView*                 m_pSwView;
43     String                  sDocumentURL;
44     bool                    m_bDocumentLoad;
45 
46     SwMailMergeConfigItem&  m_rConfigItem;
47 
48     String                  m_sStarting;
49     String                  m_sDocumentType;
50     String                  m_sAddressBlock;
51     String                  m_sAddressList;
52     String                  m_sGreetingsLine;
53     String                  m_sLayout;
54     String                  m_sPrepareMerge;
55     String                  m_sMerge;
56     String                  m_sOutput;
57     String                  m_sFinish;
58 
59     sal_uInt16              m_nRestartPage;
60 
61     using svt::OWizardMachine::skipUntil;
62 
63 protected:
64     virtual svt::OWizardPage*       createPage(WizardState _nState);
65     virtual void                    enterState( WizardState _nState );
66 
67 // roadmap feature ??
68 //    virtual sal_Bool            prepareLeaveCurrentState( CommitPageReason _eReason );
69     virtual String                  getStateDisplayName( WizardState _nState ) const;
70 
71 public:
72     SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rConfigItem);
73     ~SwMailMergeWizard();
74 
GetSwView()75     SwView*                     GetSwView() {return m_pSwView;}
GetConfigItem()76     SwMailMergeConfigItem&      GetConfigItem() { return m_rConfigItem;}
77 
SetReloadDocument(const String & rURL)78     void                    SetReloadDocument(const String& rURL){sDocumentURL = rURL;}
GetReloadDocument() const79     const String&           GetReloadDocument() const {return sDocumentURL;}
80 
81     //next step requires loading of document
SetDocumentLoad(bool bSet)82     void                    SetDocumentLoad(bool bSet) {m_bDocumentLoad = bSet;}
83 
84     void                    UpdateRoadmap();
85     void                    CreateTargetDocument();
86 
GetRestartPage() const87     sal_uInt16              GetRestartPage() const {return m_nRestartPage;}
SetRestartPage(sal_uInt16 nPage)88     void                    SetRestartPage(sal_uInt16 nPage) { m_nRestartPage = nPage;}
89 
skipUntil(sal_uInt16 nPage)90     sal_Bool                skipUntil( sal_uInt16 nPage)
91                                 {return ::svt::RoadmapWizard::skipUntil(WizardState(nPage));}
92 
93     void                    updateRoadmapItemLabel( WizardState _nState );
94 
95  	virtual short		    Execute();
96     virtual void            StartExecuteModal( const Link& rEndDialogHdl );
97 };
98 #endif
99 
100