xref: /AOO41X/main/chart2/source/controller/main/ChartFrameloader.hxx (revision de7b3f825c374d9f7270d1282e9d92876f197200)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef _CHARTFRAMELOADER_HXX
24 #define _CHARTFRAMELOADER_HXX
25 
26 #include "ServiceMacros.hxx"
27 #include <osl/conditn.hxx>
28 #include <com/sun/star/frame/XSynchronousFrameLoader.hpp>
29 #include <com/sun/star/lang/XServiceInfo.hpp>
30 #include <com/sun/star/uno/XComponentContext.hpp>
31 #include <cppuhelper/implbase2.hxx>
32 
33 //.............................................................................
34 namespace chart
35 {
36 //.............................................................................
37 
38 class ChartFrameLoader : public ::cppu::WeakImplHelper2<
39          ::com::sun::star::frame::XSynchronousFrameLoader
40          , ::com::sun::star::lang::XServiceInfo
41             //comprehends XComponent (required interface)
42     //  ,public ::com::sun::star::uno::XWeak            // implemented by WeakImplHelper(optional interface)
43     //  ,public ::com::sun::star::uno::XInterface       // implemented by WeakImplHelper(optional interface)
44     //  ,public ::com::sun::star::lang::XTypeProvider   // implemented by WeakImplHelper
45         >
46 {
47 private:
48     ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext>        m_xCC;
49     sal_Bool            m_bCancelRequired;
50     ::osl::Condition    m_oCancelFinished;
51 
52 private:
53         sal_Bool impl_checkCancel();
54     //no default constructor
ChartFrameLoader()55     ChartFrameLoader(){}
56 public:
57     ChartFrameLoader(::com::sun::star::uno::Reference<
58                ::com::sun::star::uno::XComponentContext > const & xContext);
59     virtual ~ChartFrameLoader();
60 
61     //-----------------------------------------------------------------
62     // ::com::sun::star::lang::XServiceInfo
63     //-----------------------------------------------------------------
64 
65     APPHELPER_XSERVICEINFO_DECL()
66     APPHELPER_SERVICE_FACTORY_HELPER(ChartFrameLoader)
67 
68     //-----------------------------------------------------------------
69     // ::com::sun::star::frame::XFrameLoader
70     //-----------------------------------------------------------------
71 
72     virtual sal_Bool SAL_CALL
73         load( const ::com::sun::star::uno::Sequence<
74                 ::com::sun::star::beans::PropertyValue >& rMediaDescriptor
75                 ,const ::com::sun::star::uno::Reference<
76                 ::com::sun::star::frame::XFrame >& xFrame )
77                             throw (::com::sun::star::uno::RuntimeException);
78 
79     virtual void SAL_CALL
80         cancel()            throw (::com::sun::star::uno::RuntimeException);
81 };
82 
83 //.............................................................................
84 } //namespace chart
85 //.............................................................................
86 
87 #endif
88