| java.lang.Object | |
| ↳ | chan.content.ChanPerformer |
Provides performing connectivity with chan.
By default you must implement the following methods:
Depending one the ChanConfiguration.Board configuration you must implement the following methods:
If you configure some options, you also must implement the following methods:
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| ChanPerformer.CaptchaData | Captcha data map. |
||||||||||
| ChanPerformer.CaptchaState | Captcha states for |
||||||||||
| ChanPerformer.CheckAuthorizationData | Arguments holder for |
||||||||||
| ChanPerformer.CheckAuthorizationResult | Result holder for |
||||||||||
| ChanPerformer.ReadBoardsData | Arguments holder for |
||||||||||
| ChanPerformer.ReadBoardsResult | Result holder for |
||||||||||
| ChanPerformer.ReadCaptchaData | Arguments holder for |
||||||||||
| ChanPerformer.ReadCaptchaResult | Captcha result for |
||||||||||
| ChanPerformer.ReadContentData | Arguments holder for |
||||||||||
| ChanPerformer.ReadContentResult | Result holder for |
||||||||||
| ChanPerformer.ReadPostsCountData | Arguments holder for |
||||||||||
| ChanPerformer.ReadPostsCountResult | Result holder for |
||||||||||
| ChanPerformer.ReadPostsData | Arguments holder for |
||||||||||
| ChanPerformer.ReadPostsResult | Result holder for |
||||||||||
| ChanPerformer.ReadSearchPostsData | Arguments holder for |
||||||||||
| ChanPerformer.ReadSearchPostsResult | Result holder for |
||||||||||
| ChanPerformer.ReadSinglePostData | Arguments holder for |
||||||||||
| ChanPerformer.ReadSinglePostResult | Result holder for |
||||||||||
| ChanPerformer.ReadThreadSummariesData | Arguments holder for |
||||||||||
| ChanPerformer.ReadThreadSummariesResult | Result holder for |
||||||||||
| ChanPerformer.ReadThreadsData | Arguments holder for |
||||||||||
| ChanPerformer.ReadThreadsResult | Result holder for |
||||||||||
| ChanPerformer.ReadUserBoardsData | Arguments holder for |
||||||||||
| ChanPerformer.ReadUserBoardsResult | Result holder for |
||||||||||
| ChanPerformer.SendAddToArchiveData | Arguments holder for |
||||||||||
| ChanPerformer.SendAddToArchiveResult | Result for |
||||||||||
| ChanPerformer.SendDeletePostsData | Arguments holder for |
||||||||||
| ChanPerformer.SendDeletePostsResult | Result for |
||||||||||
| ChanPerformer.SendPostData | Arguments holder for |
||||||||||
| ChanPerformer.SendPostResult | Result for |
||||||||||
| ChanPerformer.SendReportPostsData | Arguments holder for |
||||||||||
| ChanPerformer.SendReportPostsResult | Result for |
||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Suspends this thread and shows captcha dialog for user. | |||||||||||
Suspends this thread and shows images dialog for user. | |||||||||||
Suspends this thread and shows images dialog for user. | |||||||||||
Suspends this thread and shows items dialog for user. | |||||||||||
Suspends this thread and shows items dialog for user. | |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Return linked ChanPerformer instance.
| Parameters | |
|---|---|
object |
Object:
Linked object: ChanConfiguration, ChanPerformer,
ChanLocator or ChanMarkup. |
| Returns | |
|---|---|
T |
ChanPerformer instance.
|
Calls when application requests chan to check authorization data.
This method must be overridden in the following cases:
OPTION_ALLOW_CAPTCHA_PASS enabledOPTION_ALLOW_USER_AUTHORIZATION enabled| Parameters | |
|---|---|
data |
ChanPerformer.CheckAuthorizationData:
ChanPerformer.CheckAuthorizationData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.CheckAuthorizationResult |
ChanPerformer.CheckAuthorizationResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
InvalidResponseException |
if server returned an invalid data. |
Calls when application requests chan to download boards list.
This method must be overridden if option
OPTION_SINGLE_BOARD_MODE is not enabled.
| Parameters | |
|---|---|
data |
ChanPerformer.ReadBoardsData:
ChanPerformer.ReadBoardsData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.ReadBoardsResult |
ChanPerformer.ReadBoardsResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
InvalidResponseException |
if server returned an invalid data. |
Calls when application requests chan to read captcha.
This method must be overridden if option allowPosting is
enabled for this board.
This method must return ChanPerformer.ReadCaptchaResult with captcha data.
If your chan uses custom captcha, you must specify a resulting image using
setImage(Bitmap).
In the case of Yandex Captcha, resulting captchaData must contain challenge string by
CHALLENGE. key
In the case of Google reCAPTCHA and Mail.Ru Nocaptcha, resulting captchaData must contain API key by
API_KEY. key
If your captcha has short lifetime, you can check mayShowLoadButton.
If this argument equals true, the result may hold NEED_LOAD. This will
show "Click to load captcha" button for user.
| Parameters | |
|---|---|
data |
ChanPerformer.ReadCaptchaData:
ChanPerformer.ReadCaptchaData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.ReadCaptchaResult |
ChanPerformer.ReadCaptchaResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
InvalidResponseException |
if server returned an invalid data. |
Calls when application requests chan to download thumbnail, image, etc.
| Parameters | |
|---|---|
data |
ChanPerformer.ReadContentData:
ChanPerformer.ReadContentData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.ReadContentResult |
ChanPerformer.ReadContentResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
InvalidResponseException |
if server returned an invalid data. |
Calls when application requests chan to download posts list.
This method must be overridden.
Option OPTION_READ_THREAD_PARTIALLY allows you to download threads partially.
You can check partialThreadLoading flag and download only posts after
lastPostNumber.
| Parameters | |
|---|---|
data |
ChanPerformer.ReadPostsData:
ChanPerformer.ReadPostsData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.ReadPostsResult |
ChanPerformer.ReadPostsResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
InvalidResponseException |
if server returned an invalid data. |
RedirectException |
if server returned data that can be considered as redirect. |
Calls when application requests chan to download posts count.
This method is not the same as onReadPosts(ReadPostsData). This method must download
and parse data quickly as possible.
This method must be overridden if option
OPTION_READ_POSTS_COUNT is enabled.
| Parameters | |
|---|---|
data |
ChanPerformer.ReadPostsCountData:
ChanPerformer.ReadPostsCountData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.ReadPostsCountResult |
ChanPerformer.ReadPostsCountResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
InvalidResponseException |
if server returned an invalid data. |
Calls when application requests chan to download search posts list.
This method must be overridden if option allowSearch is
enabled for this board.
| Parameters | |
|---|---|
data |
ChanPerformer.ReadSearchPostsData:
ChanPerformer.ReadSearchPostsData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.ReadSearchPostsResult |
ChanPerformer.ReadSearchPostsResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
InvalidResponseException |
if server returned an invalid data. |
Calls when application requests chan to download single post.
This method must be overridden if chan supports
OPTION_READ_SINGLE_POST.
| Parameters | |
|---|---|
data |
ChanPerformer.ReadSinglePostData:
ChanPerformer.ReadSinglePostData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.ReadSinglePostResult |
ChanPerformer.ReadSinglePostResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
InvalidResponseException |
if server returned an invalid data. |
Calls when application requests chan to download thread summaries.
You can check type field and return necessary data.
This method must be overridden in the following cases:
allowArchive enabled| Parameters | |
|---|---|
data |
ChanPerformer.ReadThreadSummariesData:
ChanPerformer.ReadThreadSummariesData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.ReadThreadSummariesResult |
ChanPerformer.ReadThreadSummariesResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
InvalidResponseException |
if server returned an invalid data. |
Calls when application requests chan to download threads list.
This method must be overridden.
Option allowCatalog allows client to download catalog of threads.
Use isCatalog() to determine whether it necessary to do.
| Parameters | |
|---|---|
data |
ChanPerformer.ReadThreadsData:
ChanPerformer.ReadThreadsData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.ReadThreadsResult |
ChanPerformer.ReadThreadsResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
InvalidResponseException |
if server returned an invalid data. |
RedirectException |
if server returned data that can be considered as redirect. |
Calls when application requests chan to download user boards list.
This method must be overridden if option
OPTION_READ_USER_BOARDS is enabled.
| Parameters | |
|---|---|
data |
ChanPerformer.ReadUserBoardsData:
ChanPerformer.ReadUserBoardsData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.ReadUserBoardsResult |
ChanPerformer.ReadUserBoardsResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
InvalidResponseException |
if server returned an invalid data. |
Calls when application requests chan to add thread to archive.
This method must be overridden if chan implements archivation.
You can throw ApiException with ARCHIVE_* error types.
| Parameters | |
|---|---|
data |
ChanPerformer.SendAddToArchiveData:
ChanPerformer.SendAddToArchiveData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.SendAddToArchiveResult |
ChanPerformer.SendAddToArchiveResult instance. |
| Throws | |
|---|---|
ApiException |
if archivation wasn't complete due to user errors. It can hold error code,
see ApiException. |
InvalidResponseException |
if server returns an invalid data. |
HttpException |
|
Calls when application requests chan to delete posts.
This method must be overridden if option allowDeleting is
enabled for this board.
postNumbers contains several post numbers. You must perform deleting all of these
posts. You must throw ApiException only in case if nothing was deleted. In other cases
you must return and throw nothing.
You can throw ApiException with DELETE_* error types.
| Parameters | |
|---|---|
data |
ChanPerformer.SendDeletePostsData:
ChanPerformer.SendDeletePostsData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.SendDeletePostsResult |
ChanPerformer.SendDeletePostsResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
ApiException |
if deleting wasn't complete due to user errors. |
InvalidResponseException |
if server returned an invalid data. |
Calls when application requests chan to send post.
You can throw ApiException with SEND_* error types.
| Parameters | |
|---|---|
data |
ChanPerformer.SendPostData:
ChanPerformer.SendPostData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.SendPostResult |
ChanPerformer.SendPostResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
ApiException |
if sending wasn't complete due to user errors. |
InvalidResponseException |
if server returned an invalid data. |
Calls when application requests chan to send report.
This method must be overridden if option allowReporting is
enabled for this board.
You can throw ApiException with REPORT_* error types.
| Parameters | |
|---|---|
data |
ChanPerformer.SendReportPostsData:
ChanPerformer.SendDeletePostsData instance with arguments. |
| Returns | |
|---|---|
ChanPerformer.SendReportPostsResult |
ChanPerformer.SendReportPostsResult instance. |
| Throws | |
|---|---|
HttpException |
if HTTP or another error with message occurred. |
ApiException |
if reporting wasn't complete due to user errors. |
InvalidResponseException |
if server returns an invalid data. |
Suspends this thread and shows captcha dialog for user. Captcha will be loaded with
onReadCaptcha(ReadCaptchaData). You can specify requirement for differen behaviors.
| Parameters | |
|---|---|
requirement |
String:
Requirement string. |
boardName |
String:
Board name. |
threadNumber |
String:
Thread number. |
retry |
boolean:
True if this is not the first request. If true, this will show "invalid captcha" toast for user. |
| Returns | |
|---|---|
ChanPerformer.CaptchaData |
ChanPerformer.CaptchaData with INPUT or null if user has canceled an operation.
|
Suspends this thread and shows images dialog for user. User can choose multiple images.
| Parameters | |
|---|---|
selected |
boolean:
Array of default selected indexes, true for selected, may be null. |
images |
Bitmap:
Array of images. |
descriptionText |
String:
Description text (e.g. "Select all burgers"). |
descriptionImage |
Bitmap:
Description image (e.g. example image). |
| Returns | |
|---|---|
boolean[] |
Array of selected indexes or null if user has canceled an operation.
|
Suspends this thread and shows images dialog for user. User can choose only one image.
| Parameters | |
|---|---|
selected |
int:
Default selected index, may be -1. |
images |
Bitmap:
Array of images. |
descriptionText |
String:
Description text (e.g. "Select all burgers"). |
descriptionImage |
Bitmap:
Description image (e.g. example image). |
| Returns | |
|---|---|
Integer |
Index of chosen image, -1 if image wasn't chosen or null if user has canceled an operation.
|
Suspends this thread and shows items dialog for user. User can choose multiple items.
| Parameters | |
|---|---|
selected |
boolean:
Array of default selected indexes, true for selected, may be null. |
items |
CharSequence:
Array of items. |
descriptionText |
String:
Description text (e.g. "Select all burgers"). |
descriptionImage |
Bitmap:
Description image (e.g. example image). |
| Returns | |
|---|---|
boolean[] |
Array of selected indexes or null if user has canceled an operation.
|
Suspends this thread and shows items dialog for user. User can choose only one item.
| Parameters | |
|---|---|
selected |
int:
Default selected index, may be -1. |
items |
CharSequence:
Array of items. |
descriptionText |
String:
Description text (e.g. "Select all burgers"). |
descriptionImage |
Bitmap:
Description image (e.g. example image). |
| Returns | |
|---|---|
Integer |
Index of chosen item, -1 if item wasn't chosen or null if user has canceled an operation.
|