1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
/// C++ type: <span style='color: green;'>```QSyntaxHighlighter```</span>
///
/// <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>The <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html">QSyntaxHighlighter</a> class allows you to define syntax highlighting rules, and in addition you can use the class to query a document's current formatting or user data.</p>
/// <p>The <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html">QSyntaxHighlighter</a> class is a base class for implementing <a href="http://doc.qt.io/qt-5/qtextdocument.html">QTextDocument</a> syntax highlighters. A syntax highligher automatically highlights parts of the text in a <a href="http://doc.qt.io/qt-5/qtextdocument.html">QTextDocument</a>. Syntax highlighters are often used when the user is entering text in a specific format (for example source code) and help the user to read the text and identify syntax errors.</p>
/// <p>To provide your own syntax highlighting, you must subclass <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html">QSyntaxHighlighter</a> and reimplement <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#highlightBlock">highlightBlock</a>().</p>
/// <p>When you create an instance of your <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html">QSyntaxHighlighter</a> subclass, pass it the <a href="http://doc.qt.io/qt-5/qtextdocument.html">QTextDocument</a> that you want the syntax highlighting to be applied to. For example:</p>
/// <pre class="cpp">
///   <span class="type"><a href="http://doc.qt.io/qt-5/qtextedit.html">QTextEdit</a></span> <span class="operator">*</span>editor <span class="operator">=</span> <span class="keyword">new</span> <span class="type"><a href="http://doc.qt.io/qt-5/qtextedit.html">QTextEdit</a></span>;
///   MyHighlighter <span class="operator">*</span>highlighter <span class="operator">=</span> <span class="keyword">new</span> MyHighlighter(editor<span class="operator">-</span><span class="operator">&gt;</span>document());
///
/// </pre>
/// <p>After this your <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#highlightBlock">highlightBlock</a>() function will be called automatically whenever necessary. Use your <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#highlightBlock">highlightBlock</a>() function to apply formatting (e.g. setting the font and color) to the text that is passed to it. <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html">QSyntaxHighlighter</a> provides the <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#setFormat">setFormat</a>() function which applies a given <a href="http://doc.qt.io/qt-5/qtextcharformat.html">QTextCharFormat</a> on the current text block. For example:</p>
/// <pre class="cpp">
///   <span class="type">void</span> MyHighlighter<span class="operator">::</span>highlightBlock(<span class="keyword">const</span> <span class="type"><a href="http://doc.qt.io/qt-5/qstring.html">QString</a></span> <span class="operator">&amp;</span>text)
///   {
/// &#32;     <span class="type"><a href="http://doc.qt.io/qt-5/qtextcharformat.html">QTextCharFormat</a></span> myClassFormat;
/// &#32;     myClassFormat<span class="operator">.</span>setFontWeight(<span class="type"><a href="http://doc.qt.io/qt-5/qfont.html">QFont</a></span><span class="operator">::</span>Bold);
/// &#32;     myClassFormat<span class="operator">.</span>setForeground(<span class="type">Qt</span><span class="operator">::</span>darkMagenta);
/// &#32;     <span class="type"><a href="http://doc.qt.io/qt-5/qstring.html">QString</a></span> pattern <span class="operator">=</span> <span class="string">"\\bMy[A-Za-z]+\\b"</span>;
///
/// &#32;     <span class="type"><a href="http://doc.qt.io/qt-5/qregexp.html">QRegExp</a></span> expression(pattern);
/// &#32;     <span class="type">int</span> index <span class="operator">=</span> text<span class="operator">.</span>indexOf(expression);
/// &#32;     <span class="keyword">while</span> (index <span class="operator">&gt;</span><span class="operator">=</span> <span class="number">0</span>) {
/// &#32;         <span class="type">int</span> length <span class="operator">=</span> expression<span class="operator">.</span>matchedLength();
/// &#32;         setFormat(index<span class="operator">,</span> length<span class="operator">,</span> myClassFormat);
/// &#32;         index <span class="operator">=</span> text<span class="operator">.</span>indexOf(expression<span class="operator">,</span> index <span class="operator">+</span> length);
/// &#32;     }
///   }
///
/// </pre>
/// <p>Some syntaxes can have constructs that span several text blocks. For example, a C++ syntax highlighter should be able to cope with <code>/</code><code>*...*</code><code>/</code> multiline comments. To deal with these cases it is necessary to know the end state of the previous text block (e.g. "in comment").</p>
/// <p>Inside your <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#highlightBlock">highlightBlock</a>() implementation you can query the end state of the previous text block using the <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#previousBlockState">previousBlockState</a>() function. After parsing the block you can save the last state using <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#setCurrentBlockState">setCurrentBlockState</a>().</p>
/// <p>The <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#currentBlockState">currentBlockState</a>() and <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#previousBlockState">previousBlockState</a>() functions return an int value. If no state is set, the returned value is -1. You can designate any other value to identify any given state using the <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#setCurrentBlockState">setCurrentBlockState</a>() function. Once the state is set the <a href="http://doc.qt.io/qt-5/qtextblock.html">QTextBlock</a> keeps that value until it is set set again or until the corresponding paragraph of text is deleted.</p>
/// <p>For example, if you're writing a simple C++ syntax highlighter, you might designate 1 to signify "in comment":</p>
/// <pre class="cpp">
///   <span class="type"><a href="http://doc.qt.io/qt-5/qtextcharformat.html">QTextCharFormat</a></span> multiLineCommentFormat;
///   multiLineCommentFormat<span class="operator">.</span>setForeground(<span class="type">Qt</span><span class="operator">::</span>red);
///
///   <span class="type"><a href="http://doc.qt.io/qt-5/qregexp.html">QRegExp</a></span> startExpression(<span class="string">"/\\*"</span>);
///   <span class="type"><a href="http://doc.qt.io/qt-5/qregexp.html">QRegExp</a></span> endExpression(<span class="string">"\\*/"</span>);
///
///   setCurrentBlockState(<span class="number">0</span>);
///
///   <span class="type">int</span> startIndex <span class="operator">=</span> <span class="number">0</span>;
///   <span class="keyword">if</span> (previousBlockState() <span class="operator">!</span><span class="operator">=</span> <span class="number">1</span>)
/// &#32;     startIndex <span class="operator">=</span> text<span class="operator">.</span>indexOf(startExpression);
///
///   <span class="keyword">while</span> (startIndex <span class="operator">&gt;</span><span class="operator">=</span> <span class="number">0</span>) {
/// &#32;    <span class="type">int</span> endIndex <span class="operator">=</span> text<span class="operator">.</span>indexOf(endExpression<span class="operator">,</span> startIndex);
/// &#32;    <span class="type">int</span> commentLength;
/// &#32;    <span class="keyword">if</span> (endIndex <span class="operator">=</span><span class="operator">=</span> <span class="operator">-</span><span class="number">1</span>) {
/// &#32;        setCurrentBlockState(<span class="number">1</span>);
/// &#32;        commentLength <span class="operator">=</span> text<span class="operator">.</span>length() <span class="operator">-</span> startIndex;
/// &#32;    } <span class="keyword">else</span> {
/// &#32;        commentLength <span class="operator">=</span> endIndex <span class="operator">-</span> startIndex
/// &#32;                        <span class="operator">+</span> endExpression<span class="operator">.</span>matchedLength();
/// &#32;    }
/// &#32;    setFormat(startIndex<span class="operator">,</span> commentLength<span class="operator">,</span> multiLineCommentFormat);
/// &#32;    startIndex <span class="operator">=</span> text<span class="operator">.</span>indexOf(startExpression<span class="operator">,</span>
/// &#32;                              startIndex <span class="operator">+</span> commentLength);
///   }
///
/// </pre>
/// <p>In the example above, we first set the current block state to 0. Then, if the previous block ended within a comment, we higlight from the beginning of the current block (<code>startIndex = 0</code>). Otherwise, we search for the given start expression. If the specified end expression cannot be found in the text block, we change the current block state by calling <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#setCurrentBlockState">setCurrentBlockState</a>(), and make sure that the rest of the block is higlighted.</p>
/// <p>In addition you can query the current formatting and user data using the <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#format">format</a>() and <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#currentBlockUserData">currentBlockUserData</a>() functions respectively. You can also attach user data to the current text block using the <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#setCurrentBlockUserData">setCurrentBlockUserData</a>() function. <a href="http://doc.qt.io/qt-5/qtextblockuserdata.html">QTextBlockUserData</a> can be used to store custom settings. In the case of syntax highlighting, it is in particular interesting as cache storage for information that you may figure out while parsing the paragraph's text. For an example, see the <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#setCurrentBlockUserData">setCurrentBlockUserData</a>() documentation.</p></div>
#[repr(C)]
pub struct SyntaxHighlighter(u8);

impl SyntaxHighlighter {
  /// C++ method: <span style='color: green;'>```QTextDocument* QSyntaxHighlighter::document() const```</span>
  ///
  /// <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#document">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Returns the <a href="http://doc.qt.io/qt-5/qtextdocument.html">QTextDocument</a> on which this syntax highlighter is installed.</p>
  /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#setDocument">setDocument</a>().</p></div>
  pub fn document(&self) -> *mut ::text_document::TextDocument {
    unsafe { ::ffi::qt_gui_c_QSyntaxHighlighter_document(self as *const ::syntax_highlighter::SyntaxHighlighter) }
  }

  /// C++ method: <span style='color: green;'>```virtual const QMetaObject* QSyntaxHighlighter::metaObject() const```</span>
  ///
  ///
  pub fn meta_object(&self) -> *const ::qt_core::meta_object::MetaObject {
    unsafe { ::ffi::qt_gui_c_QSyntaxHighlighter_metaObject(self as *const ::syntax_highlighter::SyntaxHighlighter) }
  }

  /// C++ method: <span style='color: green;'>```virtual int QSyntaxHighlighter::qt_metacall(QMetaObject::Call arg1, int arg2, void** arg3)```</span>
  ///
  ///
  pub unsafe fn qt_metacall(&mut self,
                            arg1: ::qt_core::meta_object::Call,
                            arg2: ::libc::c_int,
                            arg3: *mut *mut ::libc::c_void)
                            -> ::libc::c_int {
    ::ffi::qt_gui_c_QSyntaxHighlighter_qt_metacall(self as *mut ::syntax_highlighter::SyntaxHighlighter,
                                                   arg1,
                                                   arg2,
                                                   arg3)
  }

