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_xDocName(m_xBuilder->weld_label("docname"))
39  , m_xPrinter(m_xBuilder->weld_label("printer"))
40  , m_xPrintInfo(m_xBuilder->weld_label("printinfo"))
41 {
42 }
43 
45 {
46 }
47 
48 // Progress Indicator for Creation of personalized Mail Merge documents:
50  : GenericDialogController(pParent, "modules/swriter/ui/mmcreatingdialog.ui",
51  "MMCreatingDialog")
52  , m_sCountingPattern()
53  , m_nTotalCount(0)
54  , m_nCurrentPosition(0)
55  , m_xCounting(m_xBuilder->weld_label("progress"))
56 {
57  m_sCountingPattern = m_xCounting->get_label();
58  m_xCounting->set_label("...");
59 }
60 
62 {
63 }
64 
66 {
67  constexpr OUStringLiteral sVariable_Total("%Y");
68  constexpr OUStringLiteral sVariable_Position("%X");
69 
70  OUString sText(m_sCountingPattern);
71  sText = sText.replaceAll( sVariable_Total, OUString::number( m_nTotalCount ) );
72  sText = sText.replaceAll( sVariable_Position, OUString::number( m_nCurrentPosition ) );
73  m_xCounting->set_label(sText);
74 }
75 
76 void CreateMonitor::SetTotalCount( sal_Int32 nTotal )
77 {
78  m_nTotalCount = nTotal;
80 }
81 
82 void CreateMonitor::SetCurrentPosition( sal_Int32 nCurrent )
83 {
84  m_nCurrentPosition = nCurrent;
86 }
87 
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 m_nTotalCount
Definition: dbui.hxx:62
void UpdateCountingText()
Definition: dbui.cxx:65
OUString m_sCountingPattern
Definition: dbui.hxx:61
PrintMonitor(weld::Window *pParent)
Definition: dbui.cxx:35
sal_Int32 m_nCurrentPosition
Definition: dbui.hxx:63
virtual ~PrintMonitor() override
Definition: dbui.cxx:44
void SetTotalCount(sal_Int32 nTotal)
Definition: dbui.cxx:76
virtual ~SaveMonitor() override
Definition: dbui.cxx:31
void SetCurrentPosition(sal_Int32 nCurrent)
Definition: dbui.cxx:82
CreateMonitor(weld::Window *pParent)
Definition: dbui.cxx:49
std::unique_ptr< weld::Label > m_xCounting
Definition: dbui.hxx:65
SaveMonitor(weld::Window *pParent)
Definition: dbui.cxx:22
virtual ~CreateMonitor() override
Definition: dbui.cxx:61