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 
24cdf0e10cSrcweir #ifndef _DBAUI_LINKEDDOCUMENTS_HXX_
25cdf0e10cSrcweir #define _DBAUI_LINKEDDOCUMENTS_HXX_
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "AppElementType.hxx"
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
30cdf0e10cSrcweir #include <com/sun/star/container/XNameAccess.hpp>
31cdf0e10cSrcweir #endif
32cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
33cdf0e10cSrcweir #include <com/sun/star/lang/XMultiServiceFactory.hpp>
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir #ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
36cdf0e10cSrcweir #include <com/sun/star/lang/XComponent.hpp>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
39cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp>
40cdf0e10cSrcweir #endif
41cdf0e10cSrcweir #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
42cdf0e10cSrcweir #include <com/sun/star/sdbc/XConnection.hpp>
43cdf0e10cSrcweir #endif
44cdf0e10cSrcweir #include <com/sun/star/frame/XFrame.hpp>
45cdf0e10cSrcweir #ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
46cdf0e10cSrcweir #include <com/sun/star/frame/XComponentLoader.hpp>
47cdf0e10cSrcweir #endif
48cdf0e10cSrcweir #ifndef _COM_SUN_STAR_UCB_XCONTENT_HPP_
49cdf0e10cSrcweir #include <com/sun/star/ucb/XContent.hpp>
50cdf0e10cSrcweir #endif
51cdf0e10cSrcweir #include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp>
52cdf0e10cSrcweir #ifndef _LINK_HXX
53cdf0e10cSrcweir #include <tools/link.hxx>
54cdf0e10cSrcweir #endif
55cdf0e10cSrcweir #ifndef _STRING_HXX
56cdf0e10cSrcweir #include <tools/string.hxx>
57cdf0e10cSrcweir #endif
58cdf0e10cSrcweir #ifndef COMPHELPER_NAMEDVALUECOLLECTION_HXX
59cdf0e10cSrcweir #include <comphelper/namedvaluecollection.hxx>
60cdf0e10cSrcweir #endif
61cdf0e10cSrcweir 
62cdf0e10cSrcweir class Window;
63cdf0e10cSrcweir //......................................................................
64cdf0e10cSrcweir namespace dbaui
65cdf0e10cSrcweir {
66cdf0e10cSrcweir //......................................................................
67cdf0e10cSrcweir 
68cdf0e10cSrcweir 	//==================================================================
69cdf0e10cSrcweir 	//= OLinkedDocumentsAccess
70cdf0e10cSrcweir 	//==================================================================
71cdf0e10cSrcweir 	class OLinkedDocumentsAccess
72cdf0e10cSrcweir 	{
73cdf0e10cSrcweir 	protected:
74cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
75cdf0e10cSrcweir 					m_xORB;
76cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
77cdf0e10cSrcweir 					m_xDocumentContainer;
78cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>
79cdf0e10cSrcweir 					m_xConnection;
80cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >
81cdf0e10cSrcweir                     m_xDocumentUI;
82cdf0e10cSrcweir 		Window*		m_pDialogParent;
83cdf0e10cSrcweir 		String		m_sCurrentlyEditing;
84cdf0e10cSrcweir         ::rtl::OUString
85cdf0e10cSrcweir                     m_sDataSourceName;
86cdf0e10cSrcweir 
87cdf0e10cSrcweir 	public:
88cdf0e10cSrcweir 		OLinkedDocumentsAccess(
89cdf0e10cSrcweir             Window* _pDialogParent,
90cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& i_rDocumentUI,
91cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
92cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer,
93cdf0e10cSrcweir             const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
94cdf0e10cSrcweir             const ::rtl::OUString& _sDataSourceName
95cdf0e10cSrcweir         );
96cdf0e10cSrcweir 		~OLinkedDocumentsAccess();
97cdf0e10cSrcweir 
isConnected() const98cdf0e10cSrcweir         inline sal_Bool isConnected() const { return m_xConnection.is(); }
99cdf0e10cSrcweir 
100cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>
101cdf0e10cSrcweir                 open(
102cdf0e10cSrcweir                     const ::rtl::OUString& _rLinkName,
103cdf0e10cSrcweir                     ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>& _xDefinition,
104cdf0e10cSrcweir                     ElementOpenMode _eOpenMode,
105cdf0e10cSrcweir                     const ::comphelper::NamedValueCollection& _rAdditionalArgs
106cdf0e10cSrcweir                 );
107cdf0e10cSrcweir 
108cdf0e10cSrcweir         ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
109cdf0e10cSrcweir                 newDocument(
110cdf0e10cSrcweir                           sal_Int32 i_nActionID,
111cdf0e10cSrcweir                     const ::comphelper::NamedValueCollection& i_rCreationArgs,
112cdf0e10cSrcweir                           ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& o_rDefinition
113cdf0e10cSrcweir                 );
114cdf0e10cSrcweir 
115cdf0e10cSrcweir         void    newFormWithPilot(
116cdf0e10cSrcweir                     const sal_Int32 _nCommandType = -1,
117cdf0e10cSrcweir                     const ::rtl::OUString& _rObjectName = ::rtl::OUString()
118cdf0e10cSrcweir                 );
119cdf0e10cSrcweir         void    newReportWithPilot(
120cdf0e10cSrcweir                     const sal_Int32 _nCommandType = -1,
121cdf0e10cSrcweir                     const ::rtl::OUString& _rObjectName = ::rtl::OUString()
122cdf0e10cSrcweir                 );
123cdf0e10cSrcweir         void    newQueryWithPilot();
124cdf0e10cSrcweir         void    newTableWithPilot();
125cdf0e10cSrcweir 
126cdf0e10cSrcweir 		enum RESULT
127cdf0e10cSrcweir 		{
128cdf0e10cSrcweir 			ERROR,
129cdf0e10cSrcweir 			SUCCESS,
130cdf0e10cSrcweir 			CANCEL
131cdf0e10cSrcweir 		};
132cdf0e10cSrcweir     private:
133cdf0e10cSrcweir 		::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
134cdf0e10cSrcweir             impl_open(
135cdf0e10cSrcweir                 const ::rtl::OUString& _rLinkName,
136cdf0e10cSrcweir                 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _xDefinition,
137cdf0e10cSrcweir                 ElementOpenMode _eOpenMode,
138cdf0e10cSrcweir                 const ::comphelper::NamedValueCollection& _rAdditionalArgs
139cdf0e10cSrcweir             );
140cdf0e10cSrcweir 
141cdf0e10cSrcweir         void
142cdf0e10cSrcweir             impl_newWithPilot(
143cdf0e10cSrcweir                 const char* _pWizardService,
144cdf0e10cSrcweir                 const sal_Int32 _nCommandType,
145cdf0e10cSrcweir                 const ::rtl::OUString& _rObjectName
146cdf0e10cSrcweir             );
147cdf0e10cSrcweir 
148cdf0e10cSrcweir 	};
149cdf0e10cSrcweir 
150cdf0e10cSrcweir //......................................................................
151cdf0e10cSrcweir }	// namespace dbaui
152cdf0e10cSrcweir //......................................................................
153cdf0e10cSrcweir 
154cdf0e10cSrcweir #endif // _DBAUI_LINKEDDOCUMENTS_HXX_
155cdf0e10cSrcweir 
156