merge the formfield patch from ooo-build
[ooovba.git] / configmgr / source / backend / binarycache.hxx
blobf4506a12b1cf7272801bf1e6b501cf8bbd6bd096
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: binarycache.hxx,v $
10 * $Revision: 1.6 $
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 ************************************************************************/
30 #ifndef CONFIGMGR_BINARYCACHE_HXX
31 #define CONFIGMGR_BINARYCACHE_HXX
33 #include "matchlocale.hxx"
35 #include <rtl/ustring.hxx>
36 #include <com/sun/star/uno/XComponentContext.hpp>
37 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 #include <com/sun/star/configuration/backend/XLayer.hpp>
40 namespace configmgr
42 // -----------------------------------------------------------------------------
43 namespace backend
45 namespace css = com::sun::star ;
46 namespace uno = css::uno ;
47 namespace lang = css::lang ;
48 namespace backenduno = css::configuration::backend ;
50 // -----------------------------------------------------------------------------
51 class MergedComponentData;
53 // -----------------------------------------------------------------------------
55 class BinaryCache
57 public:
58 explicit
59 BinaryCache(const uno::Reference<uno::XComponentContext>& xContext);
61 void setOwnerEntity(rtl::OUString const & aOwnerEntity);
62 void disableCache();
64 bool isCacheEnabled(rtl::OUString const & aEntity) const;
66 rtl::OUString getCacheFileURL(rtl::OUString const & aComponent) const;
68 bool readComponentData(MergedComponentData & aComponentData,
69 uno::Reference< lang::XMultiServiceFactory > const & aFactory,
70 rtl::OUString const & aComponent,
71 rtl::OUString const & aSchemaVersion,
72 rtl::OUString const & aEntity,
73 com::sun::star::lang::Locale const & aRequestedLocale,
74 std::vector< com::sun::star::lang::Locale > & outKnownLocales,
75 const uno::Reference<backenduno::XLayer> * pLayers,
76 sal_Int32 nNumLayers,
77 bool bIncludeTemplates = true);
79 bool writeComponentData(MergedComponentData const & aComponentData,
80 uno::Reference< lang::XMultiServiceFactory > const & aFactory,
81 rtl::OUString const & aComponent,
82 rtl::OUString const & aSchemaVersion,
83 rtl::OUString const & aEntity,
84 std::vector< com::sun::star::lang::Locale > const & aKnownLocales,
85 const uno::Reference<backenduno::XLayer> * pLayers,
86 sal_Int32 nNumLayers);
87 private:
88 rtl::OUString mBaseURL;
89 rtl::OUString mOwnerEntity;
90 bool mbCacheEnabled;
93 // -----------------------------------------------------------------------------------
94 // helper for cache reader implementations - see backendaccess.cxx for implementation
95 uno::Sequence< rtl::OUString >
96 getAvailableLocales(const uno::Reference<backenduno::XLayer> * pLayers, sal_Int32 nNumLayers);
97 // -----------------------------------------------------------------------------------
99 // -----------------------------------------------------------------------------------
102 #endif //