|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +/** |
| 6 | + * SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors |
| 7 | + * SPDX-License-Identifier: AGPL-3.0-or-later |
| 8 | + */ |
| 9 | + |
| 10 | +namespace OCA\Text; |
| 11 | + |
| 12 | +use OCP\Config\Lexicon\Entry; |
| 13 | +use OCP\Config\Lexicon\ILexicon; |
| 14 | +use OCP\Config\Lexicon\Strictness; |
| 15 | +use OCP\Config\ValueType; |
| 16 | + |
| 17 | +class ConfigLexicon implements ILexicon { |
| 18 | + public function getStrictness(): Strictness { |
| 19 | + return Strictness::WARNING; |
| 20 | + } |
| 21 | + |
| 22 | + public function getAppConfigs(): array { |
| 23 | + return [ |
| 24 | + new Entry( |
| 25 | + key: 'default_file_extension', |
| 26 | + type: ValueType::STRING, |
| 27 | + defaultRaw: 'md', |
| 28 | + definition: 'Default file extension for new text files (usually `md` or `txt`)', |
| 29 | + lazy: false, |
| 30 | + ), |
| 31 | + new Entry( |
| 32 | + key: 'open_read_only_enabled', |
| 33 | + type: ValueType::BOOL, |
| 34 | + defaultRaw: false, |
| 35 | + definition: 'Whether files are opened in read-only mode per default', |
| 36 | + lazy: false, |
| 37 | + ), |
| 38 | + new Entry( |
| 39 | + key: 'rich_editing_enabled', |
| 40 | + type: ValueType::BOOL, |
| 41 | + defaultRaw: true, |
| 42 | + definition: 'Whether rich editing is enabled', |
| 43 | + lazy: false, |
| 44 | + ), |
| 45 | + new Entry( |
| 46 | + key: 'workspace_available', |
| 47 | + type: ValueType::BOOL, |
| 48 | + defaultRaw: true, |
| 49 | + definition: 'Whether folder descriptions are available', |
| 50 | + lazy: false, |
| 51 | + ), |
| 52 | + new Entry( |
| 53 | + key: 'notify_push', |
| 54 | + type: ValueType::BOOL, |
| 55 | + defaultRaw: true, |
| 56 | + definition: 'Whether notify_push is used for real-time synchronization', |
| 57 | + lazy: false, |
| 58 | + ), |
| 59 | + new Entry( |
| 60 | + key: 'offline_readonly_delay', |
| 61 | + type: ValueType::INT, |
| 62 | + defaultRaw: 5 * 60, |
| 63 | + definition: 'Delay before editor switches to read-onl when offline (in seconds)', |
| 64 | + lazy: false, |
| 65 | + ), |
| 66 | + ]; |
| 67 | + } |
| 68 | + |
| 69 | + public function getUserConfigs(): array { |
| 70 | + return [ |
| 71 | + new Entry( |
| 72 | + key: 'workspace_enabled', |
| 73 | + type: ValueType::BOOL, |
| 74 | + defaultRaw: true, |
| 75 | + definition: 'Whether folder description is enabled for the user', |
| 76 | + lazy: false, |
| 77 | + ), |
| 78 | + new Entry( |
| 79 | + key: 'is_full_width_editor', |
| 80 | + type: ValueType::BOOL, |
| 81 | + defaultRaw: false, |
| 82 | + definition: 'Whether the editor should be displayed in full width mode', |
| 83 | + lazy: false, |
| 84 | + ), |
| 85 | + ]; |
| 86 | + } |
| 87 | +} |
0 commit comments