  /// C++ method: <span style='color: green;'>```virtual void* QSyntaxHighlighter::qt_metacast(const char* arg1)```</span>
  ///
  ///
  pub unsafe fn qt_metacast(&mut self, arg1: *const ::libc::c_char) -> *mut ::libc::c_void {
    ::ffi::qt_gui_c_QSyntaxHighlighter_qt_metacast(self as *mut ::syntax_highlighter::SyntaxHighlighter, arg1)
  }

  /// C++ method: <span style='color: green;'>```[slot] void QSyntaxHighlighter::rehighlight()```</span>
  ///
  /// <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#rehighlight">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Reapplies the highlighting to the whole document.</p>
  /// <p>This function was introduced in  Qt 4.2.</p>
  /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#rehighlightBlock">rehighlightBlock</a>().</p></div>
  pub fn rehighlight(&mut self) {
    unsafe { ::ffi::qt_gui_c_QSyntaxHighlighter_rehighlight(self as *mut ::syntax_highlighter::SyntaxHighlighter) }
  }

  /// C++ method: <span style='color: green;'>```[slot] void QSyntaxHighlighter::rehighlightBlock(const QTextBlock& block)```</span>
  ///
  /// <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#rehighlightBlock">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Reapplies the highlighting to the given <a href="http://doc.qt.io/qt-5/qtextblock.html">QTextBlock</a> <i>block</i>.</p>
  /// <p>This function was introduced in  Qt 4.6.</p>
  /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#rehighlight">rehighlight</a>().</p></div>
  pub fn rehighlight_block(&mut self, block: &::text_block::TextBlock) {
    unsafe {
      ::ffi::qt_gui_c_QSyntaxHighlighter_rehighlightBlock(self as *mut ::syntax_highlighter::SyntaxHighlighter,
                                                          block as *const ::text_block::TextBlock)
    }
  }

  /// C++ method: <span style='color: green;'>```void QSyntaxHighlighter::setDocument(QTextDocument* doc)```</span>
  ///
  /// <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#setDocument">C++ documentation:</a> <div style='border: 1px solid #5CFF95; background: #D6FFE4; padding: 16px;'><p>Installs the syntax highlighter on the given <a href="http://doc.qt.io/qt-5/qtextdocument.html">QTextDocument</a> <i>doc</i>. A <a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html">QSyntaxHighlighter</a> can only be used with one document at a time.</p>
  /// <p><b>See also </b><a href="http://doc.qt.io/qt-5/qsyntaxhighlighter.html#document">document</a>().</p></div>
  pub unsafe fn set_document(&mut self, doc: *mut ::text_document::TextDocument) {
    ::ffi::qt_gui_c_QSyntaxHighlighter_setDocument(self as *mut ::syntax_highlighter::SyntaxHighlighter, doc)
  }

