xref: /aoo41x/main/sw/source/ui/inc/mailmergewizard.hxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _MAILMERGEWIZARD_HXX
28 #define _MAILMERGEWIZARD_HXX
29 
30 #include <svtools/roadmapwizard.hxx>
31 
32 class SwView;
33 class SwMailMergeConfigItem;
34 
35 #define MM_DOCUMENTSELECTPAGE   0
36 #define MM_OUTPUTTYPETPAGE      1
37 #define MM_ADDRESSBLOCKPAGE     2
38 #define MM_GREETINGSPAGE        3
39 #define MM_LAYOUTPAGE           4
40 #define MM_PREPAREMERGEPAGE     5
41 #define MM_MERGEPAGE            6
42 #define MM_OUTPUTPAGE           7
43 
44 class SwMailMergeWizard : public ::svt::RoadmapWizard
45 {
46     SwView*                 m_pSwView;
47     String                  sDocumentURL;
48     bool                    m_bDocumentLoad;
49 
50     SwMailMergeConfigItem&  m_rConfigItem;
51 
52     String                  m_sStarting;
53     String                  m_sDocumentType;
54     String                  m_sAddressBlock;
55     String                  m_sAddressList;
56     String                  m_sGreetingsLine;
57     String                  m_sLayout;
58     String                  m_sPrepareMerge;
59     String                  m_sMerge;
60     String                  m_sOutput;
61     String                  m_sFinish;
62 
63     sal_uInt16              m_nRestartPage;
64 
65     using svt::OWizardMachine::skipUntil;
66 
67 protected:
68     virtual svt::OWizardPage*       createPage(WizardState _nState);
69     virtual void                    enterState( WizardState _nState );
70 
71 // roadmap feature ??
72 //    virtual sal_Bool            prepareLeaveCurrentState( CommitPageReason _eReason );
73     virtual String                  getStateDisplayName( WizardState _nState ) const;
74 
75 public:
76     SwMailMergeWizard(SwView& rView, SwMailMergeConfigItem& rConfigItem);
77     ~SwMailMergeWizard();
78 
79     SwView*                     GetSwView() {return m_pSwView;}
80     SwMailMergeConfigItem&      GetConfigItem() { return m_rConfigItem;}
81 
82     void                    SetReloadDocument(const String& rURL){sDocumentURL = rURL;}
83     const String&           GetReloadDocument() const {return sDocumentURL;}
84 
85     //next step requires loading of document
86     void                    SetDocumentLoad(bool bSet) {m_bDocumentLoad = bSet;}
87 
88     void                    UpdateRoadmap();
89     void                    CreateTargetDocument();
90 
91     sal_uInt16              GetRestartPage() const {return m_nRestartPage;}
92     void                    SetRestartPage(sal_uInt16 nPage) { m_nRestartPage = nPage;}
93 
94     sal_Bool                skipUntil( sal_uInt16 nPage)
95                                 {return ::svt::RoadmapWizard::skipUntil(WizardState(nPage));}
96 
97     void                    updateRoadmapItemLabel( WizardState _nState );
98 
99  	virtual short		    Execute();
100     virtual void            StartExecuteModal( const Link& rEndDialogHdl );
101 };
102 #endif
103 
104