1*161f4cd1SAndrew Rist /************************************************************** 2*161f4cd1SAndrew Rist * 3*161f4cd1SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*161f4cd1SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*161f4cd1SAndrew Rist * distributed with this work for additional information 6*161f4cd1SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*161f4cd1SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*161f4cd1SAndrew Rist * "License"); you may not use this file except in compliance 9*161f4cd1SAndrew Rist * with the License. You may obtain a copy of the License at 10*161f4cd1SAndrew Rist * 11*161f4cd1SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*161f4cd1SAndrew Rist * 13*161f4cd1SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*161f4cd1SAndrew Rist * software distributed under the License is distributed on an 15*161f4cd1SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*161f4cd1SAndrew Rist * KIND, either express or implied. See the License for the 17*161f4cd1SAndrew Rist * specific language governing permissions and limitations 18*161f4cd1SAndrew Rist * under the License. 19*161f4cd1SAndrew Rist * 20*161f4cd1SAndrew Rist *************************************************************/ 21*161f4cd1SAndrew Rist 22*161f4cd1SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef DBACCESS_CLOSEVETO_HXX 25cdf0e10cSrcweir #define DBACCESS_CLOSEVETO_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "dbaccessdllapi.h" 28cdf0e10cSrcweir 29cdf0e10cSrcweir /** === begin UNO includes === **/ 30cdf0e10cSrcweir #include <com/sun/star/uno/XInterface.hpp> 31cdf0e10cSrcweir /** === end UNO includes === **/ 32cdf0e10cSrcweir 33cdf0e10cSrcweir #include <boost/scoped_ptr.hpp> 34cdf0e10cSrcweir 35cdf0e10cSrcweir //...................................................................................................................... 36cdf0e10cSrcweir namespace dbaui 37cdf0e10cSrcweir { 38cdf0e10cSrcweir //...................................................................................................................... 39cdf0e10cSrcweir 40cdf0e10cSrcweir //================================================================================================================== 41cdf0e10cSrcweir //= CloseVeto 42cdf0e10cSrcweir //================================================================================================================== 43cdf0e10cSrcweir struct CloseVeto_Data; 44cdf0e10cSrcweir /** will add a XCloseListener to a given component, and veto its closing as long as the <code>CloseVeto</code> 45cdf0e10cSrcweir instance is alive. 46cdf0e10cSrcweir 47cdf0e10cSrcweir If closing has been requested and vetoed while the <code>CloseVeto</code> instance is alive, and the ownership 48cdf0e10cSrcweir went to the <code>CloseVeto</code> instance, then it will close the component in its dtor. 49cdf0e10cSrcweir */ 50cdf0e10cSrcweir class DBACCESS_DLLPRIVATE CloseVeto 51cdf0e10cSrcweir { 52cdf0e10cSrcweir public: 53cdf0e10cSrcweir CloseVeto( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& i_closeable ); 54cdf0e10cSrcweir ~CloseVeto(); 55cdf0e10cSrcweir 56cdf0e10cSrcweir private: 57cdf0e10cSrcweir ::boost::scoped_ptr< CloseVeto_Data > m_pData; 58cdf0e10cSrcweir }; 59cdf0e10cSrcweir 60cdf0e10cSrcweir //...................................................................................................................... 61cdf0e10cSrcweir } // namespace dbaui 62cdf0e10cSrcweir //...................................................................................................................... 63cdf0e10cSrcweir 64cdf0e10cSrcweir #endif // DBACCESS_CLOSEVETO_HXX 65