1
/*****************************************************************
3
Copyright 2010 Anton Kreuzkamp <akreuzkamp@web.de>
5
Permission is hereby granted, free of charge, to any person obtaining a copy
6
of this software and associated documentation files (the "Software"), to deal
7
in the Software without restriction, including without limitation the rights
8
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
copies of the Software, and to permit persons to whom the Software is
10
furnished to do so, subject to the following conditions:
12
The above copyright notice and this permission notice shall be included in
13
all copies or substantial portions of the Software.
15
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
19
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22
******************************************************************/
23
#ifndef LAUNCHERITEM_H
24
#define LAUNCHERITEM_H
26
#include "abstractgroupableitem.h"
27
#include "taskmanager_export.h"
37
class LauncherItemPrivate;
40
* An item shown in the taskmanager, in order to use it to launch the application (or file) the launcher is linked to.
41
* If the Application is running the launcher gets hidden, in order to not waste space.
43
class TASKMANAGER_EXPORT LauncherItem : public AbstractGroupableItem
48
* Creates a LauncherItem for a executable
49
* @param url the URL to the application or file the launcher gets linked to
51
LauncherItem(QObject *parent, const KUrl &url);
55
* @deprecated: use itemType() instead
57
KDE_DEPRECATED bool isGroupItem() const;
58
ItemType itemType() const;
63
QString genericName() const;
65
void setIcon(const QIcon &icon);
66
void setName(const QString &name);
67
void setGenericName(const QString &genericName);
69
// bookkeeping methods for showing/not showing
70
void associateItemIfMatches(AbstractGroupableItem *item);
71
void removeItemIfAssociated(AbstractGroupableItem *item);
72
bool shouldShow() const;
74
//reimplemented pure virtual methods from abstractgroupableitem
75
bool isOnCurrentDesktop() const;
76
bool isOnAllDesktops() const;
78
bool isShaded() const;
79
bool isMaximized() const;
80
bool isMinimized() const;
81
bool isFullScreen() const;
82
bool isKeptBelowOthers() const;
83
bool isAlwaysOnTop() const;
84
bool isActionSupported(NET::Action) const;
85
bool isActive() const;
86
bool demandsAttention() const;
87
void addMimeData(QMimeData *mimeData) const;
88
KUrl launcherUrl() const;
89
void setLauncherUrl(const KUrl &url);
97
void setMaximized(bool);
98
void toggleMaximized();
100
void setMinimized(bool);
101
void toggleMinimized();
103
void setFullScreen(bool);
104
void toggleFullScreen();
106
void setKeptBelowOthers(bool);
107
void toggleKeptBelowOthers();
109
void setAlwaysOnTop(bool);
110
void toggleAlwaysOnTop();
117
void show(bool shouldShow);
120
friend class LauncherItemPrivate;
121
LauncherItemPrivate * const d;
123
//preferred applications hack
124
QString defaultApplication(QString application, bool storageId = false);
126
Q_PRIVATE_SLOT(d, void associateDestroyed(QObject *obj))
129
} // TaskManager namespace