• 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
StandardActionListModel.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_STANDARD_ACTION_LIST_MODEL_H
21 #define LANCELOT_STANDARD_ACTION_LIST_MODEL_H
22 
23 #include <QtCore/QVariant>
24 
25 #include <lancelot/lancelot_export.h>
26 #include <lancelot/models/ActionListModel.h>
27 
28 namespace Lancelot
29 {
30 
35 class LANCELOT_EXPORT StandardActionListModel: public ActionListModel {
36  Q_OBJECT
37 protected:
41  class LANCELOT_EXPORT Item { //krazy:exclude=dpointer
42  public:
43  explicit Item(QString itemTitle = QString(),
44  QString itemDescription = QString(),
45  QIcon itemIcon = QIcon(),
46  QVariant itemData = QVariant())
47  : title(itemTitle), description(itemDescription), icon(itemIcon), data(itemData) {};
48 
49  QString title;
50  QString description;
51  QIcon icon;
52  QVariant data;
53  };
54 
55 public:
59  StandardActionListModel();
60 
64  virtual ~StandardActionListModel();
65 
66  L_Override QString title(int index) const;
67  L_Override QString description(int index) const;
68  L_Override QIcon icon(int index) const;
69  L_Override bool isCategory(int index) const;
70 
71  L_Override int size() const;
72 
77  void add(const Item & item);
78 
86  void add(const QString & title, const QString & description, QIcon icon, const QVariant & data);
87 
93  void insert(int where, const Item & item);
94 
103  void insert(int where, const QString & title, const QString & description, QIcon icon, const QVariant & data);
104 
110  void set(int index, const Item & item);
111 
120  void set(int index, const QString & title, const QString & description, QIcon icon, const QVariant & data);
121 
126  void removeAt(int index);
127 
132  const Item & itemAt(int index) const;
133 
137  void clear();
138 
139 protected:
144  void setEmitInhibited(bool value);
145 
149  bool emitInhibited() const;
150 
151 
152 private:
153  class Private;
154  Private * const d;
155 
156 };
157 
158 } // namespace Lancelot
159 
160 #endif /* LANCELOT_STANDARD_ACTION_LIST_MODEL_H */
161 
Lancelot::StandardActionListModel::Item::data
QVariant data
Definition: StandardActionListModel.h:52
Lancelot::StandardActionListModel::Item::description
QString description
Definition: StandardActionListModel.h:50
Lancelot::StandardActionListModel::Item::icon
QIcon icon
Definition: StandardActionListModel.h:51
Lancelot::ActionListModel
This class represents a list data model.
Definition: ActionListModel.h:37
L_Override
#define L_Override
Definition: lancelot_export.h:41
lancelot_export.h
Lancelot::StandardActionListModel::Item
This class represents an item in the list model.
Definition: StandardActionListModel.h:41
LANCELOT_EXPORT
#define LANCELOT_EXPORT
Definition: lancelot_export.h:32
Lancelot::StandardActionListModel
A basic implementation of ActionListModel.
Definition: StandardActionListModel.h:35
ActionListModel.h
QString
Lancelot::StandardActionListModel::Item::Item
Item(QString itemTitle=QString(), QString itemDescription=QString(), QIcon itemIcon=QIcon(), QVariant itemData=QVariant())
Definition: StandardActionListModel.h:43
QIcon
QVariant
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