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