Struct bitcoin_qt::PaymentServer
source · pub struct PaymentServer { /* private fields */ }
Expand description
| This class handles payment requests from | clicking on bitcoin: URIs | | This is somewhat tricky, because we have to | deal with the situation where the user clicks | on a link during startup/initialization, when | the splash-screen is up but the main window | (and the Send Coins tab) is not. | | So, the strategy is: | | Create the server, and register the event | handler, when the application is created. Save | any URIs received at or during startup in | a list. | | When startup is finished and the main window is | shown, a signal is sent to slot uiReady(), | which emits a receivedURI() signal for any | payment requests that happened during startup. | | After startup, receivedURI() happens as usual. | | This class has one more feature: a static | method that finds URIs passed in the command | line and, if a server is running in another | process, sends them to the server. |
Implementations§
source§impl PaymentServer
impl PaymentServer
sourcepub fn received_payment_request(&mut self, _0: SendCoinsRecipient)
pub fn received_payment_request(&mut self, _0: SendCoinsRecipient)
| Fired when a valid payment request is | received |
sourcepub fn message(&mut self, title: &String, message: &String, style: u32)
pub fn message(&mut self, title: &String, message: &String, style: u32)
| Fired when a message should be reported | to the user |
sourcepub fn ipc_parse_command_line(&mut self, argc: i32, argv: &[*mut u8])
pub fn ipc_parse_command_line(&mut self, argc: i32, argv: &[*mut u8])
| Parse URIs on command line | | Returns false on error | | Sending to the server is done synchronously, | at startup. If the server isn’t already | running, startup continues, and the | items in savedPaymentRequest will | be handled when uiReady() is called. | | Warning: ipcSendCommandLine() is | called early in init, so don’t use “Q_EMIT | message()”, but “QMessageBox::”! |
sourcepub fn ipc_send_command_line(&mut self) -> bool
pub fn ipc_send_command_line(&mut self) -> bool
| Returns true if there were URIs on the | command line which were successfully sent | to an already-running process. | | Note: if a payment request is given, | SelectParams(MAIN/TESTNET) will be called | so we startup in the right mode.
| Sending to the server is done synchronously, at | startup. | | If the server isn’t already running, startup | continues, and the items in savedPaymentRequest | will be handled when uiReady() is called. |
sourcepub fn new(parent: *mut u32, start_local_server: Option<bool>) -> Self
pub fn new(parent: *mut u32, start_local_server: Option<bool>) -> Self
| parent should be QApplication object |
sourcepub fn event_filter(&mut self, object: *mut u32, event: *mut u32) -> bool
pub fn event_filter(&mut self, object: *mut u32, event: *mut u32) -> bool
| Constructor registers this on the parent | | QApplication to receive QEvent::FileOpen | and QEvent:Drop events |
| OSX-specific way of handling bitcoin: | URIs |
sourcepub fn ui_ready(&mut self)
pub fn ui_ready(&mut self)
| Signal this when the main window’s UI | is ready to display payment requests | to the user |
sourcepub fn handle_uri_or_file(&mut self, s: &String)
pub fn handle_uri_or_file(&mut self, s: &String)
| Handle an incoming URI, URI with local | file scheme or file |
pub fn handle_uri_connection(&mut self)
sourcepub fn set_options_model(&mut self, options_model: *mut OptionsModel)
pub fn set_options_model(&mut self, options_model: *mut OptionsModel)
| OptionsModel is used for getting proxy | settings and display unit |