Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONDLG_HXX
20 : #define INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONDLG_HXX
21 :
22 : #include <boost/scoped_ptr.hpp>
23 : #include <vcl/button.hxx>
24 : #include <vcl/dialog.hxx>
25 : #include <vcl/fixed.hxx>
26 : #include <vcl/msgbox.hxx>
27 : #include "JoinTableView.hxx"
28 : #include "RelControliFace.hxx"
29 : #include "moduledbu.hxx"
30 : #include "RelationControl.hxx"
31 :
32 : namespace dbaui
33 : {
34 : class OJoinTableView;
35 : class ORelationDialog : public ModalDialog
36 : ,public IRelationControlInterface
37 : {
38 : OModuleClient m_aModuleClient;
39 : boost::scoped_ptr<OTableListBoxControl> m_xTableControl;
40 : OJoinTableView::OTableWindowMap* m_pTableMap;
41 :
42 : VclPtr<RadioButton> m_pRB_NoCascUpd;
43 : VclPtr<RadioButton> m_pRB_CascUpd;
44 : VclPtr<RadioButton> m_pRB_CascUpdNull;
45 : VclPtr<RadioButton> m_pRB_CascUpdDefault;
46 : VclPtr<RadioButton> m_pRB_NoCascDel;
47 : VclPtr<RadioButton> m_pRB_CascDel;
48 : VclPtr<RadioButton> m_pRB_CascDelNull;
49 : VclPtr<RadioButton> m_pRB_CascDelDefault;
50 :
51 : VclPtr<OKButton> m_pPB_OK;
52 :
53 : TTableConnectionData::value_type m_pConnData;
54 : TTableConnectionData::value_type m_pOrigConnData;
55 : ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > m_xConnection;
56 :
57 : bool m_bTriedOneUpdate;
58 :
59 : public:
60 : ORelationDialog(OJoinTableView* pParent,
61 : const TTableConnectionData::value_type& pConnectionData,
62 : bool bAllowTableSelect = false );
63 : virtual ~ORelationDialog();
64 : virtual void dispose() SAL_OVERRIDE;
65 :
66 0 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > getConnection() SAL_OVERRIDE { return m_xConnection; }
67 :
68 : virtual short Execute() SAL_OVERRIDE;
69 :
70 : /** getTableMap gives access to the table window map
71 : @retrun the table window from the join view
72 : */
73 : OJoinTableView::OTableWindowMap* getTableMap() const { return m_pTableMap; }
74 :
75 : /** getConnectionData returns the current connection data
76 : @return the current connection data
77 : */
78 : virtual TTableConnectionData::value_type getConnectionData() const SAL_OVERRIDE;
79 :
80 : /** setValid set the valid inside, can be used for OK buttons
81 : @param _bValid true when the using control allows an update
82 : */
83 : virtual void setValid(bool _bValid) SAL_OVERRIDE;
84 :
85 : /** notifyConnectionChange is callback which is called when the table selection has changed and a new connection exists
86 : @param _pConnectionData the connection which exists between the new tables
87 : */
88 : virtual void notifyConnectionChange() SAL_OVERRIDE;
89 : protected:
90 : void Init(const TTableConnectionData::value_type& _pConnectionData);
91 :
92 : private:
93 : DECL_LINK( OKClickHdl, Button* );
94 : };
95 : }
96 : #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONDLG_HXX
97 :
98 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|