LibreOffice Module forms (master) 1
resettable.cxx
Go to the documentation of this file.
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#include <resettable.hxx>
21
22#include <cppuhelper/weak.hxx>
23
24
25namespace frm
26{
27
28
29 using ::com::sun::star::uno::Reference;
30 using ::com::sun::star::form::XResetListener;
31 using ::com::sun::star::lang::EventObject;
32
33
34 //= ResetHelper
35
36
37 void ResetHelper::addResetListener( const Reference< XResetListener >& _listener )
38 {
40 }
41
42
43 void ResetHelper::removeResetListener( const Reference< XResetListener >& _listener )
44 {
46 }
47
48
50 {
52 EventObject aResetEvent( m_rParent );
53
54 bool bContinue = true;
55 while ( aIter.hasMoreElements() && bContinue )
56 bContinue = aIter.next()->approveReset( aResetEvent );
57
58 return bContinue;
59 }
60
61
63 {
64 EventObject aResetEvent( m_rParent );
65 m_aResetListeners.notifyEach( &XResetListener::resetted, aResetEvent );
66 }
67
68
70 {
71 EventObject aEvent( m_rParent );
73 }
74
75
76} // namespace frm
77
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AnyEventRef aEvent
sal_Int32 addInterface(const css::uno::Reference< ListenerT > &rxIFace)
void disposeAndClear(const css::lang::EventObject &rEvt)
sal_Int32 removeInterface(const css::uno::Reference< ListenerT > &rxIFace)
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
css::uno::Reference< ListenerT > const & next()
void addResetListener(const css::uno::Reference< css::form::XResetListener > &_listener)
Definition: resettable.cxx:37
::comphelper::OInterfaceContainerHelper3< css::form::XResetListener > m_aResetListeners
Definition: resettable.hxx:55
::cppu::OWeakObject & m_rParent
Definition: resettable.hxx:54
void notifyResetted()
Definition: resettable.cxx:62
void removeResetListener(const css::uno::Reference< css::form::XResetListener > &_listener)
Definition: resettable.cxx:43
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25