Simplify a bit
[LibreOffice.git] / idl / inc / slot.hxx
blob34d60f1831af297e23cac028915b10adfb03a4f4
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 .
20 #pragma once
22 #include "types.hxx"
23 #include <tools/solar.h>
25 class SvMetaSlot : public SvMetaAttribute
27 public:
28 SvIdentifier aGroupId;
29 SvIdentifier aExecMethod;
30 SvIdentifier aStateMethod;
32 SvBOOL aToggle;
33 SvBOOL aAutoUpdate;
35 SvBOOL aAsynchron;
37 SvBOOL aRecordPerItem;// exclusive
38 SvBOOL aRecordPerSet;
39 SvBOOL aNoRecord;
40 SvBOOL aRecordAbsolute;
42 SvBOOL aMenuConfig;
43 SvBOOL aToolBoxConfig;
44 SvBOOL aAccelConfig;
45 SvBOOL aFastCall;
46 SvBOOL aContainer;
47 OString aDisableFlags;
48 SvMetaSlot* pNextSlot;
49 sal_uInt32 nListPos;
50 SvBOOL aReadOnlyDoc;
52 void WriteSlot( std::string_view rShellName,
53 sal_uInt16 nCount, std::string_view rSlotId,
54 SvSlotElementList &rList,
55 size_t nStart,
56 SvIdlDataBase & rBase, SvStream & rOutStm );
58 bool IsVariable() const;
59 bool IsMethod() const;
61 void SetRecordPerItem( bool bSet )
63 aRecordPerItem = bSet;
64 if( bSet )
65 aRecordPerSet = aNoRecord = false;
67 void SetRecordPerSet( bool bSet )
69 aRecordPerSet = bSet;
70 if( bSet )
71 aRecordPerItem = aNoRecord = false;
73 void SetNoRecord( bool bSet )
75 aNoRecord = bSet;
76 if( bSet )
77 aRecordPerItem = aRecordPerSet = false;
80 public:
81 SvMetaSlot();
82 SvMetaSlot( SvMetaType * pType );
84 const OString& GetGroupId() const;
85 const OString& GetExecMethod() const;
86 const OString& GetStateMethod() const;
87 const OString& GetDisableFlags() const;
88 bool GetToggle() const;
89 bool GetAutoUpdate() const;
91 bool GetAsynchron() const;
93 bool GetRecordPerItem() const;
94 bool GetRecordPerSet() const;
95 bool GetNoRecord() const;
96 bool GetRecordAbsolute() const;
98 bool GetMenuConfig() const;
99 bool GetToolBoxConfig() const;
100 bool GetAccelConfig() const;
101 bool GetFastCall() const;
102 bool GetContainer() const;
103 bool GetReadOnlyDoc() const;
105 sal_uInt32 GetListPos() const
106 { return nListPos; }
107 void SetListPos(sal_uInt32 n)
108 { nListPos = n; }
109 void ResetSlotPointer()
110 { pNextSlot = nullptr; }
112 virtual bool Test( SvTokenStream & rInStm ) override;
113 virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase,
114 SvTokenStream & rInStm ) override;
115 virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override;
116 virtual void Insert( SvSlotElementList& ) override;
117 void WriteSlotStubs( std::string_view rShellName,
118 std::vector<OString> & rList,
119 SvStream & rOutStm ) const;
120 sal_uInt16 WriteSlotMap( std::string_view rShellName,
121 sal_uInt16 nCount,
122 SvSlotElementList&,
123 size_t nStart,
124 SvIdlDataBase & rBase,
125 SvStream & rOutStm );
126 sal_uInt16 WriteSlotParamArray( SvIdlDataBase & rBase,
127 SvStream & rOutStm ) const;
130 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */