calc: on editing invalidation of view with different zoom is wrong
[LibreOffice.git] / framework / inc / uielement / menubarmerger.hxx
blob16bb8ec676102c499b8a855df479081325ed153c
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 #pragma once
22 #include <com/sun/star/beans/PropertyValue.hpp>
24 #include <rtl/ustring.hxx>
25 #include <vcl/menu.hxx>
27 #include <string_view>
28 #include <vector>
30 namespace framework
33 struct AddonMenuItem;
34 typedef ::std::vector< AddonMenuItem > AddonMenuContainer;
36 struct AddonMenuItem
38 OUString aTitle;
39 OUString aURL;
40 OUString aContext;
41 AddonMenuContainer aSubMenu;
44 enum RPResultInfo
46 RP_OK,
47 RP_POPUPMENU_NOT_FOUND,
48 RP_MENUITEM_NOT_FOUND,
49 RP_MENUITEM_INSTEAD_OF_POPUPMENU_FOUND
52 struct ReferencePathInfo
54 VclPtr<Menu> pPopupMenu;
55 sal_uInt16 nPos;
56 sal_Int32 nLevel;
57 RPResultInfo eResult;
60 namespace MenuBarMerger
62 bool IsCorrectContext(
63 std::u16string_view aContext, std::u16string_view aModuleIdentifier );
65 void RetrieveReferencePath( std::u16string_view,
66 std::vector< OUString >& aReferencePath );
67 ReferencePathInfo FindReferencePath( const std::vector< OUString >& aReferencePath, Menu* pMenu );
68 sal_uInt16 FindMenuItem( std::u16string_view rCmd,
69 Menu const * pMenu );
70 void GetMenuEntry( const css::uno::Sequence< css::beans::PropertyValue >& rAddonMenuEntry,
71 AddonMenuItem& aAddonMenu );
72 void GetSubMenu( const css::uno::Sequence< css::uno::Sequence< css::beans::PropertyValue > >& rSubMenuEntries,
73 AddonMenuContainer& rSubMenu );
74 bool ProcessMergeOperation( Menu* pMenu,
75 sal_uInt16 nPos,
76 sal_uInt16& rItemId,
77 std::u16string_view rMergeCommand,
78 std::u16string_view rMergeCommandParameter,
79 const OUString& rModuleIdentifier,
80 const AddonMenuContainer& rAddonMenuItems );
81 bool ProcessFallbackOperation( const ReferencePathInfo& aRefPathInfo,
82 sal_uInt16& rItemId,
83 std::u16string_view rMergeCommand,
84 std::u16string_view rMergeFallback,
85 const ::std::vector< OUString >& rReferencePath,
86 std::u16string_view rModuleIdentifier,
87 const AddonMenuContainer& rAddonMenuItems );
88 bool MergeMenuItems( Menu* pMenu,
89 sal_uInt16 nPos,
90 sal_uInt16 nModIndex,
91 sal_uInt16& rItemId,
92 const OUString& rModuleIdentifier,
93 const AddonMenuContainer& rAddonMenuItems );
94 bool ReplaceMenuItem( Menu* pMenu,
95 sal_uInt16 nPos,
96 sal_uInt16& rItemId,
97 const OUString& rModuleIdentifier,
98 const AddonMenuContainer& rAddonMenuItems );
99 bool RemoveMenuItems( Menu* pMenu,
100 sal_uInt16 nPos,
101 std::u16string_view rMergeCommandParameter );
102 bool CreateSubMenu( Menu* pSubMenu,
103 sal_uInt16& nItemId,
104 const OUString& rModuleIdentifier,
105 const AddonMenuContainer& rAddonSubMenu );
108 } // namespace framework
110 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */