update emoji autocorrect entries from po-files
[LibreOffice.git] / include / sfx2 / mnumgr.hxx
blobf752575c64157f1eefcf541fd586326ce319707c
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 #ifndef INCLUDED_SFX2_MNUMGR_HXX
20 #define INCLUDED_SFX2_MNUMGR_HXX
22 #include <vcl/menu.hxx>
23 #include <tools/wintypes.hxx>
24 #include <tools/link.hxx>
25 #include <com/sun/star/embed/VerbDescriptor.hpp>
26 #include <com/sun/star/uno/Sequence.hxx>
28 #include <tools/stream.hxx>
29 #include <tools/resid.hxx>
30 #include <sfx2/sfx.hrc>
32 class SfxVirtualMenu;
33 class SfxPoolItem;
34 class SfxBindings;
35 class ResMgr;
36 class Menu;
37 class PopupMenu;
38 class SfxBindings;
39 class ResId;
40 class Point;
41 class SfxObjectShell;
42 class SfxModule;
43 class SfxViewFrame;
45 class SfxMenuManager
47 friend class SfxPopupMenuManager;
49 SfxVirtualMenu* pMenu; // the actual Menu
50 SfxVirtualMenu* pOldMenu; // only while reconfiguring
51 SfxBindings* pBindings;
52 ResMgr* pResMgr;
53 sal_uInt32 nType;
54 bool bAddClipboardFuncs : 1;
56 void Construct( SfxVirtualMenu& rMenu );
58 protected:
59 SfxMenuManager( Menu*, SfxBindings& );
60 ~SfxMenuManager();
61 sal_uInt16 GetItemPos( sal_uInt16 nId );
62 sal_uInt32 GetType() { return nType; }
63 public:
65 DECL_LINK( Select, Menu* );
67 SfxVirtualMenu* GetMenu() const
68 { return pMenu; }
70 SfxBindings& GetBindings() { return *pBindings; }
71 const SfxBindings& GetBindings() const { return *pBindings; }
72 void SetResMgr(ResMgr* pMgr) {pResMgr = pMgr; }
73 ResMgr* GetResMgr() const { return pResMgr; }
74 void SetPopupMenu( sal_uInt16 nId, PopupMenu *pMenu );
79 class SAL_DLLPUBLIC_EXPORT SfxPopupMenuManager : public SfxMenuManager
81 private:
82 Menu* pSVMenu;
84 // when #i107205 gets fixed this one should be superfluous.
85 // But right now we want to avoid the memory leak that would otherwise occur,
86 // if we don't delete the pointer that got created in SfxPopupMenuManager::Popup
87 static PopupMenu * pStaticThesSubMenu;
89 SfxPopupMenuManager( const SfxPopupMenuManager& ) SAL_DELETED_FUNCTION;
90 SfxPopupMenuManager& operator=( const SfxPopupMenuManager& ) SAL_DELETED_FUNCTION;
92 public:
93 SfxPopupMenuManager( PopupMenu*, SfxBindings& );
94 ~SfxPopupMenuManager();
95 static void ExecutePopup( const ResId&, SfxViewFrame* pViewFrame, const Point& rPoint, vcl::Window* pWindow );
96 // @deprecated!!
97 // Don't use this method any longer. The whole class will be removed in the future.
98 // Changing code which relies on Popup would need much more effort.
99 static SfxPopupMenuManager* Popup( const ResId& rResId, SfxViewFrame* pFrame,const Point& rPoint, vcl::Window* pWindow );
101 sal_uInt16 Execute( const Point& rPos, vcl::Window *pWindow );
103 void RemoveDisabledEntries();
104 Menu* GetSVMenu();
107 #endif // INCLUDED_SFX2_MNUMGR_HXX
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */