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 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_sw.hxx"
26 
27 #ifdef SW_DLLIMPLEMENTATION
28 #undef SW_DLLIMPLEMENTATION
29 #endif
30 
31 
32 #include <mmoutputtypepage.hxx>
33 #include <mailmergewizard.hxx>
34 #include <mmconfigitem.hxx>
35 #include <vcl/msgbox.hxx>
36 #ifndef _DBUI_HRC
37 #include <dbui.hrc>
38 #endif
39 #include <swtypes.hxx>
40 #include <mmoutputtypepage.hrc>
41 #include <dbui.hrc>
42 
43 /*-- 02.04.2004 11:06:55---------------------------------------------------
44 
45   -----------------------------------------------------------------------*/
SwMailMergeOutputTypePage(SwMailMergeWizard * _pParent)46 SwMailMergeOutputTypePage::SwMailMergeOutputTypePage( SwMailMergeWizard* _pParent) :
47     svt::OWizardPage( _pParent, SW_RES(DLG_MM_OUTPUTTYPE_PAGE)),
48 #ifdef MSC
49 #pragma warning (disable : 4355)
50 #endif
51     m_aHeaderFI(    this, SW_RES( FI_HEADER    )),
52     m_aTypeFT(      this, SW_RES( FT_TYPE    )),
53     m_aLetterRB(    this, SW_RES( RB_LETTER  )),
54     m_aMailRB(      this, SW_RES( RB_MAIL    )),
55     m_aHintHeaderFI(this, SW_RES( FI_HINTHEADER)),
56     m_aHintFI(      this, SW_RES( FI_HINT)),
57 #ifdef MSC
58 #pragma warning (default : 4355)
59 #endif
60     m_sLetterHintHeader(  SW_RES( ST_LETTERHINTHEADER)),
61     m_sMailHintHeader(      SW_RES( ST_MAILHINTHEADER)),
62     m_sLetterHint(          SW_RES( ST_LETTERHINT)),
63     m_sMailHint(            SW_RES( ST_MAILHINT)),
64     m_pWizard(_pParent)
65 {
66     FreeResource();
67     Link aLink = LINK(this, SwMailMergeOutputTypePage, TypeHdl_Impl);
68     m_aLetterRB.SetClickHdl(aLink);
69     m_aMailRB.SetClickHdl(aLink);
70 
71     SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
72     if(rConfigItem.IsOutputToLetter())
73         m_aLetterRB.Check();
74     else
75         m_aMailRB.Check();
76     TypeHdl_Impl(&m_aLetterRB);
77 
78 }
79 /*-- 02.04.2004 11:06:55---------------------------------------------------
80 
81   -----------------------------------------------------------------------*/
~SwMailMergeOutputTypePage()82 SwMailMergeOutputTypePage::~SwMailMergeOutputTypePage()
83 {
84 }
85 /*-- 14.04.2004 14:44:07---------------------------------------------------
86 
87   -----------------------------------------------------------------------*/
IMPL_LINK(SwMailMergeOutputTypePage,TypeHdl_Impl,RadioButton *,EMPTYARG)88 IMPL_LINK( SwMailMergeOutputTypePage, TypeHdl_Impl, RadioButton*, EMPTYARG )
89 {
90     bool bLetter = m_aLetterRB.IsChecked();
91         m_aHintHeaderFI.SetText(bLetter ? m_sLetterHintHeader : m_sMailHintHeader);
92         m_aHintFI.SetText(bLetter ? m_sLetterHint : m_sMailHint);
93     m_pWizard->GetConfigItem().SetOutputToLetter(bLetter);
94     m_pWizard->updateRoadmapItemLabel( MM_ADDRESSBLOCKPAGE );
95     m_pWizard->UpdateRoadmap();
96     return 0;
97 }
98 
99 
100