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    ImportSyncMetadata,
36    AllowedKinds,
37    ForceFullImport,
38    #[cfg(feature = "tracing")]
39    OtlpEndpoint,
40    #[cfg(feature = "profiling")]
41    PyroscopeEndpoint,
42    #[cfg(all(feature = "test", feature = "kobo"))]
43    EnableKernLog,
44    #[cfg(all(feature = "test", feature = "kobo"))]
45    EnableDbusLog,
46    /// Identity for a monolingual dictionary row, keyed by ISO 639-1 language code.
47    DictionaryInfo(String),
48    /// Summary row in the Reader category showing "regular / inverted".
49    RefreshRate,
50    /// Global refresh rate (regular, non-inverted page turns).
51    RefreshRateRegular,
52    /// Global refresh rate (inverted page turns).
53    RefreshRateInverted,
54    /// Per-kind refresh rate row in the Reader category list.
55    RefreshRateByKind(String),
56    /// Regular refresh rate inside a per-kind editor.
57    RefreshRateByKindRegular(String),
58    /// Inverted refresh rate inside a per-kind editor.
59    RefreshRateByKindInverted(String),
60    DitheredKinds,
61}