Detailed Description
The PhoneLauncherView class is a view onto a scene, which is a grid of objects.
PhoneLauncherView creates and maintains the scene itself; it is capable of creating and adding the grid objects which will populate the scene's grid. Each grid object represents a folder or application, i.e. something that can be 'opened'.
In addition to the grid objects, a 'selected' item is positioned over the 'current' grid object. The selected item has a different appearance to its current grid object, and is also able to animate.
This class is part of the Qt Extended server and cannot be used by other Qt Extended applications.
See also GridBrowserScreen.
Member Function Documentation
PhoneLauncherView::PhoneLauncherView ( int rows, int cols, const QString & mapping, const QString & animator, const QString & animatorBackground, QWidget * parent = 0 )
rows: Number of rows that will be in the grid. cols: Number of columns that will be in the grid. mapping: A list of characters that map to grid objects according to their position. For example, the first character in mapping will refer to the grid object at row 0, column 0, the second character will refer to row 0, column 1 etc. The mapping is used by keyPressEvent(QKeyEvent *). animator: The name of an animation object, which generally comes from a configuration file. Note that this name must be known to AnimatorFactory, which is responsible for the creation of the animators. The string may be an empty string, in which case there will be no animation. Note, however, that if any movie files (.mng) are present for a QContent object, these will take precedence over any animator. animatorBackground: The name of an animation object (to be used for the background during animation), which generally comes from a configuration file. Note that this name must be known to AnimatorFactory, which is responsible for the creation of the animators. The string may be an empty string, in which case there will be no background animation. parent: Optional parent widget.
PhoneLauncherView::~PhoneLauncherView () [virtual]
void PhoneLauncherView::addItem ( QContent * content, int pos = -1 )
Creates a new GridItem object and adds it to the scene, or else updates the GridItem at the given position, if it already exists. When a new GridItem object is added, its position and size will be calculated and set in response to resizeevent(...). When an existing GridItem object is modified, its position and size do not change in response to content -- position and size are determined by other factors, such as the size of the view and the current resolution.
content: Contains information to be used by the GridItem object, such as the Icon used to display it, the name of its underlying application, etc. pos: The index of the GridItem object, which will be converted into a row and a column position.
void PhoneLauncherView::clicked ( QContent content ) [signal]
Indicates that an item on the grid with the given content has been selected. Typically, this is handled by invoking that item's underlying application. content See description.
QContent * PhoneLauncherView::currentItem () const [slot]
Returns the content information for the current GridItem object, or 0 if no item is current.
See also setCurrentItem().
void PhoneLauncherView::highlighted ( QContent content ) [signal]
Indicates that the item on the grid with the given content has become the new current item. content See description.
void PhoneLauncherView::pressed ( QContent content ) [signal]
Indicates that a key or mouse press has occurred which, when released, will result in the item on the grid with the given content to be selected. content See description.
void PhoneLauncherView::setBusy ( bool flag )
Currently does nothing. In the future, this function could allow PhoneLauncherView to change the appearance of the SelectedItem object to indicate that it is 'busy' (for example, starting an application). flag: Not currently used.
void PhoneLauncherView::setCurrentItem ( int idx )
Causes the item positioned at the given index to become the current item. If idx is invalid, no change will occur. idx: The index of a GridItem object.
See also currentItem().
void PhoneLauncherView::updateImages ()
Causes all GridItem objects to query their QContent counterparts to refresh their image information. This function should be called when image data has/may have changed.