  /// C++ method: <span style='color: green;'>```static QString QSyntaxHighlighter::tr(const char* s, const char* c, int n)```</span>
  ///
  ///
  pub unsafe fn tr(s: *const ::libc::c_char, c: *const ::libc::c_char, n: ::libc::c_int) -> ::qt_core::string::String {
    {
      let mut object: ::qt_core::string::String =
        ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized();
      ::ffi::qt_gui_c_QSyntaxHighlighter_tr_to_output(s, c, n, &mut object);
      object
    }
  }

  /// C++ method: <span style='color: green;'>```static QString QSyntaxHighlighter::trUtf8(const char* s, const char* c, int n)```</span>
  ///
  ///
  pub unsafe fn tr_utf8(s: *const ::libc::c_char,
                        c: *const ::libc::c_char,
                        n: ::libc::c_int)
                        -> ::qt_core::string::String {
    {
      let mut object: ::qt_core::string::String =
        ::cpp_utils::new_uninitialized::NewUninitialized::new_uninitialized();
      ::ffi::qt_gui_c_QSyntaxHighlighter_trUtf8_to_output(s, c, n, &mut object);
      object
    }
  }
}

impl ::cpp_utils::CppDeletable for ::syntax_highlighter::SyntaxHighlighter {
  fn deleter() -> ::cpp_utils::Deleter<Self> {
    ::ffi::qt_gui_c_QSyntaxHighlighter_delete
  }
}

/// Types for accessing built-in Qt signals and slots present in this module
pub mod connection {
  use ::cpp_utils::StaticCast;
  /// Provides access to built-in Qt signals of `SyntaxHighlighter`.
  pub struct Signals<'a>(&'a ::syntax_highlighter::SyntaxHighlighter);
  /// Represents a built-in Qt signal `QSyntaxHighlighter::objectNameChanged`.
  ///
  /// An object of this type can be created from `SyntaxHighlighter` with `object.signals().object_name_changed()` and used for creating Qt connections using `qt_core::connection` API. After the connection is made, the object can (should) be dropped. The connection will remain active until sender or receiver are destroyed or until a manual disconnection is made.
  ///
  /// An object of this type contains a reference to the original `SyntaxHighlighter` object.
  pub struct ObjectNameChanged<'a>(&'a ::syntax_highlighter::SyntaxHighlighter);
  impl<'a> ::qt_core::connection::Receiver for ObjectNameChanged<'a> {
    type Arguments = (&'static ::qt_core::string::String,);
    fn object(&self) -> &::qt_core::object::Object {
      self.0.static_cast()
    }
    fn receiver_id() -> &'static [u8] {
      b"2objectNameChanged(const QString&)\0"
    }
  }
  impl<'a> ::qt_core::connection::Signal for ObjectNameChanged<'a> {}
  impl<'a> Signals<'a> {
    /// Returns an object representing a built-in Qt signal `QSyntaxHighlighter::objectNameChanged`.
    ///
    /// Return value of this function can be used for creating Qt connections using `qt_core::connection` API.
    pub fn object_name_changed(&self) -> ObjectNameChanged {
      ObjectNameChanged(self.0)
    }
  }
  /// Provides access to built-in Qt slots of `SyntaxHighlighter`.
  pub struct Slots<'a>(&'a ::syntax_highlighter::SyntaxHighlighter);
  /// Represents a built-in Qt slot `QSyntaxHighlighter::rehighlightBlock`.
  ///
  /// An object of this type can be created from `SyntaxHighlighter` with `object.slots().rehighlight_block()` and used for creating Qt connections using `qt_core::connection` API. After the connection is made, the object can (should) be dropped. The connection will remain active until sender or receiver are destroyed or until a manual disconnection is made.
  ///
  /// An object of this type contains a reference to the original `SyntaxHighlighter` object.
  pub struct RehighlightBlock<'a>(&'a ::syntax_highlighter::SyntaxHighlighter);
  impl<'a> ::qt_core::connection::Receiver for RehighlightBlock<'a> {
    type Arguments = (&'static ::text_block::TextBlock,);
    fn object(&self) -> &::qt_core::object::Object {
      self.0.static_cast()
    }
    fn receiver_id() -> &'static [u8] {
      b"1rehighlightBlock(const QTextBlock&)\0"
    }
  }
  /// Represents a built-in Qt slot `QSyntaxHighlighter::rehighlight`.
  ///
  /// An object of this type can be created from `SyntaxHighlighter` with `object.slots().rehighlight()` and used for creating Qt connections using `qt_core::connection` API. After the connection is made, the object can (should) be dropped. The connection will remain active until sender or receiver are destroyed or until a manual disconnection is made.
  ///
  /// An object of this type contains a reference to the original `SyntaxHighlighter` object.
  pub struct Rehighlight<'a>(&'a ::syntax_highlighter::SyntaxHighlighter);
  impl<'a> ::qt_core::connection::Receiver for Rehighlight<'a> {
    type Arguments = ();
    fn object(&self) -> &::qt_core::object::Object {
      self.0.static_cast()
    }
    fn receiver_id() -> &'static [u8] {
      b"1rehighlight()\0"
    }
  }
  impl<'a> Slots<'a> {
    /// Returns an object representing a built-in Qt slot `QSyntaxHighlighter::rehighlightBlock`.
    ///
    /// Return value of this function can be used for creating Qt connections using `qt_core::connection` API.
    pub fn rehighlight_block(&self) -> RehighlightBlock {
      RehighlightBlock(self.0)
    }
    /// Returns an object representing a built-in Qt slot `QSyntaxHighlighter::rehighlight`.
    ///
    /// Return value of this function can be used for creating Qt connections using `qt_core::connection` API.
    pub fn rehighlight(&self) -> Rehighlight {
      Rehighlight(self.0)
    }
  }
  impl ::syntax_highlighter::SyntaxHighlighter {
    /// Provides access to built-in Qt signals of this type
    pub fn signals(&self) -> Signals {
      Signals(self)
    }
    /// Provides access to built-in Qt slots of this type
    pub fn slots(&self) -> Slots {
      Slots(self)
    }
  }

}

