Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
406
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 16.57 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Runtime.CompilerServices;
  4. using System.Threading.Tasks;
  5. using Tmds.DBus;
  6.  
  7. [assembly: InternalsVisibleTo(Tmds.DBus.Connection.DynamicAssemblyName)]
  8. namespace Klipper.DBus
  9. {
  10.     [DBusInterface("org.kde.JobViewServer")]
  11.     interface IJobViewServer : IDBusObject
  12.     {
  13.         Task<ObjectPath> requestViewAsync(string AppName, string AppIconName, int Capabilities);
  14.     }
  15.  
  16.     [DBusInterface("org.kde.libkonq.FileUndoManager")]
  17.     interface IFileUndoManager : IDBusObject
  18.     {
  19.         Task<byte[]> getAsync();
  20.         Task<IDisposable> WatchlockAsync(Action handler, Action<Exception> onError = null);
  21.         Task<IDisposable> WatchpopAsync(Action handler, Action<Exception> onError = null);
  22.         Task<IDisposable> WatchpushAsync(Action<byte[]> handler, Action<Exception> onError = null);
  23.         Task<IDisposable> WatchunlockAsync(Action handler, Action<Exception> onError = null);
  24.     }
  25.  
  26.     [DBusInterface("org.qtproject.Qt.QApplication")]
  27.     interface IQApplication : IDBusObject
  28.     {
  29.         Task setStyleSheetAsync(string Sheet);
  30.         Task setAutoSipEnabledAsync(bool Enabled);
  31.         Task<bool> autoSipEnabledAsync();
  32.         Task closeAllWindowsAsync();
  33.         Task aboutQtAsync();
  34.         Task<T> GetAsync<T>(string prop);
  35.         Task<QApplicationProperties> GetAllAsync();
  36.         Task SetAsync(string prop, object val);
  37.         Task<IDisposable> WatchPropertiesAsync(Action<PropertyChanges> handler);
  38.     }
  39.  
  40.     [Dictionary]
  41.     class QApplicationProperties
  42.     {
  43.         private int _cursorFlashTime = default(int);
  44.         public int CursorFlashTime
  45.         {
  46.             get
  47.             {
  48.                 return _cursorFlashTime;
  49.             }
  50.  
  51.             set
  52.             {
  53.                 _cursorFlashTime = (value);
  54.             }
  55.         }
  56.  
  57.         private int _doubleClickInterval = default(int);
  58.         public int DoubleClickInterval
  59.         {
  60.             get
  61.             {
  62.                 return _doubleClickInterval;
  63.             }
  64.  
  65.             set
  66.             {
  67.                 _doubleClickInterval = (value);
  68.             }
  69.         }
  70.  
  71.         private int _keyboardInputInterval = default(int);
  72.         public int KeyboardInputInterval
  73.         {
  74.             get
  75.             {
  76.                 return _keyboardInputInterval;
  77.             }
  78.  
  79.             set
  80.             {
  81.                 _keyboardInputInterval = (value);
  82.             }
  83.         }
  84.  
  85.         private int _wheelScrollLines = default(int);
  86.         public int WheelScrollLines
  87.         {
  88.             get
  89.             {
  90.                 return _wheelScrollLines;
  91.             }
  92.  
  93.             set
  94.             {
  95.                 _wheelScrollLines = (value);
  96.             }
  97.         }
  98.  
  99.         private (int, int) _globalStrut = default((int, int));
  100.         public (int, int) GlobalStrut
  101.         {
  102.             get
  103.             {
  104.                 return _globalStrut;
  105.             }
  106.  
  107.             set
  108.             {
  109.                 _globalStrut = (value);
  110.             }
  111.         }
  112.  
  113.         private int _startDragTime = default(int);
  114.         public int StartDragTime
  115.         {
  116.             get
  117.             {
  118.                 return _startDragTime;
  119.             }
  120.  
  121.             set
  122.             {
  123.                 _startDragTime = (value);
  124.             }
  125.         }
  126.  
  127.         private int _startDragDistance = default(int);
  128.         public int StartDragDistance
  129.         {
  130.             get
  131.             {
  132.                 return _startDragDistance;
  133.             }
  134.  
  135.             set
  136.             {
  137.                 _startDragDistance = (value);
  138.             }
  139.         }
  140.  
  141.         private string _styleSheet = default(string);
  142.         public string StyleSheet
  143.         {
  144.             get
  145.             {
  146.                 return _styleSheet;
  147.             }
  148.  
  149.             set
  150.             {
  151.                 _styleSheet = (value);
  152.             }
  153.         }
  154.  
  155.         private bool _autoSipEnabled = default(bool);
  156.         public bool AutoSipEnabled
  157.         {
  158.             get
  159.             {
  160.                 return _autoSipEnabled;
  161.             }
  162.  
  163.             set
  164.             {
  165.                 _autoSipEnabled = (value);
  166.             }
  167.         }
  168.     }
  169.  
  170.     static class QApplicationExtensions
  171.     {
  172.         public static Task<int> GetCursorFlashTimeAsync(this IQApplication o) => o.GetAsync<int>("cursorFlashTime");
  173.         public static Task<int> GetDoubleClickIntervalAsync(this IQApplication o) => o.GetAsync<int>("doubleClickInterval");
  174.         public static Task<int> GetKeyboardInputIntervalAsync(this IQApplication o) => o.GetAsync<int>("keyboardInputInterval");
  175.         public static Task<int> GetWheelScrollLinesAsync(this IQApplication o) => o.GetAsync<int>("wheelScrollLines");
  176.         public static Task<(int, int)> GetGlobalStrutAsync(this IQApplication o) => o.GetAsync<(int, int)>("globalStrut");
  177.         public static Task<int> GetStartDragTimeAsync(this IQApplication o) => o.GetAsync<int>("startDragTime");
  178.         public static Task<int> GetStartDragDistanceAsync(this IQApplication o) => o.GetAsync<int>("startDragDistance");
  179.         public static Task<string> GetStyleSheetAsync(this IQApplication o) => o.GetAsync<string>("styleSheet");
  180.         public static Task<bool> GetAutoSipEnabledAsync(this IQApplication o) => o.GetAsync<bool>("autoSipEnabled");
  181.         public static Task SetCursorFlashTimeAsync(this IQApplication o, int val) => o.SetAsync("cursorFlashTime", val);
  182.         public static Task SetDoubleClickIntervalAsync(this IQApplication o, int val) => o.SetAsync("doubleClickInterval", val);
  183.         public static Task SetKeyboardInputIntervalAsync(this IQApplication o, int val) => o.SetAsync("keyboardInputInterval", val);
  184.         public static Task SetWheelScrollLinesAsync(this IQApplication o, int val) => o.SetAsync("wheelScrollLines", val);
  185.         public static Task SetGlobalStrutAsync(this IQApplication o, (int, int) val) => o.SetAsync("globalStrut", val);
  186.         public static Task SetStartDragTimeAsync(this IQApplication o, int val) => o.SetAsync("startDragTime", val);
  187.         public static Task SetStartDragDistanceAsync(this IQApplication o, int val) => o.SetAsync("startDragDistance", val);
  188.         public static Task SetStyleSheetAsync(this IQApplication o, string val) => o.SetAsync("styleSheet", val);
  189.         public static Task SetAutoSipEnabledAsync(this IQApplication o, bool val) => o.SetAsync("autoSipEnabled", val);
  190.     }
  191.  
  192.     [DBusInterface("org.qtproject.Qt.QGuiApplication")]
  193.     interface IQGuiApplication : IDBusObject
  194.     {
  195.         Task<T> GetAsync<T>(string prop);
  196.         Task<QGuiApplicationProperties> GetAllAsync();
  197.         Task SetAsync(string prop, object val);
  198.         Task<IDisposable> WatchPropertiesAsync(Action<PropertyChanges> handler);
  199.     }
  200.  
  201.     [Dictionary]
  202.     class QGuiApplicationProperties
  203.     {
  204.         private string _applicationDisplayName = default(string);
  205.         public string ApplicationDisplayName
  206.         {
  207.             get
  208.             {
  209.                 return _applicationDisplayName;
  210.             }
  211.  
  212.             set
  213.             {
  214.                 _applicationDisplayName = (value);
  215.             }
  216.         }
  217.  
  218.         private string _desktopFileName = default(string);
  219.         public string DesktopFileName
  220.         {
  221.             get
  222.             {
  223.                 return _desktopFileName;
  224.             }
  225.  
  226.             set
  227.             {
  228.                 _desktopFileName = (value);
  229.             }
  230.         }
  231.  
  232.         private int _layoutDirection = default(int);
  233.         public int LayoutDirection
  234.         {
  235.             get
  236.             {
  237.                 return _layoutDirection;
  238.             }
  239.  
  240.             set
  241.             {
  242.                 _layoutDirection = (value);
  243.             }
  244.         }
  245.  
  246.         private string _platformName = default(string);
  247.         public string PlatformName
  248.         {
  249.             get
  250.             {
  251.                 return _platformName;
  252.             }
  253.  
  254.             set
  255.             {
  256.                 _platformName = (value);
  257.             }
  258.         }
  259.  
  260.         private bool _quitOnLastWindowClosed = default(bool);
  261.         public bool QuitOnLastWindowClosed
  262.         {
  263.             get
  264.             {
  265.                 return _quitOnLastWindowClosed;
  266.             }
  267.  
  268.             set
  269.             {
  270.                 _quitOnLastWindowClosed = (value);
  271.             }
  272.         }
  273.     }
  274.  
  275.     static class QGuiApplicationExtensions
  276.     {
  277.         public static Task<string> GetApplicationDisplayNameAsync(this IQGuiApplication o) => o.GetAsync<string>("applicationDisplayName");
  278.         public static Task<string> GetDesktopFileNameAsync(this IQGuiApplication o) => o.GetAsync<string>("desktopFileName");
  279.         public static Task<int> GetLayoutDirectionAsync(this IQGuiApplication o) => o.GetAsync<int>("layoutDirection");
  280.         public static Task<string> GetPlatformNameAsync(this IQGuiApplication o) => o.GetAsync<string>("platformName");
  281.         public static Task<bool> GetQuitOnLastWindowClosedAsync(this IQGuiApplication o) => o.GetAsync<bool>("quitOnLastWindowClosed");
  282.         public static Task SetApplicationDisplayNameAsync(this IQGuiApplication o, string val) => o.SetAsync("applicationDisplayName", val);
  283.         public static Task SetDesktopFileNameAsync(this IQGuiApplication o, string val) => o.SetAsync("desktopFileName", val);
  284.         public static Task SetLayoutDirectionAsync(this IQGuiApplication o, int val) => o.SetAsync("layoutDirection", val);
  285.         public static Task SetQuitOnLastWindowClosedAsync(this IQGuiApplication o, bool val) => o.SetAsync("quitOnLastWindowClosed", val);
  286.     }
  287.  
  288.     [DBusInterface("org.qtproject.Qt.QCoreApplication")]
  289.     interface IQCoreApplication : IDBusObject
  290.     {
  291.         Task quitAsync();
  292.         Task<T> GetAsync<T>(string prop);
  293.         Task<QCoreApplicationProperties> GetAllAsync();
  294.         Task SetAsync(string prop, object val);
  295.         Task<IDisposable> WatchPropertiesAsync(Action<PropertyChanges> handler);
  296.     }
  297.  
  298.     [Dictionary]
  299.     class QCoreApplicationProperties
  300.     {
  301.         private string _applicationName = default(string);
  302.         public string ApplicationName
  303.         {
  304.             get
  305.             {
  306.                 return _applicationName;
  307.             }
  308.  
  309.             set
  310.             {
  311.                 _applicationName = (value);
  312.             }
  313.         }
  314.  
  315.         private string _applicationVersion = default(string);
  316.         public string ApplicationVersion
  317.         {
  318.             get
  319.             {
  320.                 return _applicationVersion;
  321.             }
  322.  
  323.             set
  324.             {
  325.                 _applicationVersion = (value);
  326.             }
  327.         }
  328.  
  329.         private string _organizationName = default(string);
  330.         public string OrganizationName
  331.         {
  332.             get
  333.             {
  334.                 return _organizationName;
  335.             }
  336.  
  337.             set
  338.             {
  339.                 _organizationName = (value);
  340.             }
  341.         }
  342.  
  343.         private string _organizationDomain = default(string);
  344.         public string OrganizationDomain
  345.         {
  346.             get
  347.             {
  348.                 return _organizationDomain;
  349.             }
  350.  
  351.             set
  352.             {
  353.                 _organizationDomain = (value);
  354.             }
  355.         }
  356.  
  357.         private bool _quitLockEnabled = default(bool);
  358.         public bool QuitLockEnabled
  359.         {
  360.             get
  361.             {
  362.                 return _quitLockEnabled;
  363.             }
  364.  
  365.             set
  366.             {
  367.                 _quitLockEnabled = (value);
  368.             }
  369.         }
  370.     }
  371.  
  372.     static class QCoreApplicationExtensions
  373.     {
  374.         public static Task<string> GetApplicationNameAsync(this IQCoreApplication o) => o.GetAsync<string>("applicationName");
  375.         public static Task<string> GetApplicationVersionAsync(this IQCoreApplication o) => o.GetAsync<string>("applicationVersion");
  376.         public static Task<string> GetOrganizationNameAsync(this IQCoreApplication o) => o.GetAsync<string>("organizationName");
  377.         public static Task<string> GetOrganizationDomainAsync(this IQCoreApplication o) => o.GetAsync<string>("organizationDomain");
  378.         public static Task<bool> GetQuitLockEnabledAsync(this IQCoreApplication o) => o.GetAsync<bool>("quitLockEnabled");
  379.         public static Task SetApplicationNameAsync(this IQCoreApplication o, string val) => o.SetAsync("applicationName", val);
  380.         public static Task SetApplicationVersionAsync(this IQCoreApplication o, string val) => o.SetAsync("applicationVersion", val);
  381.         public static Task SetOrganizationNameAsync(this IQCoreApplication o, string val) => o.SetAsync("organizationName", val);
  382.         public static Task SetOrganizationDomainAsync(this IQCoreApplication o, string val) => o.SetAsync("organizationDomain", val);
  383.         public static Task SetQuitLockEnabledAsync(this IQCoreApplication o, bool val) => o.SetAsync("quitLockEnabled", val);
  384.     }
  385.  
  386.     [DBusInterface("org.kde.PlasmaShell")]
  387.     interface IPlasmaShell : IDBusObject
  388.     {
  389.         Task toggleDashboardAsync();
  390.         Task toggleActivityManagerAsync();
  391.         Task toggleWidgetExplorerAsync();
  392.         Task setDashboardShownAsync(bool Show);
  393.         Task showInteractiveConsoleAsync();
  394.         Task loadScriptInInteractiveConsoleAsync(string Script);
  395.         Task showInteractiveKWinConsoleAsync();
  396.         Task loadKWinScriptInInteractiveConsoleAsync(string Script);
  397.         Task evaluateScriptAsync(string Script);
  398.         Task<byte[]> dumpCurrentLayoutJSAsync();
  399.         Task loadLookAndFeelDefaultLayoutAsync(string Layout);
  400.         Task activateLauncherMenuAsync();
  401.     }
  402.  
  403.     [DBusInterface("org.kde.klipper.klipper")]
  404.     interface IKlipper : IDBusObject
  405.     {
  406.         Task<string> getClipboardContentsAsync();
  407.         Task setClipboardContentsAsync(string S);
  408.         Task clearClipboardContentsAsync();
  409.         Task clearClipboardHistoryAsync();
  410.         Task saveClipboardHistoryAsync();
  411.         Task<string[]> getClipboardHistoryMenuAsync();
  412.         Task<string> getClipboardHistoryItemAsync(int I);
  413.         Task showKlipperPopupMenuAsync();
  414.         Task showKlipperManuallyInvokeActionMenuAsync();
  415.     }
  416.  
  417.     [DBusInterface("org.freedesktop.Notifications")]
  418.     interface INotifications : IDBusObject
  419.     {
  420.         Task<uint> NotifyAsync(string AppName, uint ReplacesId, string AppIcon, string Summary, string Body, string[] Actions, IDictionary<string, object> Hints, int Timeout);
  421.         Task CloseNotificationAsync(uint Id);
  422.         Task<string[]> GetCapabilitiesAsync();
  423.         Task<(string name, string vendor, string version, string specVersion)> GetServerInformationAsync();
  424.         Task<IDisposable> WatchNotificationClosedAsync(Action<(uint id, uint reason)> handler, Action<Exception> onError = null);
  425.         Task<IDisposable> WatchActionInvokedAsync(Action<(uint id, string actionKey)> handler, Action<Exception> onError = null);
  426.     }
  427.  
  428.     [DBusInterface("org.kde.osdService")]
  429.     interface IOsdService : IDBusObject
  430.     {
  431.         Task brightnessChangedAsync(int Percent);
  432.         Task keyboardBrightnessChangedAsync(int Percent);
  433.         Task volumeChangedAsync(int Percent);
  434.         Task microphoneVolumeChangedAsync(int Percent);
  435.         Task mediaPlayerVolumeChangedAsync(int Percent, string PlayerName, string PlayerIconName);
  436.         Task kbdLayoutChangedAsync(string LayoutName);
  437.         Task virtualDesktopChangedAsync(string CurrentVirtualDesktopName);
  438.         Task touchpadEnabledChangedAsync(bool TouchpadEnabled);
  439.         Task wifiEnabledChangedAsync(bool WifiEnabled);
  440.         Task bluetoothEnabledChangedAsync(bool BluetoothEnabled);
  441.         Task wwanEnabledChangedAsync(bool WwanEnabled);
  442.         Task virtualKeyboardEnabledChangedAsync(bool VirtualKeyboardEnabled);
  443.         Task showTextAsync(string Icon, string Text);
  444.         Task<IDisposable> WatchosdProgressAsync(Action<(string icon, int percent, string additionalText)> handler, Action<Exception> onError = null);
  445.         Task<IDisposable> WatchosdTextAsync(Action<(string icon, string text)> handler, Action<Exception> onError = null);
  446.     }
  447.  
  448.     [DBusInterface("org.freedesktop.Application")]
  449.     interface IApplication : IDBusObject
  450.     {
  451.         Task ActivateAsync(IDictionary<string, object> PlatformData);
  452.         Task OpenAsync(string[] Uris, IDictionary<string, object> PlatformData);
  453.         Task ActivateActionAsync(string ActionName, object[] Parameter, IDictionary<string, object> PlatformData);
  454.     }
  455.  
  456.     [DBusInterface("org.kde.KDBusService")]
  457.     interface IKDBusService : IDBusObject
  458.     {
  459.         Task<int> CommandLineAsync(string[] Arguments, string WorkingDir, IDictionary<string, object> PlatformData);
  460.     }
  461. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement