UDK 3.2.7 C/C++ API Reference
cppuhelper/access_control.hxx
Go to the documentation of this file.
00001 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
00002 /*************************************************************************
00003  *
00004  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
00005  *
00006  * Copyright 2000, 2010 Oracle and/or its affiliates.
00007  *
00008  * OpenOffice.org - a multi-platform office productivity suite
00009  *
00010  * This file is part of OpenOffice.org.
00011  *
00012  * OpenOffice.org is free software: you can redistribute it and/or modify
00013  * it under the terms of the GNU Lesser General Public License version 3
00014  * only, as published by the Free Software Foundation.
00015  *
00016  * OpenOffice.org is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU Lesser General Public License version 3 for more details
00020  * (a copy is included in the LICENSE file that accompanied this code).
00021  *
00022  * You should have received a copy of the GNU Lesser General Public License
00023  * version 3 along with OpenOffice.org.  If not, see
00024  * <http://www.openoffice.org/license.html>
00025  * for a copy of the LGPLv3 License.
00026  *
00027  ************************************************************************/
00028 #ifndef _CPPUHELPER_ACCESS_CONTROL_HXX_
00029 #define _CPPUHELPER_ACCESS_CONTROL_HXX_
00030 
00031 #include <com/sun/star/uno/XComponentContext.hpp>
00032 #include <com/sun/star/security/XAccessController.hpp>
00033 #include "cppuhelperdllapi.h"
00034 
00035 
00036 namespace cppu
00037 {
00038 
00041 class CPPUHELPER_DLLPUBLIC AccessControl
00042 {
00043     ::com::sun::star::uno::Reference< ::com::sun::star::security::XAccessController > m_xController;
00044 
00045 public:
00050     AccessControl(
00051         ::com::sun::star::uno::Reference<
00052             ::com::sun::star::uno::XComponentContext > const & xContext )
00053         SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00058     AccessControl(
00059         ::com::sun::star::uno::Reference<
00060             ::com::sun::star::security::XAccessController > const & xController )
00061         SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00066     AccessControl( ::cppu::AccessControl const & ac )
00067         SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00068 
00071     inline void SAL_CALL clear() SAL_THROW(())
00072         { m_xController.clear(); }
00073 
00078     inline ::com::sun::star::uno::Reference<
00079         ::com::sun::star::security::XAccessController > const & SAL_CALL get() const SAL_THROW(())
00080         { return m_xController; }
00081 
00086     inline ::com::sun::star::security::XAccessController * SAL_CALL operator -> () const SAL_THROW(())
00087         { return m_xController.get(); }
00088 
00089 
00096     void SAL_CALL checkRuntimePermission(
00097         ::rtl::OUString const & name )
00098         SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00099 
00106     void SAL_CALL checkFilePermission(
00107         ::rtl::OUString const & url,
00108         ::rtl::OUString const & actions )
00109         SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00110 
00118     void SAL_CALL checkSocketPermission(
00119         ::rtl::OUString const & host,
00120         ::rtl::OUString const & actions )
00121         SAL_THROW( (::com::sun::star::uno::RuntimeException) );
00122 };
00123 
00124 }
00125 
00126 #endif
00127 
00128 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines