1d975be8cSAndre Fischer /************************************************************** 2d975be8cSAndre Fischer * 3d975be8cSAndre Fischer * Licensed to the Apache Software Foundation (ASF) under one 4d975be8cSAndre Fischer * or more contributor license agreements. See the NOTICE file 5d975be8cSAndre Fischer * distributed with this work for additional information 6d975be8cSAndre Fischer * regarding copyright ownership. The ASF licenses this file 7d975be8cSAndre Fischer * to you under the Apache License, Version 2.0 (the 8d975be8cSAndre Fischer * "License"); you may not use this file except in compliance 9d975be8cSAndre Fischer * with the License. You may obtain a copy of the License at 10d975be8cSAndre Fischer * 11d975be8cSAndre Fischer * http://www.apache.org/licenses/LICENSE-2.0 12d975be8cSAndre Fischer * 13d975be8cSAndre Fischer * Unless required by applicable law or agreed to in writing, 14d975be8cSAndre Fischer * software distributed under the License is distributed on an 15d975be8cSAndre Fischer * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16d975be8cSAndre Fischer * KIND, either express or implied. See the License for the 17d975be8cSAndre Fischer * specific language governing permissions and limitations 18d975be8cSAndre Fischer * under the License. 19d975be8cSAndre Fischer * 20d975be8cSAndre Fischer *************************************************************/ 21d975be8cSAndre Fischer 22*95a18594SAndre Fischer #ifndef SFX_SIDEBAR_ASYNCHRONOUS_CALL_HXX 23*95a18594SAndre Fischer #define SFX_SIDEBAR_ASYNCHRONOUS_CALL_HXX 24d975be8cSAndre Fischer 25*95a18594SAndre Fischer #include <boost/function.hpp> 26*95a18594SAndre Fischer #include <tools/solar.h> 27*95a18594SAndre Fischer #include <tools/link.hxx> 28d975be8cSAndre Fischer 29*95a18594SAndre Fischer namespace sfx2 { namespace sidebar { 30d975be8cSAndre Fischer 31*95a18594SAndre Fischer /** A simple asynchronous call via Application::PostUserCall. 32*95a18594SAndre Fischer */ 33*95a18594SAndre Fischer class AsynchronousCall 34*95a18594SAndre Fischer { 35*95a18594SAndre Fischer public: 36*95a18594SAndre Fischer typedef ::boost::function<void(void)> Action; 37*95a18594SAndre Fischer 38*95a18594SAndre Fischer AsynchronousCall (const Action& rAction); 39*95a18594SAndre Fischer ~AsynchronousCall (void); 40d975be8cSAndre Fischer 41*95a18594SAndre Fischer void RequestCall (const Action& rAction); 42*95a18594SAndre Fischer void RequestCall (void); 43*95a18594SAndre Fischer void CancelRequest (void); 44*95a18594SAndre Fischer 45*95a18594SAndre Fischer private: 46*95a18594SAndre Fischer Action maAction; 47*95a18594SAndre Fischer sal_uLong mnCallId; 48d975be8cSAndre Fischer 49*95a18594SAndre Fischer DECL_LINK(HandleUserCall, void*); 50*95a18594SAndre Fischer }; 51d975be8cSAndre Fischer 52d975be8cSAndre Fischer 53*95a18594SAndre Fischer } } // end of namespace sfx2::sidebar 54d975be8cSAndre Fischer 55d975be8cSAndre Fischer #endif 56