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_RELATIONCONTROL_HXX
20 : #define INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONCONTROL_HXX
21 :
22 : #include <vcl/fixed.hxx>
23 : #include <vcl/builder.hxx>
24 : #include <vcl/lstbox.hxx>
25 : #include "JoinTableView.hxx"
26 :
27 : namespace dbaui
28 : {
29 : class OTableListBoxControl;
30 : class IRelationControlInterface;
31 : class ORelationControl;
32 :
33 : class OTableListBoxControl
34 : {
35 : ListBox* m_pLeftTable;
36 : ListBox* m_pRightTable;
37 :
38 : ORelationControl* m_pRC_Tables;
39 : const OJoinTableView::OTableWindowMap* m_pTableMap;
40 : IRelationControlInterface* m_pParentDialog;
41 : OUString m_strCurrentLeft;
42 : OUString m_strCurrentRight;
43 : private:
44 : DECL_LINK( OnTableChanged, ListBox* );
45 : public:
46 : OTableListBoxControl(VclBuilderContainer* _pParent,
47 : const OJoinTableView::OTableWindowMap* _pTableMap,
48 : IRelationControlInterface* _pParentDialog);
49 : virtual ~OTableListBoxControl();
50 :
51 : /** fillListBoxes fills the list boxes with the table windows
52 : */
53 : void fillListBoxes();
54 :
55 : /** fillAndDisable fill the listboxes only with one entry and then disable them
56 : @param _pConnectionData
57 : contains the data which should be filled into the listboxes
58 : */
59 : void fillAndDisable(const TTableConnectionData::value_type& _pConnectionData);
60 :
61 : /** enables the relation control
62 : *
63 : * \param _bEnable when sal_True enables it, otherwise disable it.
64 : */
65 : void enableRelation(bool _bEnable);
66 :
67 : /** NotifyCellChange notifies the browse control that the connection data has changed
68 : */
69 : void NotifyCellChange();
70 :
71 : /** Init is a call through to the control inside this one
72 : @param _pConnData
73 : the connection data which is used to init the control
74 : */
75 : void Init(const TTableConnectionData::value_type& _pConnData);
76 : void lateUIInit();
77 : void lateInit();
78 :
79 : void Disable();
80 : void Invalidate();
81 :
82 : bool SaveModified();
83 :
84 : TTableWindowData::value_type getReferencingTable() const;
85 :
86 : /** getContainer returns the container interface
87 : @return the interface of the container
88 : */
89 0 : IRelationControlInterface* getContainer() const { return m_pParentDialog; }
90 : };
91 : }
92 : #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_RELATIONCONTROL_HXX
93 :
94 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|