impl ::cpp_utils::StaticCast<::qt_core::object::Object> for ::syntax_highlighter::SyntaxHighlighter {
  fn static_cast_mut(&mut self) -> &mut ::qt_core::object::Object {
    let ffi_result = unsafe { ::ffi::qt_gui_c_QSyntaxHighlighter_G_static_cast_QObject_ptr(self as *mut ::syntax_highlighter::SyntaxHighlighter) };
    unsafe { ffi_result.as_mut() }.expect("Attempted to convert null pointer to reference")
  }

  fn static_cast(&self) -> &::qt_core::object::Object {
    let ffi_result = unsafe { ::ffi::qt_gui_c_QSyntaxHighlighter_G_static_cast_QObject_ptr(self as *const ::syntax_highlighter::SyntaxHighlighter as *mut ::syntax_highlighter::SyntaxHighlighter) };
    unsafe { ffi_result.as_ref() }.expect("Attempted to convert null pointer to reference")
  }
}

impl ::cpp_utils::UnsafeStaticCast<::syntax_highlighter::SyntaxHighlighter> for ::qt_core::object::Object {
  unsafe fn static_cast_mut(&mut self) -> &mut ::syntax_highlighter::SyntaxHighlighter {
    let ffi_result =
      ::ffi::qt_gui_c_QSyntaxHighlighter_G_static_cast_QSyntaxHighlighter_ptr(self as *mut ::qt_core::object::Object);
    ffi_result.as_mut().expect("Attempted to convert null pointer to reference")
  }

  unsafe fn static_cast(&self) -> &::syntax_highlighter::SyntaxHighlighter {
    let ffi_result = ::ffi::qt_gui_c_QSyntaxHighlighter_G_static_cast_QSyntaxHighlighter_ptr(self as *const ::qt_core::object::Object as *mut ::qt_core::object::Object);
    ffi_result.as_ref().expect("Attempted to convert null pointer to reference")
  }
}

impl ::std::ops::Deref for ::syntax_highlighter::SyntaxHighlighter {
  type Target = ::qt_core::object::Object;
  fn deref(&self) -> &::qt_core::object::Object {
    let ffi_result = unsafe { ::ffi::qt_gui_c_QSyntaxHighlighter_G_static_cast_QObject_ptr(self as *const ::syntax_highlighter::SyntaxHighlighter as *mut ::syntax_highlighter::SyntaxHighlighter) };
    unsafe { ffi_result.as_ref() }.expect("Attempted to convert null pointer to reference")
  }
}

impl ::std::ops::DerefMut for ::syntax_highlighter::SyntaxHighlighter {
  fn deref_mut(&mut self) -> &mut ::qt_core::object::Object {
    let ffi_result = unsafe { ::ffi::qt_gui_c_QSyntaxHighlighter_G_static_cast_QObject_ptr(self as *mut ::syntax_highlighter::SyntaxHighlighter) };
    unsafe { ffi_result.as_mut() }.expect("Attempted to convert null pointer to reference")
  }
}