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 :
27 0 : SwMailMergeOutputTypePage::SwMailMergeOutputTypePage(SwMailMergeWizard* pParent)
28 : : svt::OWizardPage(pParent, "MMOutputTypePage",
29 : "modules/swriter/ui/mmoutputtypepage.ui")
30 0 : , m_pWizard(pParent)
31 : {
32 0 : get(m_pLetterRB, "letter");
33 0 : get(m_pMailRB, "email");
34 0 : get(m_pLetterHint, "letterft");
35 0 : get(m_pMailHint, "emailft");
36 :
37 0 : Link aLink = LINK(this, SwMailMergeOutputTypePage, TypeHdl_Impl);
38 0 : m_pLetterRB->SetClickHdl(aLink);
39 0 : m_pMailRB->SetClickHdl(aLink);
40 :
41 0 : SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem();
42 0 : if(rConfigItem.IsOutputToLetter())
43 0 : m_pLetterRB->Check();
44 : else
45 0 : m_pMailRB->Check();
46 0 : TypeHdl_Impl(m_pLetterRB);
47 :
48 0 : }
49 :
50 0 : IMPL_LINK_NOARG(SwMailMergeOutputTypePage, TypeHdl_Impl)
51 : {
52 0 : bool bLetter = m_pLetterRB->IsChecked();
53 0 : m_pLetterHint->Show(bLetter);
54 0 : m_pMailHint->Show(!bLetter);
55 0 : m_pWizard->GetConfigItem().SetOutputToLetter(bLetter);
56 0 : m_pWizard->updateRoadmapItemLabel( MM_ADDRESSBLOCKPAGE );
57 0 : m_pWizard->UpdateRoadmap();
58 0 : return 0;
59 : }
60 :
61 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|