| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | /*************************************************************************
 | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-08 14:28:46 +00:00
										 |  |  |  *  OpenOffice.org - a multi-platform office productivity suite | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-08 14:28:46 +00:00
										 |  |  |  *  $RCSfile: JoinController.hxx,v $ | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2007-11-01 14:15:26 +00:00
										 |  |  |  *  $Revision: 1.23 $ | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2007-11-01 14:15:26 +00:00
										 |  |  |  *  last change: $Author: hr $ $Date: 2007-11-01 15:15:26 $ | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-08 14:28:46 +00:00
										 |  |  |  *  The Contents of this file are made available subject to | 
					
						
							|  |  |  |  *  the terms of GNU Lesser General Public License Version 2.1. | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-08 14:28:46 +00:00
										 |  |  |  *    GNU Lesser General Public License Version 2.1 | 
					
						
							|  |  |  |  *    ============================================= | 
					
						
							|  |  |  |  *    Copyright 2005 by Sun Microsystems, Inc. | 
					
						
							|  |  |  |  *    901 San Antonio Road, Palo Alto, CA 94303, USA | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-08 14:28:46 +00:00
										 |  |  |  *    This library is free software; you can redistribute it and/or | 
					
						
							|  |  |  |  *    modify it under the terms of the GNU Lesser General Public | 
					
						
							|  |  |  |  *    License version 2.1, as published by the Free Software Foundation. | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-08 14:28:46 +00:00
										 |  |  |  *    This library is distributed in the hope that it will be useful, | 
					
						
							|  |  |  |  *    but WITHOUT ANY WARRANTY; without even the implied warranty of | 
					
						
							|  |  |  |  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU | 
					
						
							|  |  |  |  *    Lesser General Public License for more details. | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |  * | 
					
						
							| 
									
										
										
										
											2005-09-08 14:28:46 +00:00
										 |  |  |  *    You should have received a copy of the GNU Lesser General Public | 
					
						
							|  |  |  |  *    License along with this library; if not, write to the Free Software | 
					
						
							|  |  |  |  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston, | 
					
						
							|  |  |  |  *    MA  02111-1307  USA | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |  * | 
					
						
							|  |  |  |  ************************************************************************/ | 
					
						
							|  |  |  | #ifndef DBAUI_JOINCONTROLLER_HXX
 | 
					
						
							|  |  |  | #define DBAUI_JOINCONTROLLER_HXX
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-08-14 10:55:40 +00:00
										 |  |  | #ifndef DBAUI_SINGLEDOCCONTROLLER_HXX
 | 
					
						
							|  |  |  | #include "singledoccontroller.hxx"
 | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2001-03-14 09:35:11 +00:00
										 |  |  | #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
 | 
					
						
							|  |  |  | #include <com/sun/star/beans/XPropertySet.hpp>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2007-07-06 07:23:57 +00:00
										 |  |  | #ifndef _DBAUI_MODULE_DBU_HXX_
 | 
					
						
							|  |  |  | #include "moduledbu.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | #ifndef DBAUI_JOINTABLEVIEW_HXX
 | 
					
						
							|  |  |  | #include "JoinTableView.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | #ifndef DBAUI_JOINDESIGNVIEW_HXX
 | 
					
						
							|  |  |  | #include "JoinDesignView.hxx"
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2007-11-01 14:15:26 +00:00
										 |  |  | #include "TableConnectionData.hxx"
 | 
					
						
							|  |  |  | #include "TableWindowData.hxx"
 | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | #ifndef _MEMORY_
 | 
					
						
							|  |  |  | #include <memory>
 | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2007-11-01 14:15:26 +00:00
										 |  |  | #include <boost/shared_ptr.hpp>
 | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | class VCLXWindow; | 
					
						
							|  |  |  | namespace dbaui | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2006-07-10 14:28:07 +00:00
										 |  |  |     class OAddTableDlg; | 
					
						
							|  |  |  |     class AddTableDialogContext; | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |     class OTableConnectionData; | 
					
						
							|  |  |  |     class OTableWindowData; | 
					
						
							|  |  |  |     class OTableWindow; | 
					
						
							| 
									
										
										
										
											2001-08-14 10:55:40 +00:00
										 |  |  |     typedef OSingleDocumentController OJoinController_BASE; | 
					
						
							| 
									
										
										
										
											2007-11-01 14:15:26 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-08-14 10:55:40 +00:00
										 |  |  |     class OJoinController : public OJoinController_BASE | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |     { | 
					
						
							| 
									
										
										
										
											2007-07-06 07:23:57 +00:00
										 |  |  |         OModuleClient                    m_aModuleClient; | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |     protected: | 
					
						
							| 
									
										
										
										
											2007-11-01 14:15:26 +00:00
										 |  |  |         TTableConnectionData m_vTableConnectionData; | 
					
						
							|  |  |  |         TTableWindowData     m_vTableData; | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         Fraction                                m_aZoom; | 
					
						
							| 
									
										
										
										
											2001-07-09 05:56:49 +00:00
										 |  |  |         ::dbtools::SQLExceptionInfo             m_aExceptionInfo; | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-10 14:28:07 +00:00
										 |  |  |         OAddTableDlg*                               m_pAddTableDialog; | 
					
						
							|  |  |  |         ::std::auto_ptr< AddTableDialogContext >    m_pDialogContext; | 
					
						
							| 
									
										
										
										
											2007-11-01 14:15:26 +00:00
										 |  |  |         Point                                   m_aMinimumTableViewSize; | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // state of a feature. 'feature' may be the handle of a ::com::sun::star::util::URL somebody requested a dispatch interface for OR a toolbar slot.
 | 
					
						
							| 
									
										
										
										
											2002-01-24 16:43:35 +00:00
										 |  |  |         virtual FeatureState    GetState(sal_uInt16 nId) const; | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |         // execute a feature
 | 
					
						
							| 
									
										
										
										
											2004-09-09 08:43:52 +00:00
										 |  |  |         virtual void            Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs); | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2004-08-02 14:53:14 +00:00
										 |  |  |         /** loads the information for the windows.
 | 
					
						
							|  |  |  |             @param  _aViewProps | 
					
						
							|  |  |  |                 The properties which comes from the layout information. | 
					
						
							|  |  |  |         */ | 
					
						
							|  |  |  |         void loadTableWindows(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& _aViewProps); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         /** loads the information for one window.
 | 
					
						
							|  |  |  |             @param  _rTable | 
					
						
							|  |  |  |                 The properties which comes from the layout information. | 
					
						
							|  |  |  |         */ | 
					
						
							|  |  |  |         void loadTableWindow(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& _rTable); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         /** saves the TableWindows structure in a sequence of property values
 | 
					
						
							|  |  |  |             @param  _rViewProps | 
					
						
							|  |  |  |                 Contains the new sequence. | 
					
						
							|  |  |  |         */ | 
					
						
							|  |  |  |         void saveTableWindows(::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& _rViewProps); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2002-02-19 13:16:17 +00:00
										 |  |  |         virtual ~OJoinController(); | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |     public: | 
					
						
							|  |  |  |         OJoinController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-10 14:28:07 +00:00
										 |  |  |         // ---------------------------------------------------------------
 | 
					
						
							|  |  |  |         // attribute access
 | 
					
						
							| 
									
										
										
										
											2007-11-01 14:15:26 +00:00
										 |  |  |         inline TTableWindowData*        getTableWindowData()     { return &m_vTableData; } | 
					
						
							|  |  |  |         inline TTableConnectionData*    getTableConnectionData() { return &m_vTableConnectionData;} | 
					
						
							|  |  |  |         inline OAddTableDlg*            getAddTableDialog()const { return m_pAddTableDialog; } | 
					
						
							| 
									
										
										
										
											2006-07-10 14:28:07 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         // ---------------------------------------------------------------
 | 
					
						
							|  |  |  |         // OSingleDocumentController overridables
 | 
					
						
							|  |  |  |         virtual void        reconnect( sal_Bool _bUI ); | 
					
						
							|  |  |  |         virtual void        setModified( sal_Bool _bModified = sal_True ); | 
					
						
							| 
									
										
										
										
											2002-08-19 06:29:43 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-10 14:28:07 +00:00
										 |  |  |         // ---------------------------------------------------------------
 | 
					
						
							|  |  |  |         // own overridables
 | 
					
						
							|  |  |  |         /** determines whether or not it's allowed for database views to participate in the game
 | 
					
						
							|  |  |  |         */ | 
					
						
							|  |  |  |         virtual bool allowViews() const = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         /** determines whether or not it's allowed for queries to participate in the game
 | 
					
						
							|  |  |  |         */ | 
					
						
							|  |  |  |         virtual bool allowQueries() const = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         /** provides access to the OJoinDesignView belonging to the controller, which might
 | 
					
						
							|  |  |  |             or might not be the direct view (getView) | 
					
						
							|  |  |  |         */ | 
					
						
							|  |  |  |         virtual OJoinDesignView*    getJoinView(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // ---------------------------------------------------------------
 | 
					
						
							| 
									
										
										
										
											2002-02-19 13:16:17 +00:00
										 |  |  |         /** erase the data in the data vector
 | 
					
						
							|  |  |  |             @param  _pData | 
					
						
							|  |  |  |                     the data whioch should be erased | 
					
						
							|  |  |  |         */ | 
					
						
							| 
									
										
										
										
											2007-11-01 14:15:26 +00:00
										 |  |  |         void    removeConnectionData(const TTableConnectionData::value_type& _pData); | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-10 14:28:07 +00:00
										 |  |  |         void    SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, long nOffsetX, long nOffsetY ); | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-10 14:28:07 +00:00
										 |  |  |         void    SaveTabWinPosSize(OTableWindow* pTabWin, long nOffsetX, long nOffsetY); | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-10 14:28:07 +00:00
										 |  |  |         // ---------------------------------------------------------------
 | 
					
						
							|  |  |  |         // UNO interface overridables
 | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |         // XEventListener
 | 
					
						
							|  |  |  |         virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw(::com::sun::star::uno::RuntimeException); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         // ::com::sun::star::lang::XComponent
 | 
					
						
							| 
									
										
										
										
											2001-08-14 10:55:40 +00:00
										 |  |  |         virtual void    SAL_CALL disposing(); | 
					
						
							| 
									
										
										
										
											2001-10-23 11:30:27 +00:00
										 |  |  |         // ::com::sun::star::frame::XController
 | 
					
						
							|  |  |  |         virtual sal_Bool SAL_CALL suspend(sal_Bool bSuspend) throw( ::com::sun::star::uno::RuntimeException ); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-10 14:28:07 +00:00
										 |  |  |         // ---------------------------------------------------------------
 | 
					
						
							|  |  |  |         // misc
 | 
					
						
							|  |  |  |         /** only defines a method to save a SQLException in d&d methods to show the error at a later state
 | 
					
						
							| 
									
										
										
										
											2001-07-09 05:56:49 +00:00
										 |  |  |             set the internal member m_aExceptionInfo to _rInfo | 
					
						
							|  |  |  |         */ | 
					
						
							|  |  |  |         void setErrorOccured(const ::dbtools::SQLExceptionInfo& _rInfo) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             m_aExceptionInfo = _rInfo; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         /**
 | 
					
						
							|  |  |  |             just returns the internal member and clears it | 
					
						
							|  |  |  |         */ | 
					
						
							|  |  |  |         ::dbtools::SQLExceptionInfo clearOccuredError() | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             ::dbtools::SQLExceptionInfo aInfo = m_aExceptionInfo; | 
					
						
							|  |  |  |             m_aExceptionInfo = ::dbtools::SQLExceptionInfo(); | 
					
						
							|  |  |  |             return aInfo; | 
					
						
							|  |  |  |         } | 
					
						
							| 
									
										
										
										
											2005-03-23 08:49:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2001-03-01 12:29:19 +00:00
										 |  |  |     protected: | 
					
						
							| 
									
										
										
										
											2007-11-01 14:15:26 +00:00
										 |  |  |         TTableWindowData::value_type createTableWindowData(const ::rtl::OUString& _sComposedName,const ::rtl::OUString& _sTableName,const ::rtl::OUString& _sWindowName); | 
					
						
							| 
									
										
										
										
											2001-10-23 11:30:27 +00:00
										 |  |  |         // ask the user if the design should be saved when it is modified
 | 
					
						
							|  |  |  |         virtual short saveModified() = 0; | 
					
						
							|  |  |  |         // called when the orignal state should be reseted (first time load)
 | 
					
						
							|  |  |  |         virtual void reset()         = 0; | 
					
						
							| 
									
										
										
										
											2004-11-16 13:31:13 +00:00
										 |  |  |         virtual void describeSupportedFeatures(); | 
					
						
							| 
									
										
										
										
											2001-08-23 13:23:57 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2006-07-10 14:28:07 +00:00
										 |  |  |         AddTableDialogContext&  impl_getDialogContext() const; | 
					
						
							| 
									
										
										
										
											2001-02-28 09:09:17 +00:00
										 |  |  |     }; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | #endif // DBAUI_JOINCONTROLLER_HXX
 | 
					
						
							|  |  |  | 
 |