Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_LINKEDDOCUMENTS_HXX
21 : #define INCLUDED_DBACCESS_SOURCE_UI_INC_LINKEDDOCUMENTS_HXX
22 :
23 : #include "AppElementType.hxx"
24 :
25 : #include <com/sun/star/container/XNameAccess.hpp>
26 : #include <com/sun/star/uno/XComponentContext.hpp>
27 : #include <com/sun/star/lang/XComponent.hpp>
28 : #include <com/sun/star/beans/XPropertySet.hpp>
29 : #include <com/sun/star/sdbc/XConnection.hpp>
30 : #include <com/sun/star/frame/XFrame.hpp>
31 : #include <com/sun/star/frame/XComponentLoader.hpp>
32 : #include <com/sun/star/ucb/XContent.hpp>
33 : #include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp>
34 : #include <comphelper/namedvaluecollection.hxx>
35 : #include <vcl/vclptr.hxx>
36 :
37 : namespace vcl { class Window; }
38 : namespace dbaui
39 : {
40 :
41 : // OLinkedDocumentsAccess
42 : class OLinkedDocumentsAccess
43 : {
44 : protected:
45 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
46 : m_xContext;
47 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
48 : m_xDocumentContainer;
49 : ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>
50 : m_xConnection;
51 : ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >
52 : m_xDocumentUI;
53 : VclPtr<vcl::Window> m_pDialogParent;
54 : OUString m_sCurrentlyEditing;
55 : OUString m_sDataSourceName;
56 :
57 : public:
58 : OLinkedDocumentsAccess(
59 : vcl::Window* _pDialogParent,
60 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& i_rDocumentUI,
61 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
62 : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer,
63 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
64 : const OUString& _sDataSourceName
65 : );
66 : ~OLinkedDocumentsAccess();
67 :
68 0 : inline bool isConnected() const { return m_xConnection.is(); }
69 :
70 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>
71 : open(
72 : const OUString& _rLinkName,
73 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>& _xDefinition,
74 : ElementOpenMode _eOpenMode,
75 : const ::comphelper::NamedValueCollection& _rAdditionalArgs
76 : );
77 :
78 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
79 : newDocument(
80 : sal_Int32 i_nActionID,
81 : const ::comphelper::NamedValueCollection& i_rCreationArgs,
82 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& o_rDefinition
83 : );
84 :
85 : void newFormWithPilot(
86 : const sal_Int32 _nCommandType = -1,
87 : const OUString& _rObjectName = OUString()
88 : );
89 : void newReportWithPilot(
90 : const sal_Int32 _nCommandType = -1,
91 : const OUString& _rObjectName = OUString()
92 : );
93 : void newQueryWithPilot();
94 : void newTableWithPilot();
95 :
96 : enum RESULT
97 : {
98 : ERROR,
99 : SUCCESS,
100 : CANCEL
101 : };
102 : private:
103 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
104 : impl_open(
105 : const OUString& _rLinkName,
106 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _xDefinition,
107 : ElementOpenMode _eOpenMode,
108 : const ::comphelper::NamedValueCollection& _rAdditionalArgs
109 : );
110 :
111 : void
112 : impl_newWithPilot(
113 : const char* _pWizardService,
114 : const sal_Int32 _nCommandType,
115 : const OUString& _rObjectName
116 : );
117 :
118 : };
119 :
120 : } // namespace dbaui
121 :
122 : #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_LINKEDDOCUMENTS_HXX
123 :
124 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|