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