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 :
20 : #include <mmoutputtypepage.hxx>
21 : #include <mailmergewizard.hxx>
22 : #include <mmconfigitem.hxx>
23 : #include <vcl/msgbox.hxx>
24 : #include <dbui.hrc>
25 : #include <swtypes.hxx>
26 : #include <mmoutputtypepage.hrc>
27 :
28 0 : SwMailMergeOutputTypePage::SwMailMergeOutputTypePage( SwMailMergeWizard* _pParent) :
29 : svt::OWizardPage( _pParent, SW_RES(DLG_MM_OUTPUTTYPE_PAGE)),
30 : #ifdef MSC
31 : #pragma warning (disable : 4355)
32 : #endif
33 : m_aHeaderFI( this, SW_RES( FI_HEADER )),
34 : m_aTypeFT( this, SW_RES( FT_TYPE )),
35 : m_aLetterRB( this, SW_RES( RB_LETTER )),
36 : m_aMailRB( this, SW_RES( RB_MAIL )),
37 : m_aHintHeaderFI(this, SW_RES( FI_HINTHEADER)),
38 : m_aHintFI( this, SW_RES( FI_HINT)),
39 : #ifdef MSC
40 : #pragma warning (default : 4355)
41 : #endif
42 : m_sLetterHintHeader( SW_RES( ST_LETTERHINTHEADER)),
43 : m_sMailHintHeader( SW_RES( ST_MAILHINTHEADER)),
44 : m_sLetterHint( SW_RES( ST_LETTERHINT)),
45 : m_sMailHint( SW_RES( ST_MAILHINT)),
46 0 : m_pWizard(_pParent)
47 : {
48 0 : FreeResource();
49 0 : Link aLink = LINK(this, SwMailMergeOutputTypePage, TypeHdl_Impl);
50 0 : m_aLetterRB.SetClickHdl(aLink);
51 0 : m_aMailRB.SetClickHdl(aLink);
52 :
53 0 : SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
54 0 : if(rConfigItem.IsOutputToLetter())
55 0 : m_aLetterRB.Check();
56 : else
57 0 : m_aMailRB.Check();
58 0 : TypeHdl_Impl(&m_aLetterRB);
59 :
60 0 : }
61 :
62 0 : SwMailMergeOutputTypePage::~SwMailMergeOutputTypePage()
63 : {
64 0 : }
65 :
66 0 : IMPL_LINK_NOARG(SwMailMergeOutputTypePage, TypeHdl_Impl)
67 : {
68 0 : bool bLetter = m_aLetterRB.IsChecked();
69 0 : m_aHintHeaderFI.SetText(bLetter ? m_sLetterHintHeader : m_sMailHintHeader);
70 0 : m_aHintFI.SetText(bLetter ? m_sLetterHint : m_sMailHint);
71 0 : m_pWizard->GetConfigItem().SetOutputToLetter(bLetter);
72 0 : m_pWizard->updateRoadmapItemLabel( MM_ADDRESSBLOCKPAGE );
73 0 : m_pWizard->UpdateRoadmap();
74 0 : return 0;
75 : }
76 :
77 :
78 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|