merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / inc / linkeddocuments.hxx
blob281c639f3d3985edde2d70d72d3ccde4c57c1d3f
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: linkeddocuments.hxx,v $
10 * $Revision: 1.18 $
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 ************************************************************************/
31 #ifndef _DBAUI_LINKEDDOCUMENTS_HXX_
32 #define _DBAUI_LINKEDDOCUMENTS_HXX_
34 #include "AppElementType.hxx"
36 #ifndef _COM_SUN_STAR_CONTAINER_XNAMEACCESS_HPP_
37 #include <com/sun/star/container/XNameAccess.hpp>
38 #endif
39 #ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
40 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
41 #endif
42 #ifndef _COM_SUN_STAR_LANG_XCOMPONENT_HPP_
43 #include <com/sun/star/lang/XComponent.hpp>
44 #endif
45 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
46 #include <com/sun/star/beans/XPropertySet.hpp>
47 #endif
48 #ifndef _COM_SUN_STAR_SDBC_XCONNECTION_HPP_
49 #include <com/sun/star/sdbc/XConnection.hpp>
50 #endif
51 #include <com/sun/star/frame/XFrame.hpp>
52 #ifndef _COM_SUN_STAR_FRAME_XCOMPONENTLOADER_HPP_
53 #include <com/sun/star/frame/XComponentLoader.hpp>
54 #endif
55 #ifndef _COM_SUN_STAR_UCB_XCONTENT_HPP_
56 #include <com/sun/star/ucb/XContent.hpp>
57 #endif
58 #ifndef _LINK_HXX
59 #include <tools/link.hxx>
60 #endif
61 #ifndef _STRING_HXX
62 #include <tools/string.hxx>
63 #endif
64 #ifndef COMPHELPER_NAMEDVALUECOLLECTION_HXX
65 #include <comphelper/namedvaluecollection.hxx>
66 #endif
68 class Window;
69 //......................................................................
70 namespace dbaui
72 //......................................................................
74 //==================================================================
75 //= OLinkedDocumentsAccess
76 //==================================================================
77 class OLinkedDocumentsAccess
79 protected:
80 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
81 m_xORB;
82 ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
83 m_xDocumentContainer;
84 ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>
85 m_xConnection;
86 ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >
87 m_xParentFrame;
88 Window* m_pDialogParent;
89 String m_sCurrentlyEditing;
90 ::rtl::OUString
91 m_sDataSourceName;
93 public:
94 OLinkedDocumentsAccess(
95 Window* _pDialogParent
96 ,const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& _rxParentFrame
97 ,const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
98 ,const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer
99 ,const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection
100 ,const ::rtl::OUString& _sDataSourceName
102 ~OLinkedDocumentsAccess();
104 inline sal_Bool isConnected() const { return m_xConnection.is(); }
106 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>
107 open(
108 const ::rtl::OUString& _rLinkName,
109 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>& _xDefinition,
110 ElementOpenMode _eOpenMode,
111 const ::comphelper::NamedValueCollection& _rAdditionalArgs
114 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
115 newDocument(
116 sal_Int32 _nNewFormId,
117 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>& _xDefinition,
118 const sal_Int32 _nCommandType,
119 const ::rtl::OUString& _sObjectName
122 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
123 newFormWithPilot(
124 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>& _xDefinition,
125 const sal_Int32 _nCommandType = -1,
126 const ::rtl::OUString& _rObjectName = ::rtl::OUString()
129 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
130 newReportWithPilot(
131 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>& _xDefinition,
132 const sal_Int32 _nCommandType = -1,
133 const ::rtl::OUString& _rObjectName = ::rtl::OUString()
135 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
136 newQueryWithPilot();
138 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
139 newTableWithPilot();
141 enum RESULT
143 ERROR,
144 SUCCESS,
145 CANCEL
147 private:
148 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
149 impl_open(
150 const ::rtl::OUString& _rLinkName,
151 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>& _xDefinition,
152 ElementOpenMode _eOpenMode,
153 const ::comphelper::NamedValueCollection& _rAdditionalArgs
156 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
157 impl_newWithPilot(
158 const char* _pWizardService,
159 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _xDefinition,
160 const sal_Int32 _nCommandType,
161 const ::rtl::OUString& _rObjectName
166 //......................................................................
167 } // namespace dbaui
168 //......................................................................
170 #endif // _DBAUI_LINKEDDOCUMENTS_HXX_