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
|
<chapter id="objects_exported_to_scripting">
<title>Objects exported to scripting</title>
<sect1 id="settings">
<title>settings</title>
<para>
This object hold application settings and can be used to read or write them.
</para>
<sect2 id="settings.read">
<title><funcsynopsis>string settings.read(string key,string default=NULL)</funcsynopsis></title>
Returns application setting with given key.
The parameter default specify default value returned when the setting does not exist.
It can be omitted, in that case NULL will be returned.
</sect2>
<sect2 id="settings.readBool">
<title><funcsynopsis>bool settings.readBool(string key,bool default=false)</funcsynopsis></title>
Returns application setting with given key - treating it as boolean value.
The parameter default specify default value returned when the setting does not exist.
It can be omitted, in that case false will be returned.
</sect2>
<sect2 id="settings.readExpand">
<title><funcsynopsis>string settings.readExpand(string key,string default=NULL)</funcsynopsis></title>
Returns application setting with given key. Environment variable references are expanded (see <link linkend="settings.expand">expand</link>).
The parameter default specify default value returned when the setting does not exist.
It can be omitted, in that case NULL will be returned.
</sect2>
<sect2 id="settings.expand">
<title><funcsynopsis>string settings.expand(string)</funcsynopsis></title>
Return string with environment variable references (in form $VARIABLE and ${VARIABLE})
Any character preceded with backslash (especially $ character) is not processed in expansion.
<note>
Some internal variables (all of them beginning with $PDFEDIT_) can override corresponding environment variables.
This function will use the internal variable in expansion if both internal and environment variables exist.
</note>
<table frame="none" id="internal_vars_list">
<title>List of internal variables</title>
<tgroup cols="2"><tbody>
<row>
<entry>$PDFEDIT_BIN</entry>
<entry>Full path to directory in which the binary file resides</entry>
</row>
<row>
<entry>$PDFEDIT_DATA</entry>
<entry>
Full path to directory with editor data files - usually something like
<filename>/usr/share/pdfedit</filename> or <filename>/usr/local/share/pdfedit</filename>
unless configured diferently when building editor.
</entry>
</row>
</tbody></tgroup>
</table>
</sect2>
<sect2 id="settings.write">
<title><funcsynopsis>string settings.write(string key,string value)</funcsynopsis></title>
Write application setting with given key and value
</sect2>
<sect2 id="settings.remove">
<title><funcsynopsis>string settings.remove(string key)</funcsynopsis></title>
Remove key from user settings, effectively restoring the setting to its default value
</sect2>
<sect2 id="settings.flush">
<title><funcsynopsis>void settings.flush()</funcsynopsis></title>
Write all unsaved settings to disk. Unsaved settings are automatically writen
to disk on application exit, but this can flush them to disk explicitly.
</sect2>
</sect1>
<sect1 id="document_related">
<title>Document-related objects in scripting</title>
<para>
These objects are set to reflect currently edited document
</para>
<sect2 id="document">
<title>document</title>
<para>
This object represents currently edited PDF document.
Type of this object is <link linkend="type_Pdf">Pdf</link>
</para>
</sect2>
</sect1>
</chapter>
|