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: ElementSelector.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 ************************************************************************/
30 #ifndef _CHART_ELEMENTSELECTOR_HXX
31 #define _CHART_ELEMENTSELECTOR_HXX
33 #include "ServiceMacros.hxx"
34 #include <com/sun/star/lang/XServiceInfo.hpp>
35 #include <cppuhelper/implbase1.hxx>
36 #include <svtools/toolboxcontroller.hxx>
38 #include <vcl/lstbox.hxx>
39 #include <cppuhelper/weakref.hxx>
43 //.............................................................................
46 //.............................................................................
48 struct ListBoxEntryData
52 sal_Int32 nHierarchyDepth
;
54 ListBoxEntryData() : nHierarchyDepth(0)
59 class SelectorListBox
: public ListBox
62 SelectorListBox( Window
* pParent
, WinBits nStyle
);
63 virtual ~SelectorListBox();
65 virtual void Select();
66 virtual long Notify( NotifyEvent
& rNEvt
);
67 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> CreateAccessible();
69 void ReleaseFocus_Impl();
71 void SetChartController( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XController
>& xChartController
);
72 void UpdateChartElementsListAndSelection();
75 ::com::sun::star::uno::WeakReference
<
76 ::com::sun::star::frame::XController
> m_xChartController
;
78 ::std::vector
< ListBoxEntryData
> m_aEntries
;
83 // ------------------------------------------------------------------
84 // ------------------------------------------------------------------
86 typedef ::cppu::ImplHelper1
< ::com::sun::star::lang::XServiceInfo
> ElementSelectorToolbarController_BASE
;
88 class ElementSelectorToolbarController
: public ::svt::ToolboxController
89 , ElementSelectorToolbarController_BASE
92 ElementSelectorToolbarController( ::com::sun::star::uno::Reference
<
93 ::com::sun::star::uno::XComponentContext
> const & xContext
);
94 virtual ~ElementSelectorToolbarController();
97 APPHELPER_XSERVICEINFO_DECL()
98 APPHELPER_SERVICE_FACTORY_HELPER(ElementSelectorToolbarController
)
101 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
) throw (::com::sun::star::uno::RuntimeException
);
102 virtual void SAL_CALL
acquire() throw ();
103 virtual void SAL_CALL
release() throw ();
106 virtual void SAL_CALL
initialize( const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& aArguments
) throw (::com::sun::star::uno::Exception
, ::com::sun::star::uno::RuntimeException
);
108 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
);
109 // XToolbarController
110 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
> SAL_CALL
createItemWindow( const ::com::sun::star::uno::Reference
< ::com::sun::star::awt::XWindow
>& Parent
) throw (::com::sun::star::uno::RuntimeException
);
113 //no default constructor
114 ElementSelectorToolbarController(){}
117 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xCC
;
118 ::std::auto_ptr
< SelectorListBox
> m_apSelectorListBox
;
121 //.............................................................................
123 //.............................................................................