sync master with lastest vba changes
[ooovba.git] / binfilter / inc / bf_svtools / restrictedpaths.hxx
bloba84263ae3a83f6e861b79ac4fab91a42ad792373
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: restrictedpaths.hxx,v $
10 * $Revision: 1.4 $
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 SVTOOLS_RESTRICTEDPATHS_HXX
32 #define SVTOOLS_RESTRICTEDPATHS_HXX
34 #ifndef SVTOOLS_URL_FILTER_HXX
35 #include <bf_svtools/urlfilter.hxx>
36 #endif
38 #ifndef INCLUDED_SVTDLLAPI_H
39 #include <bf_svtools/svtdllapi.h>
40 #endif
42 #ifndef _STRING_HXX
43 #include <tools/string.hxx>
44 #endif
46 #include <vector>
48 namespace binfilter
50 class RestrictedPaths : public IUrlFilter
52 private:
53 ::std::vector< String > m_aUnrestrictedURLs;
54 bool m_bFilterIsEnabled;
56 public:
57 RestrictedPaths();
58 virtual ~RestrictedPaths();
60 inline bool hasFilter() const { return !m_aUnrestrictedURLs.empty(); }
61 inline const ::std::vector< String >& getFilter() const { return m_aUnrestrictedURLs; }
63 inline void enableFilter( bool _bEnable ) { m_bFilterIsEnabled = _bEnable; }
64 inline bool isFilterEnabled() const { return m_bFilterIsEnabled; }
66 public:
67 /** checks URL access permissions
69 <p>with the "restriction" feature we have in the file dialog, it's possible that
70 only certain URLs can be browsed. This method checks whether a given URL belongs
71 to this set of permitted URLs.</p>
73 <p>If no "access restriction" is effective, this method always returns <TRUE/>.</p>
75 virtual bool isUrlAllowed( const String& _rURL ) const;
80 #endif // SVTOOLS_RESTRICTEDPATHS_HXX