build fix
[LibreOffice.git] / include / sfx2 / objface.hxx
blob3805d2fe0fb315982cd1279a520b9e4dc929d4a0
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_OBJFACE_HXX
20 #define INCLUDED_SFX2_OBJFACE_HXX
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 <tools/resid.hxx>
29 struct SfxInterface_Impl;
30 class SfxConfigItem;
31 class SfxModule;
32 class SvStream;
34 class SFX2_DLLPUBLIC SfxInterface final
36 friend class SfxSlotPool;
38 const char* pName; // Sfx-internal name of interface
39 const SfxInterface* pGenoType; // base interface
40 SfxSlot* pSlots; // SlotMap
41 sal_uInt16 nCount; // number of slots in SlotMap
42 SfxInterfaceId nClassId; // Id of interface
43 bool bSuperClass; // Whether children inherit its toolbars etc
44 std::unique_ptr<SfxInterface_Impl> pImplData;
46 public:
47 SfxInterface( const char *pClass,
48 bool bSuperClass,
49 SfxInterfaceId nClassId,
50 const SfxInterface* pGeno,
51 SfxSlot &rMessages, sal_uInt16 nMsgCount );
52 ~SfxInterface();
54 void SetSlotMap( SfxSlot& rMessages, sal_uInt16 nMsgCount );
55 inline sal_uInt16 Count() const;
57 const SfxSlot* GetRealSlot( const SfxSlot * ) const;
58 const SfxSlot* GetRealSlot( sal_uInt16 nSlotId ) const;
59 const SfxSlot* GetSlot( sal_uInt16 nSlotId ) const;
60 const SfxSlot* GetSlot( const OUString& rCommand ) const;
62 const char* GetClassName() const { return pName; }
63 bool UseAsSuperClass() const { return bSuperClass; }
65 const SfxInterface* GetGenoType() const { return pGenoType; }
67 void RegisterObjectBar(sal_uInt16, SfxVisibilityFlags nFlags, sal_uInt32 nResId);
68 void RegisterObjectBar(sal_uInt16, SfxVisibilityFlags nFlags, sal_uInt32 nResId, SfxShellFeature nFeature);
69 void RegisterChildWindow(sal_uInt16, bool bContext = false);
70 void RegisterChildWindow(sal_uInt16, bool bContext, SfxShellFeature nFeature);
71 void RegisterStatusBar(sal_uInt32 nResId);
72 sal_uInt32 GetObjectBarId(sal_uInt16 nNo) const;
73 sal_uInt16 GetObjectBarPos( sal_uInt16 nNo ) const;
74 SfxVisibilityFlags GetObjectBarFlags( sal_uInt16 nNo ) const;
75 SfxShellFeature GetObjectBarFeature(sal_uInt16 nNo) const;
76 sal_uInt16 GetObjectBarCount() const;
77 bool IsObjectBarVisible( sal_uInt16 nNo) const;
78 SfxShellFeature GetChildWindowFeature(sal_uInt16 nNo) const;
79 sal_uInt32 GetChildWindowId( sal_uInt16 nNo ) const;
80 sal_uInt16 GetChildWindowCount() const;
81 void RegisterPopupMenu( const OUString& );
82 const OUString& GetPopupMenuName() const;
83 sal_uInt32 GetStatusBarId() const;
85 void Register( SfxModule* );
87 SAL_DLLPRIVATE bool ContainsSlot_Impl( const SfxSlot *pSlot ) const
88 { return pSlot >= pSlots && pSlot < pSlots + Count(); }
92 // returns the number of functions in this cluster
94 inline sal_uInt16 SfxInterface::Count() const
96 return nCount;
99 #endif
101 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */