1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
28 #ifndef _CHART_ELEMENTSELECTOR_HXX
29 #define _CHART_ELEMENTSELECTOR_HXX
31 #include "ServiceMacros.hxx"
32 #include "ObjectHierarchy.hxx"
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <cppuhelper/implbase1.hxx>
35 #include <svtools/toolboxcontroller.hxx>
37 #include <vcl/lstbox.hxx>
38 #include <cppuhelper/weakref.hxx>
42 //.............................................................................
45 //.............................................................................
47 struct ListBoxEntryData
50 ObjectHierarchy::tOID OID
;
51 sal_Int32 nHierarchyDepth
;
53 ListBoxEntryData() : nHierarchyDepth(0)
58 class SelectorListBox
: public ListBox
61 SelectorListBox( Window
* pParent
, WinBits nStyle
);
62 virtual ~SelectorListBox();
64 virtual void Select();
65 virtual long Notify( NotifyEvent
& rNEvt
);
66 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::accessibility::XAccessible
> CreateAccessible();
68 void ReleaseFocus_Impl();
70 void SetChartController( const ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XController
>& xChartController
);
71 void UpdateChartElementsListAndSelection();
74 ::com::sun::star::uno::WeakReference
<
75 ::com::sun::star::frame::XController
> m_xChartController
;
77 ::std::vector
< ListBoxEntryData
> m_aEntries
;
82 // ------------------------------------------------------------------
83 // ------------------------------------------------------------------
85 typedef ::cppu::ImplHelper1
< ::com::sun::star::lang::XServiceInfo
> ElementSelectorToolbarController_BASE
;
87 class ElementSelectorToolbarController
: public ::svt::ToolboxController
88 , ElementSelectorToolbarController_BASE
91 ElementSelectorToolbarController( ::com::sun::star::uno::Reference
<
92 ::com::sun::star::uno::XComponentContext
> const & xContext
);
93 virtual ~ElementSelectorToolbarController();
96 APPHELPER_XSERVICEINFO_DECL()
97 APPHELPER_SERVICE_FACTORY_HELPER(ElementSelectorToolbarController
)
100 virtual ::com::sun::star::uno::Any SAL_CALL
queryInterface( const ::com::sun::star::uno::Type
& aType
) throw (::com::sun::star::uno::RuntimeException
);
101 virtual void SAL_CALL
acquire() throw ();
102 virtual void SAL_CALL
release() throw ();
105 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
);
107 virtual void SAL_CALL
statusChanged( const ::com::sun::star::frame::FeatureStateEvent
& Event
) throw ( ::com::sun::star::uno::RuntimeException
);
108 // XToolbarController
109 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
);
112 //no default constructor
113 ElementSelectorToolbarController(){}
116 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
> m_xCC
;
117 ::std::auto_ptr
< SelectorListBox
> m_apSelectorListBox
;
120 //.............................................................................
122 //.............................................................................
126 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */