fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / framework / inc / uielement / toolbarmerger.hxx
blob0902ff36a9e15062e3239aa5416eb94048c07108
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 .
20 #ifndef INCLUDED_FRAMEWORK_INC_UIELEMENT_TOOLBARMERGER_HXX
21 #define INCLUDED_FRAMEWORK_INC_UIELEMENT_TOOLBARMERGER_HXX
23 #include <uielement/comboboxtoolbarcontroller.hxx>
24 #include <uielement/imagebuttontoolbarcontroller.hxx>
25 #include <uielement/togglebuttontoolbarcontroller.hxx>
26 #include <uielement/buttontoolbarcontroller.hxx>
27 #include <uielement/spinfieldtoolbarcontroller.hxx>
28 #include <uielement/edittoolbarcontroller.hxx>
29 #include <uielement/dropdownboxtoolbarcontroller.hxx>
30 #include <uielement/commandinfo.hxx>
32 #include <com/sun/star/beans/PropertyValue.hpp>
34 #include <svtools/toolboxcontroller.hxx>
36 #include <rtl/ustring.hxx>
37 #include <vcl/toolbox.hxx>
39 namespace framework
42 struct AddonsParams
44 OUString aImageId;
45 OUString aTarget;
46 OUString aControlType;
49 struct AddonToolbarItem
51 OUString aCommandURL;
52 OUString aLabel;
53 OUString aImageIdentifier;
54 OUString aTarget;
55 OUString aContext;
56 OUString aControlType;
57 sal_uInt16 nWidth;
60 typedef ::std::vector< AddonToolbarItem > AddonToolbarItemContainer;
62 struct ReferenceToolbarPathInfo
64 VclPtr<ToolBox> pToolbar;
65 sal_uInt16 nPos;
66 bool bResult;
69 class ToolBarMerger
71 public:
72 static bool IsCorrectContext( const OUString& aContext, const OUString& aModuleIdentifier );
74 static bool ConvertSeqSeqToVector( const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& rSequence,
75 AddonToolbarItemContainer& rContainer );
77 static void ConvertSequenceToValues( const css::uno::Sequence< css::beans::PropertyValue >& rSequence,
78 OUString& rCommandURL,
79 OUString& rLabel,
80 OUString& rImageIdentifier,
81 OUString& rTarget,
82 OUString& rContext,
83 OUString& rControlType,
84 sal_uInt16& rWidth );
86 static ReferenceToolbarPathInfo FindReferencePoint( ToolBox* pToolbar,
87 const OUString& rReferencePoint );
89 static bool ProcessMergeOperation( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
90 ToolBox* pToolbar,
91 sal_uInt16 nPos,
92 sal_uInt16& rItemId,
93 CommandToInfoMap& rCommandMap,
94 const OUString& rModuleIdentifier,
95 const OUString& rMergeCommand,
96 const OUString& rMergeCommandParameter,
97 const AddonToolbarItemContainer& rItems );
99 static bool ProcessMergeFallback( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
100 ToolBox* pToolbar,
101 sal_uInt16 nPos,
102 sal_uInt16& rItemId,
103 CommandToInfoMap& rCommandMap,
104 const OUString& rModuleIdentifier,
105 const OUString& rMergeCommand,
106 const OUString& rMergeFallback,
107 const AddonToolbarItemContainer& rItems );
109 static bool MergeItems( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
110 ToolBox* pToolbar,
111 sal_uInt16 nPos,
112 sal_uInt16 nModIndex,
113 sal_uInt16& rItemId,
114 CommandToInfoMap& rCommandMap,
115 const OUString& rModuleIdentifier,
116 const AddonToolbarItemContainer& rAddonToolbarItems );
118 static bool ReplaceItem( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& xFrame,
119 ToolBox* pToolbar,
120 sal_uInt16 nPos,
121 sal_uInt16& rItemId,
122 CommandToInfoMap& rCommandMap,
123 const OUString& rModuleIdentifier,
124 const AddonToolbarItemContainer& rAddonToolbarItems );
126 static bool RemoveItems( ToolBox* pToolbar,
127 sal_uInt16 nPos,
128 const OUString& rMergeCommandParameter );
130 static ::cppu::OWeakObject* CreateController(
131 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
132 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > & xFrame,
133 ToolBox* pToolbar,
134 const OUString& rCommandURL,
135 sal_uInt16 nId,
136 sal_uInt16 nWidth,
137 const OUString& rControlType );
139 static void CreateToolbarItem( ToolBox* pToolbox,
140 CommandToInfoMap& rCommandMap,
141 sal_uInt16 nPos,
142 sal_uInt16 nItemId,
143 const AddonToolbarItem& rAddonToolbarItem );
145 private:
146 ToolBarMerger( const ToolBarMerger& ) SAL_DELETED_FUNCTION;
147 ToolBarMerger& operator=( const ToolBarMerger& ) SAL_DELETED_FUNCTION;
150 } // namespace framework
152 #endif // INCLUDED_FRAMEWORK_INC_UIELEMENT_TOOLBARMERGER_HXX
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */