Avoid potential negative array index access to cached text.
[LibreOffice.git] / sfx2 / inc / sidebar / ControllerFactory.hxx
blobc30cec61425ba1278f2ca2b5769eab5ee282cb46
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 #pragma once
21 #include <com/sun/star/uno/Reference.hxx>
22 #include <vcl/toolbox.hxx>
24 namespace com::sun::star::awt { class XWindow; }
25 namespace com::sun::star::frame { class XController; }
26 namespace com::sun::star::frame { class XFrame; }
27 namespace com::sun::star::frame { class XToolbarController; }
29 class ToolBox;
31 namespace weld {
32 class Builder;
33 class Toolbar;
36 namespace sfx2::sidebar {
38 /** Convenience class for the easy creation of toolbox controllers.
40 class ControllerFactory
42 public:
43 static css::uno::Reference<css::lang::XComponent> CreateImageController(
44 const css::uno::Reference<css::frame::XFrame>& rxFrame,
45 const css::uno::Reference<css::awt::XWindow>& rxParentWindow);
47 static css::uno::Reference<css::frame::XToolbarController> CreateToolBoxController(
48 ToolBox* pToolBox,
49 const ToolBoxItemId nItemId,
50 const OUString& rsCommandName,
51 const css::uno::Reference<css::frame::XFrame>& rxFrame,
52 const css::uno::Reference<css::frame::XController>& rxController,
53 const css::uno::Reference<css::awt::XWindow>& rxParentWindow,
54 const sal_Int32 nItemWidth, bool bSideBar);
56 static css::uno::Reference<css::frame::XToolbarController> CreateToolBoxController(
57 weld::Toolbar& rToolbar,
58 weld::Builder& rBuilder,
59 const OUString& rsCommandName,
60 const css::uno::Reference<css::frame::XFrame>& rxFrame,
61 const css::uno::Reference<css::frame::XController>& rxController,
62 bool bSideBar);
64 private:
65 static css::uno::Reference<css::frame::XToolbarController> CreateToolBarController(
66 const css::uno::Reference<css::awt::XWindow>& rToolbar,
67 const OUString& rsCommandName,
68 const css::uno::Reference<css::frame::XFrame>& rxFrame,
69 const css::uno::Reference<css::frame::XController>& rxController,
70 const sal_Int32 nWidth, bool bSideBar);
74 } // end of namespace sfx2::sidebar
76 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */