• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdepim API Reference
  • KDE Home
  • Contact Us
 

kalarm

Classes | Public Types | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
AkonadiModel Class Reference

#include <akonadimodel.h>

Inherits EntityTreeModel.

Classes

struct  Event
 

Public Types

enum  {
  TimeColumn = 0, TimeToColumn, RepeatColumn, ColourColumn,
  TypeColumn, TextColumn, TemplateNameColumn, ColumnCount
}
 
enum  {
  EnabledTypesRole = UserRole, BaseColourRole, AlarmTypeRole, IsStandardRole,
  KeepFormatRole, EnabledRole, StatusRole, AlarmActionsRole,
  AlarmSubActionRole, ValueRole, SortRole, CommandErrorRole
}
 
enum  Change {
  Added, Deleted, Invalidated, Enabled,
  ReadOnly, AlarmTypes, WrongType, Location,
  Colour
}
 
typedef QList< Event > EventList
 

Signals

void collectionAdded (const Akonadi::Collection &)
 
void collectionDeleted (Akonadi::Collection::Id, bool status=true)
 
void collectionModified (Akonadi::Collection::Id, bool status=true)
 
void collectionStatusChanged (const Akonadi::Collection &, AkonadiModel::Change, const QVariant &newValue, bool inserted)
 
void eventChanged (const AkonadiModel::Event &)
 
void eventsAdded (const AkonadiModel::EventList &)
 
void eventsToBeRemoved (const AkonadiModel::EventList &)
 
void itemDone (Akonadi::Item::Id, bool status=true)
 
void migrationCompleted ()
 
void serverStopped ()
 

Public Member Functions

 ~AkonadiModel ()
 
bool addEvent (KAEvent &, Akonadi::Collection &)
 
bool addEvents (const KAEvent::List &, Akonadi::Collection &)
 
QColor backgroundColor (Akonadi::Collection &) const
 
Akonadi::Collection collection (const KAEvent &e) const
 
Akonadi::Collection collectionById (Akonadi::Collection::Id) const
 
Akonadi::Collection collectionForItem (Akonadi::Item::Id) const
 
QModelIndex collectionIndex (Akonadi::Collection::Id id) const
 
QModelIndex collectionIndex (const Akonadi::Collection &) const
 
virtual QVariant data (const QModelIndex &, int role=Qt::DisplayRole) const
 
bool deleteEvent (const KAEvent &event)
 
bool deleteEvent (Akonadi::Item::Id itemId)
 
QString displayName (Akonadi::Collection &) const
 
KAEvent event (const Akonadi::Item &item) const
 
KAEvent event (Akonadi::Item::Id) const
 
KAEvent event (const QModelIndex &) const
 
QModelIndex eventIndex (const KAEvent &)
 
Akonadi::Item::Id findItemId (const KAEvent &)
 
bool isCollectionBeingDeleted (Akonadi::Collection::Id) const
 
bool isMigrationCompleted () const
 
Akonadi::Item itemById (Akonadi::Item::Id) const
 
QModelIndex itemIndex (Akonadi::Item::Id id) const
 
QModelIndex itemIndex (const Akonadi::Item &) const
 
bool refresh (Akonadi::Collection &) const
 
bool refresh (Akonadi::Item &) const
 
void reload ()
 
bool reloadCollection (const Akonadi::Collection &)
 
bool removeCollection (const Akonadi::Collection &)
 
void setBackgroundColor (Akonadi::Collection &, const QColor &)
 
virtual bool setData (const QModelIndex &, const QVariant &value, int role)
 
QString storageType (const Akonadi::Collection &) const
 
QString tooltip (const Akonadi::Collection &, CalEvent::Types) const
 
void updateCommandError (const KAEvent &)
 
bool updateEvent (KAEvent &event)
 
bool updateEvent (Akonadi::Item::Id oldId, KAEvent &newEvent)
 

Static Public Member Functions

static QColor foregroundColor (const Akonadi::Collection &, const QStringList &mimeTypes)
 
static QSize iconSize ()
 
static AkonadiModel * instance ()
 
static bool isCompatible (const Akonadi::Collection &)
 
static int isWritable (const Akonadi::Collection &)
 
static int isWritable (const Akonadi::Collection &, KACalendar::Compat &format)
 
static QString readOnlyTooltip (const Akonadi::Collection &)
 
static CalEvent::Types types (const Akonadi::Collection &)
 

Protected Member Functions

virtual int entityColumnCount (HeaderGroup) const
 
virtual QVariant entityHeaderData (int section, Qt::Orientation, int role, HeaderGroup) const
 

Detailed Description

Definition at line 46 of file akonadimodel.h.

Member Typedef Documentation

typedef QList<Event> AkonadiModel::EventList

Definition at line 83 of file akonadimodel.h.

Member Enumeration Documentation

anonymous enum
Enumerator
TimeColumn 
TimeToColumn 
RepeatColumn 
ColourColumn 
TypeColumn 
TextColumn 
TemplateNameColumn 
ColumnCount 

Definition at line 51 of file akonadimodel.h.

anonymous enum
Enumerator
EnabledTypesRole 
BaseColourRole 
AlarmTypeRole 
IsStandardRole 
KeepFormatRole 
EnabledRole 
StatusRole 
AlarmActionsRole 
AlarmSubActionRole 
ValueRole 
SortRole 
CommandErrorRole 

Definition at line 57 of file akonadimodel.h.

enum AkonadiModel::Change
Enumerator
Added 
Deleted 
Invalidated 
Enabled 
ReadOnly 
AlarmTypes 
WrongType 
Location 
Colour 

Definition at line 50 of file akonadimodel.h.

Constructor & Destructor Documentation

AkonadiModel::~AkonadiModel ( )

Definition at line 147 of file akonadimodel.cpp.

Member Function Documentation

bool AkonadiModel::addEvent ( KAEvent &  ,
Akonadi::Collection &   
)

Definition at line 1351 of file akonadimodel.cpp.

bool AkonadiModel::addEvents ( const KAEvent::List &  ,
Akonadi::Collection &   
)

Definition at line 1334 of file akonadimodel.cpp.

QColor AkonadiModel::backgroundColor ( Akonadi::Collection &  collection) const

Get the background color for a collection and its alarms.

Definition at line 885 of file akonadimodel.cpp.

Akonadi::Collection AkonadiModel::collection ( const KAEvent &  e) const
inline

Definition at line 124 of file akonadimodel.h.

void AkonadiModel::collectionAdded ( const Akonadi::Collection &  )
signal

Signal emitted when a collection has been added to the model.

Collection AkonadiModel::collectionById ( Akonadi::Collection::Id  ) const

Definition at line 1843 of file akonadimodel.cpp.

void AkonadiModel::collectionDeleted ( Akonadi::Collection::Id  ,
bool  status = true 
)
signal

Signal emitted when Akonadi has completed a collection deletion.

Parameters
idAkonadi ID for the collection
statustrue if successful, false if error
Collection AkonadiModel::collectionForItem ( Akonadi::Item::Id  ) const

Definition at line 1876 of file akonadimodel.cpp.

QModelIndex AkonadiModel::collectionIndex ( Akonadi::Collection::Id  id) const
inline

Definition at line 119 of file akonadimodel.h.

QModelIndex AkonadiModel::collectionIndex ( const Akonadi::Collection &  ) const
void AkonadiModel::collectionModified ( Akonadi::Collection::Id  ,
bool  status = true 
)
signal

Signal emitted when Akonadi has completed a collection modification.

Parameters
idAkonadi ID for the collection
statustrue if successful, false if error
void AkonadiModel::collectionStatusChanged ( const Akonadi::Collection &  ,
AkonadiModel::Change  ,
const QVariant &  newValue,
bool  inserted 
)
signal

Signal emitted when a collection's enabled or read-only status has changed.

Parameters
insertedtrue if the reason for the change is that the collection has been inserted into the model
QVariant AkonadiModel::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
virtual

Definition at line 213 of file akonadimodel.cpp.

bool AkonadiModel::deleteEvent ( const KAEvent &  event)

Definition at line 1405 of file akonadimodel.cpp.

bool AkonadiModel::deleteEvent ( Akonadi::Item::Id  itemId)
QString AkonadiModel::displayName ( Akonadi::Collection &  collection) const

Return the display name for a collection.

Definition at line 907 of file akonadimodel.cpp.

int AkonadiModel::entityColumnCount ( HeaderGroup  group) const
protectedvirtual

Definition at line 657 of file akonadimodel.cpp.

QVariant AkonadiModel::entityHeaderData ( int  section,
Qt::Orientation  orientation,
int  role,
HeaderGroup  group 
) const
protectedvirtual

Definition at line 673 of file akonadimodel.cpp.

KAEvent AkonadiModel::event ( const Akonadi::Item &  item) const
inline

Return the alarm with the specified unique identifier.

Returns
the event, or invalid event if no such event exists.

Definition at line 150 of file akonadimodel.h.

KAEvent AkonadiModel::event ( Akonadi::Item::Id  ) const
KAEvent AkonadiModel::event ( const QModelIndex &  index) const

Definition at line 1271 of file akonadimodel.cpp.

void AkonadiModel::eventChanged ( const AkonadiModel::Event &  )
signal

Signal emitted when an event in the model has changed.

QModelIndex AkonadiModel::eventIndex ( const KAEvent &  event)

Return an event's model index, based on its itemId() value.

Definition at line 1190 of file akonadimodel.cpp.

void AkonadiModel::eventsAdded ( const AkonadiModel::EventList &  )
signal

Signal emitted when events have been added to the model.

void AkonadiModel::eventsToBeRemoved ( const AkonadiModel::EventList &  )
signal

Signal emitted when events are about to be removed from the model.

Item::Id AkonadiModel::findItemId ( const KAEvent &  event)

Search for an event's item ID.

This method ignores any itemId() value contained in the KAEvent. The collectionId() is used if available.

Definition at line 1199 of file akonadimodel.cpp.

QColor AkonadiModel::foregroundColor ( const Akonadi::Collection &  collection,
const QStringList &  mimeTypes 
)
static

Get the foreground color for a collection, based on specified mime types.

Definition at line 857 of file akonadimodel.cpp.

static QSize AkonadiModel::iconSize ( )
inlinestatic

Definition at line 204 of file akonadimodel.h.

AkonadiModel * AkonadiModel::instance ( )
static

Definition at line 83 of file akonadimodel.cpp.

bool AkonadiModel::isCollectionBeingDeleted ( Akonadi::Collection::Id  ) const

Definition at line 1105 of file akonadimodel.cpp.

bool AkonadiModel::isCompatible ( const Akonadi::Collection &  )
static

Check whether a collection is stored in the current KAlarm calendar format.

Definition at line 1884 of file akonadimodel.cpp.

bool AkonadiModel::isMigrationCompleted ( ) const

Return whether calendar migration/creation at initialisation has completed.

Definition at line 205 of file akonadimodel.cpp.

int AkonadiModel::isWritable ( const Akonadi::Collection &  collection)
static

Return whether a collection is fully writable, i.e.

with create/delete/change rights and compatible with the current KAlarm calendar format.

Returns
1 = fully writable, 0 = writable except that backend calendar is in an old KAlarm format, -1 = read-only or incompatible format.

Definition at line 1893 of file akonadimodel.cpp.

int AkonadiModel::isWritable ( const Akonadi::Collection &  collection,
KACalendar::Compat &  format 
)
static

Return whether a collection is fully writable, i.e.

with create/delete/change rights and compatible with the current KAlarm calendar format.

Parameters
formatUpdated to contain the backend calendar storage format. If read-only, = KACalendar::Current; if unknown format, = KACalendar::Incompatible; otherwise = the backend calendar storage format.
Returns
1 = fully writable, 0 = writable except that backend calendar is in an old KAlarm format, -1 = read-only (if compat == KACalendar::Current), or incompatible format otherwise.

Definition at line 1899 of file akonadimodel.cpp.

Item AkonadiModel::itemById ( Akonadi::Item::Id  ) const

Definition at line 1865 of file akonadimodel.cpp.

void AkonadiModel::itemDone ( Akonadi::Item::Id  ,
bool  status = true 
)
signal

Signal emitted when Akonadi has completed an item creation, update or deletion.

Parameters
idAkonadi ID for the item
statustrue if successful, false if error
QModelIndex AkonadiModel::itemIndex ( Akonadi::Item::Id  id) const
inline

Definition at line 142 of file akonadimodel.h.

QModelIndex AkonadiModel::itemIndex ( const Akonadi::Item &  ) const
void AkonadiModel::migrationCompleted ( )
signal

Signal emitted when calendar migration/creation has completed.

QString AkonadiModel::readOnlyTooltip ( const Akonadi::Collection &  )
static

Return the read-only status tooltip for a collection.

A null string is returned if the collection is fully writable.

Definition at line 963 of file akonadimodel.cpp.

bool AkonadiModel::refresh ( Akonadi::Collection &  collection) const

Refresh the specified collection instance with up to date data.

Definition at line 1807 of file akonadimodel.cpp.

bool AkonadiModel::refresh ( Akonadi::Item &  item) const

Refresh the specified item instance with up to date data.

Definition at line 1820 of file akonadimodel.cpp.

void AkonadiModel::reload ( )

Reload all collections' data from Akonadi storage (not from the backend).

Definition at line 1152 of file akonadimodel.cpp.

bool AkonadiModel::reloadCollection ( const Akonadi::Collection &  collection)

Reload a collection's data from Akonadi storage (not from the backend).

Definition at line 1139 of file akonadimodel.cpp.

bool AkonadiModel::removeCollection ( const Akonadi::Collection &  collection)

Remove a collection from Akonadi.

The calendar file is not removed.

Returns
true if a removal job has been scheduled.

Definition at line 1081 of file akonadimodel.cpp.

void AkonadiModel::serverStopped ( )
signal

Signal emitted when the Akonadi server has stopped.

void AkonadiModel::setBackgroundColor ( Akonadi::Collection &  ,
const QColor &   
)

Set the background color for a collection and its alarms.

Definition at line 874 of file akonadimodel.cpp.

bool AkonadiModel::setData ( const QModelIndex &  index,
const QVariant &  value,
int  role 
)
virtual

Definition at line 532 of file akonadimodel.cpp.

QString AkonadiModel::storageType ( const Akonadi::Collection &  collection) const

Return the storage type (file/directory/URL etc.) for a collection.

Definition at line 918 of file akonadimodel.cpp.

QString AkonadiModel::tooltip ( const Akonadi::Collection &  ,
CalEvent::Types   
) const

Get the tooltip for a collection.

The collection's enabled status is evaluated for specified alarm types.

Definition at line 930 of file akonadimodel.cpp.

CalEvent::Types AkonadiModel::types ( const Akonadi::Collection &  )
static

Definition at line 1926 of file akonadimodel.cpp.

void AkonadiModel::updateCommandError ( const KAEvent &  event)

To be called when the command error status of an alarm has changed, to set in the Akonadi database and update the visual command error indications.

Definition at line 846 of file akonadimodel.cpp.

bool AkonadiModel::updateEvent ( KAEvent &  event)

Definition at line 1378 of file akonadimodel.cpp.

bool AkonadiModel::updateEvent ( Akonadi::Item::Id  oldId,
KAEvent &  newEvent 
)

The documentation for this class was generated from the following files:
  • akonadimodel.h
  • akonadimodel.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:52 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kalarm

Skip menu "kalarm"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdepim API Reference

Skip menu "kdepim API Reference"
  • akonadi_next
  • akregator
  • blogilo
  • calendarsupport
  • console
  •   kabcclient
  •   konsolekalendar
  • kaddressbook
  • kalarm
  •   lib
  • kdgantt2
  • kjots
  • kleopatra
  • kmail
  • knode
  • knotes
  • kontact
  • korgac
  • korganizer
  • ktimetracker
  • libkdepim
  • libkleo
  • libkpgp
  • mailcommon
  • messagelist
  • messageviewer
  • pimprint

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