1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef DBAUI_RELATIONCONTROL_HXX
25 #define DBAUI_RELATIONCONTROL_HXX
26 
27 #ifndef _FIXED_HXX //autogen
28 #include <vcl/fixed.hxx>
29 #endif
30 #ifndef _SV_LSTBOX_HXX //autogen
31 #include <vcl/lstbox.hxx>
32 #endif
33 #ifndef DBAUI_JOINTABLEVIEW_HXX
34 #include "JoinTableView.hxx"
35 #endif
36 
37 namespace dbaui
38 {
39 	//========================================================================
40 	class OTableListBoxControl;
41 	class OTableConnectionData;
42 	class ORelationTableConnectionData;
43 	class IRelationControlInterface;
44 	class ORelationControl;
45 
46 	class OTableListBoxControl	: public Window
47 	{
48 		FixedLine								m_aFL_InvolvedTables;
49 		ListBox									m_lmbLeftTable,
50 												m_lmbRightTable;
51 		FixedLine								m_aFL_InvolvedFields;
52 
53 		ORelationControl*						m_pRC_Tables;
54 		const OJoinTableView::OTableWindowMap*	m_pTableMap;
55 		IRelationControlInterface*				m_pParentDialog;
56 		String									m_strCurrentLeft;
57 		String									m_strCurrentRight;
58 	private:
59 		DECL_LINK( OnTableChanged, ListBox* );
60 	public:
61 		OTableListBoxControl(Window* _pParent,
62 							 const ResId& _rResId,
63 							 const OJoinTableView::OTableWindowMap*	_pTableMap,
64 							 IRelationControlInterface* _pParentDialog);
65 		virtual ~OTableListBoxControl();
66 
67 		/** fillListBoxes fills the list boxes with the table windows
68 		*/
69 		void fillListBoxes();
70 
71 		/** fillAndDisable fill the listboxes only with one entry and then disable them
72 			@param	_pConnectionData
73 					contains the data which should be filled into the listboxes
74 		*/
75 		void fillAndDisable(const TTableConnectionData::value_type& _pConnectionData);
76 
77 		/** enables the relation control
78 		*
79 		* \param _bEnable when sal_True enables it, otherwise disable it.
80 		*/
81 		void enableRelation(bool _bEnable);
82 
83 		/** NotifyCellChange notifies the browse control that the connection data has changed
84 		*/
85 		void NotifyCellChange();
86 
87 		/** Init is a call through to the control inside this one
88 			@param	_pConnData
89 					the connection data which is used to init the control
90 		*/
91 		void Init(const TTableConnectionData::value_type& _pConnData);
92 		void lateUIInit(Window* _pTableSeparator = NULL);
93 		void lateInit();
94 
95 		sal_Bool SaveModified();
96 
97 		TTableWindowData::value_type getReferencingTable()	const;
98 
99 		/** getContainer returns the container interface
100 			@return the interface of the container
101 		*/
getContainer() const102 		IRelationControlInterface* getContainer() const { return m_pParentDialog; }
103 	};
104 }
105 #endif // DBAUI_RELATIONCONTROL_HXX
106 
107 /* vim: set noet sw=4 ts=4: */
108