LibreOffice Module dbaccess (master) 1
sqlmessage.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 <core_resource.hxx>
21#include <sqlmessage.hxx>
22#include <strings.hrc>
23#include <com/sun/star/sdbc/SQLException.hpp>
24#include <com/sun/star/sdb/SQLContext.hpp>
25#include <utility>
26#include <vcl/stdtext.hxx>
27#include <vcl/svapp.hxx>
28#include <vcl/weld.hxx>
29#include <osl/diagnose.h>
33
34#include <tools/urlobj.hxx>
35
36#define RET_MORE RET_RETRY + 1
37
38using namespace dbtools;
39using namespace com::sun::star::uno;
40using namespace com::sun::star::sdb;
41using namespace com::sun::star::sdbc;
42
43namespace dbaui
44{
45
46namespace
47{
48 class ImageProvider
49 {
50 private:
52
53 public:
54 explicit ImageProvider(OUString defaultImageID)
55 : m_defaultImageID(std::move(defaultImageID))
56 {
57 }
58
59 const OUString& getImage() const
60 {
61 return m_defaultImageID;
62 }
63 };
64
65 class LabelProvider
66 {
67 private:
68 OUString m_label;
69 public:
70 explicit LabelProvider(TranslateId labelResourceID)
71 : m_label(DBA_RES(labelResourceID))
72 {
73 }
74
75 const OUString& getLabel() const
76 {
77 return m_label;
78 }
79 };
80
81 class ProviderFactory
82 {
83 private:
84 mutable std::shared_ptr< ImageProvider > m_pErrorImage;
85 mutable std::shared_ptr< ImageProvider > m_pWarningsImage;
86 mutable std::shared_ptr< ImageProvider > m_pInfoImage;
87 mutable std::shared_ptr< LabelProvider > m_pErrorLabel;
88 mutable std::shared_ptr< LabelProvider > m_pWarningsLabel;
89 mutable std::shared_ptr< LabelProvider > m_pInfoLabel;
90
91 public:
92 ProviderFactory()
93 {
94 }
95
96 std::shared_ptr< ImageProvider > const & getImageProvider( SQLExceptionInfo::TYPE _eType ) const
97 {
98 std::shared_ptr< ImageProvider >* ppProvider( &m_pErrorImage );
99 OUString sNormalImageID("dialog-error");
100
101 switch ( _eType )
102 {
103 case SQLExceptionInfo::TYPE::SQLWarning:
104 ppProvider = &m_pWarningsImage;
105 sNormalImageID = "dialog-warning";
106 break;
107
108 case SQLExceptionInfo::TYPE::SQLContext:
109 ppProvider = &m_pInfoImage;
110 sNormalImageID = "dialog-information";
111 break;
112
113 default:
114 break;
115 }
116
117 if ( !ppProvider->get() )
118 (*ppProvider) = std::make_shared<ImageProvider>(sNormalImageID);
119 return *ppProvider;
120 }
121
122 std::shared_ptr< LabelProvider > const & getLabelProvider( SQLExceptionInfo::TYPE _eType, bool _bSubLabel ) const
123 {
124 std::shared_ptr< LabelProvider >* ppProvider( &m_pErrorLabel );
125 TranslateId pLabelID( STR_EXCEPTION_ERROR );
126
127 switch ( _eType )
128 {
129 case SQLExceptionInfo::TYPE::SQLWarning:
130 ppProvider = &m_pWarningsLabel;
131 pLabelID = STR_EXCEPTION_WARNING;
132 break;
133
134 case SQLExceptionInfo::TYPE::SQLContext:
135 ppProvider = &m_pInfoLabel;
136 pLabelID = _bSubLabel ? STR_EXCEPTION_DETAILS : STR_EXCEPTION_INFO;
137 break;
138 default:
139 break;
140 }
141
142 if ( !ppProvider->get() )
143 (*ppProvider) = std::make_shared<LabelProvider>( pLabelID );
144 return *ppProvider;
145 }
146
147 };
148
150 struct ExceptionDisplayInfo
151 {
153
154 std::shared_ptr< ImageProvider > pImageProvider;
155 std::shared_ptr< LabelProvider > pLabelProvider;
156
158
159 OUString sMessage;
160 OUString sSQLState;
161 OUString sErrorCode;
162
163 ExceptionDisplayInfo() : eType( SQLExceptionInfo::TYPE::Undefined ), bSubEntry( false ) { }
164 explicit ExceptionDisplayInfo( SQLExceptionInfo::TYPE _eType ) : eType( _eType ), bSubEntry( false ) { }
165 };
166
167 bool lcl_hasDetails( const ExceptionDisplayInfo& _displayInfo )
168 {
169 return ( !_displayInfo.sErrorCode.isEmpty() )
170 || ( !_displayInfo.sSQLState.isEmpty()
171 && _displayInfo.sSQLState != "S1000"
172 );
173 }
174
175 typedef std::vector< ExceptionDisplayInfo > ExceptionDisplayChain;
176
178 OUString lcl_stripOOoBaseVendor( const OUString& _rErrorMessage )
179 {
180 OUString sErrorMessage( _rErrorMessage );
181
182 const OUString sVendorIdentifier( ::connectivity::SQLError::getMessagePrefix() );
183 if ( sErrorMessage.startsWith( sVendorIdentifier ) )
184 {
185 // characters to strip
186 sal_Int32 nStripLen( sVendorIdentifier.getLength() );
187 // usually, there should be a whitespace between the vendor and the real message
188 while ( ( sErrorMessage.getLength() > nStripLen )
189 && ( sErrorMessage[nStripLen] == ' ' )
190 )
191 ++nStripLen;
192 sErrorMessage = sErrorMessage.copy( nStripLen );
193 }
194
195 return sErrorMessage;
196 }
197
198 void lcl_buildExceptionChain( const SQLExceptionInfo& _rErrorInfo, const ProviderFactory& _rFactory, ExceptionDisplayChain& _out_rChain )
199 {
200 ExceptionDisplayChain().swap(_out_rChain);
201
202 SQLExceptionIteratorHelper iter( _rErrorInfo );
203 while ( iter.hasMoreElements() )
204 {
205 // current chain element
206 SQLExceptionInfo aCurrentElement;
207 iter.next( aCurrentElement );
208
209 const SQLException* pCurrentError = aCurrentElement;
210 OSL_ENSURE( pCurrentError, "lcl_buildExceptionChain: iterator failure!" );
211 // hasMoreElements should not have returned <TRUE/> in this case
212
213 ExceptionDisplayInfo aDisplayInfo( aCurrentElement.getType() );
214
215 aDisplayInfo.sMessage = pCurrentError->Message.trim();
216 aDisplayInfo.sSQLState = pCurrentError->SQLState;
217 if ( pCurrentError->ErrorCode )
218 aDisplayInfo.sErrorCode = OUString::number( pCurrentError->ErrorCode );
219
220 if ( aDisplayInfo.sMessage.isEmpty()
221 && !lcl_hasDetails( aDisplayInfo )
222 )
223 {
224 OSL_FAIL( "lcl_buildExceptionChain: useless exception: no state, no error code, no message!" );
225 continue;
226 }
227
228 aDisplayInfo.pImageProvider = _rFactory.getImageProvider( aCurrentElement.getType() );
229 aDisplayInfo.pLabelProvider = _rFactory.getLabelProvider( aCurrentElement.getType(), false );
230
231 _out_rChain.push_back( aDisplayInfo );
232
233 if ( aCurrentElement.getType() == SQLExceptionInfo::TYPE::SQLContext )
234 {
235 const SQLContext* pContext = aCurrentElement;
236 if ( !pContext->Details.isEmpty() )
237 {
238 ExceptionDisplayInfo aSubInfo( aCurrentElement.getType() );
239
240 aSubInfo.sMessage = pContext->Details;
241 aSubInfo.pImageProvider = _rFactory.getImageProvider( aCurrentElement.getType() );
242 aSubInfo.pLabelProvider = _rFactory.getLabelProvider( aCurrentElement.getType(), true );
243 aSubInfo.bSubEntry = true;
244
245 _out_rChain.push_back( aSubInfo );
246 }
247 }
248 }
249 }
250
251 void lcl_insertExceptionEntry(weld::TreeView& rList, size_t nElementPos, const ExceptionDisplayInfo& rEntry)
252 {
253 rList.append(OUString::number(nElementPos), rEntry.pLabelProvider->getLabel(), rEntry.pImageProvider->getImage());
254 }
255}
256
257namespace {
258
259class OExceptionChainDialog : public weld::GenericDialogController
260{
261 std::unique_ptr<weld::TreeView> m_xExceptionList;
262 std::unique_ptr<weld::TextView> m_xExceptionText;
263
266
267 ExceptionDisplayChain m_aExceptions;
268
269public:
270 OExceptionChainDialog(weld::Window* pParent, ExceptionDisplayChain&& rExceptions);
271
272protected:
273 DECL_LINK(OnExceptionSelected, weld::TreeView&, void);
274};
275
276}
277
278OExceptionChainDialog::OExceptionChainDialog(weld::Window* pParent, ExceptionDisplayChain&& rExceptions)
279 : GenericDialogController(pParent, "dbaccess/ui/sqlexception.ui", "SQLExceptionDialog")
280 , m_xExceptionList(m_xBuilder->weld_tree_view("list"))
281 , m_xExceptionText(m_xBuilder->weld_text_view("description"))
282 , m_aExceptions(std::move(rExceptions))
283{
284 int nListWidth = m_xExceptionText->get_approximate_digit_width() * 28;
285 int nTextWidth = m_xExceptionText->get_approximate_digit_width() * 42;
286 int nHeight = m_xExceptionList->get_height_rows(6);
287 m_xExceptionList->set_size_request(nListWidth, nHeight);
288 m_xExceptionText->set_size_request(nTextWidth, nHeight);
289
290 m_sStatusLabel = DBA_RES( STR_EXCEPTION_STATUS );
291 m_sErrorCodeLabel = DBA_RES( STR_EXCEPTION_ERRORCODE );
292
293 m_xExceptionList->connect_changed(LINK(this, OExceptionChainDialog, OnExceptionSelected));
294
295 bool bHave22018 = false;
296 size_t elementPos = 0;
297
298 for (auto const& elem : m_aExceptions)
299 {
300 lcl_insertExceptionEntry(*m_xExceptionList, elementPos, elem);
301 bHave22018 = elem.sSQLState == "22018";
302 ++elementPos;
303 }
304
305 // if the error has the code 22018, then add an additional explanation
306 // #i24021#
307 if ( bHave22018 )
308 {
309 ProviderFactory aProviderFactory;
310
311 ExceptionDisplayInfo aInfo22018;
312 aInfo22018.sMessage = DBA_RES( STR_EXPLAN_STRINGCONVERSION_ERROR );
313 aInfo22018.pLabelProvider = aProviderFactory.getLabelProvider( SQLExceptionInfo::TYPE::SQLContext, false );
314 aInfo22018.pImageProvider = aProviderFactory.getImageProvider( SQLExceptionInfo::TYPE::SQLContext );
315 m_aExceptions.push_back( aInfo22018 );
316
317 lcl_insertExceptionEntry(*m_xExceptionList, m_aExceptions.size() - 1, aInfo22018);
318 }
319
320 if (m_xExceptionList->n_children())
321 {
322 m_xExceptionList->select(0);
323 OnExceptionSelected(*m_xExceptionList);
324 }
325}
326
327IMPL_LINK_NOARG(OExceptionChainDialog, OnExceptionSelected, weld::TreeView&, void)
328{
329 OUString sText;
330
331 OUString sId(m_xExceptionList->get_selected_id());
332 if (!sId.isEmpty())
333 {
334 const ExceptionDisplayInfo& aExceptionInfo(m_aExceptions[sId.toUInt32()]);
335
336 if ( !aExceptionInfo.sSQLState.isEmpty() )
337 {
338 sText += m_sStatusLabel + ": " + aExceptionInfo.sSQLState + "\n";
339 }
340
341 if ( !aExceptionInfo.sErrorCode.isEmpty() )
342 {
343 sText += m_sErrorCodeLabel + ": " + aExceptionInfo.sErrorCode + "\n";
344 }
345
346 if ( !sText.isEmpty() )
347 sText += "\n";
348
349 sText += aExceptionInfo.sMessage;
350 }
351
352 m_xExceptionText->set_text(sText);
353}
354
355// SQLMessageBox_Impl
357{
358 ExceptionDisplayChain aDisplayInfo;
359
360 explicit SQLMessageBox_Impl( const SQLExceptionInfo& _rExceptionInfo )
361 {
362 // transform the exception chain to a form more suitable for displaying it here
363 ProviderFactory aProviderFactory;
364 lcl_buildExceptionChain( _rExceptionInfo, aProviderFactory, aDisplayInfo );
365 }
366};
367
368namespace
369{
370 void lcl_addButton(weld::MessageDialog* pDialog, StandardButtonType eType, bool bDefault)
371 {
372 sal_uInt16 nButtonID = 0;
373 switch (eType)
374 {
375 case StandardButtonType::Yes:
376 nButtonID = RET_YES;
377 pDialog->add_button(GetStandardText(StandardButtonType::Yes), nButtonID);
378 break;
379 case StandardButtonType::No:
380 nButtonID = RET_NO;
381 pDialog->add_button(GetStandardText(StandardButtonType::No), nButtonID);
382 break;
383 case StandardButtonType::OK:
384 nButtonID = RET_OK;
385 pDialog->add_button(GetStandardText(StandardButtonType::OK), nButtonID);
386 break;
387 case StandardButtonType::Cancel:
388 nButtonID = RET_CANCEL;
389 pDialog->add_button(GetStandardText(StandardButtonType::Cancel), nButtonID);
390 break;
391 case StandardButtonType::Retry:
392 nButtonID = RET_RETRY;
393 pDialog->add_button(GetStandardText(StandardButtonType::Retry), nButtonID);
394 break;
395 case StandardButtonType::Help:
396 nButtonID = RET_HELP;
397 pDialog->add_button(GetStandardText(StandardButtonType::Help), nButtonID);
398 break;
399 default:
400 OSL_FAIL( "lcl_addButton: invalid button id!" );
401 break;
402 }
403 if (bDefault)
404 pDialog->set_default_response(nButtonID);
405 }
406}
407
408void OSQLMessageBox::impl_fillMessages()
409{
410 OSL_PRECOND( !m_pImpl->aDisplayInfo.empty(), "OSQLMessageBox::impl_fillMessages: nothing to display at all?" );
411
412 if ( m_pImpl->aDisplayInfo.empty() )
413 return;
414 const ExceptionDisplayInfo* pSecondInfo = nullptr;
415
416 const ExceptionDisplayInfo& rFirstInfo = *m_pImpl->aDisplayInfo.begin();
417 if ( m_pImpl->aDisplayInfo.size() > 1 )
418 pSecondInfo = &m_pImpl->aDisplayInfo[1];
419 OUString sPrimary, sSecondary;
420 sPrimary = rFirstInfo.sMessage;
421 // one or two texts to display?
422 if ( pSecondInfo )
423 {
424 // we show two elements in the main dialog if and only if one of
425 // - the first element in the chain is an SQLContext, and the second
426 // element denotes its sub entry
427 // - the first and the second element are both independent (i.e. the second
428 // is no sub entry), and none of them is a context.
429 bool bFirstElementIsContext = ( rFirstInfo.eType == SQLExceptionInfo::TYPE::SQLContext );
430 bool bSecondElementIsContext = ( pSecondInfo->eType == SQLExceptionInfo::TYPE::SQLContext );
431
432 if ( bFirstElementIsContext && pSecondInfo->bSubEntry )
433 sSecondary = pSecondInfo->sMessage;
434 if ( !bFirstElementIsContext && !bSecondElementIsContext )
435 sSecondary = pSecondInfo->sMessage;
436 }
437
438 // primary text
439 m_xDialog->set_primary_text(lcl_stripOOoBaseVendor(sPrimary));
440
441 // secondary text (if applicable)
442 m_xDialog->set_secondary_text(lcl_stripOOoBaseVendor(sSecondary));
443}
444
445void OSQLMessageBox::impl_createStandardButtons( MessBoxStyle _nStyle )
446{
447 if ( _nStyle & MessBoxStyle::YesNoCancel )
448 {
449 lcl_addButton(m_xDialog.get(), StandardButtonType::Yes, bool(_nStyle & MessBoxStyle::DefaultYes));
450 lcl_addButton(m_xDialog.get(), StandardButtonType::No, bool(_nStyle & MessBoxStyle::DefaultNo));
451 lcl_addButton(m_xDialog.get(), StandardButtonType::Cancel, bool(_nStyle & MessBoxStyle::DefaultCancel));
452 }
453 else if ( _nStyle & MessBoxStyle::OkCancel )
454 {
455 lcl_addButton(m_xDialog.get(), StandardButtonType::OK, bool(_nStyle & MessBoxStyle::DefaultOk));
456 lcl_addButton(m_xDialog.get(), StandardButtonType::Cancel, bool(_nStyle & MessBoxStyle::DefaultCancel));
457 }
458 else if ( _nStyle & MessBoxStyle::YesNo )
459 {
460 lcl_addButton(m_xDialog.get(), StandardButtonType::Yes, bool(_nStyle & MessBoxStyle::DefaultYes));
461 lcl_addButton(m_xDialog.get(), StandardButtonType::No, bool(_nStyle & MessBoxStyle::DefaultNo));
462 }
463 else if ( _nStyle & MessBoxStyle::RetryCancel )
464 {
465 lcl_addButton(m_xDialog.get(), StandardButtonType::Retry, bool(_nStyle & MessBoxStyle::DefaultRetry));
466 lcl_addButton(m_xDialog.get(), StandardButtonType::Cancel, bool(_nStyle & MessBoxStyle::DefaultCancel));
467 }
468 else if ( _nStyle & MessBoxStyle::Ok )
469 {
470 lcl_addButton(m_xDialog.get(), StandardButtonType::OK, true);
471 }
472
473 if ( m_sHelpURL.isEmpty() )
474 return;
475
476 lcl_addButton(m_xDialog.get(), StandardButtonType::Help, false);
477
478 OUString aTmp;
479 INetURLObject aHID( m_sHelpURL );
480 if ( aHID.GetProtocol() == INetProtocol::Hid )
481 aTmp = aHID.GetURLPath();
482 else
483 aTmp = m_sHelpURL;
484
485 m_xDialog->set_help_id(aTmp);
486}
487
488void OSQLMessageBox::impl_addDetailsButton()
489{
490 size_t nFirstPageVisible = m_xDialog->get_secondary_text().isEmpty() ? 1 : 2;
491
492 bool bMoreDetailsAvailable = m_pImpl->aDisplayInfo.size() > nFirstPageVisible;
493 if ( !bMoreDetailsAvailable )
494 {
495 // even if the text fits into what we can display, we might need to details button
496 // if there is more non-trivial information in the errors than the mere messages
497 for (auto const& error : m_pImpl->aDisplayInfo)
498 {
499 if ( lcl_hasDetails(error) )
500 {
501 bMoreDetailsAvailable = true;
502 break;
503 }
504 }
505 }
506
507 if ( bMoreDetailsAvailable )
508 {
509 m_xDialog->add_button(GetStandardText(StandardButtonType::More), RET_MORE);
510 m_xMoreButton.reset(m_xDialog->weld_widget_for_response(RET_MORE));
511 m_xMoreButton->connect_clicked(LINK(this, OSQLMessageBox, ButtonClickHdl));
512 }
513}
514
515void OSQLMessageBox::Construct(weld::Window* pParent, MessBoxStyle _nStyle, MessageType _eImage)
516{
517 // init the image
518 MessageType eType( _eImage );
519 if ( eType == AUTO )
520 {
521 switch ( m_pImpl->aDisplayInfo[0].eType )
522 {
523 case SQLExceptionInfo::TYPE::SQLException: eType = Error; break;
524 case SQLExceptionInfo::TYPE::SQLWarning: eType = Warning; break;
525 case SQLExceptionInfo::TYPE::SQLContext: eType = Info; break;
526 default: OSL_FAIL( "OSQLMessageBox::Construct: invalid type!" );
527 }
528 }
529 VclMessageType eMessageType;
530 switch (eType)
531 {
532 default:
533 OSL_FAIL( "OSQLMessageBox::impl_initImage: unsupported image type!" );
534 [[fallthrough]];
535 case Info:
536 eMessageType = VclMessageType::Info;
537 break;
538 case Warning:
539 eMessageType = VclMessageType::Warning;
540 break;
541 case Error:
542 eMessageType = VclMessageType::Error;
543 break;
544 case Query:
545 eMessageType = VclMessageType::Question;
546 break;
547 }
548
549 m_xDialog.reset(Application::CreateMessageDialog(pParent, eMessageType, VclButtonsType::NONE, ""));
550 m_xDialog->set_title(utl::ConfigManager::getProductName() + " Base");
551
552 impl_fillMessages();
553
554 // create buttons
555 impl_createStandardButtons( _nStyle );
556 impl_addDetailsButton();
557}
558
559OSQLMessageBox::OSQLMessageBox(weld::Window* pParent, const SQLExceptionInfo& rException, MessBoxStyle nStyle, OUString sHelpURL)
560 : m_pImpl(new SQLMessageBox_Impl(rException))
561 , m_sHelpURL(std::move(sHelpURL))
562{
563 Construct(pParent, nStyle, AUTO);
564}
565
566OSQLMessageBox::OSQLMessageBox(weld::Window* pParent, const OUString& rTitle, const OUString& rMessage, MessBoxStyle nStyle, MessageType eType, const ::dbtools::SQLExceptionInfo* pAdditionalErrorInfo )
567{
568 SQLContext aError;
569 aError.Message = rTitle;
570 aError.Details = rMessage;
571 if (pAdditionalErrorInfo)
572 aError.NextException = pAdditionalErrorInfo->get();
573
574 m_pImpl.reset(new SQLMessageBox_Impl(SQLExceptionInfo(aError)));
575
576 Construct(pParent, nStyle, eType);
577}
578
580{
581}
582
584{
585 OExceptionChainDialog aDlg(m_xDialog.get(), std::vector(m_pImpl->aDisplayInfo));
586 aDlg.run();
587}
588
589// OSQLWarningBox
590OSQLWarningBox::OSQLWarningBox(weld::Window* pParent, const OUString& rMessage, MessBoxStyle nStyle,
591 const ::dbtools::SQLExceptionInfo* pAdditionalErrorInfo )
592 : OSQLMessageBox(pParent, DBA_RES(STR_EXCEPTION_WARNING), rMessage, nStyle, MessageType::Warning, pAdditionalErrorInfo)
593{
594}
595
596// OSQLErrorBox
597OSQLErrorBox::OSQLErrorBox(weld::Window* pParent, const OUString& rMessage)
598 : OSQLMessageBox(pParent, DBA_RES(STR_EXCEPTION_ERROR), rMessage, MessBoxStyle::Ok | MessBoxStyle::DefaultOk,
599 MessageType::Error, nullptr)
600{
601}
602
603} // namespace dbaui
604
605/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
::std::unique_ptr< XmlIdRegistry_Impl > m_pImpl
Reference< XExecutableDialog > m_xDialog
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
OUString GetURLPath(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
INetProtocol GetProtocol() const
static const OUString & getMessagePrefix()
OSQLErrorBox(weld::Window *pParent, const OUString &_rMessage)
Definition: sqlmessage.cxx:597
std::unique_ptr< SQLMessageBox_Impl > m_pImpl
Definition: sqlmessage.hxx:78
void Construct(weld::Window *pParent, MessBoxStyle nStyle, MessageType eImage)
Definition: sqlmessage.cxx:515
OSQLMessageBox(weld::Window *pParent, const dbtools::SQLExceptionInfo &_rException, MessBoxStyle _nStyle=MessBoxStyle::Ok|MessBoxStyle::DefaultOk, OUString _sHelpURL=OUString())
display an SQLException with auto-recognizing a main and a detailed message
Definition: sqlmessage.cxx:559
virtual ~OSQLMessageBox() override
Definition: sqlmessage.cxx:579
OSQLWarningBox(weld::Window *pParent, const OUString &_rMessage, MessBoxStyle _nStyle=MessBoxStyle::Ok|MessBoxStyle::DefaultOk, const ::dbtools::SQLExceptionInfo *_pAdditionalErrorInfo=nullptr)
Definition: sqlmessage.cxx:590
static OUString getProductName()
virtual void set_default_response(int response)=0
virtual void add_button(const OUString &rText, int response, const OUString &rHelpId={})=0
void append(TreeIter *pRet=nullptr)
#define DBA_RES(id)
DECL_LINK(CheckNameHdl, SvxNameDialog &, bool)
IMPL_LINK_NOARG(OApplicationController, OnClipboardChanged, TransferableDataHelper *, void)
IMPL_LINK_NOARG(OSQLMessageBox, ButtonClickHdl, weld::Button &, void)
Definition: sqlmessage.cxx:583
MessBoxStyle
Definition: sqlmessage.hxx:48
@ Warning
Definition: sqlmessage.hxx:43
std::shared_ptr< LabelProvider > m_pErrorLabel
Definition: sqlmessage.cxx:87
OUString sSQLState
Definition: sqlmessage.cxx:160
std::unique_ptr< weld::TextView > m_xExceptionText
Definition: sqlmessage.cxx:262
OUString sMessage
Definition: sqlmessage.cxx:159
bool bSubEntry
Definition: sqlmessage.cxx:157
OUString m_label
Definition: sqlmessage.cxx:68
std::shared_ptr< LabelProvider > m_pWarningsLabel
Definition: sqlmessage.cxx:88
std::shared_ptr< ImageProvider > pImageProvider
Definition: sqlmessage.cxx:154
std::shared_ptr< ImageProvider > m_pErrorImage
Definition: sqlmessage.cxx:84
std::shared_ptr< LabelProvider > m_pInfoLabel
Definition: sqlmessage.cxx:89
SQLExceptionInfo::TYPE eType
Definition: sqlmessage.cxx:152
std::shared_ptr< ImageProvider > m_pInfoImage
Definition: sqlmessage.cxx:86
ExceptionDisplayChain m_aExceptions
Definition: sqlmessage.cxx:267
OUString sErrorCode
Definition: sqlmessage.cxx:161
std::unique_ptr< weld::TreeView > m_xExceptionList
Definition: sqlmessage.cxx:261
std::shared_ptr< ImageProvider > m_pWarningsImage
Definition: sqlmessage.cxx:85
std::shared_ptr< LabelProvider > pLabelProvider
Definition: sqlmessage.cxx:155
OUString m_defaultImageID
Definition: sqlmessage.cxx:51
OUString m_sStatusLabel
Definition: sqlmessage.cxx:264
#define RET_MORE
Definition: sqlmessage.cxx:36
OUString m_sErrorCodeLabel
Definition: sqlmessage.cxx:265
OUString VCL_DLLPUBLIC GetStandardText(StandardButtonType eButton)
ExceptionDisplayChain aDisplayInfo
Definition: sqlmessage.cxx:358
SQLMessageBox_Impl(const SQLExceptionInfo &_rExceptionInfo)
Definition: sqlmessage.cxx:360
TYPE
OUString sId
Definition: unodatbr.cxx:1040
RET_HELP
RET_OK
RET_CANCEL
RET_NO
RET_RETRY
RET_YES
VclMessageType
StandardButtonType