update dev300-m58
[ooovba.git] / dbaccess / source / ui / inc / RelationController.hxx
blobb39181e013515ef07761ce3ac2ad7974ea4b1ae9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: RelationController.hxx,v $
10 * $Revision: 1.19 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBAUI_RELATIONCONTROLLER_HXX
31 #define DBAUI_RELATIONCONTROLLER_HXX
33 #ifndef DBAUI_JOINCONTROLLER_HXX
34 #include "JoinController.hxx"
35 #endif
36 #ifndef DBAUI_RELATIONDESIGNVIEW_HXX
37 #include "RelationDesignView.hxx"
38 #endif
40 class VCLXWindow;
41 class WaitObject;
42 namespace dbaui
44 class OTableConnectionData;
45 class OTableWindowData;
46 class OAddTableDlg;
47 class OTableFieldDesc;
48 class OTableWindow;
49 class ORelationController : public OJoinController
51 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess > m_xTables;
52 ::std::auto_ptr<WaitObject> m_pWaitObject;
53 ULONG m_nThreadEvent;
54 sal_Bool m_bRelationsPossible;
55 protected:
56 // all the features which should be handled by this class
57 virtual void describeSupportedFeatures();
58 // 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.
59 virtual FeatureState GetState(sal_uInt16 nId) const;
60 // execute a feature
61 virtual void Execute(sal_uInt16 nId, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue>& aArgs);
63 ORelationDesignView* getRelationView() { return static_cast<ORelationDesignView*>(m_pView); }
64 void loadData();
65 TTableWindowData::value_type existsTable(const ::rtl::OUString& _rComposedTableName,sal_Bool _bCase) const;
67 // load the window positions out of the datasource
68 void loadLayoutInformation();
69 void loadTableData(const ::com::sun::star::uno::Any& _aTable);
70 public:
71 ORelationController(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM);
73 ~ORelationController();
74 // temp
75 void SaveTabWinsPosSize( OJoinTableView::OTableWindowMap* pTabWinList, long nOffsetX, long nOffsetY );
77 void mergeData(const TTableConnectionData& _aConnectionData);
79 virtual sal_Bool Construct(Window* pParent);
81 // XServiceInfo
82 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
83 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
84 // need by registration
85 static ::rtl::OUString getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException );
86 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException );
87 static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
88 SAL_CALL Create(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&);
90 // OJoinController overridables
91 virtual bool allowViews() const;
92 virtual bool allowQueries() const;
94 private:
95 // ask the user if the design should be saved when it is modified
96 virtual short saveModified();
97 virtual void reset();
98 virtual void impl_initialize();
99 virtual ::rtl::OUString getPrivateTitle( ) const;
100 DECL_LINK( OnThreadFinished, void* );
103 #endif // DBAUI_RELATIONCONTROLLER_HXX