Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / uibase / sidebar / PageMarginPopup.cxx
blob67f13acc01d802815159f4df5259040240eb320e
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 <PageMarginPopup.hxx>
20 #include "PageMarginControl.hxx"
21 #include <vcl/toolbox.hxx>
23 PageMarginPopup::PageMarginPopup(const css::uno::Reference<css::uno::XComponentContext>& rContext)
24 : PopupWindowController(rContext, nullptr, OUString())
28 void PageMarginPopup::initialize( const css::uno::Sequence< css::uno::Any >& rArguments )
30 PopupWindowController::initialize(rArguments);
32 ToolBox* pToolBox = nullptr;
33 ToolBoxItemId nId;
34 if (getToolboxId(nId, &pToolBox))
35 pToolBox->SetItemBits(nId, ToolBoxItemBits::DROPDOWNONLY | pToolBox->GetItemBits(nId));
38 PageMarginPopup::~PageMarginPopup()
42 std::unique_ptr<WeldToolbarPopup> PageMarginPopup::weldPopupWindow()
44 return std::make_unique<sw::sidebar::PageMarginControl>(this, m_pToolbar);
47 VclPtr<vcl::Window> PageMarginPopup::createVclPopupWindow( vcl::Window* pParent )
49 mxInterimPopover = VclPtr<InterimToolbarPopup>::Create(getFrameInterface(), pParent,
50 std::make_unique<sw::sidebar::PageMarginControl>(this, pParent->GetFrameWeld()));
52 mxInterimPopover->Show();
54 return mxInterimPopover;
57 OUString PageMarginPopup::getImplementationName()
59 return "lo.writer.PageMarginToolBoxControl";
62 css::uno::Sequence<OUString> PageMarginPopup::getSupportedServiceNames()
64 return { "com.sun.star.frame.ToolbarController" };
67 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
68 lo_writer_PageMarginToolBoxControl_get_implementation(
69 css::uno::XComponentContext* rContext,
70 css::uno::Sequence<css::uno::Any> const & )
72 return cppu::acquire(new PageMarginPopup(rContext));
75 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */