1 /*
2  * This file is part of EvinceD.
3  * EvinceD is based on GtkD.
4  *
5  * EvinceD is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU Lesser General Public License
7  * as published by the Free Software Foundation; either version 3
8  * of the License, or (at your option) any later version, with
9  * some exceptions, please read the COPYING file.
10  *
11  * EvinceD is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public License
17  * along with EvinceD; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
19  */
20 
21 // generated automatically - do not change
22 // find conversion definition on APILookup.txt
23 
24 
25 module evince.document.DocumentFormsT;
26 
27 public  import evince.document.FormField;
28 public  import evince.document.MappingList;
29 public  import evince.document.Page;
30 public  import evince.document.c.functions;
31 public  import evince.document.c.types;
32 public  import glib.Str;
33 public  import gobject.ObjectG;
34 
35 
36 /** */
37 public template DocumentFormsT(TStruct)
38 {
39 	/** Get the main Gtk struct */
40 	public EvDocumentForms* getDocumentFormsStruct(bool transferOwnership = false)
41 	{
42 		if (transferOwnership)
43 			ownedRef = false;
44 		return cast(EvDocumentForms*)getStruct();
45 	}
46 
47 
48 	/** */
49 	public bool documentIsModified()
50 	{
51 		return ev_document_forms_document_is_modified(getDocumentFormsStruct()) != 0;
52 	}
53 
54 	/** */
55 	public bool formFieldButtonGetState(FormField field)
56 	{
57 		return ev_document_forms_form_field_button_get_state(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct()) != 0;
58 	}
59 
60 	/** */
61 	public void formFieldButtonSetState(FormField field, bool state)
62 	{
63 		ev_document_forms_form_field_button_set_state(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct(), state);
64 	}
65 
66 	/** */
67 	public string formFieldChoiceGetItem(FormField field, int index)
68 	{
69 		auto retStr = ev_document_forms_form_field_choice_get_item(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct(), index);
70 
71 		scope(exit) Str.freeString(retStr);
72 		return Str.toString(retStr);
73 	}
74 
75 	/** */
76 	public int formFieldChoiceGetNItems(FormField field)
77 	{
78 		return ev_document_forms_form_field_choice_get_n_items(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct());
79 	}
80 
81 	/** */
82 	public string formFieldChoiceGetText(FormField field)
83 	{
84 		auto retStr = ev_document_forms_form_field_choice_get_text(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct());
85 
86 		scope(exit) Str.freeString(retStr);
87 		return Str.toString(retStr);
88 	}
89 
90 	/** */
91 	public bool formFieldChoiceIsItemSelected(FormField field, int index)
92 	{
93 		return ev_document_forms_form_field_choice_is_item_selected(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct(), index) != 0;
94 	}
95 
96 	/** */
97 	public void formFieldChoiceSelectItem(FormField field, int index)
98 	{
99 		ev_document_forms_form_field_choice_select_item(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct(), index);
100 	}
101 
102 	/** */
103 	public void formFieldChoiceSetText(FormField field, string text)
104 	{
105 		ev_document_forms_form_field_choice_set_text(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct(), Str.toStringz(text));
106 	}
107 
108 	/** */
109 	public void formFieldChoiceToggleItem(FormField field, int index)
110 	{
111 		ev_document_forms_form_field_choice_toggle_item(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct(), index);
112 	}
113 
114 	/** */
115 	public void formFieldChoiceUnselectAll(FormField field)
116 	{
117 		ev_document_forms_form_field_choice_unselect_all(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct());
118 	}
119 
120 	/** */
121 	public string formFieldTextGetText(FormField field)
122 	{
123 		auto retStr = ev_document_forms_form_field_text_get_text(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct());
124 
125 		scope(exit) Str.freeString(retStr);
126 		return Str.toString(retStr);
127 	}
128 
129 	/** */
130 	public void formFieldTextSetText(FormField field, string text)
131 	{
132 		ev_document_forms_form_field_text_set_text(getDocumentFormsStruct(), (field is null) ? null : field.getFormFieldStruct(), Str.toStringz(text));
133 	}
134 
135 	/** */
136 	public MappingList getFormFields(Page page)
137 	{
138 		auto __p = ev_document_forms_get_form_fields(getDocumentFormsStruct(), (page is null) ? null : page.getPageStruct());
139 
140 		if(__p is null)
141 		{
142 			return null;
143 		}
144 
145 		return ObjectG.getDObject!(MappingList)(cast(EvMappingList*) __p, true);
146 	}
147 }