PDEPlugInCallbackProtocol

Trait PDEPlugInCallbackProtocol 

Source
pub unsafe trait PDEPlugInCallbackProtocol {
    // Provided methods
    unsafe fn printSession(&self) -> PMPrintSession
       where Self: Sized + Message { ... }
    unsafe fn printSettings(&self) -> PMPrintSettings
       where Self: Sized + Message { ... }
    unsafe fn pageFormat(&self) -> PMPageFormat
       where Self: Sized + Message { ... }
    unsafe fn PMPrinter(&self) -> PMPrinter
       where Self: Sized + Message { ... }
    unsafe fn willChangePPDOptionKeyValue_ppdChoice(
        &self,
        option: &NSString,
        choice: &NSString,
    ) -> bool
       where Self: Sized + Message { ... }
}
Available on crate features PDEPluginInterface and objc2 only.
Expand description

A protocol implemented by the print system so that printing dialog extensions can obtain information about the current printer and print job.

An print system created instance implementing the protocol, PDEPlugInCallbackProtocol, is passed to PDEPlugin as part of the PDEPlugIn’s PDEPanelsForType:withHostInfo: message. The PDEPlugIn is expected to hold on to the passed in instance and to use this PDEPlugInCallbackProtocol to query the print system for relevant information. The PDEPlugin can pass the instance implementing PDEPlugInCallbackProtocol to PDEPanels as needed.

See also Apple’s documentation

Provided Methods§

Source

unsafe fn printSession(&self) -> PMPrintSession
where Self: Sized + Message,

Available on crate feature PMDefinitions only.

Return a reference to the current print session.

Source

unsafe fn printSettings(&self) -> PMPrintSettings
where Self: Sized + Message,

Available on crate feature PMDefinitions only.

Return a reference to the print settings object that is being modified by the printer dialog.

This method will return nil if the current print dialog is not operating on a print settings. The page setup dialog is the most obvious case where this method will return nil.

Source

unsafe fn pageFormat(&self) -> PMPageFormat
where Self: Sized + Message,

Available on crate feature PMDefinitions only.

Return a reference to the page format that is being used by the printer dialog.

The caller should be prepared for this method to return nil if the current print dialog is operating without a page format instance. Today both the print and page setup dialogs will return a reference to a page format object.

Source

unsafe fn PMPrinter(&self) -> PMPrinter
where Self: Sized + Message,

Available on crate feature PMDefinitions only.

Return a reference to the current printer instance.

When the page setup dialog is displayed this method will return the user’s default printer. When the print dialog is displayed this method will return the printer currently selected in the print dialog.

Source

unsafe fn willChangePPDOptionKeyValue_ppdChoice( &self, option: &NSString, choice: &NSString, ) -> bool
where Self: Sized + Message,

Available on crate feature objc2-foundation only.

A PDEPlugIn makes this call to let the print system know that the plugin intends to alter the choice for a PPD option.

When a print dialog plugin intends to change the choice for a PPD option it notifies the print system with this call. If the desired choice is in conflict with other currently selected PPD options then the print system will try to do conflict resolution. This may include presenting the user with a dialog explaining the conflict and allowing the user to cancel the change.

The ‘option’ parameter names a main key from the printer’s PPD. As an example take the following PPD fragment:

*OpenUI *MediaType/Paper Type: PickOne *MediaType Plain/Plain: “” *MediaType Transparency/Transparency: “” *CloseUI: *MediaType

If a panel wishes to switch the value of the option key ‘MediaType’ to the choice ‘Transparency’ then it should invoke this callback passing “ MediaType“ and @“Transparency” as the ‘option’ and ‘choice’ parameters. If that choice is allowed then YES will be returned otherwise NO.

Returns: Returns YES if the plugin should make the change and returns NO if the user or the print system would like the change not to occur.

Trait Implementations§

Source§

impl ProtocolType for dyn PDEPlugInCallbackProtocol

Available on crate feature PrintCore only.
Source§

const NAME: &'static str = "PDEPlugInCallbackProtocol"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn PDEPlugInCallbackProtocol

Available on crate feature PrintCore only.

Implementations on Foreign Types§

Source§

impl<T> PDEPlugInCallbackProtocol for ProtocolObject<T>

Available on crate feature PrintCore only.

Implementors§