pub unsafe trait PDEPlugIn: NSObjectProtocol {
// Provided methods
unsafe fn initWithBundle(
this: Allocated<Self>,
the_bundle: &NSBundle,
) -> Option<Retained<Self>>
where Self: Sized + Message { ... }
unsafe fn PDEPanelsForType_withHostInfo(
&self,
pde_type: &NSString,
host: &ProtocolObject<dyn PDEPlugInCallbackProtocol>,
) -> Option<Retained<NSArray<ProtocolObject<dyn PDEPanel>>>>
where Self: Sized + Message { ... }
}PDEPluginInterface and objc2 only.Expand description
An instance implementing methods in the PDEPlugIn protocol acts as a factory for PDEPanels. The factory is provided with the type of printer panel needed (page setup or print dialog) as well as the current printer. It can use this information to determine which PDEPanels should be created.
See also Apple’s documentation
Provided Methods§
Sourceunsafe fn initWithBundle(
this: Allocated<Self>,
the_bundle: &NSBundle,
) -> Option<Retained<Self>>
Available on crate feature objc2-foundation only.
unsafe fn initWithBundle( this: Allocated<Self>, the_bundle: &NSBundle, ) -> Option<Retained<Self>>
objc2-foundation only.Called to instantiate the principal class of the PDE plug-in.
Prior to macOS 13, PDE plug-ins were instantiated with -init, and after that -initWithBundle: was called expecting a BOOL return. In macOS 13 and later, PDE plug-ins that conform to the PDEPlugIn protocol will be instantiated with -initWithBundle: as the sole initializer method, returning the usual instancetype. PDE plug-ins that do not conform to PDEPlugIn will be instantiated in the old two step way.
Parameter theBundle: The plug-in’s bundle.
Returns: Return a valid instance if initialization succeeded and nil otherwise.
Sourceunsafe fn PDEPanelsForType_withHostInfo(
&self,
pde_type: &NSString,
host: &ProtocolObject<dyn PDEPlugInCallbackProtocol>,
) -> Option<Retained<NSArray<ProtocolObject<dyn PDEPanel>>>>
Available on crate feature objc2-foundation only.
unsafe fn PDEPanelsForType_withHostInfo( &self, pde_type: &NSString, host: &ProtocolObject<dyn PDEPlugInCallbackProtocol>, ) -> Option<Retained<NSArray<ProtocolObject<dyn PDEPanel>>>>
objc2-foundation only.Returns an array of instances conforming to the PDEPanel protocol.
Parameter pdeType: The type of print panels that should be returned. These kinds are
defined in PMPrintingDialogExtensions.h and include:
kGeneralPageSetupDialogTypeIDStr
- Panels that should be shown in the page setup dialog. kGeneralPrintDialogTypeIDStr
- Panels that should be shown in the print dialog.
Parameter host: A print system provided instance that implements methods from the protocol
PDEPlugInCallbackProtocol. The PDEPlugIn can use this parameter to
obtain the current printer or print setting in order to filter the
available panels if there are printer specific PDEPanels in the PDEPlugIn.
Returns: An array of instances implementing methods from the PDEPanel protocol. Each instance represents a panel that will be shown in the printer dialog. The method may return either nil or an empty array if no panels should be used.
Trait Implementations§
Source§impl ProtocolType for dyn PDEPlugIn
Available on crate feature PrintCore only.
impl ProtocolType for dyn PDEPlugIn
PrintCore only.impl<T> ImplementedBy<T> for dyn PDEPlugIn
PrintCore only.Implementations on Foreign Types§
impl<T> PDEPlugIn for ProtocolObject<T>
PrintCore only.