Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 :
20 : #ifndef INCLUDED_FORMS_SOURCE_SOLAR_COMPONENT_NAVBARCONTROL_HXX
21 : #define INCLUDED_FORMS_SOURCE_SOLAR_COMPONENT_NAVBARCONTROL_HXX
22 :
23 : #include "formnavigation.hxx"
24 :
25 : #include <com/sun/star/frame/XDispatchProviderInterception.hpp>
26 : #include <com/sun/star/frame/XStatusListener.hpp>
27 :
28 : #include <toolkit/controls/unocontrol.hxx>
29 : #include <toolkit/awt/vclxwindow.hxx>
30 : #include <comphelper/uno3.hxx>
31 : #include <cppuhelper/implbase1.hxx>
32 : #include <tools/wintypes.hxx>
33 :
34 :
35 : namespace frm
36 : {
37 :
38 : typedef ::cppu::ImplHelper1 < ::com::sun::star::frame::XDispatchProviderInterception
39 : > ONavigationBarControl_Base;
40 :
41 : class ONavigationBarControl
42 : :public UnoControl
43 : ,public ONavigationBarControl_Base
44 : {
45 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
46 : public:
47 : ONavigationBarControl(
48 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB
49 : );
50 :
51 : protected:
52 : virtual ~ONavigationBarControl();
53 :
54 : public:
55 : // XServiceInfo - static version
56 : static OUString SAL_CALL getImplementationName_Static();
57 : static ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_Static();
58 : static ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL Create( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxFactory );
59 :
60 : protected:
61 : // UNO
62 8028 : DECLARE_UNO3_AGG_DEFAULTS( ONavigationBarControl, UnoControl )
63 : virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw ( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
64 :
65 : // XControl
66 : virtual void SAL_CALL createPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XToolkit >& _rToolkit, const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer >& _rParent ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
67 :
68 : // XServiceInfo
69 : virtual OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
70 : virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
71 :
72 : // XTypeProvider
73 : DECLARE_XTYPEPROVIDER()
74 :
75 : // XVclWindowPeer
76 : virtual void SAL_CALL setDesignMode( sal_Bool _bOn ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
77 :
78 : // XDispatchProviderInterception
79 : virtual void SAL_CALL registerDispatchProviderInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
80 : virtual void SAL_CALL releaseDispatchProviderInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
81 : };
82 :
83 : class ONavigationBarPeer
84 : :public VCLXWindow
85 : ,public OFormNavigationHelper
86 : {
87 : public:
88 : /** factory method
89 : @return
90 : a new ONavigationBarPeer instance, which has been acquired once!
91 : */
92 : static ONavigationBarPeer* Create(
93 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB,
94 : vcl::Window* _pParentWindow,
95 : const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel >& _rxModel
96 : );
97 :
98 : protected:
99 : ONavigationBarPeer(
100 : const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& _rxORB
101 : );
102 : virtual ~ONavigationBarPeer();
103 :
104 : public:
105 : // XInterface
106 : DECLARE_XINTERFACE( )
107 :
108 : // XVclWindowPeer
109 : virtual void SAL_CALL setDesignMode( sal_Bool _bOn ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
110 :
111 : // XWindow2
112 : using VCLXWindow::isEnabled;
113 :
114 : protected:
115 : // XTypeProvider
116 : DECLARE_XTYPEPROVIDER( )
117 :
118 : // XComponent
119 : void SAL_CALL dispose( ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
120 :
121 : // XVclWindowPeer
122 : void SAL_CALL setProperty( const OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rValue ) throw( ::com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
123 : ::com::sun::star::uno::Any SAL_CALL getProperty( const OUString& _rPropertyName ) throw(::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
124 :
125 : // XEventListener
126 : virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
127 :
128 : // OFormNavigationHelper overriables
129 : virtual void interceptorsChanged( ) SAL_OVERRIDE;
130 : virtual void featureStateChanged( sal_Int16 _nFeatureId, bool _bEnabled ) SAL_OVERRIDE;
131 : virtual void allFeatureStatesChanged( ) SAL_OVERRIDE;
132 : virtual void getSupportedFeatures( ::std::vector< sal_Int16 >& /* [out] */ _rFeatureIds ) SAL_OVERRIDE;
133 :
134 : // IFeatureDispatcher overriables
135 : virtual bool isEnabled( sal_Int16 _nFeatureId ) const SAL_OVERRIDE;
136 : };
137 :
138 :
139 : } // namespace frm
140 :
141 :
142 : #endif // INCLUDED_FORMS_SOURCE_SOLAR_COMPONENT_NAVBARCONTROL_HXX
143 :
144 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|