Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / source / ui / vba / vbamenu.cxx
blob8bfa966b89a69d6ba3fdbaf9391c1841c0b3678c
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/.
8 */
10 #include "vbamenu.hxx"
11 #include "vbamenuitems.hxx"
12 #include <ooo/vba/XCommandBarControls.hpp>
14 using namespace com::sun::star;
15 using namespace ooo::vba;
17 ScVbaMenu::ScVbaMenu( const uno::Reference< ov::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< XCommandBarControl >& rCommandBarControl ) : Menu_BASE( rParent, rContext ), m_xCommandBarControl( rCommandBarControl )
21 OUString SAL_CALL
22 ScVbaMenu::getCaption()
24 return m_xCommandBarControl->getCaption();
27 void SAL_CALL
28 ScVbaMenu::setCaption( const OUString& _caption )
30 m_xCommandBarControl->setCaption( _caption );
33 void SAL_CALL
34 ScVbaMenu::Delete( )
36 m_xCommandBarControl->Delete();
39 uno::Any SAL_CALL
40 ScVbaMenu::MenuItems( const uno::Any& aIndex )
42 uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBarControl->Controls( uno::Any() ), uno::UNO_QUERY_THROW );
43 uno::Reference< excel::XMenuItems > xMenuItems( new ScVbaMenuItems( this, mxContext, xCommandBarControls ) );
44 if( aIndex.hasValue() )
46 return xMenuItems->Item( aIndex, uno::Any() );
48 return uno::makeAny( xMenuItems );
51 OUString
52 ScVbaMenu::getServiceImplName()
54 return "ScVbaMenu";
57 uno::Sequence<OUString>
58 ScVbaMenu::getServiceNames()
60 static uno::Sequence< OUString > const aServiceNames
62 "ooo.vba.excel.Menu"
64 return aServiceNames;
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */