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: RelationDlg.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 ************************************************************************/
30 #ifndef DBAUI_RELATIONDIALOG_HXX
31 #define DBAUI_RELATIONDIALOG_HXX
33 #ifndef _DIALOG_HXX //autogen
34 #include <vcl/dialog.hxx>
37 #ifndef _BUTTON_HXX //autogen
38 #include <vcl/button.hxx>
40 #ifndef _FIXED_HXX //autogen
41 #include <vcl/fixed.hxx>
43 //#ifndef _EDIT_HXX //autogen
44 //#include <vcl/edit.hxx>
46 #ifndef _SV_MSGBOX_HXX
47 #include <vcl/msgbox.hxx>
49 #ifndef DBAUI_JOINTABLEVIEW_HXX
50 #include "JoinTableView.hxx"
52 #ifndef DBAUI_RELCONTROLIFACE_HXX
53 #include "RelControliFace.hxx"
55 #ifndef _DBAUI_MODULE_DBU_HXX_
56 #include "moduledbu.hxx"
63 class OTableListBoxControl
;
64 class ORelationTableConnectionData
;
65 //========================================================================
66 class ORelationDialog
: public ModalDialog
67 ,public IRelationControlInterface
69 OModuleClient m_aModuleClient
;
70 ::std::auto_ptr
<OTableListBoxControl
> m_pTableControl
;
71 OJoinTableView::OTableWindowMap
* m_pTableMap
;
73 FixedLine aFL_CascUpd
;
74 RadioButton aRB_NoCascUpd
,
78 FixedLine aFL_CascDel
;
79 RadioButton aRB_NoCascDel
,
85 CancelButton aPB_CANCEL
;
89 TTableConnectionData::value_type m_pConnData
;
90 TTableConnectionData::value_type m_pOrigConnData
;
91 ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> m_xConnection
;
93 BOOL m_bTriedOneUpdate
;
96 ORelationDialog(OJoinTableView
* pParent
,
97 const TTableConnectionData::value_type
& pConnectionData
,
98 BOOL bAllowTableSelect
= FALSE
);
99 virtual ~ORelationDialog();
101 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::sdbc::XConnection
> getConnection(){ return m_xConnection
; }
103 virtual short Execute();
105 /** getTableMap gives acces to the table window map
106 @retrun the table window from the join view
108 OJoinTableView::OTableWindowMap
* getTableMap() const { return m_pTableMap
; }
110 /** getConnectionData returns the current connection data
111 @return the current connectiondata
113 virtual TTableConnectionData::value_type
getConnectionData() const;
115 /** setValid set the valid inside, can be used for OK buttons
116 @param _bValid true when the using control allows an update
118 virtual void setValid(sal_Bool _bValid
);
120 /** notifyConnectionChange is callback which is called when the table selection has changed and a new connection exists
121 @param _pConnectionData the connection which exists between the new tables
123 virtual void notifyConnectionChange();
125 void Init(const TTableConnectionData::value_type
& _pConnectionData
);
128 DECL_LINK( OKClickHdl
, Button
* );
131 #endif // DBAUI_RELATIONDIALOG_HXX