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  * This file is part of the LibreOffice project.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this
00007  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * This file incorporates work covered by the following license notice:
00010  *
00011  *   Licensed to the Apache Software Foundation (ASF) under one or more
00012  *   contributor license agreements. See the NOTICE file distributed
00013  *   with this work for additional information regarding copyright
00014  *   ownership. The ASF licenses this file to you under the Apache
00015  *   License, Version 2.0 (the "License"); you may not use this file
00016  *   except in compliance with the License. You may obtain a copy of
00017  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
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 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines