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