## Attributes Element

A component definition file can define an optional section for attributes. Attributes are inherited from a component’s optional base component. Generally, attributes can hold any static character data that is common to all instances of a component. However, there are some predefined attributes that the UI designer understands and some which are specific to the built-in components.

#### Example Attributes Declaration

    <attributes>
       <attribute  key="is-layout-object">true</attribute>
       <attribute  key="is-transient-object">true</attribute>
       <attribute  key="display-model-class">
          com.nokia.sdt.component.symbian.displaymodel.DisplayModel
       </attribute>
    </attributes>

#### Predefined Common Attributes

Attribute | Description
--- | ---
is-layout-object | A boolean flag indicating that a component is a layout object. A layout object is always created in the upper part of the editor where the “layout” exists, and must define location and size properties.
is-layout-container | A boolean flag indicating that a component can be a layout container. Containers have the additional behavior that they can contain other layout objects.
is-non-layout-object | A boolean flag indicating that a component is a non-layout object. A non-layout object is always created in the lower part of the editor and appears only as an icon.
is-transient-object | A boolean flag indicating that a component is a transient UI object. It will appear in the upper part of the editor when it is selected, and all other layout objects will be greyed out. An example of this is a menu bar. Generally, a trainsient object is also a non-layout object. Without declaring the latter, it would only show up in the outline view until selected. If a transient object is also a container, its children should not be transient objects but regular layout objects.
is-top-level-only-layout-object | A boolean flag indicating that a component can only be added to a container defining its "is-top-level-content-container" attribute as true.
is-top-level-content-container | A boolean flag indicating a container that can be used as a top level content container (e.g. CCoeControl, Form, or SettingsItemList).
is-exclusive-child-layout-object | A boolean flag indicating that a component must be the exclusive content of its container and can have no siblings.
is-not-user-removable | A boolean flag indicating that a component is not removable by the user in the editor. No delete operation will be available for it.
is-non-resizable-layout-object | A boolean flag indicating that a component is not resizable by the user in the editor. Selection trackers will not include resize trackers.
is-non-resizable-or-moveable-layout-object | A boolean flag indicating that a component is not moveable or resizable by the user in the editor.
fixed-child-order | A boolean flag indicating that children of this container can't be reordered by the user in the outline or by any reorder actions (move up/move down).
lays-out-children | A boolean flag indicating that a container is responsible for laying out its children via its ILayout implementation (script), so the editor will inhibit sizing and moving them after they are created.
never-add-component | A boolean flag indicating that a component can never be added to a container unless that container specifically has a IQueryContainment implementation (script) allowing it.
not-in-toolbox | A boolean flag indicating to the UI designer that the component should not appear in the toolbox.
is-system-component | A boolean flag indicating that a component has some special system significance (e.g., control pane, status pane, navi pane content). System components are not selected when the select-all action is invoked.
is-initial-content | A boolean flag indicating initial content for the S60 wizard (e.g., List). This will show the component (and its thumbnail) in the wizard’s initial content page.
display-model-class | The Java class used by the root container for its IDisplayModel implementation. This attribute should only be set (and is required to be set) by the root container. This should always be: com.nokia.sdt.component.symbian.displaymodel.DisplayModel
supported-layouts | Semicolon-delimited list of layout names supported by a container component. These names correspond to various skins supported by the Symbian UI designer.
event-handler-target | A boolean flag indicating this component is the target of event handler prototypes and handlers. When set, the script variable 'handlerClassName' is visible to child components and is the value of this component's 'className' property.
associated-palette-drawer | A string representing the palette drawer that is associated with some container. This is used to ensure this drawer is open in the palette when the palette is built.
vertical-scrollable-container | A boolean flag on containers indicating that this container should be scrollable vertically.
horizontal-scrollable-container | A boolean flag on containers indicating that this container should be scrollable horizontally.
collapsed-in-outline | A boolean flag on containers indicating that this container should be collapsed by default in the outline (when not specified, containers are expanded by default).
layout-container-indirection-reference-property | The name of the component reference property whose value contains the name of the instance that provides indirection of the layout container adapter. This allows the layout container to display layout object children of another container. NOTE that this can only be used with an outline container, since otherwise, there would be more than one controller and figure in the graphical viewer for the same model object. The case of multiple graphical representations in a view for a single model object is not supported.
no-transient-child-clipping | A boolean flag that applies only to objects rendered in the transient layer. This flag indicates that the container's children should not be clipped when they are painted.

#### Predefined Symbian-specific Attributes

Attribute | Description
--- | ---
rss-control-type-enum | An attribute to define the control type in RSS (EEikCt... or EAknCt...).
is-design-reference | Indicates whether the component is a design reference. If so, it is expected to publish the properties: filePath (string) baseName (string)

#### Predefined S60-specific Attributes

Attribute | Description
--- | ---
is-navipane-content | A boolean flag indicating that a component is the contents of the navipane.
is-dialog-content | A boolean flag indicating that a component is the contents of a dialog.
is-form-content | A boolean flag indicating that a component is the contents of a form.
is-ccoecontrol-content | A boolean flag indicating that a component is the contents of a CCoeControl.
status-pane-id | An attribute to define the pane id for a status pane.
options-menu-property-name | An attribute to define the name of the options menu reference property, for example optionsMenu.
has-builtin-options-menu | A boolean flag indicating that a component has a builtin options menu (e.g. CAknForm). This flag is used by the S60 wizard to inhibit creation of the options menu.
container-background-color-property-name | An attribute for containers identifying which property defines the background color.
is-non-resizable-or-moveable-layout-object | A boolean flag indicating that a component is not moveable or resizable by the user in the editor.
container-background-color | An attribute for containers that defines the actual look and feel color that defines the background color. It is used as a fallback when the "container-background-color-property-name" is not set.
default-cba-value | An attribute with an alternate CBA default for use by the wizard.

#### Non-Layout Components

If creating a non-layout component, use the is-non-layout-object attribute in the attribute declaration section of your component definition file. Non-layout components are objects that are not visually represented, such as the S60 standard web-client component. A non-layout component can represent data or a code pattern to be added to a design. For example, the web-client component performs a HTTP Get on the URL specified as the default. Non-layout components appear in the non-layout area of the UI Designer and are not visually represented in the UI design, however they may have an associated icon image that is visible in the Outline view.

Figure 1. Non-layout Component in Non-layout Area

#### Transient Components

If creating a transient component, use the is-transient-object attribute in the attribute declaration section of your component definition file. Similar to non-layout components, transient components do not represent visual objects in the layout of the UI design. Although a transient component does not represent a visual aspect of the design, it does have visual properties.

An example of a transient component is a menubar and its menu items. At runtime, the menu items are visible when activated. They have “transient” visual properties. Non-layout components and transient components have no place in the layout of the design and are therefore represented as icons in the non-layout area of the UI Designer editor. Transient component instances, however, will appear in the upper (layout) area of the editor when selected in the non-layout area; and may be edited visually.

##### Related Reference

Defining a Transient Component