xref: /trunk/main/dbaccess/source/ui/inc/RelationDlg.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
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 
23cdf0e10cSrcweir #ifndef DBAUI_RELATIONDIALOG_HXX
24cdf0e10cSrcweir #define DBAUI_RELATIONDIALOG_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef _DIALOG_HXX //autogen
27cdf0e10cSrcweir #include <vcl/dialog.hxx>
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #ifndef _BUTTON_HXX //autogen
31cdf0e10cSrcweir #include <vcl/button.hxx>
32cdf0e10cSrcweir #endif
33cdf0e10cSrcweir #ifndef _FIXED_HXX //autogen
34cdf0e10cSrcweir #include <vcl/fixed.hxx>
35cdf0e10cSrcweir #endif
36cdf0e10cSrcweir //#ifndef _EDIT_HXX //autogen
37cdf0e10cSrcweir //#include <vcl/edit.hxx>
38cdf0e10cSrcweir //#endif
39cdf0e10cSrcweir #ifndef _SV_MSGBOX_HXX
40cdf0e10cSrcweir #include <vcl/msgbox.hxx>
41cdf0e10cSrcweir #endif
42cdf0e10cSrcweir #ifndef DBAUI_JOINTABLEVIEW_HXX
43cdf0e10cSrcweir #include "JoinTableView.hxx"
44cdf0e10cSrcweir #endif
45cdf0e10cSrcweir #ifndef DBAUI_RELCONTROLIFACE_HXX
46cdf0e10cSrcweir #include "RelControliFace.hxx"
47cdf0e10cSrcweir #endif
48cdf0e10cSrcweir #ifndef _DBAUI_MODULE_DBU_HXX_
49cdf0e10cSrcweir #include "moduledbu.hxx"
50cdf0e10cSrcweir #endif
51cdf0e10cSrcweir 
52cdf0e10cSrcweir 
53cdf0e10cSrcweir namespace dbaui
54cdf0e10cSrcweir {
55cdf0e10cSrcweir     class OJoinTableView;
56cdf0e10cSrcweir     class OTableListBoxControl;
57cdf0e10cSrcweir     class ORelationTableConnectionData;
58cdf0e10cSrcweir     //========================================================================
59cdf0e10cSrcweir     class ORelationDialog : public ModalDialog
60cdf0e10cSrcweir                             ,public IRelationControlInterface
61cdf0e10cSrcweir     {
62cdf0e10cSrcweir         OModuleClient                           m_aModuleClient;
63cdf0e10cSrcweir         ::std::auto_ptr<OTableListBoxControl>   m_pTableControl;
64cdf0e10cSrcweir         OJoinTableView::OTableWindowMap*        m_pTableMap;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir         FixedLine   aFL_CascUpd;
67cdf0e10cSrcweir         RadioButton aRB_NoCascUpd,
68cdf0e10cSrcweir                     aRB_CascUpd,
69cdf0e10cSrcweir                     aRB_CascUpdNull,
70cdf0e10cSrcweir                     aRB_CascUpdDefault;
71cdf0e10cSrcweir         FixedLine   aFL_CascDel;
72cdf0e10cSrcweir         RadioButton aRB_NoCascDel,
73cdf0e10cSrcweir                     aRB_CascDel,
74cdf0e10cSrcweir                     aRB_CascDelNull,
75cdf0e10cSrcweir                     aRB_CascDelDefault;
76cdf0e10cSrcweir 
77cdf0e10cSrcweir         OKButton    aPB_OK;
78cdf0e10cSrcweir         CancelButton aPB_CANCEL;
79cdf0e10cSrcweir         HelpButton  aPB_HELP;
80cdf0e10cSrcweir 
81cdf0e10cSrcweir 
82cdf0e10cSrcweir         TTableConnectionData::value_type                                        m_pConnData;
83cdf0e10cSrcweir         TTableConnectionData::value_type                                        m_pOrigConnData;
84cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
85cdf0e10cSrcweir 
86cdf0e10cSrcweir         sal_Bool                                                                    m_bTriedOneUpdate;
87cdf0e10cSrcweir 
88cdf0e10cSrcweir     public:
89cdf0e10cSrcweir         ORelationDialog(OJoinTableView* pParent,
90cdf0e10cSrcweir                         const TTableConnectionData::value_type& pConnectionData,
91cdf0e10cSrcweir                         sal_Bool bAllowTableSelect = sal_False );
92cdf0e10cSrcweir         virtual ~ORelationDialog();
93cdf0e10cSrcweir 
getConnection()94cdf0e10cSrcweir         virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection(){ return m_xConnection; }
95cdf0e10cSrcweir 
96cdf0e10cSrcweir         virtual short Execute();
97cdf0e10cSrcweir 
98*30acf5e8Spfg         /** getTableMap gives access to the table window map
99cdf0e10cSrcweir             @retrun the table window from the join view
100cdf0e10cSrcweir         */
getTableMap() const101cdf0e10cSrcweir         OJoinTableView::OTableWindowMap* getTableMap() const { return m_pTableMap; }
102cdf0e10cSrcweir 
103cdf0e10cSrcweir         /** getConnectionData returns the current connection data
104cdf0e10cSrcweir             @return the current connectiondata
105cdf0e10cSrcweir         */
106cdf0e10cSrcweir         virtual TTableConnectionData::value_type getConnectionData() const;
107cdf0e10cSrcweir 
108cdf0e10cSrcweir         /** setValid set the valid inside, can be used for OK buttons
109cdf0e10cSrcweir             @param  _bValid true when the using control allows an update
110cdf0e10cSrcweir         */
111cdf0e10cSrcweir         virtual void setValid(sal_Bool _bValid);
112cdf0e10cSrcweir 
113cdf0e10cSrcweir         /** notifyConnectionChange is callback which is called when the table selection has changed and a new connection exists
114cdf0e10cSrcweir             @param  _pConnectionData    the connection which exists between the new tables
115cdf0e10cSrcweir         */
116cdf0e10cSrcweir         virtual void notifyConnectionChange();
117cdf0e10cSrcweir     protected:
118cdf0e10cSrcweir         void Init(const TTableConnectionData::value_type& _pConnectionData);
119cdf0e10cSrcweir 
120cdf0e10cSrcweir     private:
121cdf0e10cSrcweir         DECL_LINK( OKClickHdl, Button* );
122cdf0e10cSrcweir     };
123cdf0e10cSrcweir }
124cdf0e10cSrcweir #endif // DBAUI_RELATIONDIALOG_HXX
125