1 /*
2  * This file is part of gtkD.
3  *
4  * gtkD is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License
6  * as published by the Free Software Foundation; either version 3
7  * of the License, or (at your option) any later version, with
8  * some exceptions, please read the COPYING file.
9  *
10  * gtkD is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public License
16  * along with gtkD; if not, write to the Free Software
17  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
18  */
19 
20 // generated automatically - do not change
21 // find conversion definition on APILookup.txt
22 // implement new conversion functionalities on the wrap.utils pakage
23 
24 
25 module gstreamer.PresetIF;
26 
27 private import glib.Str;
28 private import gstreamerc.gstreamer;
29 public  import gstreamerc.gstreamertypes;
30 
31 
32 /**
33  * This interface offers methods to query and manipulate parameter preset sets.
34  * A preset is a bunch of property settings, together with meta data and a name.
35  * The name of a preset serves as key for subsequent method calls to manipulate
36  * single presets.
37  * All instances of one type will share the list of presets. The list is created
38  * on demand, if presets are not used, the list is not created.
39  * 
40  * The interface comes with a default implementation that serves most plugins.
41  * Wrapper plugins will override most methods to implement support for the
42  * native preset format of those wrapped plugins.
43  * One method that is useful to be overridden is gst_preset_get_property_names().
44  * With that one can control which properties are saved and in which order.
45  * When implementing support for read-only presets, one should set the vmethods
46  * for gst_preset_save_preset() and gst_preset_delete_preset() to %NULL.
47  * Applications can use gst_preset_is_editable() to check for that.
48  * 
49  * The default implementation supports presets located in a system directory,
50  * application specific directory and in the users home directory. When getting
51  * a list of presets individual presets are read and overlaid in 1) system,
52  * 2) application and 3) user order. Whenever an earlier entry is newer, the
53  * later entries will be updated.
54  */
55 public interface PresetIF{
56 	/** Get the main Gtk struct */
57 	public GstPreset* getPresetStruct();
58 
59 	/** the main Gtk struct as a void* */
60 	protected void* getStruct();
61 
62 
63 	/**
64 	 * Gets the directory for application specific presets if set by the
65 	 * application.
66 	 *
67 	 * Return: the directory or %NULL, don't free or modify
68 	 *     the string
69 	 */
70 	public static string getAppDir();
71 
72 	/**
73 	 * Sets an extra directory as an absolute path that should be considered when
74 	 * looking for presets. Any presets in the application dir will shadow the
75 	 * system presets.
76 	 *
77 	 * Params:
78 	 *     appDir = the application specific preset dir
79 	 *
80 	 * Return: %TRUE for success, %FALSE if the dir already has been set
81 	 */
82 	public static bool setAppDir(string appDir);
83 
84 	/**
85 	 * Delete the given preset.
86 	 *
87 	 * Params:
88 	 *     name = preset name to remove
89 	 *
90 	 * Return: %TRUE for success, %FALSE if e.g. there is no preset with that @name
91 	 */
92 	public bool deletePreset(string name);
93 
94 	/**
95 	 * Gets the @value for an existing meta data @tag. Meta data @tag names can be
96 	 * something like e.g. "comment". Returned values need to be released when done.
97 	 *
98 	 * Params:
99 	 *     name = preset name
100 	 *     tag = meta data item name
101 	 *     value = value
102 	 *
103 	 * Return: %TRUE for success, %FALSE if e.g. there is no preset with that @name
104 	 *     or no value for the given @tag
105 	 */
106 	public bool getMeta(string name, string tag, out string value);
107 
108 	/**
109 	 * Get a copy of preset names as a %NULL terminated string array.
110 	 *
111 	 * Return: list with names, use g_strfreev() after usage.
112 	 */
113 	public string[] getPresetNames();
114 
115 	/**
116 	 * Get a the names of the GObject properties that can be used for presets.
117 	 *
118 	 * Return: an
119 	 *     array of property names which should be freed with g_strfreev() after use.
120 	 */
121 	public string[] getPropertyNames();
122 
123 	/**
124 	 * Check if one can add new presets, change existing ones and remove presets.
125 	 *
126 	 * Return: %TRUE if presets are editable or %FALSE if they are static
127 	 *
128 	 * Since: 1.6
129 	 */
130 	public bool isEditable();
131 
132 	/**
133 	 * Load the given preset.
134 	 *
135 	 * Params:
136 	 *     name = preset name to load
137 	 *
138 	 * Return: %TRUE for success, %FALSE if e.g. there is no preset with that @name
139 	 */
140 	public bool loadPreset(string name);
141 
142 	/**
143 	 * Renames a preset. If there is already a preset by the @new_name it will be
144 	 * overwritten.
145 	 *
146 	 * Params:
147 	 *     oldName = current preset name
148 	 *     newName = new preset name
149 	 *
150 	 * Return: %TRUE for success, %FALSE if e.g. there is no preset with @old_name
151 	 */
152 	public bool renamePreset(string oldName, string newName);
153 
154 	/**
155 	 * Save the current object settings as a preset under the given name. If there
156 	 * is already a preset by this @name it will be overwritten.
157 	 *
158 	 * Params:
159 	 *     name = preset name to save
160 	 *
161 	 * Return: %TRUE for success, %FALSE
162 	 */
163 	public bool savePreset(string name);
164 
165 	/**
166 	 * Sets a new @value for an existing meta data item or adds a new item. Meta
167 	 * data @tag names can be something like e.g. "comment". Supplying %NULL for the
168 	 * @value will unset an existing value.
169 	 *
170 	 * Params:
171 	 *     name = preset name
172 	 *     tag = meta data item name
173 	 *     value = new value
174 	 *
175 	 * Return: %TRUE for success, %FALSE if e.g. there is no preset with that @name
176 	 */
177 	public bool setMeta(string name, string tag, string value);
178 }