bump product version to 4.2.0.1
[LibreOffice.git] / include / svx / sidebar / SelectionChangeHandler.hxx
blob6f95909d1657fe24eb79b3c7ea7da226839d465a
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef INCLUDED_SVX_SIDEBAR_SELECTIONCHANGEHANDLER_HXX
20 #define INCLUDED_SVX_SIDEBAR_SELECTIONCHANGEHANDLER_HXX
22 #include <svx/svxdllapi.h>
23 #include <sfx2/sidebar/EnumContext.hxx>
24 #include <com/sun/star/frame/XController.hpp>
25 #include <com/sun/star/view/XSelectionSupplier.hpp>
26 #include <com/sun/star/view/XSelectionChangeListener.hpp>
28 #include <cppuhelper/compbase1.hxx>
29 #include <cppuhelper/basemutex.hxx>
31 #include <boost/noncopyable.hpp>
32 #include <boost/function.hpp>
34 namespace cssu = ::com::sun::star::uno;
37 class SdrMarkView;
40 namespace svx { namespace sidebar {
42 namespace {
43 typedef ::cppu::WeakComponentImplHelper1 <
44 css::view::XSelectionChangeListener
45 > SelectionChangeHandlerInterfaceBase;
49 class SVX_DLLPUBLIC SelectionChangeHandler
50 : private ::boost::noncopyable,
51 private ::cppu::BaseMutex,
52 public SelectionChangeHandlerInterfaceBase
54 public:
55 SelectionChangeHandler (
56 const boost::function<rtl::OUString(void)>& rSelectionChangeCallback,
57 const cssu::Reference<css::frame::XController>& rxController,
58 const sfx2::sidebar::EnumContext::Context eDefaultContext);
59 virtual ~SelectionChangeHandler (void);
61 virtual void SAL_CALL selectionChanged (const css::lang::EventObject& rEvent)
62 throw (cssu::RuntimeException);
64 virtual void SAL_CALL disposing (const css::lang::EventObject& rEvent)
65 throw (cssu::RuntimeException);
67 virtual void SAL_CALL disposing (void)
68 throw (cssu::RuntimeException);
70 void Connect (void);
71 void Disconnect (void);
73 private:
74 const boost::function<rtl::OUString(void)> maSelectionChangeCallback;
75 cssu::Reference<css::frame::XController> mxController;
76 const sfx2::sidebar::EnumContext::Context meDefaultContext;
77 bool mbIsConnected;
81 } } // end of namespace svx::sidebar
84 #endif
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */