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 _DBAUI_SQLMESSAGE_HXX_
21 #define _DBAUI_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
{
41 //.........................................................................
44 //.........................................................................
46 //==================================================================
48 //==================================================================
49 struct SQLMessageBox_Impl
;
50 class OSQLMessageBox
: public ButtonDialog
52 FixedImage m_aInfoImage
;
57 ::std::auto_ptr
< SQLMessageBox_Impl
> m_pImpl
;
71 /** display an SQLException with auto-recognizing a main and a detailed message
73 The first two messages from the exception chain are used as main and detailed message (recognizing the
74 detailed field of an <type scope="com::sun::star::sdb">SQLContext</type>).
78 const dbtools::SQLExceptionInfo
& _rException
,
79 WinBits _nStyle
= WB_OK
| WB_DEF_OK
,
80 const OUString
& _rHelpURL
= OUString()
83 /** display a database related error message
85 @param rTitle the title to display
86 @param rMessage the detailed message to display
87 @param _eType determines the image to use. AUTO is disallowed in this constructor version
89 OSQLMessageBox(Window
* pParent
,
90 const OUString
& rTitle
,
91 const OUString
& rMessage
,
92 WinBits nStyle
= WB_OK
| WB_DEF_OK
,
93 MessageType _eType
= Info
,
94 const ::dbtools::SQLExceptionInfo
* _pAdditionalErrorInfo
= NULL
);
99 void Construct( WinBits nStyle
, MessageType eImage
);
101 DECL_LINK(ButtonClickHdl
, Button
* );
104 void impl_positionControls();
105 void impl_initImage( MessageType _eImage
);
106 void impl_createStandardButtons( WinBits _nStyle
);
107 void impl_addDetailsButton();
110 //==================================================================
112 //==================================================================
113 class OSQLWarningBox
: public OSQLMessageBox
116 OSQLWarningBox( Window
* _pParent
,
117 const OUString
& _rMessage
,
118 WinBits _nStyle
= WB_OK
| WB_DEF_OK
,
119 const ::dbtools::SQLExceptionInfo
* _pAdditionalErrorInfo
= NULL
);
122 //==================================================================
124 //==================================================================
125 class OSQLErrorBox
: public OSQLMessageBox
128 OSQLErrorBox( Window
* _pParent
,
129 const OUString
& _rMessage
,
130 WinBits _nStyle
= WB_OK
| WB_DEF_OK
,
131 const ::dbtools::SQLExceptionInfo
* _pAdditionalErrorInfo
= NULL
);
134 //.........................................................................
136 //.........................................................................
138 #endif // _DBAUI_SQLMESSAGE_HXX_
140 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */