1use crate::prelude::TextExt;
2use crate::utils;
3use qt_core::{QBox, SlotNoArgs, SlotOfBool};
4use qt_widgets::{QTextBrowser, QTextEdit};
5
6macro_rules! impl_ext {
7 ($name: ident) => {
8 impl TextExt for QBox<$name> {
9 unsafe fn connect_redo_available<F: FnMut(&Self, bool) + 'static>(&self, mut cb: F) {
10 utils::connect_1a!(self, redo_available, SlotOfBool, cb);
11 }
12 unsafe fn connect_selection_changed<F: FnMut(&Self) + 'static>(&self, mut cb: F) {
13 utils::connect_0a!(self, selection_changed, cb);
14 }
15 unsafe fn connect_text_changed<F: FnMut(&Self) + 'static>(&self, mut cb: F) {
16 utils::connect_0a!(self, text_changed, cb);
17 }
18 unsafe fn connect_undo_available<F: FnMut(&Self, bool) + 'static>(&self, mut cb: F) {
19 utils::connect_1a!(self, undo_available, SlotOfBool, cb);
20 }
21 }
22 };
23}
24
25impl_ext!(QTextEdit);
26impl_ext!(QTextBrowser);