nss: upgrade to release 3.73
[LibreOffice.git] / sfx2 / source / control / emojipopup.cxx
blob82f9bc3fc1fd4fed8c998aaf4ae97d019633d722
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 #include <sfx2/emojipopup.hxx>
20 #include <emojicontrol.hxx>
21 #include <vcl/toolbox.hxx>
23 EmojiPopup::EmojiPopup(const css::uno::Reference<css::uno::XComponentContext>& rContext)
24 : PopupWindowController(rContext, nullptr, OUString())
28 void EmojiPopup::initialize(const css::uno::Sequence<css::uno::Any>& rArguments)
30 PopupWindowController::initialize(rArguments);
32 ToolBox* pToolBox = nullptr;
33 sal_uInt16 nId = 0;
34 if (getToolboxId(nId, &pToolBox))
35 pToolBox->SetItemBits(nId, ToolBoxItemBits::DROPDOWNONLY | pToolBox->GetItemBits(nId));
38 EmojiPopup::~EmojiPopup() {}
40 std::unique_ptr<WeldToolbarPopup> EmojiPopup::weldPopupWindow()
42 return std::make_unique<SfxEmojiControl>(this, m_pToolbar);
45 VclPtr<vcl::Window> EmojiPopup::createVclPopupWindow(vcl::Window* pParent)
47 mxInterimPopover = VclPtr<InterimToolbarPopup>::Create(
48 getFrameInterface(), pParent,
49 std::make_unique<SfxEmojiControl>(this, pParent->GetFrameWeld()));
51 mxInterimPopover->Show();
53 return mxInterimPopover;
56 OUString EmojiPopup::getImplementationName()
58 return "com.sun.star.comp.sfx2.InsertEmojiToolBoxControl";
61 css::uno::Sequence<OUString> EmojiPopup::getSupportedServiceNames()
63 return { "com.sun.star.frame.ToolbarController" };
66 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
67 com_sun_star_comp_sfx2_InsertEmojiToolBoxControl_get_implementation(
68 css::uno::XComponentContext* rContext, css::uno::Sequence<css::uno::Any> const&)
70 return cppu::acquire(new EmojiPopup(rContext));
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */