Home · All Namespaces · All Classes
Classes | Public Slots | Signals | Public Member Functions | Protected Member Functions

Launcher Class Reference

#include <launcher.h>

Collaboration diagram for Launcher:
Collaboration graph
[legend]

List of all members.

Classes

class  Placement
 A class for storing, parsing and ordering the placement information of the items. More...

Public Slots

int focusToButton (const QString &desktopFileEntry)
void setPage (uint page)
void updateButtonState (const QString &desktopEntryPath, const QString &packageName, LauncherButtonModel::State state, int progress, bool packageRemovable)
void removePlaceholderButton (const QString &desktopEntryPath)
void updateButtonPlacementsOnPage (LauncherPage *page)

Signals

void launcherButtonClicked ()
void panningRequested (uint page)
void focusToPageRequested (uint page)
void focusToButtonRequested (const QString &desktopFileEntry)

Public Member Functions

 Launcher (QGraphicsItem *parent=NULL, LauncherModel *model=NULL)
virtual ~Launcher ()
void setLauncherDataStore (LauncherDataStore *dataStore)
void setApplicationPackageMonitorListener (ApplicationPackageMonitorListener *packageMonitorListener)
void setMaximumPageSize (int maximumPageSize)

Protected Member Functions

virtual QSharedPointer
< LauncherButton
createLauncherButton (const QString &desktopEntryPath)
virtual QSharedPointer
< LauncherPage
createLauncherPage ()
 Creates a launcher page.

Detailed Description

Widget for launching and browsing installed applications. The widget monitors a desktop file entry directory and creates buttons that represent the applications that can be launched.

For updating the launcher first time from launcher data store, we listen to dataStoreChanged() signal. After the first initialization we disconnect from dataStoreChanged signal and rely on signals for individual updates to provide the changes in desktop entries.

Each application .desktop file must define the Name, Type and Icon keys where type is Application. The Exec key must define the application binary to be launched when the icon is selected.

Example my_application.desktop file:

 [Desktop Entry]
 Version=1.0
 Type=Application
 Name=my_localized_application_name
 Comment=my_localized_application_comment
 Exec=/usr/bin/my-app
 Icon=my_app_icon_id

Constructor & Destructor Documentation

Launcher::Launcher ( QGraphicsItem *  parent = NULL,
LauncherModel model = NULL 
)

Constructs a Launcher widget. The Launcher will not store/restore launcher button positions and entries before a LauncherDataStore has been set using setLauncherDataStore().

Parameters:
parent parent graphics item for the widget, defaults to NULL
model model for the widget, defaults to a LauncherModel
Launcher::~Launcher (  )  [virtual]

Destroys the Launcher.


Member Function Documentation

QSharedPointer< LauncherButton > Launcher::createLauncherButton ( const QString &  desktopEntryPath  )  [protected, virtual]

Creates a launcher button instance from a .desktop entry file.

Parameters:
desktopEntryPath The path of the .desktop entry file to create a launcher button from
Returns:
a LauncherButton representing the .desktop entry file
QSharedPointer< LauncherPage > Launcher::createLauncherPage (  )  [protected, virtual]

Creates a launcher page.

int Launcher::focusToButton ( const QString &  desktopFileEntry  )  [slot]

Requests Launcher to focus to a Launcher Button specified by a desktop file.

Parameters:
desktopFileEntry is application's desktop file. Name should be given in format "filename.desktop" or in absolute path.
Returns:
index of page that contains application. Returns -1 if buttons is not found from launcher.
void Launcher::focusToButtonRequested ( const QString &  desktopFileEntry  )  [signal]

Signal requesting launcher to focus to an button specified by a desktopfile.

void Launcher::focusToPageRequested ( uint  page  )  [signal]

Signal to request moving launcher focus to a page

void Launcher::launcherButtonClicked (  )  [signal]

Signal sent when a launcher button was clicked.

void Launcher::panningRequested ( uint  page  )  [signal]

Signal to request panning to specific page

Parameters:
page number of page to pan to
void Launcher::removePlaceholderButton ( const QString &  desktopEntryPath  )  [slot]

Removes placeholder launcher button for an application if application is not installed.

We can only remove button if it is found from launcher and desktop entry file paths match. Different desktop entry file paths means that button is not placeholder and hence needs to be removed by launcher data store.

Parameters:
desktopEntryPath of an application
void Launcher::setApplicationPackageMonitorListener ( ApplicationPackageMonitorListener packageMonitorListener  ) 

Connects the Launcher to an ApplicationPackageMonitor for monitoring installation and update progress of application packages.

Parameters:
packageMonitorListener Listens to signals from application package monitor
void Launcher::setLauncherDataStore ( LauncherDataStore dataStore  ) 

Takes a LauncherDataStore into use.

Parameters:
dataStore LauncherDataStore for storing launcher button positions and entries
void Launcher::setMaximumPageSize ( int  maximumPageSize  ) 

Sets the maximum size of the Launcher pages. Negative values are ignored. If a LauncherPage already has more items than the desired maximum the page is not resized.

Parameters:
maximumPageSize the maximum number of buttons on a single LauncherPage
void Launcher::setPage ( uint  page  )  [slot]

Set launcher to show a page.

Parameters:
number of page to show.
void Launcher::updateButtonPlacementsOnPage ( LauncherPage page  )  [slot]

Updates current Launcher Button placements on LauncherPage to desktop files.

Parameters:
Page for update
void Launcher::updateButtonState ( const QString &  desktopEntryPath,
const QString &  packageName,
LauncherButtonModel::State  state,
int  progress,
bool  packageRemovable 
) [slot]

Updates the state and operation progress of a launcher button. Creates a new placeholder button if one doesn't exist for the given desktopentryfile.

Parameters:
desktopEntryPath Desktop entry of the package that button represents
state State button should be set to
progress Progress of operation
packageRemovable is the package represented by this button removable

The documentation for this class was generated from the following files:

Copyright © 2011 Nokia Corporation Generated on Thu Jul 7 2011 22:14:50
Doxygen 1.7.1
MeeGo Touch