Skip to content

WebEngineContextMenuRequest

🛈 DocStrings

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
class WebEngineContextMenuRequest:
    def __init__(self, item: QtWebEngineCore.QWebEngineContextMenuRequest):
        self.item = item

    def __getattr__(self, val):
        return getattr(self.item, val)

    def get_media_url(self) -> core.Url:
        return core.Url(self.item.mediaUrl())

    def get_link_url(self) -> core.Url:
        return core.Url(self.item.linkUrl())

    def get_media_type(self) -> MediaTypeStr:
        """Get media type."""
        return MEDIA_TYPES.inverse[self.item.mediaType()]

    def get_media_flags(self) -> list[MediaFlagStr]:
        """Get media flags."""
        return MEDIA_FLAGS.get_list(self.item.mediaFlags())

    def get_edit_flags(self) -> list[EditFlagStr]:
        """Get edit flags."""
        return EDIT_FLAGS.get_list(self.item.editFlags())

    def can_undo(self) -> bool:
        """Returns whether undo is possible."""
        return bool(mod.EditFlag.CanUndo & self.item.editFlags())

    def can_redo(self) -> bool:
        """Returns whether redo is possible."""
        return bool(mod.EditFlag.CanRedo & self.item.editFlags())

    def can_cut(self) -> bool:
        """Returns whether cut is possible."""
        return bool(mod.EditFlag.CanCut & self.item.editFlags())

    def can_copy(self) -> bool:
        """Returns whether copy is possible."""
        return bool(mod.EditFlag.CanCopy & self.item.editFlags())

    def can_paste(self) -> bool:
        """Returns whether paste is possible."""
        return bool(mod.EditFlag.CanPaste & self.item.editFlags())

    def can_delete(self) -> bool:
        """Returns whether delete is possible."""
        return bool(mod.EditFlag.CanDelete & self.item.editFlags())

    def can_select_all(self) -> bool:
        """Returns whether select_all is possible."""
        return bool(mod.EditFlag.CanSelectAll & self.item.editFlags())

    def can_translate(self) -> bool:
        """Returns whether translate is possible."""
        return bool(mod.EditFlag.CanTranslate & self.item.editFlags())

    def can_edit_richly(self) -> bool:
        """Returns whether edit_richly is possible."""
        return bool(mod.EditFlag.CanEditRichly & self.item.editFlags())

can_copy() -> bool

Returns whether copy is possible.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def can_copy(self) -> bool:
    """Returns whether copy is possible."""
    return bool(mod.EditFlag.CanCopy & self.item.editFlags())

can_cut() -> bool

Returns whether cut is possible.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def can_cut(self) -> bool:
    """Returns whether cut is possible."""
    return bool(mod.EditFlag.CanCut & self.item.editFlags())

can_delete() -> bool

Returns whether delete is possible.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def can_delete(self) -> bool:
    """Returns whether delete is possible."""
    return bool(mod.EditFlag.CanDelete & self.item.editFlags())

can_edit_richly() -> bool

Returns whether edit_richly is possible.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def can_edit_richly(self) -> bool:
    """Returns whether edit_richly is possible."""
    return bool(mod.EditFlag.CanEditRichly & self.item.editFlags())

can_paste() -> bool

Returns whether paste is possible.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def can_paste(self) -> bool:
    """Returns whether paste is possible."""
    return bool(mod.EditFlag.CanPaste & self.item.editFlags())

can_redo() -> bool

Returns whether redo is possible.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def can_redo(self) -> bool:
    """Returns whether redo is possible."""
    return bool(mod.EditFlag.CanRedo & self.item.editFlags())

can_select_all() -> bool

Returns whether select_all is possible.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def can_select_all(self) -> bool:
    """Returns whether select_all is possible."""
    return bool(mod.EditFlag.CanSelectAll & self.item.editFlags())

can_translate() -> bool

Returns whether translate is possible.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def can_translate(self) -> bool:
    """Returns whether translate is possible."""
    return bool(mod.EditFlag.CanTranslate & self.item.editFlags())

can_undo() -> bool

Returns whether undo is possible.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def can_undo(self) -> bool:
    """Returns whether undo is possible."""
    return bool(mod.EditFlag.CanUndo & self.item.editFlags())

get_edit_flags() -> list[EditFlagStr]

Get edit flags.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def get_edit_flags(self) -> list[EditFlagStr]:
    """Get edit flags."""
    return EDIT_FLAGS.get_list(self.item.editFlags())

get_media_flags() -> list[MediaFlagStr]

Get media flags.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def get_media_flags(self) -> list[MediaFlagStr]:
    """Get media flags."""
    return MEDIA_FLAGS.get_list(self.item.mediaFlags())

get_media_type() -> MediaTypeStr

Get media type.

Source code in prettyqt/webenginecore/webenginecontextmenurequest.py
def get_media_type(self) -> MediaTypeStr:
    """Get media type."""
    return MEDIA_TYPES.inverse[self.item.mediaType()]

:fa-brands-github: Show source on GitHub