Plugins
Plugin system based on libpeas. Plugins may implement multiple extension points, each providing specific functionality.
General design principals and rationale:
- Each extension is defined by an interface, so multiple may be implemented by one plugin
- Extensions provide access to context objects that plugins use to do real work, so that additional features can be added (to the context) without breaking existing implementations of an extension
- A context instance is created per plugin, so they can be disposed of when a plugin is deactivated
- Resources obtained from contexts are proxies for the underlying engine objects, so the API surface can be controlled and access restrictions enforced
- Resources are obtained from contexts via async methods, so that permission can be requested from people via a UI prompt before returning the resource
Notification Plugins
Requires access to inbound/outbound email, folders identities & metadata (but not email content), contacts, avatars.
Permissions:
- Folders
- Contacts
Email/Conversation Plugins
Requires access to individual email messages, their parts and contents.
Use cases
Drafts/Templates
- Display info bar when loaded (depending on folder?)
- Add action specific to the email to the info bar
- Execute command to edit message in composer when activated
Diffs
- Access email parts when loaded
- Add diff widget to email view
Calendar
- Access email parts when loaded
- Add calendar widget to email view
- Add action specific to the email to the info bar
- Execute DBus/external command to create calendar part
Prefer plain
- Access email parts when loaded
- Override default email body view
Permissions:
- Folders?
Folder Plugins
Use cases
Trash/Spam
- Display inforbar when selected
- Add action specific to a folder to the info bar
- Execute command to empty trash when action triggered
Templates
- Display inforbar when selected
- Add action (specific to a folder?) to the info bar
- Open augmented composer
ACL
- Register per-folder action
- Send commands to the server?
- Store/cache data?
Quota
Probably account-based, but may want to show per-folder storage use?
- Register per-folder action
- Send commands to the server?
- Store/cache data?
Permissions
- Folders (metadata, not email content)
- Server
UI hooks
Display infobar when a specific folder is selected. Should use a signal with a specific context argument so that they can be added without requiring state to be maintained.
Per folder actions can be added when folders added/removed/changed type - which is notified per by signals.
Folder action interface receives signal when action activated.