LibreOffice Module sw (master)  1
PageColumnPopup.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  */
19 #include <PageColumnPopup.hxx>
20 #include "PageColumnControl.hxx"
21 #include <svl/intitem.hxx>
22 #include <vcl/toolbox.hxx>
23 
24 PageColumnPopup::PageColumnPopup(const css::uno::Reference<css::uno::XComponentContext>& rContext)
25  : PopupWindowController(rContext, nullptr, OUString())
26 {
27 }
28 
29 void PageColumnPopup::initialize( const css::uno::Sequence< css::uno::Any >& rArguments )
30 {
31  PopupWindowController::initialize(rArguments);
32 
33  ToolBox* pToolBox = nullptr;
34  sal_uInt16 nId = 0;
35  if (getToolboxId(nId, &pToolBox) && pToolBox->GetItemCommand(nId) == m_aCommandURL)
36  pToolBox->SetItemBits(nId, ToolBoxItemBits::DROPDOWNONLY | pToolBox->GetItemBits(nId));
37 }
38 
40 {
41 }
42 
43 std::unique_ptr<WeldToolbarPopup> PageColumnPopup::weldPopupWindow()
44 {
45  return std::make_unique<sw::sidebar::PageColumnControl>(this, m_pToolbar);
46 }
47 
49 {
50  mxInterimPopover = VclPtr<InterimToolbarPopup>::Create(getFrameInterface(), pParent,
51  std::make_unique<sw::sidebar::PageColumnControl>(this, pParent->GetFrameWeld()));
52 
53  mxInterimPopover->Show();
54 
55  return mxInterimPopover;
56 }
57 
59 {
60  return "lo.writer.PageColumnToolBoxControl";
61 }
62 
63 css::uno::Sequence<OUString> PageColumnPopup::getSupportedServiceNames()
64 {
65  return { "com.sun.star.frame.ToolbarController" };
66 }
67 
68 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
70  css::uno::XComponentContext* rContext,
71  css::uno::Sequence<css::uno::Any> const & )
72 {
73  return cppu::acquire(new PageColumnPopup(rContext));
74 }
75 
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ToolBoxItemBits GetItemBits(sal_uInt16 nItemId) const
sal_Int16 nId
virtual std::unique_ptr< WeldToolbarPopup > weldPopupWindow() override
weld::Window * GetFrameWeld() const
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &rArguments) override
void SetItemBits(sal_uInt16 nItemId, ToolBoxItemBits nBits)
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL createPopupWindow() override
virtual ~PageColumnPopup() override
VclPtr< InterimToolbarPopup > mxInterimPopover
virtual OUString SAL_CALL getImplementationName() override
PageColumnPopup(const css::uno::Reference< css::uno::XComponentContext > &rContext)
OUString GetItemCommand(sal_uInt16 nItemId) const
static VclPtr< reference_type > Create(Arg &&...arg)
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * lo_writer_PageColumnToolBoxControl_get_implementation(css::uno::XComponentContext *rContext, css::uno::Sequence< css::uno::Any > const &)