1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 28 #ifndef DBACCESS_CONTAINERAPPROVE_HXX 29 #define DBACCESS_CONTAINERAPPROVE_HXX 30 31 /** === begin UNO includes === **/ 32 #ifndef _COM_SUN_STAR_UNO_XINTERFACE_HPP_ 33 #include <com/sun/star/uno/XInterface.hpp> 34 #endif 35 /** === end UNO includes === **/ 36 37 #include <boost/shared_ptr.hpp> 38 39 //........................................................................ 40 namespace dbaccess 41 { 42 //........................................................................ 43 44 //==================================================================== 45 //= IContainerApprove 46 //==================================================================== 47 /** interface for approving elements to be inserted into a container 48 49 On the long run, one could imagine that this interface completely encapsulates 50 container/element approvals in all our various container classes herein (document 51 containers, definition containers, table containers, query containers, 52 command definition containers, bookmark containers). This would decrease coupling 53 of the respective classes. 54 */ 55 class SAL_NO_VTABLE IContainerApprove 56 { 57 public: 58 /** approves a given element for insertion into the container 59 @param _rName 60 specifies the name under which the element is going to be inserted 61 @param _rxElement 62 specifies the element which is going to be inserted 63 @throws Exception 64 if the name or the object are invalid, or not eligible for insertion 65 into the container 66 */ 67 virtual void SAL_CALL approveElement( 68 const ::rtl::OUString& _rName, 69 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxElement 70 ) = 0; 71 }; 72 73 typedef ::boost::shared_ptr< IContainerApprove > PContainerApprove; 74 75 //........................................................................ 76 } // namespace dbaccess 77 //........................................................................ 78 79 #endif // DBACCESS_CONTAINERAPPROVE_HXX 80 81