xref: /AOO41X/main/sfx2/source/sidebar/AsynchronousCall.hxx (revision d3e0dd8eb215533c15e891ee35bd141abe9397ee)
195a18594SAndre Fischer /**************************************************************
295a18594SAndre Fischer  *
395a18594SAndre Fischer  * Licensed to the Apache Software Foundation (ASF) under one
495a18594SAndre Fischer  * or more contributor license agreements.  See the NOTICE file
595a18594SAndre Fischer  * distributed with this work for additional information
695a18594SAndre Fischer  * regarding copyright ownership.  The ASF licenses this file
795a18594SAndre Fischer  * to you under the Apache License, Version 2.0 (the
895a18594SAndre Fischer  * "License"); you may not use this file except in compliance
995a18594SAndre Fischer  * with the License.  You may obtain a copy of the License at
1095a18594SAndre Fischer  *
1195a18594SAndre Fischer  *   http://www.apache.org/licenses/LICENSE-2.0
1295a18594SAndre Fischer  *
1395a18594SAndre Fischer  * Unless required by applicable law or agreed to in writing,
1495a18594SAndre Fischer  * software distributed under the License is distributed on an
1595a18594SAndre Fischer  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1695a18594SAndre Fischer  * KIND, either express or implied.  See the License for the
1795a18594SAndre Fischer  * specific language governing permissions and limitations
1895a18594SAndre Fischer  * under the License.
1995a18594SAndre Fischer  *
2095a18594SAndre Fischer  *************************************************************/
2195a18594SAndre Fischer 
2295a18594SAndre Fischer #ifndef SFX_SIDEBAR_ASYNCHRONOUS_CALL_HXX
2395a18594SAndre Fischer #define SFX_SIDEBAR_ASYNCHRONOUS_CALL_HXX
2495a18594SAndre Fischer 
2595a18594SAndre Fischer #include <boost/function.hpp>
2695a18594SAndre Fischer #include <tools/solar.h>
2795a18594SAndre Fischer #include <tools/link.hxx>
2895a18594SAndre Fischer 
2995a18594SAndre Fischer namespace sfx2 { namespace sidebar {
3095a18594SAndre 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);
4195a18594SAndre 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;
4995a18594SAndre Fischer 
5095a18594SAndre Fischer     DECL_LINK(HandleUserCall, void*);
5195a18594SAndre Fischer };
5295a18594SAndre Fischer 
5395a18594SAndre Fischer 
5495a18594SAndre Fischer } } // end of namespace sfx2::sidebar
5595a18594SAndre Fischer 
5695a18594SAndre Fischer #endif
57