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 
2295a18594SAndre Fischer #ifndef SFX_SIDEBAR_ASYNCHRONOUS_CALL_HXX
2395a18594SAndre Fischer #define SFX_SIDEBAR_ASYNCHRONOUS_CALL_HXX
24d975be8cSAndre Fischer 
2595a18594SAndre Fischer #include <boost/function.hpp>
2695a18594SAndre Fischer #include <tools/solar.h>
2795a18594SAndre Fischer #include <tools/link.hxx>
28d975be8cSAndre Fischer 
2995a18594SAndre Fischer namespace sfx2 { namespace sidebar {
30d975be8cSAndre Fischer 
3195a18594SAndre Fischer /** A simple asynchronous call via Application::PostUserCall.
3295a18594SAndre Fischer */
3395a18594SAndre Fischer class AsynchronousCall
3495a18594SAndre Fischer {
3595a18594SAndre Fischer public:
3695a18594SAndre Fischer     typedef ::boost::function<void(void)> Action;
3795a18594SAndre Fischer 
38*3091fa8aSAndre Fischer     AsynchronousCall (void);
3995a18594SAndre Fischer     AsynchronousCall (const Action& rAction);
4095a18594SAndre Fischer     ~AsynchronousCall (void);
41d975be8cSAndre Fischer 
4295a18594SAndre Fischer     void RequestCall (const Action& rAction);
4395a18594SAndre Fischer     void RequestCall (void);
4495a18594SAndre Fischer     void CancelRequest (void);
4595a18594SAndre Fischer 
4695a18594SAndre Fischer private:
4795a18594SAndre Fischer     Action maAction;
4895a18594SAndre Fischer     sal_uLong mnCallId;
49d975be8cSAndre Fischer 
5095a18594SAndre Fischer     DECL_LINK(HandleUserCall, void*);
5195a18594SAndre Fischer };
52d975be8cSAndre Fischer 
53d975be8cSAndre Fischer 
5495a18594SAndre Fischer } } // end of namespace sfx2::sidebar
55d975be8cSAndre Fischer 
56d975be8cSAndre Fischer #endif
57