Twidere-App-Android-Twitter.../twidere.component.common/src/main/java/org/mariotaku/twidere/annotation/FilterScope.java

62 lines
2.2 KiB
Java
Raw Normal View History

2017-09-10 17:32:12 +02:00
/*
* Twidere - Twitter client for Android
*
* Copyright (C) 2012-2017 Mariotaku Lee <mariotaku.lee@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package org.mariotaku.twidere.annotation;
2020-01-26 08:35:15 +01:00
import androidx.annotation.IntDef;
2017-09-10 17:32:12 +02:00
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
@IntDef(value = {FilterScope.HOME, FilterScope.INTERACTIONS, FilterScope.MESSAGES,
2017-09-14 10:21:59 +02:00
FilterScope.SEARCH_RESULTS, FilterScope.LIST_GROUP_TIMELINE, FilterScope.FAVORITES,
2017-09-14 17:38:31 +02:00
FilterScope.USER_TIMELINE, FilterScope.PUBLIC_TIMELINE, FilterScope.UGC_TIMELINE,
2017-09-15 08:11:59 +02:00
FilterScope.TARGET_NAME, FilterScope.TARGET_TEXT, FilterScope.TARGET_DESCRIPTION,
2017-09-14 17:38:31 +02:00
FilterScope.ALL, FilterScope.DEFAULT}, flag = true)
2017-09-10 17:32:12 +02:00
@Retention(RetentionPolicy.SOURCE)
public @interface FilterScope {
int HOME = 0x1;
int INTERACTIONS = 0x2;
int MESSAGES = 0x4;
2017-09-14 10:21:59 +02:00
int SEARCH_RESULTS = 0x8;
2017-09-13 11:52:09 +02:00
int LIST_GROUP_TIMELINE = 0x10;
int FAVORITES = 0x20;
2017-09-14 10:21:59 +02:00
int USER_TIMELINE = 0x40;
int PUBLIC_TIMELINE = 0x80;
int UGC_TIMELINE = LIST_GROUP_TIMELINE | FAVORITES | USER_TIMELINE | PUBLIC_TIMELINE;
2017-09-13 11:52:09 +02:00
2017-09-15 08:11:59 +02:00
int TARGET_NAME = 0x80000000;
int TARGET_TEXT = 0x40000000;
int TARGET_DESCRIPTION = 0x20000000;
2017-09-13 11:52:09 +02:00
2017-09-15 08:11:59 +02:00
int MASK_TARGET = 0xFF000000;
2017-09-13 11:52:09 +02:00
int MASK_SCOPE = 0x00FFFFFF;
2017-09-10 17:32:12 +02:00
2017-09-14 10:21:59 +02:00
int VALID_MASKS_USERS = MASK_SCOPE;
2017-09-15 08:11:59 +02:00
int VALID_MASKS_KEYWORDS = MASK_SCOPE | MASK_TARGET;
2017-09-14 10:21:59 +02:00
int VALID_MASKS_SOURCES = MASK_SCOPE & ~MESSAGES;
int VALID_MASKS_LINKS = MASK_SCOPE;
2017-09-10 17:32:12 +02:00
// Contains all flags
int ALL = 0xFFFFFFFF;
2017-09-14 17:38:31 +02:00
@SuppressWarnings("PointlessBitwiseExpression")
2017-09-15 08:11:59 +02:00
int DEFAULT = ALL & ~(TARGET_NAME | TARGET_DESCRIPTION);
2017-09-10 17:32:12 +02:00
}