• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • workspace API Reference
  • KDE Home
  • Contact Us
 

liblancelot

  • sources
  • kde-4.14
  • workspace
  • kdeplasma-addons
  • libs
  • lancelot
  • models
ActionListModel.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2007, 2008, 2009, 2010 Ivan Cukic <ivan.cukic(at)kde.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser/Library General Public License version 2,
6  * or (at your option) any later version, as published by the Free
7  * Software Foundation
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser/Library General Public License for more details
13  *
14  * You should have received a copy of the GNU Lesser/Library General Public
15  * License along with this program; if not, write to the
16  * Free Software Foundation, Inc.,
17  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18  */
19 
20 #include "ActionListModel.h"
21 
22 namespace Lancelot {
23 
24 // ActionListModel
25 
26 ActionListModel::ActionListModel()
27 {
28 }
29 
30 ActionListModel::~ActionListModel()
31 {
32 }
33 
34 QString ActionListModel::description(int index) const
35 {
36  Q_UNUSED(index);
37  return QString();
38 }
39 
40 QIcon ActionListModel::icon(int index) const
41 {
42  Q_UNUSED(index);
43  return QIcon();
44 }
45 
46 QMimeData * ActionListModel::mimeData(int index) const
47 {
48  Q_UNUSED(index);
49  return NULL;
50 }
51 
52 bool ActionListModel::dataDropAvailable(int where, const QMimeData * mimeData)
53 {
54  Q_UNUSED(where);
55  Q_UNUSED(mimeData);
56  return false;
57 }
58 
59 void ActionListModel::dataDropped(int where, const QMimeData * mimeData)
60 {
61  Q_UNUSED(where);
62  Q_UNUSED(mimeData);
63 }
64 
65 void ActionListModel::dataDragFinished(int index, Qt::DropAction action)
66 {
67  Q_UNUSED(index);
68  Q_UNUSED(action);
69 }
70 
71 void ActionListModel::setDropActions(int index, Qt::DropActions & actions, Qt::DropAction & defaultAction)
72 {
73  Q_UNUSED(index);
74  actions = Qt::IgnoreAction;
75  defaultAction = Qt::IgnoreAction;
76 }
77 
78 bool ActionListModel::isCategory(int index) const
79 {
80  Q_UNUSED(index);
81  return false;
82 }
83 
84 void ActionListModel::activated(int index)
85 {
86  activate(index);
87  emit itemActivated(index);
88 }
89 
90 bool ActionListModel::hasContextActions(int index) const
91 {
92  Q_UNUSED(index);
93  return false;
94 }
95 
96 void ActionListModel::setContextActions(int index, Lancelot::PopupMenu * menu)
97 {
98  Q_UNUSED(index);
99  Q_UNUSED(menu);
100 }
101 
102 void ActionListModel::contextActivate(int index, QAction * context)
103 {
104  Q_UNUSED(index);
105  Q_UNUSED(context);
106 }
107 
108 void ActionListModel::activate(int index)
109 {
110  Q_UNUSED(index);
111 }
112 
113 QString ActionListModel::selfTitle() const
114 {
115  return QString();
116 }
117 
118 QString ActionListModel::selfShortTitle() const
119 {
120  return QString();
121 }
122 
123 QIcon ActionListModel::selfIcon() const
124 {
125  return QIcon();
126 }
127 
128 QMimeData * ActionListModel::selfMimeData() const
129 {
130  return NULL;
131 }
132 
133 } // namespace Lancelot
134 
135 #include "ActionListModel.moc"
136 
Lancelot::ActionListModel::hasContextActions
virtual bool hasContextActions(int index) const
Definition: ActionListModel.cpp:90
Lancelot::ActionListModel::ActionListModel
ActionListModel()
Creates a new instance of ActionListModel.
Definition: ActionListModel.cpp:26
Lancelot::ActionListModel::isCategory
virtual bool isCategory(int index) const
Definition: ActionListModel.cpp:78
Lancelot::ActionListModel::activated
void activated(int index)
Activates the specified element.
Definition: ActionListModel.cpp:84
Lancelot::ActionListModel::dataDropped
virtual void dataDropped(int where, const QMimeData *mimeData)
Invoked when the data is dropped into the model.
Definition: ActionListModel.cpp:59
QMimeData
Lancelot::ActionListModel::activate
virtual void activate(int index)
Models should reimplement this function.
Definition: ActionListModel.cpp:108
Lancelot::ActionListModel::selfShortTitle
virtual QString selfShortTitle() const
Definition: ActionListModel.cpp:118
Lancelot::ActionListModel::setDropActions
virtual void setDropActions(int index, Qt::DropActions &actions, Qt::DropAction &defaultAction)
Definition: ActionListModel.cpp:71
Lancelot::ActionListModel::itemActivated
void itemActivated(int index)
This signal is emitted when an item is activated.
Lancelot::ActionListModel::dataDropAvailable
virtual bool dataDropAvailable(int where, const QMimeData *mimeData)
Definition: ActionListModel.cpp:52
ActionListModel.h
Lancelot::ActionListModel::selfMimeData
virtual QMimeData * selfMimeData() const
Definition: ActionListModel.cpp:128
Lancelot::ActionListModel::icon
virtual QIcon icon(int index) const
Definition: ActionListModel.cpp:40
Lancelot::ActionListModel::selfIcon
virtual QIcon selfIcon() const
Definition: ActionListModel.cpp:123
QString
Lancelot::ActionListModel::selfTitle
virtual QString selfTitle() const
Definition: ActionListModel.cpp:113
Lancelot::ActionListModel::dataDragFinished
virtual void dataDragFinished(int index, Qt::DropAction action)
This function is invoked when a data is dropped.
Definition: ActionListModel.cpp:65
Lancelot::ActionListModel::setContextActions
virtual void setContextActions(int index, Lancelot::PopupMenu *menu)
Adds actions ofr the specifies item to menu.
Definition: ActionListModel.cpp:96
Lancelot::ActionListModel::~ActionListModel
virtual ~ActionListModel()
Destroys this ActionListModel.
Definition: ActionListModel.cpp:30
Lancelot::PopupMenu
The popup menu class.
Definition: PopupMenu.h:37
Lancelot::ActionListModel::description
virtual QString description(int index) const
Definition: ActionListModel.cpp:34
Lancelot::ActionListModel::mimeData
virtual QMimeData * mimeData(int index) const
Definition: ActionListModel.cpp:46
Qt::DropActions
typedef DropActions
QAction
QIcon
Lancelot::ActionListModel::contextActivate
virtual void contextActivate(int index, QAction *context)
Method for handling context menu actions.
Definition: ActionListModel.cpp:102
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:43:01 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

liblancelot

Skip menu "liblancelot"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

workspace API Reference

Skip menu "workspace API Reference"
  • kdeplasma-addons
  •       GroupingDesktop
  •     liblancelot

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal