1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef DBAUI_QUERYDLG_HXX
28 #define DBAUI_QUERYDLG_HXX
29 #ifndef _SV_DIALOG_HXX //autogen
30 #include <vcl/dialog.hxx>
31 #endif
32 
33 #ifndef _SV_BUTTON_HXX //autogen
34 #include <vcl/button.hxx>
35 #endif
36 
37 #ifndef _SV_FIXED_HXX //autogen
38 #include <vcl/fixed.hxx>
39 #endif
40 #ifndef _SV_LSTBOX_HXX
41 #include <vcl/lstbox.hxx>
42 #endif
43 
44 #ifndef DBAUI_ENUMTYPES_HXX
45 #include "QEnumTypes.hxx"
46 #endif
47 
48 #ifndef DBAUI_RELCONTROLIFACE_HXX
49 #include "RelControliFace.hxx"
50 #endif
51 #ifndef DBAUI_JOINTABLEVIEW_HXX
52 #include "JoinTableView.hxx"
53 #endif
54 
55 
56 namespace dbaui
57 {
58 	class OQueryTableConnectionData;
59 	class OTableListBoxControl;
60     class OQueryTableView;
61     class OJoinControl;
62 	class DlgQryJoin :	public ModalDialog
63 						,public IRelationControlInterface
64 	{
65 	protected:
66 		FixedText				aML_HelpText;
67 		OKButton				aPB_OK;
68 		CancelButton			aPB_CANCEL;
69 		HelpButton				aPB_HELP;
70 
71         OJoinControl*                       m_pJoinControl;
72 		OTableListBoxControl*				m_pTableControl;
73 		OJoinTableView::OTableWindowMap*	m_pTableMap;
74         OQueryTableView*                    m_pTableView;
75 
76 		EJoinType				            eJoinType;
77         TTableConnectionData::value_type	m_pConnData; // enth"alt linke und rechte Tabelle
78 		TTableConnectionData::value_type	m_pOrigConnData;
79 		::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
80 
81 
82 		DECL_LINK( OKClickHdl, Button* );
83 		DECL_LINK( LBChangeHdl, ListBox* );
84         DECL_LINK( NaturalToggleHdl, CheckBox* );
85 
86 		/** setJoinType enables and set the new join type
87 			@param	_eNewJoinType	the new jointype
88 		*/
89 		void setJoinType(EJoinType _eNewJoinType);
90 	public:
91 		DlgQryJoin( OQueryTableView * pParent,
92 					const TTableConnectionData::value_type& pData,
93 					OJoinTableView::OTableWindowMap*	_pTableMap,
94 					const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _xConnection,
95 					sal_Bool _bAllowTableSelect);
96 		virtual ~DlgQryJoin();
97 		EJoinType GetJoinType() const { return eJoinType; };
98 
99 		/** getConnectionData returns the current connection data
100 			@return the current connectiondata
101 		*/
102 		virtual TTableConnectionData::value_type getConnectionData() const;
103 
104 		/** setValid set the valid inside, can be used for OK buttons
105 			@param	_bValid	true when the using control allows an update
106 		*/
107 		virtual void setValid(sal_Bool _bValid);
108 
109 		virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection() { return m_xConnection; }
110 
111 		/** notifyConnectionChange is callback which is called when the table selection has changed and a new connection exists
112 			@param	_pConnectionData	the connection which exists between the new tables
113 		*/
114 		virtual void notifyConnectionChange();
115 	};
116 }
117 #endif // DBAUI_QUERYDLG_HXX
118 
119 
120 
121