LibreOffice Module sw (master) 1
dbui.cxx
Go to the documentation of this file.
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 <dbui.hxx>
21
23 : GenericDialogController(pParent, "modules/swriter/ui/savemonitordialog.ui",
24 "SaveMonitorDialog")
25 , m_xDocName(m_xBuilder->weld_label("docname"))
26 , m_xPrinter(m_xBuilder->weld_label("printer"))
27 , m_xPrintInfo(m_xBuilder->weld_label("printinfo"))
28{
29}
30
32{
33}
34
36 : GenericDialogController(pParent, "modules/swriter/ui/printmonitordialog.ui",
37 "PrintMonitorDialog")
38 , m_xPrinter(m_xBuilder->weld_label("printer"))
39 , m_xPrintInfo(m_xBuilder->weld_label("printinfo"))
40{
41}
42
44{
45}
46
47// Progress Indicator for Creation of personalized Mail Merge documents:
49 : GenericDialogController(pParent, "modules/swriter/ui/mmcreatingdialog.ui",
50 "MMCreatingDialog")
51 , m_nTotalCount(0)
52 , m_nCurrentPosition(0)
53 , m_xCounting(m_xBuilder->weld_label("progress"))
54{
55 m_sCountingPattern = m_xCounting->get_label();
56 m_xCounting->set_label("...");
57}
58
60{
61}
62
64{
65 constexpr OUStringLiteral sVariable_Total(u"%Y");
66 constexpr OUStringLiteral sVariable_Position(u"%X");
67
68 OUString sText(m_sCountingPattern);
69 sText = sText.replaceAll( sVariable_Total, OUString::number( m_nTotalCount ) );
70 sText = sText.replaceAll( sVariable_Position, OUString::number( m_nCurrentPosition ) );
71 m_xCounting->set_label(sText);
72}
73
74void CreateMonitor::SetTotalCount( sal_Int32 nTotal )
75{
76 m_nTotalCount = nTotal;
78}
79
80void CreateMonitor::SetCurrentPosition( sal_Int32 nCurrent )
81{
82 m_nCurrentPosition = nCurrent;
84}
85
86/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString m_sCountingPattern
Definition: dbui.hxx:60
void UpdateCountingText()
Definition: dbui.cxx:63
virtual ~CreateMonitor() override
Definition: dbui.cxx:59
void SetTotalCount(sal_Int32 nTotal)
Definition: dbui.cxx:74
sal_Int32 m_nTotalCount
Definition: dbui.hxx:61
void SetCurrentPosition(sal_Int32 nCurrent)
Definition: dbui.cxx:80
CreateMonitor(weld::Window *pParent)
Definition: dbui.cxx:48
std::unique_ptr< weld::Label > m_xCounting
Definition: dbui.hxx:64
sal_Int32 m_nCurrentPosition
Definition: dbui.hxx:62
virtual ~PrintMonitor() override
Definition: dbui.cxx:43
PrintMonitor(weld::Window *pParent)
Definition: dbui.cxx:35
SaveMonitor(weld::Window *pParent)
Definition: dbui.cxx:22
virtual ~SaveMonitor() override
Definition: dbui.cxx:31
float u