bump product version to 4.1.6.2
[LibreOffice.git] / dbaccess / source / ui / inc / sqlmessage.hxx
blob42c96a6f44523da6758c1bba3a5db8826ccfd589
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
29 #include <memory>
31 // some forwards
32 namespace com { namespace sun { namespace star {
33 namespace sdb {
34 class SQLContext;
36 namespace sdbc {
37 class SQLException;
39 } } }
41 //.........................................................................
42 namespace dbaui
44 //.........................................................................
46 //==================================================================
47 // OSQLMessageBox
48 //==================================================================
49 struct SQLMessageBox_Impl;
50 class OSQLMessageBox : public ButtonDialog
52 FixedImage m_aInfoImage;
53 FixedText m_aTitle;
54 FixedText m_aMessage;
55 OUString m_sHelpURL;
57 ::std::auto_ptr< SQLMessageBox_Impl > m_pImpl;
59 public:
60 enum MessageType
62 Info,
63 Error,
64 Warning,
65 Query,
67 AUTO
70 public:
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>).
76 OSQLMessageBox(
77 Window* _pParent,
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 );
96 ~OSQLMessageBox();
98 private:
99 void Construct( WinBits nStyle, MessageType eImage );
101 DECL_LINK(ButtonClickHdl, Button* );
103 private:
104 void impl_positionControls();
105 void impl_initImage( MessageType _eImage );
106 void impl_createStandardButtons( WinBits _nStyle );
107 void impl_addDetailsButton();
110 //==================================================================
111 // OSQLWarningBox
112 //==================================================================
113 class OSQLWarningBox : public OSQLMessageBox
115 public:
116 OSQLWarningBox( Window* _pParent,
117 const OUString& _rMessage,
118 WinBits _nStyle = WB_OK | WB_DEF_OK,
119 const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo = NULL );
122 //==================================================================
123 // OSQLErrorBox
124 //==================================================================
125 class OSQLErrorBox : public OSQLMessageBox
127 public:
128 OSQLErrorBox( Window* _pParent,
129 const OUString& _rMessage,
130 WinBits _nStyle = WB_OK | WB_DEF_OK,
131 const ::dbtools::SQLExceptionInfo* _pAdditionalErrorInfo = NULL );
134 //.........................................................................
135 } // namespace dbaui
136 //.........................................................................
138 #endif // _DBAUI_SQLMESSAGE_HXX_
140 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */