/src/libreoffice/include/sfx2/objface.hxx
Line | Count | Source |
1 | | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | /* |
3 | | * This file is part of the LibreOffice project. |
4 | | * |
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/. |
8 | | * |
9 | | * This file incorporates work covered by the following license notice: |
10 | | * |
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 . |
18 | | */ |
19 | | #pragma once |
20 | | |
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> |
28 | | |
29 | | struct SfxInterface_Impl; |
30 | | class SfxModule; |
31 | | |
32 | 32 | #define SFX_OBJECTBAR_APPLICATION 0 |
33 | 372 | #define SFX_OBJECTBAR_OBJECT 1 |
34 | 51 | #define SFX_OBJECTBAR_TOOLS 2 |
35 | 0 | #define SFX_OBJECTBAR_MACRO 3 |
36 | 0 | #define SFX_OBJECTBAR_FULLSCREEN 4 |
37 | 0 | #define SFX_OBJECTBAR_RECORDING 5 |
38 | 6 | #define SFX_OBJECTBAR_COMMONTASK 6 |
39 | 6 | #define SFX_OBJECTBAR_OPTIONS 7 |
40 | 52 | #define SFX_OBJECTBAR_NAVIGATION 12 |
41 | 179k | #define SFX_OBJECTBAR_MAX 13 |
42 | | |
43 | | enum class StatusBarId : sal_uInt32 |
44 | | { |
45 | | None = 0, |
46 | | GenericStatusBar = 4, |
47 | | WriterStatusBar = 20013, |
48 | | MathStatusBar = 20816, |
49 | | DrawStatusBar = 23007, |
50 | | CalcStatusBar = 26005, |
51 | | BasicIdeStatusBar = 30805 |
52 | | }; |
53 | | |
54 | | class SFX2_DLLPUBLIC SfxInterface final |
55 | | { |
56 | | friend class SfxSlotPool; |
57 | | |
58 | | const char* pName; // Sfx-internal name of interface |
59 | | const SfxInterface* pGenoType; // base interface |
60 | | const 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; |
65 | | |
66 | | public: |
67 | | SfxInterface( const char *pClass, |
68 | | bool bSuperClass, |
69 | | SfxInterfaceId nClassId, |
70 | | const SfxInterface* pGeno, |
71 | | const SfxSlot &rMessages, sal_uInt16 nMsgCount ); |
72 | | ~SfxInterface(); |
73 | | |
74 | | void SetSlotMap( const SfxSlot& rMessages, sal_uInt16 nMsgCount ); |
75 | | inline sal_uInt16 Count() const; |
76 | | |
77 | | const SfxSlot* GetRealSlot( const SfxSlot * ) const; |
78 | | const SfxSlot* GetSlot( sal_uInt16 nSlotId ) const; |
79 | | const SfxSlot* GetSlot( const OUString& rCommand ) const; |
80 | | |
81 | 0 | const char* GetClassName() const { return pName; } |
82 | 145k | bool UseAsSuperClass() const { return bSuperClass; } |
83 | | |
84 | 0 | const SfxInterface* GetGenoType() const { return pGenoType; } |
85 | | |
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; |
103 | | |
104 | | void Register( const SfxModule* ); |
105 | | |
106 | | SAL_DLLPRIVATE bool ContainsSlot_Impl( const SfxSlot *pSlot ) const |
107 | 0 | { return pSlot >= pSlots && pSlot < pSlots + Count(); } |
108 | | }; |
109 | | |
110 | | |
111 | | // returns the number of functions in this cluster |
112 | | |
113 | | inline sal_uInt16 SfxInterface::Count() const |
114 | 54.7k | { |
115 | 54.7k | return nCount; |
116 | 54.7k | } |
117 | | |
118 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |