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 
20 #include "FontworkPropertyPanel.hxx"
21 #include <svx/svxids.hrc>
22 #include <sfx2/objsh.hxx>
23 #include <svx/xfltrit.hxx>
24 #include <svx/xflftrit.hxx>
25 #include <svx/xtable.hxx>
26 #include <sfx2/dispatch.hxx>
27 #include <sfx2/bindings.hxx>
28 #include <svtools/valueset.hxx>
29 #include <unotools/pathoptions.hxx>
30 #include <svx/svxitems.hrc>
31 #include <vcl/toolbox.hxx>
32 #include <svtools/toolbarmenu.hxx>
33 #include <comphelper/lok.hxx>
34 
35 using namespace css;
36 using namespace css::uno;
37 
38 namespace svx
39 {
40 namespace sidebar
41 {
FontworkPropertyPanel(weld::Widget * pParent,const css::uno::Reference<css::frame::XFrame> & rxFrame)42 FontworkPropertyPanel::FontworkPropertyPanel(weld::Widget* pParent,
43                                              const css::uno::Reference<css::frame::XFrame>& rxFrame)
44     : PanelLayout(pParent, "FontworkPropertyPanel", "svx/ui/sidebarfontwork.ui")
45     , m_pToolbar(m_xBuilder->weld_toolbar("fontwork-toolbox"))
46     , m_xToolbar(new ToolbarUnoDispatcher(*m_pToolbar, *m_xBuilder, rxFrame))
47 {
48     if (comphelper::LibreOfficeKit::isActive())
49         m_pToolbar->set_item_visible(".uno:ExtrusionToggle", false);
50 }
51 
52 std::unique_ptr<PanelLayout>
Create(weld::Widget * pParent,const css::uno::Reference<css::frame::XFrame> & rxFrame)53 FontworkPropertyPanel::Create(weld::Widget* pParent,
54                               const css::uno::Reference<css::frame::XFrame>& rxFrame)
55 {
56     if (pParent == nullptr)
57         throw lang::IllegalArgumentException(
58             "no parent Window given to FontworkPropertyPanel::Create", nullptr, 0);
59     if (!rxFrame.is())
60         throw lang::IllegalArgumentException("no XFrame given to FontworkPropertyPanel::Create",
61                                              nullptr, 1);
62 
63     return std::make_unique<FontworkPropertyPanel>(pParent, rxFrame);
64 }
65 }
66 } // end of namespace svx::sidebar
67 
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
69