1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef DBAUI_RELATIONCONTROLLER_HXX
20 #define DBAUI_RELATIONCONTROLLER_HXX
22 #include "JoinController.hxx"
23 #include "RelationDesignView.hxx"
28 class ORelationController
: public OJoinController
30 ::com::sun::star::uno::Reference
< ::com::sun::star::container::XNameAccess
> m_xTables
;
31 ::std::auto_ptr
<WaitObject
> m_pWaitObject
;
32 sal_uLong m_nThreadEvent
;
33 sal_Bool m_bRelationsPossible
;
35 // all the features which should be handled by this class
36 virtual void describeSupportedFeatures();
37 // 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.
38 virtual FeatureState
GetState(sal_uInt16 nId
) const;
40 virtual void Execute(sal_uInt16 nId
, const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aArgs
);
42 ORelationDesignView
* getRelationView() { return static_cast<ORelationDesignView
*>( getView() ); }
44 TTableWindowData::value_type
existsTable(const OUString
& _rComposedTableName
,sal_Bool _bCase
) const;
46 // load the window positions out of the datasource
47 void loadLayoutInformation();
48 void loadTableData(const ::com::sun::star::uno::Any
& _aTable
);
50 ORelationController(const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& _rM
);
52 ~ORelationController();
54 void SaveTabWinsPosSize( OJoinTableView::OTableWindowMap
* pTabWinList
, long nOffsetX
, long nOffsetY
);
56 void mergeData(const TTableConnectionData
& _aConnectionData
);
58 virtual sal_Bool
Construct(Window
* pParent
);
61 virtual OUString SAL_CALL
getImplementationName() throw(::com::sun::star::uno::RuntimeException
);
62 virtual ::com::sun::star::uno::Sequence
< OUString
> SAL_CALL
getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException
);
63 // need by registration
64 static OUString
getImplementationName_Static() throw( ::com::sun::star::uno::RuntimeException
);
65 static ::com::sun::star::uno::Sequence
< OUString
> getSupportedServiceNames_Static(void) throw( ::com::sun::star::uno::RuntimeException
);
66 static ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XInterface
>
67 SAL_CALL
Create(const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>&);
69 // OJoinController overridables
70 virtual bool allowViews() const;
71 virtual bool allowQueries() const;
74 // ask the user if the design should be saved when it is modified
75 virtual short saveModified();
77 virtual void impl_initialize();
78 virtual OUString
getPrivateTitle( ) const;
79 DECL_LINK( OnThreadFinished
, void* );
82 #endif // DBAUI_RELATIONCONTROLLER_HXX
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */