Elementary Prefs Data Collection Reference

- Main Page
- Related Pages
- Data Structures
- Files
- Examples

Elementary Prefs Data Collection Reference

An Elementary Prefs Collection is a plain text file (normally identified with the .epc extension), consisting of instructions for the Elm Prefs Compiler.

The syntax for the elementary prefs data files follows a simple structure of "blocks { .. }" that can contain "properties: ..", more blocks, or both.

Quick access to block descriptions:

- Page
- Items
  - Bool
  - Int
  - Float
  - Date
  - Text
  - Text Area

Author
  Ricardo de Almeida Gonzaga (ricardotk) ricar.nosp@m.do@p.nosp@m.rofus.nosp@m.ion..nosp@m.mobi

Page
page | collection { .. page { name: "main"; version: 1; title: "Preference Widgets"; subtitle: "Subtitle"; widget: "elm/vertical_frame"; items { } } .. }
| A "page" block is a grouping of prefs items together. A prefs widget must always be bound to a page, that can address other pages in the collection too as sub-pages.
`name` | `[page name]`
| The name of the page (to be referred by the application). It must be unique within the collection.
`version` | `[page version]`
| The page's version.
`title` | `[page title]`
| Set page's title.
`subtitle` | `[page subtitle]`
| Set page's subtitle.
`widget` | `[page widget]`
| Set the widget from among the available page widgets. Valid, built-in page widgets are: elm/horizontal_box elm/vertical_box elm/horizontal_frame elm/vertical_frame
`style` | `[page style]`
| Set page's style.
`icon` | `[page icon]`
| Set page's icon.
`autosave` | `[1 or 0]`
| Takes a boolean value specifying whether page is autosaved (1) or not (0). The default value is 1.
Items
items | page { .. items { name: "item"; type: INT; label: "Just a item label..."; type { } } .. }
| An "item" block declares a new Prefs item, along with its properties.
`name` | `[item name]`
| The item's name, to be referred by the application. It must be unique within the page.
`type` | `[TYPE]`
| Set the type (all types must be entered in capitals) from among the available types, that are: BOOL - Checkbox. INT - Slider. FLOAT - Slider. DATE - Date/time display and input widget. TEXT - Single-line text entry. TEXTAREA - Text entry. LABEL - Read-only label. PAGE - Prefs subpage object. SEPARATOR - Line that serves only to divide and organize prefs item. SWALLOW - Swallows an Evas_Object. SAVE - Button that will get all the values bounded to items and save it on CFG file. ACTION - Button that will emit a signal to .C file and call a smart callback. RESET - Button that will return all the values bounded to items as default declared on .EPC file.
`label` | `[a string to label]`
| Set a string to item's label.
`icon` | `[item icon]`
| This is the item icon.
`persistent` | `[1 or 0]`
| Takes a boolean value specifying whether item is persistent (1) or not (0). The default value is 1. A non persistent item doesn't save its values when saved.
`editable` | `[1 or 0]`
| Takes a boolean value specifying whether item is editable (1) or not (0). The default value is 1.
`visible` | `[1 or 0]`
| Takes a boolean value specifying whether item is visible (1) or not (0). The default value is 1.
`style` | `[item style]`
| This is the item's style.
`widget` | `[item widget]`
| This is the item's widget, for cases where a widget differs than the default assigned to the type is desired.
Bool item sub blocks
bool | item { .. bool { default: true; } .. }
`default` | `[true or false]`
| Takes a boolean value specifying whether item is checked (true) or not (false).
Int item sub blocks
int | item { .. int { default: 150; min: 0; max: 300; } .. }
`default` | `[value]`
| Set a default (initial) value to the item.
`min` | `[value]`
| Set a minimum value to the item. Note that, without a minimum value, the widget implementing the item visually will get an available range of values bound to the minimum of the least integer number representable, and it might not be what you want.
`max` | `[value]`
| Set a maximum value to the item. Note that, without a maximum value, the widget implementing the item visually will get an available range of values bound to the maximum of the least integer number representable, and it might not be what you want.
Float item sub blocks
float | item { .. float { default: 0.5; min: 0; max: 1; } .. }
`default` | `[value]`
| Set a default (initial) value to the item.
`min` | `[value]`
| Set a minimum value to the item. Note that, without a minimum value, the widget implementing the item visually will get an available range of values bound to the minimum of the least floating point number representable, and it might not be what you want.
`max` | `[value]`
| Set a maximum value to the item. Note that, without a maximum value, the widget implementing the item visually will get an available range of values bound to the maximum of the least floating point number representable, and it might not be what you want.
Date item sub blocks
date | item { .. date { default: 2012 11 05; min: 1900 1 1; max: 2200 12 31; } .. }
`default` | `[year month date] or "today"`
| Set a default (initial) date to the item. "today" will translate to current date.
`min` | `[year month date] or "today"`
| Set a minimum date to the item. "today" will translate to current date.
`max` | `[year month date] or "today"`
| Set a maximum date to the item. "today" will translate to current date.
Text item sub blocks
text | item { .. text { default: "Default text"; placeholder: "Text:"; accept: "^[a-zA-Z ]$"; deny: ""; } .. }
`default` | `[a string of text]`
| Set a default text.
`placeholder` | `[a string of text]`
| Set a placeholder.
`accept` | `[regular expression]`
| Set an acceptance regular expression. It must be a valid one.
`deny` | `[regular expression]`
| Set a denial regular expression. It must be a valid one.
Text Area item sub blocks
textarea | item { .. textarea { default: "Default text"; placeholder: "No Numbers!"; accept: ""; deny: "^[0-9]*$"; } .. }
`default` | `[a string of text]`
| Set a default text.
`placeholder` | `[a string of text]`
| Set a placeholder.
`accept` | `[regular expression]`
| Set an acceptance regular expression. It must be a valid one.
`deny` | `[regular expression]`
| Set a denial regular expression. It must be a valid one.