LibreOffice Module vcl (master) 1
stdtext.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 <vcl/stdtext.hxx>
21#include <vcl/image.hxx>
22#include <vcl/weld.hxx>
23#include <bitmaps.hlst>
24#include <strings.hrc>
25#include <svdata.hxx>
26
28 std::u16string_view rServiceName, bool bError)
29{
30 OUString aText = VclResId(SV_STDTEXT_SERVICENOTAVAILABLE).replaceAll("%s", rServiceName);
31 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pParent,
33 xBox->run();
34}
35
37{
38 ImplSVData* pSVData = ImplGetSVData();
39 std::vector<Image> &rImages = pSVData->mpWinData->maMsgBoxImgList;
40 if (rImages.empty())
41 {
42 rImages.emplace_back(StockImage::Yes, SV_RESID_BITMAP_ERRORBOX);
43 rImages.emplace_back(StockImage::Yes, SV_RESID_BITMAP_QUERYBOX);
44 rImages.emplace_back(StockImage::Yes, SV_RESID_BITMAP_WARNINGBOX);
45 rImages.emplace_back(StockImage::Yes, SV_RESID_BITMAP_INFOBOX);
46 }
47}
48
50{
53}
54
56{
57 return VclResId(SV_MSGBOX_INFO);
58}
59
61{
64}
65
67{
68 return VclResId(SV_MSGBOX_WARNING);
69}
70
72{
75}
76
78{
79 return VclResId(SV_MSGBOX_ERROR);
80}
81
83{
86}
87
89{
90 return VclResId(SV_MSGBOX_QUERY);
91}
92
94{
95 static TranslateId aResIdAry[static_cast<int>(StandardButtonType::Count)] =
96 {
97 // http://lists.freedesktop.org/archives/libreoffice/2013-January/044513.html
98 // Under windows we don't want accelerators on ok/cancel but do on other
99 // buttons
100#ifdef _WIN32
101 SV_BUTTONTEXT_OK_NOMNEMONIC,
102 SV_BUTTONTEXT_CANCEL_NOMNEMONIC,
103#else
104 SV_BUTTONTEXT_OK,
105 SV_BUTTONTEXT_CANCEL,
106#endif
107 SV_BUTTONTEXT_YES,
108 SV_BUTTONTEXT_NO,
109 SV_BUTTONTEXT_RETRY,
110 SV_BUTTONTEXT_HELP,
111 SV_BUTTONTEXT_CLOSE,
112 SV_BUTTONTEXT_MORE,
113 SV_BUTTONTEXT_IGNORE,
114 SV_BUTTONTEXT_ABORT,
115 SV_BUTTONTEXT_LESS,
116 STR_WIZDLG_PREVIOUS,
117 STR_WIZDLG_NEXT,
118 STR_WIZDLG_FINISH,
119 };
120
121 return VclResId(aResIdAry[static_cast<sal_uInt16>(eButton)]);
122}
123
124/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
Definition: builder.cxx:215
Definition: image.hxx:40
OUString GetStandardQueryBoxText()
Definition: stdtext.cxx:88
Image const & GetStandardInfoBoxImage()
Definition: stdtext.cxx:49
Image const & GetStandardWarningBoxImage()
Definition: stdtext.cxx:60
static void ImplInitMsgBoxImageList()
Definition: stdtext.cxx:36
OUString GetStandardInfoBoxText()
Definition: stdtext.cxx:55
Image const & GetStandardErrorBoxImage()
Definition: stdtext.cxx:71
Image const & GetStandardQueryBoxImage()
Definition: stdtext.cxx:82
OUString GetStandardWarningBoxText()
Definition: stdtext.cxx:66
OUString GetStandardText(StandardButtonType eButton)
Definition: stdtext.cxx:93
void ShowServiceNotAvailableError(weld::Widget *pParent, std::u16string_view rServiceName, bool bError)
Definition: stdtext.cxx:27
OUString GetStandardErrorBoxText()
Definition: stdtext.cxx:77
ImplSVWinData * mpWinData
Definition: svdata.hxx:400
std::vector< Image > maMsgBoxImgList
Definition: svdata.hxx:259
ImplSVData * ImplGetSVData()
Definition: svdata.cxx:77
OUString VclResId(TranslateId aId)
Definition: svdata.cxx:261
StandardButtonType
Definition: wintypes.hxx:244