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