• 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
  • widgets
ActionListView.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_ACTION_LIST_VIEW_H
21 #define LANCELOT_ACTION_LIST_VIEW_H
22 
23 #include <QtGui/QIcon>
24 
25 #include <lancelot/lancelot.h>
26 #include <lancelot/lancelot_export.h>
27 #include <lancelot/models/ActionListModel.h>
28 #include <lancelot/widgets/CustomListView.h>
29 
30 namespace Lancelot
31 {
32 
33 class LANCELOT_EXPORT ActionListView : public Lancelot::CustomListView
34 {
35  Q_OBJECT
36 
37  Q_PROPERTY ( int extenderPosition READ extenderPosition WRITE setExtenderPosition )
38  Q_PROPERTY ( bool categoriesActivable READ areCategoriesActivable WRITE setCategoriesActivable )
39  Q_PROPERTY ( bool showsExtendersOutside READ showsExtendersOutside WRITE setShowsExtendersOutside )
40  Q_PROPERTY ( int selectedIndex READ selectedIndex)
41 
42  // Q_PROPERTY ( int activationMethod READ activationMethod WRITE setActivationMethod )
43 
44  // @puck L_WIDGET
45  // @puck L_INCLUDE(lancelot/widgets/ActionListView.h)
46 
47 public:
48  enum ItemDisplayMode {
49  Standard = 0,
50  DescriptionFirst = 1,
51  SingleLineNameFirst = 2,
52  SingleLineDescriptionFirst = 3,
53  OnlyName = 4,
54  OnlyDescription = 5
55  };
56 
57  ActionListView(QGraphicsItem * parent = 0);
58  explicit ActionListView(ActionListModel * model, QGraphicsItem * parent = 0);
59  virtual ~ActionListView();
60 
61  void setModel(ActionListModel * model);
62  ActionListModel * model() const;
63 
64  void setExtenderPosition(int position);
65  int extenderPosition() const;
66 
67  void setDisplayMode(ItemDisplayMode mode);
68  ItemDisplayMode displayMode() const;
69  // void setActivationMethod(int method);
70  // int activationMethod() const;
71 
72  void setItemsGroup(Group * group = NULL);
73  void setItemsGroupByName(const QString & group);
74  Group * itemsGroup() const;
75 
76  void setCategoriesGroup(Group * group = NULL);
77  void setCategoriesGroupByName(const QString & group);
78  Group * categoriesGroup() const;
79 
80  void setCategoriesActivable(bool value);
81  bool areCategoriesActivable() const;
82 
83  int selectedIndex() const;
84 
85  void setItemHeight(int height, Qt::SizeHint which);
86  void setCategoryHeight(int height, Qt::SizeHint which);
87 
88  int itemHeight(Qt::SizeHint which) const;
89  int categoryHeight(Qt::SizeHint which) const;
90 
91  void setItemIconSize(QSize size);
92  void setCategoryIconSize(QSize size);
93 
94  QSize itemIconSize() const;
95  QSize categoryIconSize() const;
96 
97  void setShowsExtendersOutside(bool value);
98  bool showsExtendersOutside() const;
99 
100  L_Override void keyPressEvent(QKeyEvent * event);
101 
102 public Q_SLOTS:
103  void clearSelection();
104  void initialSelection();
105 
106  void hide();
107  void show();
108 
109 protected:
110  L_Override bool sceneEventFilter(QGraphicsItem * watched,
111  QEvent * event);
112  L_Override bool sceneEvent(QEvent * event);
113  L_Override QSizeF sizeHint(Qt::SizeHint which,
114  const QSizeF & constraint = QSizeF()) const;
115  L_Override void resizeEvent(
116  QGraphicsSceneResizeEvent * event);
117  L_Override void hoverLeaveEvent(
118  QGraphicsSceneHoverEvent * event);
119 
120 Q_SIGNALS:
121  void activated(int index);
122 
123 private:
124  class Private;
125  Private * const d;
126 };
127 
128 } // namespace Lancelot
129 
130 #endif /* LANCELOT_ACTION_LIST_VIEW_H */
131 
QEvent
Lancelot::ActionListView::ItemDisplayMode
ItemDisplayMode
Definition: ActionListView.h:48
Lancelot::ActionListModel
This class represents a list data model.
Definition: ActionListModel.h:37
QGraphicsItem
Lancelot::ActionListView
Definition: ActionListView.h:33
L_Override
#define L_Override
Definition: lancelot_export.h:41
lancelot_export.h
Lancelot::Group
Represents a group of object.
Definition: Global.h:63
LANCELOT_EXPORT
#define LANCELOT_EXPORT
Definition: lancelot_export.h:32
ActionListModel.h
QString
Lancelot::CustomListView
Wrapper around the CustomList which implements the actual scrolling.
Definition: CustomListView.h:151
QGraphicsSceneResizeEvent
QGraphicsSceneHoverEvent
QSize
QKeyEvent
QSizeF
lancelot.h
CustomListView.h
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