1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: sqlmessage.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _DBAUI_SQLMESSAGE_HXX_
32 #define _DBAUI_SQLMESSAGE_HXX_
35 #include <vcl/button.hxx>
38 #include <vcl/fixed.hxx>
40 #ifndef _SV_BTNDLG_HXX
41 #include <vcl/btndlg.hxx>
44 #ifndef _DBHELPER_DBEXCEPTION_HXX_
45 #include <connectivity/dbexception.hxx>
51 namespace com
{ namespace sun
{ namespace star
{
60 //.........................................................................
63 //.........................................................................
65 //==================================================================
67 //==================================================================
68 struct SQLMessageBox_Impl
;
69 class OSQLMessageBox
: public ButtonDialog
71 FixedImage m_aInfoImage
;
74 ::rtl::OUString m_sHelpURL
;
76 ::std::auto_ptr
< SQLMessageBox_Impl
> m_pImpl
;
90 /** display an SQLException with auto-recognizing a main and a detailed message
92 The first two messages from the exception chain are used as main and detailed message (recognizing the
93 detailed field of an <type scope="com::sun::star::sdb">SQLContext</type>).
97 const dbtools::SQLExceptionInfo
& _rException
,
98 WinBits _nStyle
= WB_OK
| WB_DEF_OK
,
99 const ::rtl::OUString
& _rHelpURL
= ::rtl::OUString()
102 /** display a database related error message
104 @param rTitle the title to display
105 @param rMessage the detailed message to display
106 @param _eType determines the image to use. AUTO is disallowed in this constructor version
108 OSQLMessageBox(Window
* pParent
,
109 const UniString
& rTitle
,
110 const UniString
& rMessage
,
111 WinBits nStyle
= WB_OK
| WB_DEF_OK
,
112 MessageType _eType
= Info
,
113 const ::dbtools::SQLExceptionInfo
* _pAdditionalErrorInfo
= NULL
);
118 void Construct( WinBits nStyle
, MessageType eImage
);
120 DECL_LINK(ButtonClickHdl
, Button
* );
123 void impl_positionControls();
124 void impl_initImage( MessageType _eImage
);
125 void impl_createStandardButtons( WinBits _nStyle
);
126 void impl_addDetailsButton();
129 //==================================================================
131 //==================================================================
132 class OSQLWarningBox
: public OSQLMessageBox
135 OSQLWarningBox( Window
* _pParent
,
136 const UniString
& _rMessage
,
137 WinBits _nStyle
= WB_OK
| WB_DEF_OK
,
138 const ::dbtools::SQLExceptionInfo
* _pAdditionalErrorInfo
= NULL
);
141 //.........................................................................
143 //.........................................................................
145 #endif // _DBAUI_SQLMESSAGE_HXX_