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
10*2e2212a7SAndrew Rist  *
11*2e2212a7SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*2e2212a7SAndrew Rist  *
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.
19*2e2212a7SAndrew Rist  *
20*2e2212a7SAndrew Rist  *************************************************************/
21*2e2212a7SAndrew Rist 
22*2e2212a7SAndrew Rist 
23cdf0e10cSrcweir #ifndef DBAUI_RELATION_TABLEVIEW_HXX
24cdf0e10cSrcweir #define DBAUI_RELATION_TABLEVIEW_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #include "JoinTableView.hxx"
27cdf0e10cSrcweir #include <comphelper/containermultiplexer.hxx>
28cdf0e10cSrcweir #include <cppuhelper/basemutex.hxx>
29cdf0e10cSrcweir #include <rtl/ref.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir namespace dbaui
32cdf0e10cSrcweir {
33cdf0e10cSrcweir 	class ORelationDesignView;
34cdf0e10cSrcweir 	class ORelationTableView :  public ::cppu::BaseMutex
35cdf0e10cSrcweir                             ,   public OJoinTableView
36cdf0e10cSrcweir                             ,   public ::comphelper::OContainerListener
37cdf0e10cSrcweir 	{
38cdf0e10cSrcweir 		OTableConnection*				 m_pExistingConnection; // is set when a connection was draged on an existing connection
39cdf0e10cSrcweir         TTableConnectionData::value_type m_pCurrentlyTabConnData; // set when we creating a connection with more than one keycolumn
40cdf0e10cSrcweir         ::rtl::Reference< comphelper::OContainerListenerAdapter>
41cdf0e10cSrcweir                                          m_pContainerListener;
42cdf0e10cSrcweir         bool                             m_bInRemove;
43cdf0e10cSrcweir 
44cdf0e10cSrcweir 		virtual void ConnDoubleClicked( OTableConnection* pConnection );
45cdf0e10cSrcweir 		virtual void AddTabWin(const ::rtl::OUString& _rComposedName, const ::rtl::OUString& rWinName, sal_Bool bNewTable = sal_False);
46cdf0e10cSrcweir 
47cdf0e10cSrcweir 		virtual OTableWindow* createWindow(const TTableWindowData::value_type& _pData);
48cdf0e10cSrcweir 
49cdf0e10cSrcweir         /** determines whether the classes Init method should accept a query name, or only table names
50cdf0e10cSrcweir         */
51cdf0e10cSrcweir         virtual bool    allowQueries() const;
52cdf0e10cSrcweir 
53cdf0e10cSrcweir         // OContainerListener
54cdf0e10cSrcweir         virtual void _elementInserted( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
55cdf0e10cSrcweir 	    virtual void _elementRemoved( const  ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
56cdf0e10cSrcweir 	    virtual void _elementReplaced( const ::com::sun::star::container::ContainerEvent& _rEvent ) throw(::com::sun::star::uno::RuntimeException);
57cdf0e10cSrcweir 
58cdf0e10cSrcweir 	public:
59cdf0e10cSrcweir 		ORelationTableView( Window* pParent, ORelationDesignView* pView );
60cdf0e10cSrcweir 		virtual ~ORelationTableView();
61cdf0e10cSrcweir 
62cdf0e10cSrcweir 		virtual void RemoveTabWin( OTableWindow* pTabWin );
63cdf0e10cSrcweir 		virtual void AddConnection(const OJoinExchangeData& jxdSource, const OJoinExchangeData& jxdDest);
64cdf0e10cSrcweir 		virtual bool RemoveConnection(OTableConnection* pConn,sal_Bool _bDelete);
65cdf0e10cSrcweir 
66cdf0e10cSrcweir 		virtual void ReSync();
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 		void AddNewRelation();
69cdf0e10cSrcweir 			// reisst den Dialog fuer eine voellig neue Relation hoch
70cdf0e10cSrcweir 		// wird vom AddTabDlg benutzt, um festzustellen, ob noch Tabellen hinzugefuegt werden duerfen
71cdf0e10cSrcweir 		virtual sal_Bool IsAddAllowed();
72cdf0e10cSrcweir 
73cdf0e10cSrcweir 		virtual void lookForUiActivities();
74cdf0e10cSrcweir 	};
75cdf0e10cSrcweir }
76cdf0e10cSrcweir #endif // DBAUI_RELATION_TABLEVIEW_HXX
77cdf0e10cSrcweir 
78cdf0e10cSrcweir 
79