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 .
20 #ifndef SUBCOMPONENTRECOVERY_HXX
21 #define SUBCOMPONENTRECOVERY_HXX
23 #include "subcomponents.hxx"
25 #include <com/sun/star/sdb/application/XDatabaseDocumentUI.hpp>
26 #include <com/sun/star/embed/XStorage.hpp>
27 #include <com/sun/star/uno/XComponentContext.hpp>
29 //........................................................................
32 //........................................................................
34 //====================================================================
35 //= SubComponentRecovery
36 //====================================================================
37 class DBACCESS_DLLPRIVATE SubComponentRecovery
41 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& i_rContext
,
42 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdb::application::XDatabaseDocumentUI
>& i_rController
,
43 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>& i_rComponent
)
44 :m_rContext( i_rContext
)
45 ,m_xDocumentUI( i_rController
, ::com::sun::star::uno::UNO_SET_THROW
)
46 ,m_xComponent( i_rComponent
)
50 impl_identifyComponent_throw();
54 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>& i_rContext
,
55 const ::com::sun::star::uno::Reference
< ::com::sun::star::sdb::application::XDatabaseDocumentUI
>& i_rController
,
56 const SubComponentType i_eType
)
57 :m_rContext( i_rContext
)
58 ,m_xDocumentUI( i_rController
, ::com::sun::star::uno::UNO_SET_THROW
)
65 // only to be used after being constructed with a component
66 void saveToRecoveryStorage(
67 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& i_rRecoveryStorage
,
68 MapCompTypeToCompDescs
& io_mapCompDescs
71 // only to be used after being constructed with a type
72 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>
74 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& i_rRecoveryStorage
,
75 const OUString
& i_rComponentName
,
76 const bool i_bForEditing
79 static const OUString
getComponentsStorageName( const SubComponentType i_eType
);
82 void impl_saveSubDocument_throw(
83 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& i_rObjectStorage
86 void impl_saveQueryDesign_throw(
87 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& i_rObjectStorage
90 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>
91 impl_recoverSubDocument_throw(
92 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& i_rRecoveryStorage
,
93 const OUString
& i_rComponentName
,
94 const bool i_bForEditing
97 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>
98 impl_recoverQueryDesign_throw(
99 const ::com::sun::star::uno::Reference
< ::com::sun::star::embed::XStorage
>& i_rRecoveryStorage
,
100 const OUString
& i_rComponentName
,
101 const bool i_bForEditing
104 void impl_identifyComponent_throw();
107 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>&
109 ::com::sun::star::uno::Reference
< ::com::sun::star::sdb::application::XDatabaseDocumentUI
>
111 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XComponent
>
113 SubComponentType m_eType
;
114 SubComponentDescriptor m_aCompDesc
;
118 //........................................................................
119 } // namespace dbaccess
120 //........................................................................
122 #endif // SUBCOMPONENTRECOVERY_HXX
124 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */