cid#1615991 Logically dead code
[LibreOffice.git] / include / sfx2 / objface.hxx
blobd537069ca0f3a7811565342a3361a4a702d8ede1
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 <memory>
22 #include <rtl/ustring.hxx>
23 #include <sal/config.h>
24 #include <sal/types.h>
25 #include <sfx2/dllapi.h>
26 #include <sfx2/msg.hxx>
27 #include <sfx2/toolbarids.hxx>
29 struct SfxInterface_Impl;
30 class SfxModule;
32 #define SFX_OBJECTBAR_APPLICATION 0
33 #define SFX_OBJECTBAR_OBJECT 1
34 #define SFX_OBJECTBAR_TOOLS 2
35 #define SFX_OBJECTBAR_MACRO 3
36 #define SFX_OBJECTBAR_FULLSCREEN 4
37 #define SFX_OBJECTBAR_RECORDING 5
38 #define SFX_OBJECTBAR_COMMONTASK 6
39 #define SFX_OBJECTBAR_OPTIONS 7
40 #define SFX_OBJECTBAR_NAVIGATION 12
41 #define SFX_OBJECTBAR_MAX 13
43 enum class StatusBarId : sal_uInt32
45 None = 0,
46 GenericStatusBar = 4,
47 WriterStatusBar = 20013,
48 MathStatusBar = 20816,
49 DrawStatusBar = 23007,
50 CalcStatusBar = 26005,
51 BasicIdeStatusBar = 30805
54 class SFX2_DLLPUBLIC SfxInterface final
56 friend class SfxSlotPool;
58 const char* pName; // Sfx-internal name of interface
59 const SfxInterface* pGenoType; // base interface
60 SfxSlot* pSlots; // SlotMap
61 sal_uInt16 nCount; // number of slots in SlotMap
62 SfxInterfaceId nClassId; // Id of interface
63 bool bSuperClass; // Whether children inherit its toolbars etc
64 std::unique_ptr<SfxInterface_Impl> pImplData;
66 public:
67 SfxInterface( const char *pClass,
68 bool bSuperClass,
69 SfxInterfaceId nClassId,
70 const SfxInterface* pGeno,
71 SfxSlot &rMessages, sal_uInt16 nMsgCount );
72 ~SfxInterface();
74 void SetSlotMap( SfxSlot& rMessages, sal_uInt16 nMsgCount );
75 inline sal_uInt16 Count() const;
77 const SfxSlot* GetRealSlot( const SfxSlot * ) const;
78 const SfxSlot* GetSlot( sal_uInt16 nSlotId ) const;
79 const SfxSlot* GetSlot( const OUString& rCommand ) const;
81 const char* GetClassName() const { return pName; }
82 bool UseAsSuperClass() const { return bSuperClass; }
84 const SfxInterface* GetGenoType() const { return pGenoType; }
86 void RegisterObjectBar(sal_uInt16, SfxVisibilityFlags nFlags, ToolbarId eId);
87 void RegisterObjectBar(sal_uInt16, SfxVisibilityFlags nFlags, ToolbarId eId, SfxShellFeature nFeature);
88 void RegisterChildWindow(sal_uInt16, bool bContext = false);
89 void RegisterChildWindow(sal_uInt16, bool bContext, SfxShellFeature nFeature);
90 void RegisterStatusBar(StatusBarId eId);
91 ToolbarId GetObjectBarId(sal_uInt16 nNo) const;
92 sal_uInt16 GetObjectBarPos( sal_uInt16 nNo ) const;
93 SfxVisibilityFlags GetObjectBarFlags( sal_uInt16 nNo ) const;
94 SfxShellFeature GetObjectBarFeature(sal_uInt16 nNo) const;
95 sal_uInt16 GetObjectBarCount() const;
96 bool IsObjectBarVisible( sal_uInt16 nNo) const;
97 SfxShellFeature GetChildWindowFeature(sal_uInt16 nNo) const;
98 sal_uInt32 GetChildWindowId( sal_uInt16 nNo ) const;
99 sal_uInt16 GetChildWindowCount() const;
100 void RegisterPopupMenu( const OUString& );
101 const OUString& GetPopupMenuName() const;
102 StatusBarId GetStatusBarId() const;
104 void Register( const SfxModule* );
106 SAL_DLLPRIVATE bool ContainsSlot_Impl( const SfxSlot *pSlot ) const
107 { return pSlot >= pSlots && pSlot < pSlots + Count(); }
111 // returns the number of functions in this cluster
113 inline sal_uInt16 SfxInterface::Count() const
115 return nCount;
118 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */