• Skip to content
  • Skip to link menu
KDE 4.5 API Reference
  • KDE API Reference
  • KDE-PIM Libraries
  • Sitemap
  • Contact Us
 

akonadi

  • Akonadi
  • Akonadi::EntityRightsFilterModel
Public Member Functions | Protected Member Functions

Akonadi::EntityRightsFilterModel Class Reference

A proxy model that filters entities by access rights. More...

#include <entityrightsfiltermodel.h>

Inheritance diagram for Akonadi::EntityRightsFilterModel:
Inheritance graph
[legend]

List of all members.

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 );
  • 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@kde.org>
Since:
4.6

Definition at line 58 of file entityrightsfiltermodel.h.


Constructor & Destructor Documentation

Akonadi::EntityRightsFilterModel::EntityRightsFilterModel ( QObject *  parent = 0  )  [explicit]

Creates a new entity rights filter model.

Parameters:
parent The parent object.
virtual Akonadi::EntityRightsFilterModel::~EntityRightsFilterModel (  )  [virtual]

Destroys the entity rights filter model.


Member Function Documentation

virtual bool Akonadi::EntityRightsFilterModel::acceptRow ( int  sourceRow,
const QModelIndex &  sourceParent 
) const [protected, virtual]

Reimplement this method for custom filtering strategies.

Reimplemented from KRecursiveFilterProxyModel.

Collection::Rights Akonadi::EntityRightsFilterModel::accessRights (  )  const

Returns the access rights that are used for filtering.

virtual Qt::ItemFlags Akonadi::EntityRightsFilterModel::flags ( const QModelIndex &  index  )  const [virtual]

virtual QModelIndexList Akonadi::EntityRightsFilterModel::match ( const QModelIndex &  start,
int  role,
const QVariant &  value,
int  hits = 1,
Qt::MatchFlags  flags = Qt::MatchFlags(Qt::MatchStartsWith|Qt::MatchWrap) 
) const [virtual]

void Akonadi::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.


The documentation for this class was generated from the following file:
  • entityrightsfiltermodel.h

akonadi

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

KDE-PIM Libraries

Skip menu "KDE-PIM Libraries"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kblog
  • kcal
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • kpimutils
  • kresources
  • ktnef
  • kxmlrpcclient
  • mailtransport
  • microblog
  • qgpgme
  • syndication
  •   atom
  •   rdf
  •   rss2
Generated for KDE-PIM Libraries by doxygen 1.7.1
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal