-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
//! This file has been automatically generated by `objc2`'s `header-translator`. | ||
//! DO NOT EDIT | ||
use crate::common::*; | ||
use crate::Foundation::*; | ||
use crate::ServiceManagement::*; | ||
|
||
ns_enum!( | ||
#[underlying(NSInteger)] | ||
pub enum SMAppServiceStatus { | ||
SMAppServiceStatusNotRegistered = 0, | ||
SMAppServiceStatusEnabled = 1, | ||
SMAppServiceStatusRequiresApproval = 2, | ||
SMAppServiceStatusNotFound = 3, | ||
} | ||
); | ||
|
||
extern_class!( | ||
#[derive(Debug, PartialEq, Eq, Hash)] | ||
#[cfg(feature = "ServiceManagement_SMAppService")] | ||
pub struct SMAppService; | ||
|
||
#[cfg(feature = "ServiceManagement_SMAppService")] | ||
unsafe impl ClassType for SMAppService { | ||
type Super = NSObject; | ||
type Mutability = InteriorMutable; | ||
} | ||
); | ||
|
||
#[cfg(feature = "ServiceManagement_SMAppService")] | ||
unsafe impl NSObjectProtocol for SMAppService {} | ||
|
||
extern_methods!( | ||
#[cfg(feature = "ServiceManagement_SMAppService")] | ||
unsafe impl SMAppService { | ||
#[cfg(feature = "Foundation_NSString")] | ||
#[method_id(@__retain_semantics Other loginItemServiceWithIdentifier:)] | ||
pub unsafe fn loginItemServiceWithIdentifier(identifier: &NSString) -> Id<Self>; | ||
|
||
#[method_id(@__retain_semantics Other mainAppService)] | ||
pub unsafe fn mainAppService() -> Id<SMAppService>; | ||
|
||
#[cfg(feature = "Foundation_NSString")] | ||
#[method_id(@__retain_semantics Other agentServiceWithPlistName:)] | ||
pub unsafe fn agentServiceWithPlistName(plist_name: &NSString) -> Id<Self>; | ||
|
||
#[cfg(feature = "Foundation_NSString")] | ||
#[method_id(@__retain_semantics Other daemonServiceWithPlistName:)] | ||
pub unsafe fn daemonServiceWithPlistName(plist_name: &NSString) -> Id<Self>; | ||
|
||
#[cfg(feature = "Foundation_NSError")] | ||
#[method(registerAndReturnError:_)] | ||
pub unsafe fn registerAndReturnError(&self) -> Result<(), Id<NSError>>; | ||
|
||
#[cfg(feature = "Foundation_NSError")] | ||
#[method(unregisterAndReturnError:_)] | ||
pub unsafe fn unregisterAndReturnError(&self) -> Result<(), Id<NSError>>; | ||
|
||
#[cfg(feature = "Foundation_NSError")] | ||
#[method(unregisterWithCompletionHandler:)] | ||
pub unsafe fn unregisterWithCompletionHandler(&self, handler: &Block<(*mut NSError,), ()>); | ||
|
||
#[method(status)] | ||
pub unsafe fn status(&self) -> SMAppServiceStatus; | ||
|
||
#[cfg(feature = "Foundation_NSURL")] | ||
#[method(statusForLegacyURL:)] | ||
pub unsafe fn statusForLegacyURL(url: &NSURL) -> SMAppServiceStatus; | ||
|
||
#[method(openSystemSettingsLoginItems)] | ||
pub unsafe fn openSystemSettingsLoginItems(); | ||
} | ||
); | ||
|
||
extern_methods!( | ||
/// Methods declared on superclass `NSObject` | ||
#[cfg(feature = "ServiceManagement_SMAppService")] | ||
unsafe impl SMAppService { | ||
#[method_id(@__retain_semantics Init init)] | ||
pub unsafe fn init(this: Allocated<Self>) -> Id<Self>; | ||
|
||
#[method_id(@__retain_semantics New new)] | ||
pub unsafe fn new() -> Id<Self>; | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//! This file has been automatically generated by `objc2`'s `header-translator`. | ||
//! DO NOT EDIT | ||
use crate::common::*; | ||
use crate::Foundation::*; | ||
use crate::ServiceManagement::*; | ||
|
||
extern_enum!( | ||
#[underlying(c_uint)] | ||
pub enum __anonymous__ { | ||
kSMErrorInternalFailure = 2, | ||
kSMErrorInvalidSignature = 3, | ||
kSMErrorAuthorizationFailure = 4, | ||
kSMErrorToolNotValid = 5, | ||
kSMErrorJobNotFound = 6, | ||
kSMErrorServiceUnavailable = 7, | ||
kSMErrorJobPlistNotFound = 8, | ||
kSMErrorJobMustBeEnabled = 9, | ||
kSMErrorInvalidPlist = 10, | ||
kSMErrorLaunchDeniedByUser = 11, | ||
kSMErrorAlreadyRegistered = 12, | ||
} | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
//! This file has been automatically generated by `objc2`'s `header-translator`. | ||
//! DO NOT EDIT | ||
use crate::common::*; | ||
use crate::Foundation::*; | ||
use crate::ServiceManagement::*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// This file has been automatically generated by `objc2`'s `header-translator`. | ||
// DO NOT EDIT | ||
|
||
//! # Bindings to the `ServiceManagement` framework | ||
|
||
#[cfg_attr( | ||
feature = "apple", | ||
link(name = "ServiceManagement", kind = "framework") | ||
)] | ||
extern "C" {} | ||
|
||
#[path = "SMAppService.rs"] | ||
mod __SMAppService; | ||
#[path = "SMErrors.rs"] | ||
mod __SMErrors; | ||
#[path = "SMLoginItem.rs"] | ||
mod __SMLoginItem; | ||
|
||
#[cfg(feature = "ServiceManagement_SMAppService")] | ||
pub use self::__SMAppService::SMAppService; | ||
pub use self::__SMAppService::SMAppServiceStatus; | ||
pub use self::__SMAppService::{ | ||
SMAppServiceStatusEnabled, SMAppServiceStatusNotFound, SMAppServiceStatusNotRegistered, | ||
SMAppServiceStatusRequiresApproval, | ||
}; | ||
pub use self::__SMErrors::{ | ||
kSMErrorAlreadyRegistered, kSMErrorAuthorizationFailure, kSMErrorInternalFailure, | ||
kSMErrorInvalidPlist, kSMErrorInvalidSignature, kSMErrorJobMustBeEnabled, kSMErrorJobNotFound, | ||
kSMErrorJobPlistNotFound, kSMErrorLaunchDeniedByUser, kSMErrorServiceUnavailable, | ||
kSMErrorToolNotValid, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters