from typing import Any

from django.forms import Form
from django.http import HttpRequest, HttpResponse
from django.views import View
from wagtail.models import Task, TaskState, WorkflowState

from .base import BaseObjectMixin

class BaseWorkflowFormView(BaseObjectMixin, View):
    redirect_url_name: str | None
    submit_url_name: str | None
    template_name: str
    action_name: str
    task_state_id: int
    redirect_url: str
    task_state: TaskState
    task: Task
    form_class: type[Form] | None
    action_verbose_name: str
    action_modal: bool
    def setup(self, request: HttpRequest, *args: Any, action_name: str, task_state_id: int, **kwargs: Any) -> None: ...
    def get_redirect_url(self) -> str: ...
    def get_task_state(self) -> TaskState: ...
    def get_task(self) -> Task: ...
    def get_form_class(self) -> type[Form] | None: ...
    def get_template_names(self) -> list[str]: ...
    def add_not_in_moderation_error(self) -> None: ...
    def check_action(self) -> None: ...
    def dispatch(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
    def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
    def get_submit_url(self) -> str: ...
    def get_context_data(self, **kwargs: Any) -> dict[str, Any]: ...
    def render_modal_form(self, request: HttpRequest, form: Form) -> HttpResponse: ...
    def render_modal_json(self, request: HttpRequest, json_data: dict[str, Any]) -> HttpResponse: ...

class WorkflowAction(BaseWorkflowFormView):
    def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...

class CollectWorkflowActionData(BaseWorkflowFormView):
    def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...

class ConfirmWorkflowCancellation(BaseObjectMixin, View):
    template_name: str
    workflow_state: WorkflowState | None
    def setup(self, request: HttpRequest, *args: Any, **kwargs: Any) -> None: ...
    def dispatch(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
    def get_context_data(self, **kwargs: Any) -> dict[str, Any]: ...

class PreviewRevisionForTask(BaseObjectMixin, View):
    task_id: int
    task: Task
    task_state: TaskState | None
    def setup(self, request: HttpRequest, *args: Any, task_id: int, **kwargs: Any) -> None: ...
    def get_task(self) -> Task: ...
    def get_task_state(self) -> TaskState | None: ...
    def add_error_message(self) -> None: ...
    def get(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse: ...
