merge the formfield patch from ooo-build
[ooovba.git] / fpicker / source / win32 / filepicker / filepickereventnotification.cxx
blob05244444e6ffcf9b17d057a03f89b0fce61401fe
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: filepickereventnotification.cxx,v $
10 * $Revision: 1.4 $
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 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_fpicker.hxx"
33 #include "filepickereventnotification.hxx"
34 #include <sal/types.h>
36 //-----------------------------------
37 // namespace directives
38 //-----------------------------------
40 using namespace com::sun::star::uno;
41 using namespace com::sun::star::ui::dialogs;
43 //-----------------------------------
44 // A FilePicker event without
45 // parameter
46 //-----------------------------------
48 CFilePickerEventNotification::CFilePickerEventNotification(EventListenerMethod_t EventListenerMethod) :
49 m_EventListenerMethod(EventListenerMethod)
53 //----------------------------------
55 //----------------------------------
57 void SAL_CALL CFilePickerEventNotification::notifyEventListener( Reference< XInterface > xListener )
59 Reference<XFilePickerListener> xFilePickerListener(xListener,UNO_QUERY);
60 if (xFilePickerListener.is())
61 (xFilePickerListener.get()->*m_EventListenerMethod)();
65 //##################################################
68 //----------------------------------
69 // A FilePicker event with parameter
70 //----------------------------------
72 CFilePickerParamEventNotification::CFilePickerParamEventNotification(EventListenerMethod_t EventListenerMethod, const FilePickerEvent& FilePickerEvent) :
73 m_EventListenerMethod(EventListenerMethod),
74 m_FilePickerEvent(FilePickerEvent)
78 //----------------------------------
79 // A FilePicker event with parameter
80 //----------------------------------
82 void SAL_CALL CFilePickerParamEventNotification::notifyEventListener( Reference< XInterface > xListener )
84 Reference<XFilePickerListener> xFilePickerListener(xListener,UNO_QUERY);
85 if (xFilePickerListener.is())
86 (xFilePickerListener.get()->*m_EventListenerMethod)(m_FilePickerEvent);