/ src / settings-ui / Settings.UI.Library / KeyboardManagerProfile.cs
KeyboardManagerProfile.cs
 1  // Copyright (c) Microsoft Corporation
 2  // The Microsoft Corporation licenses this file to you under the MIT license.
 3  // See the LICENSE file in the project root for more information.
 4  
 5  using System.Text.Json;
 6  using System.Text.Json.Serialization;
 7  
 8  using Microsoft.PowerToys.Settings.UI.Library.Interfaces;
 9  
10  namespace Microsoft.PowerToys.Settings.UI.Library
11  {
12      public class KeyboardManagerProfile : ISettingsConfig
13      {
14          [JsonPropertyName("remapKeys")]
15          public RemapKeysDataModel RemapKeys { get; set; }
16  
17          [JsonPropertyName("remapKeysToText")]
18          public RemapKeysDataModel RemapKeysToText { get; set; }
19  
20          [JsonPropertyName("remapShortcuts")]
21          public ShortcutsKeyDataModel RemapShortcuts { get; set; }
22  
23          [JsonPropertyName("remapShortcutsToText")]
24          public ShortcutsKeyDataModel RemapShortcutsToText { get; set; }
25  
26          public KeyboardManagerProfile()
27          {
28              RemapKeys = new RemapKeysDataModel();
29              RemapKeysToText = new RemapKeysDataModel();
30  
31              RemapShortcuts = new ShortcutsKeyDataModel();
32              RemapShortcutsToText = new ShortcutsKeyDataModel();
33          }
34  
35          public string ToJsonString()
36          {
37              return JsonSerializer.Serialize(this, SettingsSerializationContext.Default.KeyboardManagerProfile);
38          }
39  
40          public string GetModuleName()
41          {
42              return KeyboardManagerSettings.ModuleName;
43          }
44  
45          // This can be utilized in the future if the default.json file is to be modified/deleted.
46          public bool UpgradeSettingsConfiguration()
47          {
48              return false;
49          }
50      }
51  }