This file is indexed.

/usr/include/d/gtkd-3/atk/DocumentT.d is in libgtkd-3-dev 3.7.5-2build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  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
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
/*
 * This file is part of gtkD.
 *
 * gtkD is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Lesser General Public License
 * as published by the Free Software Foundation; either version 3
 * of the License, or (at your option) any later version, with
 * some exceptions, please read the COPYING file.
 *
 * gtkD is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with gtkD; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
 */

// generated automatically - do not change
// find conversion definition on APILookup.txt
// implement new conversion functionalities on the wrap.utils pakage


module atk.DocumentT;

public  import atk.c.functions;
public  import atk.c.types;
public  import glib.Str;
public  import gobject.Signals;
public  import gtkc.atktypes;
public  import std.algorithm;


/**
 * The AtkDocument interface should be supported by any object whose
 * content is a representation or view of a document.  The AtkDocument
 * interface should appear on the toplevel container for the document
 * content; however AtkDocument instances may be nested (i.e. an
 * AtkDocument may be a descendant of another AtkDocument) in those
 * cases where one document contains "embedded content" which can
 * reasonably be considered a document in its own right.
 */
public template DocumentT(TStruct)
{
	/** Get the main Gtk struct */
	public AtkDocument* getDocumentStruct(bool transferOwnership = false)
	{
		if (transferOwnership)
			ownedRef = false;
		return cast(AtkDocument*)getStruct();
	}


	/**
	 *
	 * Params:
	 *     attributeName = a character string representing the name of the attribute
	 *         whose value is being queried.
	 * Returns: a string value associated with the named
	 *     attribute for this document, or NULL if a value for
	 *     #attribute_name has not been specified for this document.
	 *
	 * Since: 1.12
	 */
	public string getAttributeValue(string attributeName)
	{
		return Str.toString(atk_document_get_attribute_value(getDocumentStruct(), Str.toStringz(attributeName)));
	}

	/**
	 * Gets an AtkAttributeSet which describes document-wide
	 * attributes as name-value pairs.
	 *
	 * Returns: An AtkAttributeSet containing the explicitly
	 *     set name-value-pair attributes associated with this document
	 *     as a whole.
	 *
	 * Since: 1.12
	 */
	public override AtkAttributeSet* getAttributes()
	{
		return atk_document_get_attributes(getDocumentStruct());
	}

	/**
	 * Returns: current page number inside @document. -1 if not
	 *     implemented, not know by the implementor or irrelevant.
	 *
	 * Since: 2.12
	 */
	public int getCurrentPageNumber()
	{
		return atk_document_get_current_page_number(getDocumentStruct());
	}

	/**
	 * Gets a %gpointer that points to an instance of the DOM.  It is
	 * up to the caller to check atk_document_get_type to determine
	 * how to cast this pointer.
	 *
	 * Deprecated: Since 2.12. @document is already a representation of
	 * the document. Use it directly, or one of its children, as an
	 * instance of the DOM.
	 *
	 * Returns: a %gpointer that points to an instance of the DOM.
	 */
	public void* getDocument()
	{
		return atk_document_get_document(getDocumentStruct());
	}

	/**
	 * Gets a string indicating the document type.
	 *
	 * Deprecated: Since 2.12. Please use atk_document_get_attributes() to
	 * ask for the document type if it applies.
	 *
	 * Returns: a string indicating the document type
	 */
	public string getDocumentType()
	{
		return Str.toString(atk_document_get_document_type(getDocumentStruct()));
	}

	/**
	 * Gets a UTF-8 string indicating the POSIX-style LC_MESSAGES locale
	 * of the content of this document instance.  Individual
	 * text substrings or images within this document may have
	 * a different locale, see atk_text_get_attributes and
	 * atk_image_get_image_locale.
	 *
	 * Deprecated: Please use atk_object_get_object_locale() instead.
	 *
	 * Returns: a UTF-8 string indicating the POSIX-style LC_MESSAGES
	 *     locale of the document content as a whole, or NULL if
	 *     the document content does not specify a locale.
	 */
	public string getLocale()
	{
		return Str.toString(atk_document_get_locale(getDocumentStruct()));
	}

	/**
	 * Returns: total page count of @document. -1 if not implemented, not
	 *     know by the implementor or irrelevant.
	 *
	 * Since: 2.12
	 */
	public int getPageCount()
	{
		return atk_document_get_page_count(getDocumentStruct());
	}

	/**
	 *
	 * Params:
	 *     attributeName = a character string representing the name of the attribute
	 *         whose value is being set.
	 *     attributeValue = a string value to be associated with #attribute_name.
	 * Returns: TRUE if #value is successfully associated with #attribute_name
	 *     for this document, FALSE otherwise (e.g. if the document does not
	 *     allow the attribute to be modified).
	 *
	 * Since: 1.12
	 */
	public bool setAttributeValue(string attributeName, string attributeValue)
	{
		return atk_document_set_attribute_value(getDocumentStruct(), Str.toStringz(attributeName), Str.toStringz(attributeValue)) != 0;
	}

	protected class OnLoadCompleteDelegateWrapper
	{
		void delegate(DocumentIF) dlg;
		gulong handlerId;

		this(void delegate(DocumentIF) dlg)
		{
			this.dlg = dlg;
			onLoadCompleteListeners ~= this;
		}

		void remove(OnLoadCompleteDelegateWrapper source)
		{
			foreach(index, wrapper; onLoadCompleteListeners)
			{
				if (wrapper.handlerId == source.handlerId)
				{
					onLoadCompleteListeners[index] = null;
					onLoadCompleteListeners = std.algorithm.remove(onLoadCompleteListeners, index);
					break;
				}
			}
		}
	}
	OnLoadCompleteDelegateWrapper[] onLoadCompleteListeners;

	/**
	 * The 'load-complete' signal is emitted when a pending load of
	 * a static document has completed.  This signal is to be
	 * expected by ATK clients if and when AtkDocument implementors
	 * expose ATK_STATE_BUSY.  If the state of an AtkObject which
	 * implements AtkDocument does not include ATK_STATE_BUSY, it
	 * should be safe for clients to assume that the AtkDocument's
	 * static contents are fully loaded into the container.
	 * (Dynamic document contents should be exposed via other
	 * signals.)
	 */
	gulong addOnLoadComplete(void delegate(DocumentIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
	{
		auto wrapper = new OnLoadCompleteDelegateWrapper(dlg);
		wrapper.handlerId = Signals.connectData(
			this,
			"load-complete",
			cast(GCallback)&callBackLoadComplete,
			cast(void*)wrapper,
			cast(GClosureNotify)&callBackLoadCompleteDestroy,
			connectFlags);
		return wrapper.handlerId;
	}

	extern(C) static void callBackLoadComplete(AtkDocument* documentStruct, OnLoadCompleteDelegateWrapper wrapper)
	{
		wrapper.dlg(wrapper.outer);
	}

	extern(C) static void callBackLoadCompleteDestroy(OnLoadCompleteDelegateWrapper wrapper, GClosure* closure)
	{
		wrapper.remove(wrapper);
	}

	protected class OnLoadStoppedDelegateWrapper
	{
		void delegate(DocumentIF) dlg;
		gulong handlerId;

		this(void delegate(DocumentIF) dlg)
		{
			this.dlg = dlg;
			onLoadStoppedListeners ~= this;
		}

		void remove(OnLoadStoppedDelegateWrapper source)
		{
			foreach(index, wrapper; onLoadStoppedListeners)
			{
				if (wrapper.handlerId == source.handlerId)
				{
					onLoadStoppedListeners[index] = null;
					onLoadStoppedListeners = std.algorithm.remove(onLoadStoppedListeners, index);
					break;
				}
			}
		}
	}
	OnLoadStoppedDelegateWrapper[] onLoadStoppedListeners;

	/**
	 * The 'load-stopped' signal is emitted when a pending load of
	 * document contents is cancelled, paused, or otherwise
	 * interrupted by the user or application logic.  It should not
	 * however be emitted while waiting for a resource (for instance
	 * while blocking on a file or network read) unless a
	 * user-significant timeout has occurred.
	 */
	gulong addOnLoadStopped(void delegate(DocumentIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
	{
		auto wrapper = new OnLoadStoppedDelegateWrapper(dlg);
		wrapper.handlerId = Signals.connectData(
			this,
			"load-stopped",
			cast(GCallback)&callBackLoadStopped,
			cast(void*)wrapper,
			cast(GClosureNotify)&callBackLoadStoppedDestroy,
			connectFlags);
		return wrapper.handlerId;
	}

	extern(C) static void callBackLoadStopped(AtkDocument* documentStruct, OnLoadStoppedDelegateWrapper wrapper)
	{
		wrapper.dlg(wrapper.outer);
	}

	extern(C) static void callBackLoadStoppedDestroy(OnLoadStoppedDelegateWrapper wrapper, GClosure* closure)
	{
		wrapper.remove(wrapper);
	}

	protected class OnPageChangedDelegateWrapper
	{
		void delegate(int, DocumentIF) dlg;
		gulong handlerId;

		this(void delegate(int, DocumentIF) dlg)
		{
			this.dlg = dlg;
			onPageChangedListeners ~= this;
		}

		void remove(OnPageChangedDelegateWrapper source)
		{
			foreach(index, wrapper; onPageChangedListeners)
			{
				if (wrapper.handlerId == source.handlerId)
				{
					onPageChangedListeners[index] = null;
					onPageChangedListeners = std.algorithm.remove(onPageChangedListeners, index);
					break;
				}
			}
		}
	}
	OnPageChangedDelegateWrapper[] onPageChangedListeners;

	/**
	 * The 'page-changed' signal is emitted when the current page of
	 * a document changes, e.g. pressing page up/down in a document
	 * viewer.
	 *
	 * Params:
	 *     pageNumber = the new page number. If this value is unknown
	 *         or not applicable, -1 should be provided.
	 *
	 * Since: 2.12
	 */
	gulong addOnPageChanged(void delegate(int, DocumentIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
	{
		auto wrapper = new OnPageChangedDelegateWrapper(dlg);
		wrapper.handlerId = Signals.connectData(
			this,
			"page-changed",
			cast(GCallback)&callBackPageChanged,
			cast(void*)wrapper,
			cast(GClosureNotify)&callBackPageChangedDestroy,
			connectFlags);
		return wrapper.handlerId;
	}

	extern(C) static void callBackPageChanged(AtkDocument* documentStruct, int pageNumber, OnPageChangedDelegateWrapper wrapper)
	{
		wrapper.dlg(pageNumber, wrapper.outer);
	}

	extern(C) static void callBackPageChangedDestroy(OnPageChangedDelegateWrapper wrapper, GClosure* closure)
	{
		wrapper.remove(wrapper);
	}

	protected class OnReloadDelegateWrapper
	{
		void delegate(DocumentIF) dlg;
		gulong handlerId;

		this(void delegate(DocumentIF) dlg)
		{
			this.dlg = dlg;
			onReloadListeners ~= this;
		}

		void remove(OnReloadDelegateWrapper source)
		{
			foreach(index, wrapper; onReloadListeners)
			{
				if (wrapper.handlerId == source.handlerId)
				{
					onReloadListeners[index] = null;
					onReloadListeners = std.algorithm.remove(onReloadListeners, index);
					break;
				}
			}
		}
	}
	OnReloadDelegateWrapper[] onReloadListeners;

	/**
	 * The 'reload' signal is emitted when the contents of a
	 * document is refreshed from its source.  Once 'reload' has
	 * been emitted, a matching 'load-complete' or 'load-stopped'
	 * signal should follow, which clients may await before
	 * interrogating ATK for the latest document content.
	 */
	gulong addOnReload(void delegate(DocumentIF) dlg, ConnectFlags connectFlags=cast(ConnectFlags)0)
	{
		auto wrapper = new OnReloadDelegateWrapper(dlg);
		wrapper.handlerId = Signals.connectData(
			this,
			"reload",
			cast(GCallback)&callBackReload,
			cast(void*)wrapper,
			cast(GClosureNotify)&callBackReloadDestroy,
			connectFlags);
		return wrapper.handlerId;
	}

	extern(C) static void callBackReload(AtkDocument* documentStruct, OnReloadDelegateWrapper wrapper)
	{
		wrapper.dlg(wrapper.outer);
	}

	extern(C) static void callBackReloadDestroy(OnReloadDelegateWrapper wrapper, GClosure* closure)
	{
		wrapper.remove(wrapper);
	}
}