204 lines
5.5 KiB
Python
204 lines
5.5 KiB
Python
from izzylib.enum import IntEnum, StrEnum
|
|
|
|
|
|
__all__ = []
|
|
|
|
|
|
def register(enum):
|
|
__all__.append(enum.__name__)
|
|
return enum
|
|
|
|
|
|
@register
|
|
class BitwardenFieldType(IntEnum):
|
|
TEXT = 0
|
|
HIDDEN = 1
|
|
BOOLEAN = 2
|
|
|
|
|
|
@register
|
|
class BitwardenItemType(IntEnum):
|
|
LOGIN = 1
|
|
NOTE = 2
|
|
CARD = 3
|
|
IDENTITY = 4
|
|
|
|
|
|
@register
|
|
class BitwardenLoginType(IntEnum):
|
|
AUTHENTICATOR = 0
|
|
EMAIL = 1
|
|
YUBIKEY = 3
|
|
|
|
|
|
@register
|
|
class BitwardenTemplateType(StrEnum):
|
|
ITEM = 'item'
|
|
FIELD = 'item.field'
|
|
LOGIN = 'item.login'
|
|
URL = 'item.login.uri'
|
|
CARD = 'item.card'
|
|
IDENTITY = 'item.identity'
|
|
NOTE = 'item.securenote'
|
|
FOLDER = 'folder'
|
|
COLLECTION = 'collection'
|
|
ITEM_COLLECTION = 'item-collections'
|
|
ORG_COLLECTION = 'org-collection'
|
|
|
|
|
|
@register
|
|
class BitwardenUserStatusType(IntEnum):
|
|
INVITED = 0
|
|
ACCEPTED = 1
|
|
CONFIRMED = 2
|
|
|
|
|
|
@register
|
|
class BitwardenUserType(IntEnum):
|
|
OWNER = 0
|
|
ADMIN = 1
|
|
USER = 2
|
|
MANAGER = 3
|
|
|
|
|
|
@register
|
|
class BitwardenUrlMatchType(IntEnum):
|
|
DOMAIN = 0
|
|
HOST = 1
|
|
STARTS_WITH = 2
|
|
EXACT = 3
|
|
REGEX = 4
|
|
NEVER = 5
|
|
|
|
|
|
@register
|
|
class EditAction(StrEnum):
|
|
COPY = WebKit2.EDITING_COMMAND_COPY
|
|
LINK = WebKit2.EDITING_COMMAND_CREATE_LINK
|
|
CUT = WebKit2.EDITING_COMMAND_CUT
|
|
IMAGE = WebKit2.EDITING_COMMAND_INSERT_IMAGE
|
|
PASTE = WebKit2.EDITING_COMMAND_PASTE
|
|
PLAIN = WebKit2.EDITING_COMMAND_PASTE_AS_PLAIN_TEXT
|
|
REDO = WebKit2.EDITING_COMMAND_REDO
|
|
SELECT = WebKit2.EDITING_COMMAND_SELECT_ALL
|
|
UNDO = WebKit2.EDITING_COMMAND_UNDO
|
|
|
|
|
|
@register
|
|
class FileChooserAction(IntEnum):
|
|
OPEN = Gtk.FileChooserAction.OPEN
|
|
SAVE = Gtk.FileChooserAction.SAVE
|
|
|
|
|
|
@register
|
|
class FileChooserResponse(IntEnum):
|
|
NONE = Gtk.ResponseType.NONE
|
|
APPLY = Gtk.ResponseType.APPLY
|
|
HELP = Gtk.ResponseType.HELP
|
|
REJECT = Gtk.ResponseType.REJECT
|
|
ACCEPT = Gtk.ResponseType.ACCEPT
|
|
DELETE_EVENT = Gtk.ResponseType.DELETE_EVENT
|
|
OK = Gtk.ResponseType.OK
|
|
CANCEL = Gtk.ResponseType.CANCEL
|
|
CLOSE = Gtk.ResponseType.CLOSE
|
|
YES = Gtk.ResponseType.YES
|
|
NO = Gtk.ResponseType.NO
|
|
|
|
|
|
@register
|
|
class Javascript(StrEnum):
|
|
SELECTION = 'window.getSelection().toString()'
|
|
EXEC = 'window.execCommand("{}")'
|
|
PRINT = 'window.print()'
|
|
DESELECT = 'document.getSelection().removeAllRanges()'
|
|
DELETE = 'document.activeElement.setRangeText("")'
|
|
|
|
|
|
@register
|
|
class LibraryPage(StrEnum):
|
|
HOME = ''
|
|
BOOKMARKS = 'bookmarks'
|
|
DOWNLOADS = 'downloads'
|
|
HISTORY = 'history'
|
|
PASSWORDS = 'passwords'
|
|
SEARCH = 'search'
|
|
FEDIVERSE = 'fediverse'
|
|
EXTENSIONS = 'extensions'
|
|
PREFERENCES = 'preferences'
|
|
HELP = 'help'
|
|
|
|
|
|
@register
|
|
class NotificationPriority(IntEnum):
|
|
LOW = Notify.Urgency.LOW
|
|
NORMAL = Notify.Urgency.NORMAL
|
|
CRITICAL = Notify.Urgency.CRITICAL
|
|
|
|
|
|
@register
|
|
class StylePriority(IntEnum):
|
|
FALLBACK = Gtk.STYLE_PROVIDER_PRIORITY_FALLBACK #1
|
|
THEME = Gtk.STYLE_PROVIDER_PRIORITY_THEME #200
|
|
SETTINGS = Gtk.STYLE_PROVIDER_PRIORITY_SETTINGS #400
|
|
APPLICATION = Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION #600
|
|
USER = Gtk.STYLE_PROVIDER_PRIORITY_USER #800
|
|
|
|
|
|
@register
|
|
class WatcherChangeType(IntEnum):
|
|
CREATE = 1
|
|
MODIFY = 2
|
|
DELETE = 3
|
|
|
|
|
|
@register
|
|
class WebviewAccelPolicy(IntEnum):
|
|
DEMAND = WebKit2.HardwareAccelerationPolicy.ON_DEMAND
|
|
ALWAYS = WebKit2.HardwareAccelerationPolicy.ALWAYS
|
|
NEVER = WebKit2.HardwareAccelerationPolicy.NEVER
|
|
|
|
|
|
@register
|
|
class WebviewContextActions(IntEnum):
|
|
AUDIO_COPY = WebKit2.ContextMenuAction.COPY_AUDIO_LINK_TO_CLIPBOARD
|
|
AUDIO_DOWNLOAD = WebKit2.ContextMenuAction.DOWNLOAD_AUDIO_TO_DISK
|
|
FRAME_OPEN = WebKit2.ContextMenuAction.OPEN_FRAME_IN_NEW_WINDOW
|
|
AUDIO_TAB = WebKit2.ContextMenuAction.OPEN_AUDIO_IN_NEW_WINDOW
|
|
GO_BACK = WebKit2.ContextMenuAction.GO_BACK
|
|
GO_FORWARD = WebKit2.ContextMenuAction.GO_FORWARD
|
|
GO_RELOAD = WebKit2.ContextMenuAction.RELOAD
|
|
GO_STOP = WebKit2.ContextMenuAction.STOP
|
|
IMAGE_COPY = WebKit2.ContextMenuAction.COPY_IMAGE_URL_TO_CLIPBOARD
|
|
IMAGE_COPY_FULL = WebKit2.ContextMenuAction.COPY_IMAGE_TO_CLIPBOARD
|
|
IMAGE_DOWNLOAD = WebKit2.ContextMenuAction.DOWNLOAD_IMAGE_TO_DISK
|
|
IMAGE_TAB = WebKit2.ContextMenuAction.OPEN_IMAGE_IN_NEW_WINDOW
|
|
INSPECT = WebKit2.ContextMenuAction.INSPECT_ELEMENT
|
|
LINK_COPY = WebKit2.ContextMenuAction.COPY_LINK_TO_CLIPBOARD
|
|
LINK_DOWNLOAD = WebKit2.ContextMenuAction.DOWNLOAD_LINK_TO_DISK
|
|
LINK_OPEN = WebKit2.ContextMenuAction.OPEN_LINK
|
|
LINK_TAB = WebKit2.ContextMenuAction.OPEN_LINK_IN_NEW_WINDOW
|
|
MEDIA_TOGGLE = WebKit2.ContextMenuAction.TOGGLE_MEDIA_CONTROLS
|
|
MEDIA_MUTE = WebKit2.ContextMenuAction.MEDIA_MUTE
|
|
MEDIA_LOOP = WebKit2.ContextMenuAction.TOGGLE_MEDIA_LOOP
|
|
MEDIA_PAUSE = WebKit2.ContextMenuAction.MEDIA_PAUSE
|
|
MEDIA_PLAY = WebKit2.ContextMenuAction.MEDIA_PLAY
|
|
SPELL_ADD = WebKit2.ContextMenuAction.LEARN_SPELLING
|
|
SPELL_GUESS = WebKit2.ContextMenuAction.SPELLING_GUESS
|
|
SPELL_IGNORE_GRAMMAR = WebKit2.ContextMenuAction.IGNORE_GRAMMAR
|
|
SPELL_IGNORE = WebKit2.ContextMenuAction.IGNORE_SPELLING
|
|
SPELL_NO_GUESS = WebKit2.ContextMenuAction.NO_GUESSES_FOUND
|
|
TEXT_BOLD = WebKit2.ContextMenuAction.BOLD
|
|
TEXT_COPY = WebKit2.ContextMenuAction.COPY
|
|
TEXT_CUT = WebKit2.ContextMenuAction.CUT
|
|
TEXT_DELETE = WebKit2.ContextMenuAction.DELETE
|
|
TEXT_EMOJI = WebKit2.ContextMenuAction.INSERT_EMOJI
|
|
TEXT_ITALIC = WebKit2.ContextMenuAction.ITALIC
|
|
TEXT_PASTE = WebKit2.ContextMenuAction.PASTE
|
|
TEXT_PASTE_PLAIN = WebKit2.ContextMenuAction.PASTE_AS_PLAIN_TEXT
|
|
TEXT_SELECT = WebKit2.ContextMenuAction.SELECT_ALL
|
|
TEXT_UNDERLINE = WebKit2.ContextMenuAction.UNDERLINE
|
|
VIDEO_COPY = WebKit2.ContextMenuAction.COPY_VIDEO_LINK_TO_CLIPBOARD
|
|
VIDEO_DOWNLOAD = WebKit2.ContextMenuAction.DOWNLOAD_VIDEO_TO_DISK
|
|
VIDEO_FULLSCREEN = WebKit2.ContextMenuAction.ENTER_VIDEO_FULLSCREEN
|
|
VIDEO_TAB = WebKit2.ContextMenuAction.OPEN_VIDEO_IN_NEW_WINDOW
|