| 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 | |
| 20 | #pragma once |
| 21 | |
| 22 | #include "types.hxx" |
| 23 | #include <tools/solar.h> |
| 24 | |
| 25 | class SvMetaSlot : public SvMetaAttribute |
| 26 | { |
| 27 | public: |
| 28 | SvIdentifier aGroupId; |
| 29 | SvIdentifier aExecMethod; |
| 30 | SvIdentifier aStateMethod; |
| 31 | |
| 32 | SvBOOL aToggle; |
| 33 | SvBOOL aAutoUpdate; |
| 34 | |
| 35 | SvBOOL aAsynchron; |
| 36 | |
| 37 | SvBOOL aRecordPerItem;// exclusive |
| 38 | SvBOOL aRecordPerSet; |
| 39 | SvBOOL aNoRecord; |
| 40 | SvBOOL aRecordAbsolute; |
| 41 | |
| 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; |
| 51 | SvBOOL aViewerApp; |
| 52 | |
| 53 | void WriteSlot( std::string_view rShellName, |
| 54 | sal_uInt16 nCount, std::string_view rSlotId, |
| 55 | SvSlotElementList &rList, |
| 56 | size_t nStart, |
| 57 | SvIdlDataBase & rBase, SvStream & rOutStm ); |
| 58 | |
| 59 | bool IsVariable() const; |
| 60 | bool IsMethod() const; |
| 61 | |
| 62 | void SetRecordPerItem( bool bSet ) |
| 63 | { |
| 64 | aRecordPerItem = bSet; |
| 65 | if( bSet ) |
| 66 | aRecordPerSet = aNoRecord = false; |
| 67 | } |
| 68 | void SetRecordPerSet( bool bSet ) |
| 69 | { |
| 70 | aRecordPerSet = bSet; |
| 71 | if( bSet ) |
| 72 | aRecordPerItem = aNoRecord = false; |
| 73 | } |
| 74 | void SetNoRecord( bool bSet ) |
| 75 | { |
| 76 | aNoRecord = bSet; |
| 77 | if( bSet ) |
| 78 | aRecordPerItem = aRecordPerSet = false; |
| 79 | } |
| 80 | |
| 81 | public: |
| 82 | SvMetaSlot(); |
| 83 | SvMetaSlot( SvMetaType * pType ); |
| 84 | |
| 85 | const OString& GetGroupId() const; |
| 86 | const OString& GetExecMethod() const; |
| 87 | const OString& GetStateMethod() const; |
| 88 | const OString& GetDisableFlags() const; |
| 89 | bool GetToggle() const; |
| 90 | bool GetAutoUpdate() const; |
| 91 | |
| 92 | bool GetAsynchron() const; |
| 93 | |
| 94 | bool GetRecordPerItem() const; |
| 95 | bool GetRecordPerSet() const; |
| 96 | bool GetNoRecord() const; |
| 97 | bool GetRecordAbsolute() const; |
| 98 | |
| 99 | bool GetMenuConfig() const; |
| 100 | bool GetToolBoxConfig() const; |
| 101 | bool GetAccelConfig() const; |
| 102 | bool GetFastCall() const; |
| 103 | bool GetContainer() const; |
| 104 | bool GetReadOnlyDoc() const; |
| 105 | bool GetViewerApp() const; |
| 106 | |
| 107 | sal_uInt32 GetListPos() const |
| 108 | { return nListPos; } |
| 109 | void SetListPos(sal_uInt32 n) |
| 110 | { nListPos = n; } |
| 111 | void ResetSlotPointer() |
| 112 | { pNextSlot = nullptr; } |
| 113 | |
| 114 | virtual bool Test( SvTokenStream & rInStm ) override; |
| 115 | virtual void ReadAttributesSvIdl( SvIdlDataBase & rBase, |
| 116 | SvTokenStream & rInStm ) override; |
| 117 | virtual bool ReadSvIdl( SvIdlDataBase &, SvTokenStream & rInStm ) override; |
| 118 | virtual void Insert( SvSlotElementList& ) override; |
| 119 | void WriteSlotStubs( std::string_view rShellName, |
| 120 | std::vector<OString> & rList, |
| 121 | SvStream & rOutStm ) const; |
| 122 | sal_uInt16 WriteSlotMap( std::string_view rShellName, |
| 123 | sal_uInt16 nCount, |
| 124 | SvSlotElementList&, |
| 125 | size_t nStart, |
| 126 | SvIdlDataBase & rBase, |
| 127 | SvStream & rOutStm ); |
| 128 | sal_uInt16 WriteSlotParamArray( SvIdlDataBase & rBase, |
| 129 | SvStream & rOutStm ) const; |
| 130 | }; |
| 131 | |
| 132 | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |