update dev300-m58
[ooovba.git] / forms / source / solar / component / navbarcontrol.hxx
blob116684e6abea743983fafdef8d30130607e6e570
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: navbarcontrol.hxx,v $
10 * $Revision: 1.5 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef FORMS_NAVBARCONTROL_HXX
32 #define FORMS_NAVBARCONTROL_HXX
34 #include <toolkit/controls/unocontrol.hxx>
35 #include <toolkit/awt/vclxwindow.hxx>
36 #include <comphelper/uno3.hxx>
37 #include <cppuhelper/implbase1.hxx>
38 #include <vcl/wintypes.hxx>
39 #include <com/sun/star/frame/XDispatchProviderInterception.hpp>
40 #include <com/sun/star/frame/XStatusListener.hpp>
41 #include "formnavigation.hxx"
43 //.........................................................................
44 namespace frm
46 //.........................................................................
48 //==================================================================
49 // ONavigationBarControl
50 //==================================================================
51 typedef ::cppu::ImplHelper1 < ::com::sun::star::frame::XDispatchProviderInterception
52 > ONavigationBarControl_Base;
54 class ONavigationBarControl
55 :public UnoControl
56 ,public ONavigationBarControl_Base
58 private:
59 ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
60 m_xORB;
62 public:
63 ONavigationBarControl(
64 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB
67 protected:
68 ~ONavigationBarControl();
70 public:
71 // XServiceInfo - static version
72 static ::rtl::OUString SAL_CALL getImplementationName_Static();
73 static ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames_Static();
74 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 );
76 protected:
77 // UNO
78 DECLARE_UNO3_AGG_DEFAULTS( ONavigationBarControl, UnoControl );
79 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw ( ::com::sun::star::uno::RuntimeException );
81 // XControl
82 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 );
84 // XServiceInfo
85 virtual ::rtl::OUString SAL_CALL getImplementationName() throw(::com::sun::star::uno::RuntimeException);
86 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
88 // XTypeProvider
89 DECLARE_XTYPEPROVIDER()
91 // XVclWindowPeer
92 virtual void SAL_CALL setDesignMode( sal_Bool _bOn ) throw( ::com::sun::star::uno::RuntimeException );
94 // XDispatchProviderInterception
95 virtual void SAL_CALL registerDispatchProviderInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException);
96 virtual void SAL_CALL releaseDispatchProviderInterceptor( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchProviderInterceptor >& Interceptor ) throw (::com::sun::star::uno::RuntimeException);
99 //==================================================================
100 // ONavigationBarPeer
101 //==================================================================
102 class ONavigationBarPeer
103 :public VCLXWindow
104 ,public OFormNavigationHelper
106 public:
107 /** factory method
108 @return
109 a new ONavigationBarPeer instance, which has been aquired once!
111 static ONavigationBarPeer* Create(
112 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
113 Window* _pParentWindow,
114 WinBits _nStyle
117 protected:
118 ONavigationBarPeer( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB );
119 ~ONavigationBarPeer();
121 public:
122 // XInterface
123 DECLARE_XINTERFACE( )
125 // XVclWindowPeer
126 virtual void SAL_CALL setDesignMode( sal_Bool _bOn ) throw( ::com::sun::star::uno::RuntimeException );
128 // XWindow2
129 using VCLXWindow::isEnabled;
131 protected:
132 // XTypeProvider
133 DECLARE_XTYPEPROVIDER( )
135 // XComponent
136 void SAL_CALL dispose( ) throw( ::com::sun::star::uno::RuntimeException );
138 // XVclWindowPeer
139 void SAL_CALL setProperty( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rValue ) throw( ::com::sun::star::uno::RuntimeException );
140 ::com::sun::star::uno::Any SAL_CALL getProperty( const ::rtl::OUString& _rPropertyName ) throw(::com::sun::star::uno::RuntimeException);
142 // XEventListener
143 virtual void SAL_CALL disposing( const ::com::sun::star::lang::EventObject& Source ) throw (::com::sun::star::uno::RuntimeException);
145 // OFormNavigationHelper overriables
146 virtual void interceptorsChanged( );
147 virtual void featureStateChanged( sal_Int32 _nFeatureId, sal_Bool _bEnabled );
148 virtual void allFeatureStatesChanged( );
149 virtual void getSupportedFeatures( ::std::vector< sal_Int32 >& /* [out] */ _rFeatureIds );
151 // IFeatureDispatcher overriables
152 virtual bool isEnabled( sal_Int32 _nFeatureId ) const;
155 //.........................................................................
156 } // namespace frm
157 //.........................................................................
159 #endif // FORMS_NAVBARCONTROL_HXX