1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 #include <sfx2/charmappopup.hxx>
20 #include <sfx2/charmapcontrol.hxx>
21 #include <vcl/toolbox.hxx>
23 CharmapPopup::CharmapPopup(const css::uno::Reference
<css::uno::XComponentContext
>& rContext
)
24 : PopupWindowController(rContext
, nullptr, OUString())
28 CharmapPopup::~CharmapPopup()
32 void CharmapPopup::initialize( const css::uno::Sequence
< css::uno::Any
>& rArguments
)
34 PopupWindowController::initialize(rArguments
);
36 ToolBox
* pToolBox
= nullptr;
38 if (getToolboxId(nId
, &pToolBox
) && pToolBox
->GetItemCommand(nId
) == m_aCommandURL
)
39 pToolBox
->SetItemBits(nId
, ToolBoxItemBits::DROPDOWNONLY
| pToolBox
->GetItemBits(nId
));
42 std::unique_ptr
<WeldToolbarPopup
> CharmapPopup::weldPopupWindow()
44 return std::make_unique
<SfxCharmapCtrl
>(this, m_pToolbar
);
47 VclPtr
<vcl::Window
> CharmapPopup::createVclPopupWindow( vcl::Window
* pParent
)
49 mxInterimPopover
= VclPtr
<InterimToolbarPopup
>::Create(getFrameInterface(), pParent
,
50 std::make_unique
<SfxCharmapCtrl
>(this, pParent
->GetFrameWeld()));
52 mxInterimPopover
->Show();
54 return mxInterimPopover
;
57 OUString
CharmapPopup::getImplementationName()
59 return "com.sun.star.comp.sfx2.InsertSymbolToolBoxControl";
62 css::uno::Sequence
<OUString
> CharmapPopup::getSupportedServiceNames()
64 return { "com.sun.star.frame.ToolbarController" };
67 extern "C" SAL_DLLPUBLIC_EXPORT
css::uno::XInterface
*
68 com_sun_star_comp_sfx2_InsertSymbolToolBoxControl_get_implementation(
69 css::uno::XComponentContext
* rContext
,
70 css::uno::Sequence
<css::uno::Any
> const & )
72 return cppu::acquire( new CharmapPopup( rContext
) );
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */