• Skip to content
  • Skip to link menu
  • KDE API Reference
  • kdepimlibs-4.14.10 API Reference
  • KDE Home
  • Contact Us
 

akonadi

  • Akonadi
  • EntityRightsFilterModel
Public Member Functions | Protected Member Functions | List of all members
Akonadi::EntityRightsFilterModel Class Reference

#include <entityrightsfiltermodel.h>

Inherits KRecursiveFilterProxyModel.

Public Member Functions

 EntityRightsFilterModel (QObject *parent=0)
 
virtual ~EntityRightsFilterModel ()
 
Collection::Rights accessRights () const
 
virtual Qt::ItemFlags flags (const QModelIndex &index) const
 
virtual QModelIndexList match (const QModelIndex &start, int role, const QVariant &value, int hits=1, Qt::MatchFlags flags=Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap)) const
 
void setAccessRights (Collection::Rights rights)
 

Protected Member Functions

virtual bool acceptRow (int sourceRow, const QModelIndex &sourceParent) const
 

Detailed Description

A proxy model that filters entities by access rights.

This class can be used on top of an EntityTreeModel to exclude entities by access type or to include only certain entities with special access rights.

using namespace Akonadi;
EntityTreeModel *model = new EntityTreeModel( this );
EntityRightsFilterModel *filter = new EntityRightsFilterModel();
filter->setAccessRights( Collection::CanCreateItem | Collection::CanCreateCollection );
filter->setSourceModel( model );
EntityTreeView *view = new EntityTreeView( this );
view->setModel( filter );
Akonadi::Collection::CanCreateItem
@ CanCreateItem
Can create new items in this collection.
Definition collection.h:89
Akonadi::Collection::CanCreateCollection
@ CanCreateCollection
Can create new subcollections in this collection.
Definition collection.h:92
Akonadi::EntityRightsFilterModel
A proxy model that filters entities by access rights.
Definition entityrightsfiltermodel.h:61
Akonadi::EntityRightsFilterModel::setAccessRights
void setAccessRights(Collection::Rights rights)
Sets the access rights the entities shall be filtered against.
Definition entityrightsfiltermodel.cpp:83
Akonadi::EntityTreeModel
A model for collections and items together.
Definition entitytreemodel.h:319
Akonadi::EntityTreeView
A view to show an item/collection tree provided by an EntityTreeModel.
Definition entitytreeview.h:72
Akonadi::EntityTreeView::setModel
virtual void setModel(QAbstractItemModel *model)
Definition entitytreeview.cpp:209
Akonadi
FreeBusyManager::Singleton.
Definition actionstatemanager_p.h:28
  • For collections the access rights are checked against the collections own rights.
  • For items the access rights are checked against the item's parent collection rights.
Author
Tobias Koenig tokoe.nosp@m.@kde.nosp@m..org
Since
4.6

Definition at line 60 of file entityrightsfiltermodel.h.

Constructor & Destructor Documentation

◆ EntityRightsFilterModel()

EntityRightsFilterModel::EntityRightsFilterModel ( QObject * parent = 0)
explicit

Creates a new entity rights filter model.

Parameters
parentThe parent object.

Definition at line 72 of file entityrightsfiltermodel.cpp.

◆ ~EntityRightsFilterModel()

EntityRightsFilterModel::~EntityRightsFilterModel ( )
virtual

Destroys the entity rights filter model.

Definition at line 78 of file entityrightsfiltermodel.cpp.

Member Function Documentation

◆ acceptRow()

bool EntityRightsFilterModel::acceptRow ( int sourceRow,
const QModelIndex & sourceParent ) const
protectedvirtual

Definition at line 96 of file entityrightsfiltermodel.cpp.

◆ accessRights()

Collection::Rights EntityRightsFilterModel::accessRights ( ) const

Returns the access rights that are used for filtering.

Definition at line 90 of file entityrightsfiltermodel.cpp.

◆ flags()

Qt::ItemFlags EntityRightsFilterModel::flags ( const QModelIndex & index) const
virtual
Reimplemented from superclass.

Definition at line 105 of file entityrightsfiltermodel.cpp.

◆ match()

QModelIndexList EntityRightsFilterModel::match ( const QModelIndex & start,
int role,
const QVariant & value,
int hits = 1,
Qt::MatchFlags flags = Qt::MatchFlags(Qt::MatchStartsWith | Qt::MatchWrap) ) const
virtual
Reimplemented from superclass.

Definition at line 116 of file entityrightsfiltermodel.cpp.

◆ setAccessRights()

void EntityRightsFilterModel::setAccessRights ( Collection::Rights rights)

Sets the access rights the entities shall be filtered against.

If no rights are set explicitly, Collection::AllRights is assumed.

Parameters
rightsthe access rights filter values

Definition at line 83 of file entityrightsfiltermodel.cpp.


The documentation for this class was generated from the following files:
  • entityrightsfiltermodel.h
  • entityrightsfiltermodel.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Wed Jan 24 2024 00:00:00 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

akonadi

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

kdepimlibs-4.14.10 API Reference

Skip menu "kdepimlibs-4.14.10 API Reference"
  • akonadi
  •   contact
  •   kmime
  •   socialutils
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
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