update dev300-m58
[ooovba.git] / configmgr / source / localbe / localsinglestratum.hxx
blob90285d42c5fda250c94def52d8d1510b23f8dc8c
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: localsinglestratum.hxx,v $
10 * $Revision: 1.7 $
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 ************************************************************************/
31 #ifndef CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
32 #define CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
34 #include "localstratumbase.hxx"
35 #include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
36 #include <cppuhelper/implbase1.hxx>
38 namespace configmgr
40 namespace localbe
43 namespace css = com::sun::star ;
44 namespace uno = css::uno ;
45 namespace lang = css::lang ;
46 namespace backend = css::configuration::backend ;
48 /**
49 Implements the SingleLayerStratum service for local file access.
51 class LocalSingleStratumBase : public cppu::ImplInheritanceHelper1< LocalStratumBase, backend::XSingleLayerStratum >
53 public :
54 /**
55 Service constructor from a service factory.
57 @param xContext component context
59 LocalSingleStratumBase(const uno::Reference<uno::XComponentContext>& xContext) ;
61 /** Destructor */
62 ~LocalSingleStratumBase() ;
65 // XSingleLayerStratum
66 virtual uno::Reference<backend::XLayer> SAL_CALL
67 getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
68 throw (backend::BackendAccessException,
69 lang::IllegalArgumentException,
70 uno::RuntimeException) ;
72 virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
73 getUpdatableLayer( const rtl::OUString& aLayerId )
74 throw (backend::BackendAccessException,
75 lang::IllegalArgumentException,
76 lang::NoSupportException,
77 uno::RuntimeException) ;
79 } ;
81 class LocalSingleStratum : public LocalSingleStratumBase
83 public:
84 LocalSingleStratum(const uno::Reference<uno::XComponentContext>& xContext)
85 : LocalSingleStratumBase(xContext)
86 {};
88 private:
89 virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
90 virtual const ServiceImplementationInfo * getServiceInfoData() const;
93 class LocalDataStratum : public LocalSingleStratumBase
95 public:
96 LocalDataStratum(const uno::Reference<uno::XComponentContext>& xContext)
97 : LocalSingleStratumBase(xContext)
98 {};
100 private:
101 virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
102 virtual const ServiceImplementationInfo * getServiceInfoData() const;
105 class LocalReadonlyStratum : public LocalSingleStratumBase
107 public:
108 LocalReadonlyStratum(const uno::Reference<uno::XComponentContext>& xContext)
109 : LocalSingleStratumBase(xContext)
112 // XSingleLayerStratum - readonly implementation
113 virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
114 getUpdatableLayer( const rtl::OUString& aLayerId )
115 throw (backend::BackendAccessException,
116 lang::IllegalArgumentException,
117 lang::NoSupportException,
118 uno::RuntimeException) ;
120 private:
121 virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
122 virtual const ServiceImplementationInfo * getServiceInfoData() const;
125 class LocalResourceStratum : public LocalSingleStratumBase
127 public:
128 LocalResourceStratum(const uno::Reference<uno::XComponentContext>& xContext)
129 : LocalSingleStratumBase(xContext)
132 // XSingleLayerStratum - readonly implementation
133 virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
134 getUpdatableLayer( const rtl::OUString& aLayerId )
135 throw (backend::BackendAccessException,
136 lang::IllegalArgumentException,
137 lang::NoSupportException,
138 uno::RuntimeException) ;
140 private:
141 virtual void adjustBaseURL(rtl::OUString& aBaseURL);
142 virtual void getLayerDirectories(rtl::OUString& aLayerUrl, rtl::OUString& aSubLayerUrl) const;
143 virtual const ServiceImplementationInfo * getServiceInfoData() const;
148 } } // configmgr.localbe
150 #endif