00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef _CPPUHELPER_ACCESS_CONTROL_HXX_
00020 #define _CPPUHELPER_ACCESS_CONTROL_HXX_
00021
00022 #include <com/sun/star/uno/XComponentContext.hpp>
00023 #include <com/sun/star/security/XAccessController.hpp>
00024 #include "cppuhelperdllapi.h"
00025
00026
00027 namespace cppu
00028 {
00029
00032 class CPPUHELPER_DLLPUBLIC AccessControl
00033 {
00034 ::com::sun::star::uno::Reference< ::com::sun::star::security::XAccessController > m_xController;
00035
00036 public:
00041 AccessControl(
00042 ::com::sun::star::uno::Reference<
00043 ::com::sun::star::uno::XComponentContext > const & xContext )
00044 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00049 AccessControl(
00050 ::com::sun::star::uno::Reference<
00051 ::com::sun::star::security::XAccessController > const & xController )
00052 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00057 AccessControl( ::cppu::AccessControl const & ac )
00058 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00059
00062 inline void SAL_CALL clear() SAL_THROW(())
00063 { m_xController.clear(); }
00064
00069 inline ::com::sun::star::uno::Reference<
00070 ::com::sun::star::security::XAccessController > const & SAL_CALL get() const SAL_THROW(())
00071 { return m_xController; }
00072
00077 inline ::com::sun::star::security::XAccessController * SAL_CALL operator -> () const SAL_THROW(())
00078 { return m_xController.get(); }
00079
00080
00087 void SAL_CALL checkRuntimePermission(
00088 ::rtl::OUString const & name )
00089 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00090
00097 void SAL_CALL checkFilePermission(
00098 ::rtl::OUString const & url,
00099 ::rtl::OUString const & actions )
00100 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00101
00109 void SAL_CALL checkSocketPermission(
00110 ::rtl::OUString const & host,
00111 ::rtl::OUString const & actions )
00112 SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00113 };
00114
00115 }
00116
00117 #endif
00118
00119