1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_SQLMESSAGE_HXX
21 #define INCLUDED_DBACCESS_SOURCE_UI_INC_SQLMESSAGE_HXX
23 #include <vcl/button.hxx>
24 #include <vcl/fixed.hxx>
25 #include <vcl/btndlg.hxx>
27 #include <connectivity/dbexception.hxx>
32 namespace com
{ namespace sun
{ namespace star
{
45 struct SQLMessageBox_Impl
;
46 class OSQLMessageBox
: public ButtonDialog
48 VclPtr
<FixedImage
> m_aInfoImage
;
49 VclPtr
<FixedText
> m_aTitle
;
50 VclPtr
<FixedText
> m_aMessage
;
53 ::std::unique_ptr
< SQLMessageBox_Impl
> m_pImpl
;
67 /** display an SQLException with auto-recognizing a main and a detailed message
69 The first two messages from the exception chain are used as main and detailed message (recognizing the
70 detailed field of an <type scope="com::sun::star::sdb">SQLContext</type>).
73 vcl::Window
* _pParent
,
74 const dbtools::SQLExceptionInfo
& _rException
,
75 WinBits _nStyle
= WB_OK
| WB_DEF_OK
,
76 const OUString
& _rHelpURL
= OUString()
79 /** display a database related error message
81 @param rTitle the title to display
82 @param rMessage the detailed message to display
83 @param _eType determines the image to use. AUTO is disallowed in this constructor version
85 OSQLMessageBox(vcl::Window
* pParent
,
86 const OUString
& rTitle
,
87 const OUString
& rMessage
,
88 WinBits nStyle
= WB_OK
| WB_DEF_OK
,
89 MessageType _eType
= Info
,
90 const ::dbtools::SQLExceptionInfo
* _pAdditionalErrorInfo
= NULL
);
92 virtual ~OSQLMessageBox();
93 virtual void dispose() SAL_OVERRIDE
;
96 void Construct( WinBits nStyle
, MessageType eImage
);
98 DECL_LINK(ButtonClickHdl
, Button
* );
101 void impl_positionControls();
102 void impl_initImage( MessageType _eImage
);
103 void impl_createStandardButtons( WinBits _nStyle
);
104 void impl_addDetailsButton();
108 class OSQLWarningBox
: public OSQLMessageBox
111 OSQLWarningBox( vcl::Window
* _pParent
,
112 const OUString
& _rMessage
,
113 WinBits _nStyle
= WB_OK
| WB_DEF_OK
,
114 const ::dbtools::SQLExceptionInfo
* _pAdditionalErrorInfo
= NULL
);
118 class OSQLErrorBox
: public OSQLMessageBox
121 OSQLErrorBox( vcl::Window
* _pParent
,
122 const OUString
& _rMessage
,
123 WinBits _nStyle
= WB_OK
| WB_DEF_OK
,
124 const ::dbtools::SQLExceptionInfo
* _pAdditionalErrorInfo
= NULL
);
129 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_SQLMESSAGE_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */