merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / inc / RelationDlg.hxx
blob17d34c4062a0dca23c17e6a1870898961bd58c23
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: RelationDlg.hxx,v $
10 * $Revision: 1.11 $
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>
35 #endif
37 #ifndef _BUTTON_HXX //autogen
38 #include <vcl/button.hxx>
39 #endif
40 #ifndef _FIXED_HXX //autogen
41 #include <vcl/fixed.hxx>
42 #endif
43 //#ifndef _EDIT_HXX //autogen
44 //#include <vcl/edit.hxx>
45 //#endif
46 #ifndef _SV_MSGBOX_HXX
47 #include <vcl/msgbox.hxx>
48 #endif
49 #ifndef DBAUI_JOINTABLEVIEW_HXX
50 #include "JoinTableView.hxx"
51 #endif
52 #ifndef DBAUI_RELCONTROLIFACE_HXX
53 #include "RelControliFace.hxx"
54 #endif
55 #ifndef _DBAUI_MODULE_DBU_HXX_
56 #include "moduledbu.hxx"
57 #endif
60 namespace dbaui
62 class OJoinTableView;
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,
75 aRB_CascUpd,
76 aRB_CascUpdNull,
77 aRB_CascUpdDefault;
78 FixedLine aFL_CascDel;
79 RadioButton aRB_NoCascDel,
80 aRB_CascDel,
81 aRB_CascDelNull,
82 aRB_CascDelDefault;
84 OKButton aPB_OK;
85 CancelButton aPB_CANCEL;
86 HelpButton aPB_HELP;
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;
95 public:
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();
124 protected:
125 void Init(const TTableConnectionData::value_type& _pConnectionData);
127 private:
128 DECL_LINK( OKClickHdl, Button* );
131 #endif // DBAUI_RELATIONDIALOG_HXX