Skip to main content

cadmus_core/view/settings_editor/kinds/
identity.rs

1//! Single, deduplicated identity enum for all settings.
2//!
3//! This replaces the two parallel `Kind` enums that previously existed in
4//! `setting_row` and `setting_value`.  It is only used to route
5//! [`SettingsEvent::UpdateValue`](crate::view::settings_editor::SettingsEvent)
6//! events to the correct view — the view layer itself contains no per-setting
7//! match arms.
8
9/// Identifies a specific setting value view for targeted updates.
10///
11/// Used in [`SettingsEvent::UpdateValue`](crate::view::settings_editor::SettingsEvent)
12/// so that [`CategoryEditor`](crate::view::settings_editor::CategoryEditor) can tell
13/// exactly which [`SettingValue`](crate::view::settings_editor::SettingValue) to
14/// refresh after a setting changes.
15#[derive(Debug, Clone, PartialEq, Eq)]
16pub enum SettingIdentity {
17    KeyboardLayout,
18    Locale,
19    AutoSuspend,
20    AutoPowerOff,
21    SleepCover,
22    AutoShare,
23    ButtonScheme,
24    LoggingEnabled,
25    FinishedAction,
26    LibraryInfo(usize),
27    LibraryName(usize),
28    LibraryPath(usize),
29    LibraryFinishedAction(usize),
30    IntermissionSuspend,
31    IntermissionPowerOff,
32    IntermissionShare,
33    SettingsRetention,
34    LogLevel,
35    ImportStartupTrigger,
36    ImportSyncMetadata,
37    #[cfg(feature = "tracing")]
38    OtlpEndpoint,
39    #[cfg(feature = "profiling")]
40    PyroscopeEndpoint,
41    #[cfg(all(feature = "test", feature = "kobo"))]
42    EnableKernLog,
43    #[cfg(all(feature = "test", feature = "kobo"))]
44    EnableDbusLog,
45    /// Identity for a monolingual dictionary row, keyed by ISO 639-1 language code.
46    DictionaryInfo(String),
47    /// Summary row in the Reader category showing "regular / inverted".
48    RefreshRate,
49    /// Global refresh rate (regular, non-inverted page turns).
50    RefreshRateRegular,
51    /// Global refresh rate (inverted page turns).
52    RefreshRateInverted,
53    /// Per-kind refresh rate row in the Reader category list.
54    RefreshRateByKind(String),
55    /// Regular refresh rate inside a per-kind editor.
56    RefreshRateByKindRegular(String),
57    /// Inverted refresh rate inside a per-kind editor.
58    RefreshRateByKindInverted(String),
59}