Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / dbaccess / source / core / recovery / subcomponentrecovery.hxx
blob68f75eb1fa435c719570e6407f997842e4774178
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
28 #include <comphelper/componentcontext.hxx>
30 //........................................................................
31 namespace dbaccess
33 //........................................................................
35 //====================================================================
36 //= SubComponentRecovery
37 //====================================================================
38 class DBACCESS_DLLPRIVATE SubComponentRecovery
40 public:
41 SubComponentRecovery( const ::comphelper::ComponentContext& i_rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& i_rController,
42 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& i_rComponent )
43 :m_rContext( i_rContext )
44 ,m_xDocumentUI( i_rController, ::com::sun::star::uno::UNO_SET_THROW )
45 ,m_xComponent( i_rComponent )
46 ,m_eType( UNKNOWN )
47 ,m_aCompDesc()
49 impl_identifyComponent_throw();
52 SubComponentRecovery( const ::comphelper::ComponentContext& i_rContext, const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >& i_rController,
53 const SubComponentType i_eType )
54 :m_rContext( i_rContext )
55 ,m_xDocumentUI( i_rController, ::com::sun::star::uno::UNO_SET_THROW )
56 ,m_xComponent()
57 ,m_eType( i_eType )
58 ,m_aCompDesc()
62 // only to be used after being constructed with a component
63 void saveToRecoveryStorage(
64 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rRecoveryStorage,
65 MapCompTypeToCompDescs& io_mapCompDescs
68 // only to be used after being constructed with a type
69 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
70 recoverFromStorage(
71 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rRecoveryStorage,
72 const ::rtl::OUString& i_rComponentName,
73 const bool i_bForEditing
76 static const ::rtl::OUString getComponentsStorageName( const SubComponentType i_eType );
78 private:
79 void impl_saveSubDocument_throw(
80 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rObjectStorage
83 void impl_saveQueryDesign_throw(
84 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rObjectStorage
87 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
88 impl_recoverSubDocument_throw(
89 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rRecoveryStorage,
90 const ::rtl::OUString& i_rComponentName,
91 const bool i_bForEditing
94 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
95 impl_recoverQueryDesign_throw(
96 const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& i_rRecoveryStorage,
97 const ::rtl::OUString& i_rComponentName,
98 const bool i_bForEditing
101 void impl_identifyComponent_throw();
103 private:
104 const ::comphelper::ComponentContext& m_rContext;
105 ::com::sun::star::uno::Reference< ::com::sun::star::sdb::application::XDatabaseDocumentUI >
106 m_xDocumentUI;
107 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >
108 m_xComponent;
109 SubComponentType m_eType;
110 SubComponentDescriptor m_aCompDesc;
114 //........................................................................
115 } // namespace dbaccess
116 //........................................................................
118 #endif // SUBCOMPONENTRECOVERY_HXX
120 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */