1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: navbarcontrol.hxx,v $
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 //.........................................................................
46 //.........................................................................
48 //==================================================================
49 // ONavigationBarControl
50 //==================================================================
51 typedef ::cppu::ImplHelper1
< ::com::sun::star::frame::XDispatchProviderInterception
52 > ONavigationBarControl_Base
;
54 class ONavigationBarControl
56 ,public ONavigationBarControl_Base
59 ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>
63 ONavigationBarControl(
64 const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
68 ~ONavigationBarControl();
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
);
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
);
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
);
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
);
89 DECLARE_XTYPEPROVIDER()
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
104 ,public OFormNavigationHelper
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
,
118 ONavigationBarPeer( const ::com::sun::star::uno::Reference
< ::com::sun::star::lang::XMultiServiceFactory
>& _rxORB
);
119 ~ONavigationBarPeer();
123 DECLARE_XINTERFACE( )
126 virtual void SAL_CALL
setDesignMode( sal_Bool _bOn
) throw( ::com::sun::star::uno::RuntimeException
);
129 using VCLXWindow::isEnabled
;
133 DECLARE_XTYPEPROVIDER( )
136 void SAL_CALL
dispose( ) throw( ::com::sun::star::uno::RuntimeException
);
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
);
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 //.........................................................................
157 //.........................................................................
159 #endif // FORMS_NAVBARCONTROL_HXX