LibreOffice Module svx (master)  1
TextCharacterSpacingPopup.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
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  *
9  * This file incorporates work covered by the following license notice:
10  *
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 .
18  */
21 #include <vcl/toolbox.hxx>
22 
23 using namespace svx;
24 
26  const css::uno::Reference<css::uno::XComponentContext>& rContext)
27  : PopupWindowController(rContext, nullptr, OUString())
28 {
29 }
30 
31 void TextCharacterSpacingPopup::initialize(const css::uno::Sequence<css::uno::Any>& rArguments)
32 {
33  PopupWindowController::initialize(rArguments);
34 
35  if (m_pToolbar)
36  {
37  mxPopoverContainer.reset(new ToolbarPopupContainer(m_pToolbar));
38  m_pToolbar->set_item_popover(m_aCommandURL.toUtf8(), mxPopoverContainer->getTopLevel());
39  }
40 
41  ToolBox* pToolBox = nullptr;
42  sal_uInt16 nId = 0;
43  if (getToolboxId(nId, &pToolBox))
44  pToolBox->SetItemBits(nId, ToolBoxItemBits::DROPDOWNONLY | pToolBox->GetItemBits(nId));
45 }
46 
48 
49 std::unique_ptr<WeldToolbarPopup> TextCharacterSpacingPopup::weldPopupWindow()
50 {
51  return std::make_unique<TextCharacterSpacingControl>(this, m_pToolbar);
52 }
53 
55 {
57  getFrameInterface(), pParent,
58  std::make_unique<TextCharacterSpacingControl>(this, pParent->GetFrameWeld()));
59 
60  mxInterimPopover->Show();
61 
62  return mxInterimPopover;
63 }
64 
66 {
67  return "com.sun.star.comp.svx.CharacterSpacingToolBoxControl";
68 }
69 
71 {
72  return { "com.sun.star.frame.ToolbarController" };
73 }
74 
75 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
77  css::uno::XComponentContext* rContext, css::uno::Sequence<css::uno::Any> const&)
78 {
79  return cppu::acquire(new TextCharacterSpacingPopup(rContext));
80 }
81 
82 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
TextCharacterSpacingPopup(const css::uno::Reference< css::uno::XComponentContext > &rContext)
ToolBoxItemBits GetItemBits(sal_uInt16 nItemId) const
std::unique_ptr< ToolbarPopupContainer > mxPopoverContainer
sal_Int16 nId
weld::Window * GetFrameWeld() const
void SetItemBits(sal_uInt16 nItemId, ToolBoxItemBits nBits)
VclPtr< InterimToolbarPopup > mxInterimPopover
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArguments) override
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
static VclPtr< reference_type > Create(Arg &&...arg)
virtual VclPtr< vcl::Window > createVclPopupWindow(vcl::Window *pParent) override
virtual OUString SAL_CALL getImplementationName() override
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_CharacterSpacingToolBoxControl_get_implementation(css::uno::XComponentContext *rContext, css::uno::Sequence< css::uno::Any > const &)