update dev300-m58
[ooovba.git] / forms / source / component / ImageButton.hxx
blob6375de93ac9f9b20d03c876edd3b2bd35a09c63d
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: ImageButton.hxx,v $
10 * $Revision: 1.10 $
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 _FRM_IMAGE_BUTTON_HXX_
32 #define _FRM_IMAGE_BUTTON_HXX_
34 #include "clickableimage.hxx"
35 #include <com/sun/star/awt/XMouseListener.hpp>
37 //.........................................................................
38 namespace frm
40 //.........................................................................
42 //==================================================================
43 // OImageButtonModel
44 //==================================================================
45 class OImageButtonModel
46 :public OClickableImageBaseModel
48 public:
49 DECLARE_DEFAULT_LEAF_XTOR( OImageButtonModel );
51 // ::com::sun::star::lang::XServiceInfo
52 IMPLEMENTATION_NAME(OImageButtonModel);
53 virtual StringSequence SAL_CALL getSupportedServiceNames() throw();
55 // ::com::sun::star::io::XPersistObject
56 virtual ::rtl::OUString SAL_CALL getServiceName() throw ( ::com::sun::star::uno::RuntimeException);
57 virtual void SAL_CALL write(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectOutputStream>& _rxOutStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
58 virtual void SAL_CALL read(const ::com::sun::star::uno::Reference< ::com::sun::star::io::XObjectInputStream>& _rxInStream) throw ( ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
60 // OControlModel's property handling
61 virtual void describeFixedProperties(
62 ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& /* [out] */ _rProps
63 ) const;
65 protected:
66 DECLARE_XCLONEABLE();
69 //==================================================================
70 // OImageButtonControl
71 //==================================================================
72 typedef ::cppu::ImplHelper1< ::com::sun::star::awt::XMouseListener> OImageButtonControl_BASE;
73 class OImageButtonControl : public OClickableImageBaseControl,
74 public OImageButtonControl_BASE
76 protected:
77 // UNO Anbindung
78 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Type> _getTypes();
80 public:
81 OImageButtonControl(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory>& _rxFactory);
83 // XServiceInfo
84 IMPLEMENTATION_NAME(OImageButtonControl);
85 virtual StringSequence SAL_CALL getSupportedServiceNames() throw();
87 // UNO Anbindung
88 DECLARE_UNO3_AGG_DEFAULTS(OImageButtonControl, OClickableImageBaseControl);
89 virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation(const ::com::sun::star::uno::Type& _rType) throw(::com::sun::star::uno::RuntimeException);
91 // XEventListener
92 virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& _rSource) throw(::com::sun::star::uno::RuntimeException)
93 { OControl::disposing(_rSource); }
95 // XMouseListener
96 virtual void SAL_CALL mousePressed(const ::com::sun::star::awt::MouseEvent& e) throw ( ::com::sun::star::uno::RuntimeException);
97 virtual void SAL_CALL mouseReleased(const ::com::sun::star::awt::MouseEvent& e) throw ( ::com::sun::star::uno::RuntimeException);
98 virtual void SAL_CALL mouseEntered(const ::com::sun::star::awt::MouseEvent& e) throw ( ::com::sun::star::uno::RuntimeException);
99 virtual void SAL_CALL mouseExited(const ::com::sun::star::awt::MouseEvent& e) throw ( ::com::sun::star::uno::RuntimeException);
101 // prevent method hiding
102 using OClickableImageBaseControl::disposing;
105 //.........................................................................
106 } // namespace frm
107 //.........................................................................
109 #endif // _FRM_IMAGE_BUTTON_HXX_