• 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
MergedActionListModel.h
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 #ifndef LANCELOT_MERGED_ACTION_LIST_MODEL_H
21 #define LANCELOT_MERGED_ACTION_LIST_MODEL_H
22 
23 #include <QtCore/QPair>
24 
25 #include <lancelot/lancelot_export.h>
26 #include <lancelot/models/ActionListModel.h>
27 
28 namespace Lancelot
29 {
30 
36 class LANCELOT_EXPORT MergedActionListModel: public ActionListModel {
37  Q_OBJECT
38 public:
42  MergedActionListModel();
43 
47  virtual ~MergedActionListModel();
48 
55  void addModel(QIcon icon, const QString & title, ActionListModel * model);
56 
62  void addModel(ActionListModel * model);
63 
68  ActionListModel * modelAt(int index);
69 
74  void removeModel(int index);
75 
79  int modelCount() const;
80 
87  virtual QMimeData * modelMimeData(int index) const;
88 
95  virtual void modelDataDropped(int index, Qt::DropAction action);
96 
105  virtual void setModelDropActions(int index,
106  Qt::DropActions & actions, Qt::DropAction & defaultAction);
107 
114  virtual bool hasModelContextActions(int index) const;
115 
122  virtual void setModelContextActions(int index, Lancelot::PopupMenu * menu);
123 
131  virtual void modelContextActivate(int index, QAction * context);
132 
133  L_Override QString title(int index) const;
134  L_Override QString description(int index) const;
135  L_Override QIcon icon(int index) const;
136  L_Override QMimeData * mimeData(int index) const;
137  L_Override void dataDragFinished(int index, Qt::DropAction action);
138  L_Override void setDropActions(int index, Qt::DropActions & actions, Qt::DropAction & defaultAction);
139  L_Override bool isCategory(int index) const;
140  L_Override int size() const;
141  L_Override bool hasContextActions(int index) const;
142  L_Override void setContextActions(int index, Lancelot::PopupMenu * menu);
143  L_Override void contextActivate(int index, QAction * context);
144 
145  L_Override bool dataDropAvailable(int where, const QMimeData * mimeData);
146  L_Override void dataDropped(int where, const QMimeData * mimeData);
147 
151  bool hideEmptyModels() const;
152 
156  void setHideEmptyModels(bool hide);
157 
161  bool showModelTitles() const;
162 
166  void setShowModelTitles(bool show);
167 
168 protected:
169  L_Override void activate(int index);
170 
171 protected Q_SLOTS:
172  // listen to model changes
173  void modelUpdated();
174  void modelItemInserted(int index);
175  void modelItemDeleted(int index);
176  void modelItemAltered(int index);
177 
178 private:
179  class Private;
180  Private * const d;
181 
182 };
183 
184 } // namespace Lancelot
185 
186 #endif /* LANCELOT_MERGED_ACTION_LIST_MODEL_H */
187 
Lancelot::ActionListModel
This class represents a list data model.
Definition: ActionListModel.h:37
QMimeData
L_Override
#define L_Override
Definition: lancelot_export.h:41
lancelot_export.h
LANCELOT_EXPORT
#define LANCELOT_EXPORT
Definition: lancelot_export.h:32
ActionListModel.h
QString
Lancelot::PopupMenu
The popup menu class.
Definition: PopupMenu.h:37
Qt::DropActions
typedef DropActions
QAction
Lancelot::MergedActionListModel
This class implements a model that merges a list of other models.
Definition: MergedActionListModel.h:36
QIcon
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