1 /* ============================================================ 2 * 3 * This file is a part of digiKam project 4 * https://www.digikam.org 5 * 6 * Date : 2009-12-01 7 * Description : class GroupState 8 * 9 * Copyright (C) 2010-2021 by Gilles Caulier <caulier dot gilles at gmail dot com> 10 * Copyright (C) 2009-2010 by Michael G. Hansen <mike at mghansen dot de> 11 * 12 * This program is free software; you can redistribute it 13 * and/or modify it under the terms of the GNU General 14 * Public License as published by the Free Software Foundation; 15 * either version 2, or (at your option) 16 * any later version. 17 * 18 * This program is distributed in the hope that it will be useful, 19 * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 * GNU General Public License for more details. 22 * 23 * ============================================================ */ 24 25 #ifndef DIGIKAM_GEO_GROUP_STATE_H 26 #define DIGIKAM_GEO_GROUP_STATE_H 27 28 // Qt includes 29 30 #include <QFlags> 31 32 namespace Digikam 33 { 34 35 /** 36 * @brief Representation of possible tile or cluster states 37 * 38 * The idea is that a group consists of more than one object. 39 * Thus the resulting state is that either none of the objects, 40 * some or all of them have a certain state. The constants for each 41 * state are set up such that they can be logically or'ed: If a group 42 * has the state ___All, and another the state ___Some, the bit 43 * representing ___Some is always propagated along. You only have to 44 * make sure that once you reach an object with ___None, and the computed 45 * state is ___All, to set the ___Some bit. 46 * 47 * Selected___: An object is selected. 48 * FilteredPositive___: An object was highlighted by a filter. This usually 49 * means that not-positively-filtered objects should be hidden. 50 * RegionSelected___: An object is inside a region of interest on the map. 51 */ 52 enum GeoGroupStateEnum 53 { 54 SelectedMask = 0x03 << 0, 55 SelectedNone = 0x00 << 0, 56 SelectedSome = 0x03 << 0, 57 SelectedAll = 0x02 << 0, 58 59 FilteredPositiveMask = 0x03 << 2, 60 FilteredPositiveNone = 0x00 << 2, 61 FilteredPositiveSome = 0x03 << 2, 62 FilteredPositiveAll = 0x02 << 2, 63 64 RegionSelectedMask = 0x03 << 4, 65 RegionSelectedNone = 0x00 << 4, 66 RegionSelectedSome = 0x03 << 4, 67 RegionSelectedAll = 0x02 << 4 68 }; 69 70 Q_DECLARE_FLAGS(GeoGroupState, GeoGroupStateEnum) 71 72 } // namespace Digikam 73 74 Q_DECLARE_OPERATORS_FOR_FLAGS(Digikam::GeoGroupState) 75 76 #endif // DIGIKAM_GEO_GROUP_STATE_H 77