1 /* 2 * %kadu copyright begin% 3 * Copyright 2013 Rafał Przemysław Malinowski (rafal.przemyslaw.malinowski@gmail.com) 4 * %kadu copyright end% 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of 9 * the License, or (at your option) any later version. 10 * 11 * This program is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * GNU General Public License for more details. 15 * 16 * You should have received a copy of the GNU General Public License 17 * along with this program. If not, see <http://www.gnu.org/licenses/>. 18 */ 19 20 #include "talkable/filter/group-filter-type.h" 21 22 #include "group-filter.h" 23 GroupFilter()24GroupFilter::GroupFilter() : 25 FilterType(GroupFilterInvalid) 26 { 27 } 28 GroupFilter(GroupFilterType filterType)29GroupFilter::GroupFilter(GroupFilterType filterType) : 30 FilterType(filterType) 31 { 32 } 33 GroupFilter(const Group & group)34GroupFilter::GroupFilter(const Group &group) : 35 FilterType(GroupFilterRegular), MyGroup(group) 36 { 37 } 38 operator ==(const GroupFilter & groupFilter) const39bool GroupFilter::operator == (const GroupFilter &groupFilter) const 40 { 41 if (groupFilter.filterType() != FilterType) 42 return false; 43 return groupFilter.group() == MyGroup; 44 } 45 isValid() const46bool GroupFilter::isValid() const 47 { 48 return GroupFilterInvalid != FilterType; 49 } 50 filterType() const51GroupFilterType GroupFilter::filterType() const 52 { 53 return FilterType; 54 } 55 group() const56Group GroupFilter::group() const 57 { 58 return MyGroup; 59 } 60