1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: mmoutputtypepage.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sw.hxx"
34 #ifdef SW_DLLIMPLEMENTATION
35 #undef SW_DLLIMPLEMENTATION
39 #include <mmoutputtypepage.hxx>
40 #include <mailmergewizard.hxx>
41 #include <mmconfigitem.hxx>
42 #include <vcl/msgbox.hxx>
46 #include <swtypes.hxx>
47 #include <mmoutputtypepage.hrc>
50 /*-- 02.04.2004 11:06:55---------------------------------------------------
52 -----------------------------------------------------------------------*/
53 SwMailMergeOutputTypePage::SwMailMergeOutputTypePage( SwMailMergeWizard
* _pParent
) :
54 svt::OWizardPage( _pParent
, SW_RES(DLG_MM_OUTPUTTYPE_PAGE
)),
56 #pragma warning (disable : 4355)
58 m_aHeaderFI( this, SW_RES( FI_HEADER
)),
59 m_aTypeFT( this, SW_RES( FT_TYPE
)),
60 m_aLetterRB( this, SW_RES( RB_LETTER
)),
61 m_aMailRB( this, SW_RES( RB_MAIL
)),
62 m_aHintHeaderFI(this, SW_RES( FI_HINTHEADER
)),
63 m_aHintFI( this, SW_RES( FI_HINT
)),
64 m_aNoMailHintFI(this, SW_RES( FT_NOMAILHINT
)),
66 #pragma warning (default : 4355)
68 m_sLetterHintHeader( SW_RES( ST_LETTERHINTHEADER
)),
69 m_sMailHintHeader( SW_RES( ST_MAILHINTHEADER
)),
70 m_sLetterHint( SW_RES( ST_LETTERHINT
)),
71 m_sMailHint( SW_RES( ST_MAILHINT
)),
75 Link aLink
= LINK(this, SwMailMergeOutputTypePage
, TypeHdl_Impl
);
76 m_aLetterRB
.SetClickHdl(aLink
);
77 m_aMailRB
.SetClickHdl(aLink
);
79 SwMailMergeConfigItem
& rConfigItem
= m_pWizard
->GetConfigItem();
80 m_pWizard
->EnterWait();
81 bool bMailAvailable
= rConfigItem
.IsMailAvailable();
82 m_pWizard
->LeaveWait();
83 if(rConfigItem
.IsOutputToLetter())
89 m_aNoMailHintFI
.Show();
90 m_aMailRB
.Enable(sal_False
);
93 TypeHdl_Impl(&m_aLetterRB
);
96 /*-- 02.04.2004 11:06:55---------------------------------------------------
98 -----------------------------------------------------------------------*/
99 SwMailMergeOutputTypePage::~SwMailMergeOutputTypePage()
102 /*-- 14.04.2004 14:44:07---------------------------------------------------
104 -----------------------------------------------------------------------*/
105 IMPL_LINK( SwMailMergeOutputTypePage
, TypeHdl_Impl
, RadioButton
*, EMPTYARG
)
107 bool bLetter
= m_aLetterRB
.IsChecked();
108 m_aHintHeaderFI
.SetText(bLetter
? m_sLetterHintHeader
: m_sMailHintHeader
);
109 m_aHintFI
.SetText(bLetter
? m_sLetterHint
: m_sMailHint
);
110 m_pWizard
->GetConfigItem().SetOutputToLetter(bLetter
);
111 m_pWizard
->updateRoadmapItemLabel( MM_ADDRESSBLOCKPAGE
);
112 m_pWizard
->UpdateRoadmap();