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 .
19 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONDLG_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONDLG_HXX
22 #include <boost/scoped_ptr.hpp>
23 #include <vcl/button.hxx>
24 #include <vcl/dialog.hxx>
25 #include <vcl/fixed.hxx>
26 #include <vcl/msgbox.hxx>
27 #include "JoinTableView.hxx"
28 #include "RelControliFace.hxx"
29 #include "moduledbu.hxx"
30 #include "RelationControl.hxx"
35 class ORelationDialog
: public ModalDialog
36 ,public IRelationControlInterface
38 OModuleClient m_aModuleClient
;
39 boost::scoped_ptr
<OTableListBoxControl
> m_xTableControl
;
40 OJoinTableView::OTableWindowMap
* m_pTableMap
;
42 VclPtr
<RadioButton
> m_pRB_NoCascUpd
;
43 VclPtr
<RadioButton
> m_pRB_CascUpd
;
44 VclPtr
<RadioButton
> m_pRB_CascUpdNull
;
45 VclPtr
<RadioButton
> m_pRB_CascUpdDefault
;
46 VclPtr
<RadioButton
> m_pRB_NoCascDel
;
47 VclPtr
<RadioButton
> m_pRB_CascDel
;
48 VclPtr
<RadioButton
> m_pRB_CascDelNull
;
49 VclPtr
<RadioButton
> m_pRB_CascDelDefault
;
51 VclPtr
<OKButton
> m_pPB_OK
;
53 TTableConnectionData::value_type m_pConnData
;
54 TTableConnectionData::value_type m_pOrigConnData
;
55 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> m_xConnection
;
57 bool m_bTriedOneUpdate
;
60 ORelationDialog(OJoinTableView
* pParent
,
61 const TTableConnectionData::value_type
& pConnectionData
,
62 bool bAllowTableSelect
= false );
63 virtual ~ORelationDialog();
64 virtual void dispose() SAL_OVERRIDE
;
66 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> getConnection() SAL_OVERRIDE
{ return m_xConnection
; }
68 virtual short Execute() SAL_OVERRIDE
;
70 /** getTableMap gives access to the table window map
71 @retrun the table window from the join view
73 OJoinTableView::OTableWindowMap
* getTableMap() const { return m_pTableMap
; }
75 /** getConnectionData returns the current connection data
76 @return the current connection data
78 virtual TTableConnectionData::value_type
getConnectionData() const SAL_OVERRIDE
;
80 /** setValid set the valid inside, can be used for OK buttons
81 @param _bValid true when the using control allows an update
83 virtual void setValid(bool _bValid
) SAL_OVERRIDE
;
85 /** notifyConnectionChange is callback which is called when the table selection has changed and a new connection exists
86 @param _pConnectionData the connection which exists between the new tables
88 virtual void notifyConnectionChange() SAL_OVERRIDE
;
90 void Init(const TTableConnectionData::value_type
& _pConnectionData
);
93 DECL_LINK( OKClickHdl
, Button
* );
96 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONDLG_HXX
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */