<commit_before>/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (<EMAIL>)
**
** This file is part of duihome.
**
** If you have questions regarding the use of this file, please contact
** Nokia at <EMAIL>.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/

#ifndef LAUNCHER_H
#define LAUNCHER_H

#include <QObject>
#include <QList>
#include <QFileSystemWatcher>
#include <DuiWidgetController>
#include "launchermodel.h"

#ifdef ENABLE_QTTRACKER
#include <QtTracker/Tracker>
#endif

class DuiDesktopEntry;

/*!
 * 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.
 */
class Launcher : public DuiWidgetController
{<commit_msg>Changes: Moved some documentation from the wiki to the doxygen docs<commit_after>/***************************************************************************
**
** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (<EMAIL>)
**
** This file is part of duihome.
**
** If you have questions regarding the use of this file, please contact
** Nokia at <EMAIL>.
**
** This library is free software; you can redistribute it and/or
** modify it under the terms of the GNU Lesser General Public
** License version 2.1 as published by the Free Software Foundation
** and appearing in the file LICENSE.LGPL included in the packaging
** of this file.
**
****************************************************************************/

#ifndef LAUNCHER_H
#define LAUNCHER_H

#include <QObject>
#include <QList>
#include <QFileSystemWatcher>
#include <DuiWidgetController>
#include "launchermodel.h"

#ifdef ENABLE_QTTRACKER
#include <QtTracker/Tracker>
#endif

class DuiDesktopEntry;

/*!
 * 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.
 *
 * 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. Each application can define the directory (submenu) in which the application should be displayed in by defining a value for the Categories key in its .desktop file. If no value has been defined for Categories the application will be displayed in the top level menu.
 *
 * Shortcuts are stored in tracker in \c DesktopBookmarkFolder as \c nfo:bookmark objects. Bookmarks define title, bookmark content iri, and bookmark thumbnail graphics for each shortcut. All shortcuts are displayed in the Launcher top level menu. Each shortcut is bound to a !DuiServiceAction that is triggered when shortcut is clicked. This will commence default action associated with the content iri in the system.
 *
 * Convenience API for creating shortcuts on homescreen launcher menu is provided in the \c libduihome package through the \c DuiHomeShortcutManager class.
 *
 * Example my_application.desktop file:
 * \code
 * [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
 * Categories=Games
 * X-Icon-path=/usr/share/pixmaps/
 * X-Window-Icon=my_app_icon_id
 * X-Osso-Service=my_app_dbus_service
 * X-Osso-Type=application/x-executable
 * MimeType=image/png;image/svg
 * Prestarted=yes
 * \endcode
 *
 * Example my_category.directory file
 * \code
 * [Desktop Entry]
 * Version=1.0
 * Type=Directory
 * Name=my_localized_category_name
 * Icon=my_category_icon_id
 * \endcode
 *
 * Example sparql query to list homescreen shortcut items and its output:
 * \code
 * tracker-sparql -q '
 *    SELECT ?ref ?thumb ?title WHERE {
 *        <maemo:DesktopBookmarkFolder> nfo:containsBookmark ?x.
 *        ?x maemo:bookmarkThumbnail ?thumb ;
 *           nfo:bookmarks ?ref ;
 *           nie:title ?title .
 *   }'
 *   file:///home/user/image.jpeg, file:///home/user/.thumbnails/large/0912830981230.png, Lovely image
 *   file:///home/user/image.jpeg, file:///home/user/.thumbnails/large/0912830981230.png, Lovely image
 * \endcode
 */
class Launcher : public DuiWidgetController
{
{'fraction_non_alphanumeric': 0.14381975152663717, 'fraction_numerical': 0.008843967150979154, 'mean_word_length': 4.757575757575758, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2919723', 'n_tokens_mistral': 1366, 'n_tokens_neox': 1266, 'n_words': 503}