android: Update app-specific/MIME type icons
[LibreOffice.git] / include / svx / svdsob.hxx
blob7e2b8578e01dd5ef136b59cb506341560d448dce
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 <com/sun/star/uno/Any.hxx>
24 #include <svx/svxdllapi.h>
25 #include <svx/svdtypes.hxx>
28 Stores a bitfield of the layer values that have been set.
31 class SVXCORE_DLLPUBLIC SdrLayerIDSet final
33 // For now, have up to 256 layers
34 sal_uInt8 aData[32];
36 public:
37 explicit SdrLayerIDSet(bool bInitVal = false)
39 memset(aData, bInitVal ? 0xFF : 0x00, sizeof(aData));
42 bool operator!=(const SdrLayerIDSet& rCmpSet) const
44 return (memcmp(aData, rCmpSet.aData, sizeof(aData))!=0);
47 void Set(SdrLayerID a)
49 const sal_Int16 nId = a.get();
50 if (nId >= 0 && nId < 256)
51 aData[nId / 8] |= 1 << (nId % 8);
54 void Clear(SdrLayerID a)
56 const sal_Int16 nId = a.get();
57 if (nId >= 0 && nId < 256)
58 aData[nId / 8] &= ~(1 << (nId % 8));
61 void Set(SdrLayerID a, bool b)
63 if(b)
64 Set(a);
65 else
66 Clear(a);
69 bool IsSet(SdrLayerID a) const
71 const sal_Int16 nId = a.get();
72 return nId >= 0 && nId < 256 && (aData[nId / 8] & 1 << nId % 8) != 0;
75 void SetAll()
77 memset(aData, 0xFF, sizeof(aData));
80 void ClearAll()
82 memset(aData, 0x00, sizeof(aData));
85 bool IsEmpty() const;
87 void operator&=(const SdrLayerIDSet& r2ndSet);
89 // initialize this set with a UNO sequence of sal_Int8 (e.g. as stored in settings.xml)
90 void PutValue(const css::uno::Any & rAny);
94 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */