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 _DBAUI_LINKEDDOCUMENTS_HXX_
21 : #define _DBAUI_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 <tools/string.hxx>
35 : #include <comphelper/namedvaluecollection.hxx>
36 :
37 : class Window;
38 : //......................................................................
39 : namespace dbaui
40 : {
41 : //......................................................................
42 :
43 : //==================================================================
44 : //= OLinkedDocumentsAccess
45 : //==================================================================
46 : class OLinkedDocumentsAccess
47 : {
48 : protected:
49 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
50 : m_xContext;
51 : ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >
52 : m_xDocumentContainer;
53 : ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>
54 : m_xConnection;
55 : ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >
56 : m_xDocumentUI;
57 : Window* m_pDialogParent;
58 : String m_sCurrentlyEditing;
59 : ::rtl::OUString
60 : m_sDataSourceName;
61 :
62 : public:
63 : OLinkedDocumentsAccess(
64 : Window* _pDialogParent,
65 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& i_rDocumentUI,
66 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxContext,
67 : const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess >& _rxContainer,
68 : const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _xConnection,
69 : const ::rtl::OUString& _sDataSourceName
70 : );
71 : ~OLinkedDocumentsAccess();
72 :
73 0 : inline sal_Bool isConnected() const { return m_xConnection.is(); }
74 :
75 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>
76 : open(
77 : const ::rtl::OUString& _rLinkName,
78 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent>& _xDefinition,
79 : ElementOpenMode _eOpenMode,
80 : const ::comphelper::NamedValueCollection& _rAdditionalArgs
81 : );
82 :
83 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
84 : newDocument(
85 : sal_Int32 i_nActionID,
86 : const ::comphelper::NamedValueCollection& i_rCreationArgs,
87 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& o_rDefinition
88 : );
89 :
90 : void newFormWithPilot(
91 : const sal_Int32 _nCommandType = -1,
92 : const ::rtl::OUString& _rObjectName = ::rtl::OUString()
93 : );
94 : void newReportWithPilot(
95 : const sal_Int32 _nCommandType = -1,
96 : const ::rtl::OUString& _rObjectName = ::rtl::OUString()
97 : );
98 : void newQueryWithPilot();
99 : void newTableWithPilot();
100 :
101 : enum RESULT
102 : {
103 : ERROR,
104 : SUCCESS,
105 : CANCEL
106 : };
107 : private:
108 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
109 : impl_open(
110 : const ::rtl::OUString& _rLinkName,
111 : ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& _xDefinition,
112 : ElementOpenMode _eOpenMode,
113 : const ::comphelper::NamedValueCollection& _rAdditionalArgs
114 : );
115 :
116 : void
117 : impl_newWithPilot(
118 : const char* _pWizardService,
119 : const sal_Int32 _nCommandType,
120 : const ::rtl::OUString& _rObjectName
121 : );
122 :
123 : };
124 :
125 : //......................................................................
126 : } // namespace dbaui
127 : //......................................................................
128 :
129 : #endif // _DBAUI_LINKEDDOCUMENTS_HXX_
130 :
131 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|