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  * 
46  * The default implementation supports presets located in a system directory,
47  * application specific directory and in the users home directory. When getting
48  * a list of presets individual presets are read and overlaid in 1) system,
49  * 2) application and 3) user order. Whenever an earlier entry is newer, the
50  * later entries will be updated.
51  */
52 public interface PresetIF{
53 	/** Get the main Gtk struct */
54 	public GstPreset* getPresetStruct();
55 
56 	/** the main Gtk struct as a void* */
57 	protected void* getStruct();
58 
59 	/**
60 	 */
61 
62 	/**
63 	 * Gets the directory for application specific presets if set by the
64 	 * application.
65 	 *
66 	 * Return: the directory or %NULL, don't free or modify
67 	 *     the string
68 	 */
69 	public static string getAppDir();
70 
71 	/**
72 	 * Sets an extra directory as an absolute path that should be considered when
73 	 * looking for presets. Any presets in the application dir will shadow the
74 	 * system presets.
75 	 *
76 	 * Params:
77 	 *     appDir = the application specific preset dir
78 	 *
79 	 * Return: %TRUE for success, %FALSE if the dir already has been set
80 	 */
81 	public static bool setAppDir(string appDir);
82 
83 	/**
84 	 * Delete the given preset.
85 	 *
86 	 * Params:
87 	 *     name = preset name to remove
88 	 *
89 	 * Return: %TRUE for success, %FALSE if e.g. there is no preset with that @name
90 	 */
91 	public bool deletePreset(string name);
92 
93 	/**
94 	 * Gets the @value for an existing meta data @tag. Meta data @tag names can be
95 	 * something like e.g. "comment". Returned values need to be released when done.
96 	 *
97 	 * Params:
98 	 *     name = preset name
99 	 *     tag = meta data item name
100 	 *     value = value
101 	 *
102 	 * Return: %TRUE for success, %FALSE if e.g. there is no preset with that @name
103 	 *     or no value for the given @tag
104 	 */
105 	public bool getMeta(string name, string tag, out string value);
106 
107 	/**
108 	 * Get a copy of preset names as a %NULL terminated string array.
109 	 *
110 	 * Return: list with names, use g_strfreev() after usage.
111 	 */
112 	public string[] getPresetNames();
113 
114 	/**
115 	 * Get a the names of the GObject properties that can be used for presets.
116 	 *
117 	 * Return: an
118 	 *     array of property names which should be freed with g_strfreev() after use.
119 	 */
120 	public string[] getPropertyNames();
121 
122 	/**
123 	 * Load the given preset.
124 	 *
125 	 * Params:
126 	 *     name = preset name to load
127 	 *
128 	 * Return: %TRUE for success, %FALSE if e.g. there is no preset with that @name
129 	 */
130 	public bool loadPreset(string name);
131 
132 	/**
133 	 * Renames a preset. If there is already a preset by the @new_name it will be
134 	 * overwritten.
135 	 *
136 	 * Params:
137 	 *     oldName = current preset name
138 	 *     newName = new preset name
139 	 *
140 	 * Return: %TRUE for success, %FALSE if e.g. there is no preset with @old_name
141 	 */
142 	public bool renamePreset(string oldName, string newName);
143 
144 	/**
145 	 * Save the current object settings as a preset under the given name. If there
146 	 * is already a preset by this @name it will be overwritten.
147 	 *
148 	 * Params:
149 	 *     name = preset name to save
150 	 *
151 	 * Return: %TRUE for success, %FALSE
152 	 */
153 	public bool savePreset(string name);
154 
155 	/**
156 	 * Sets a new @value for an existing meta data item or adds a new item. Meta
157 	 * data @tag names can be something like e.g. "comment". Supplying %NULL for the
158 	 * @value will unset an existing value.
159 	 *
160 	 * Params:
161 	 *     name = preset name
162 	 *     tag = meta data item name
163 	 *     value = new value
164 	 *
165 	 * Return: %TRUE for success, %FALSE if e.g. there is no preset with that @name
166 	 */
167 	public bool setMeta(string name, string tag, string value);
168 }