kalarm
#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
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.
|
inline |
Definition at line 124 of file akonadimodel.h.
|
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.
|
signal |
Collection AkonadiModel::collectionForItem | ( | Akonadi::Item::Id | ) | const |
Definition at line 1876 of file akonadimodel.cpp.
|
inline |
Definition at line 119 of file akonadimodel.h.
QModelIndex AkonadiModel::collectionIndex | ( | const Akonadi::Collection & | ) | const |
|
signal |
|
signal |
Signal emitted when a collection's enabled or read-only status has changed.
- Parameters
-
inserted true if the reason for the change is that the collection has been inserted into the model
|
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.
|
protectedvirtual |
Definition at line 657 of file akonadimodel.cpp.
|
protectedvirtual |
Definition at line 673 of file akonadimodel.cpp.
|
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.
|
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.
|
signal |
Signal emitted when events have been added to the model.
|
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.
|
static |
Get the foreground color for a collection, based on specified mime types.
Definition at line 857 of file akonadimodel.cpp.
|
inlinestatic |
Definition at line 204 of file akonadimodel.h.
|
static |
Definition at line 83 of file akonadimodel.cpp.
bool AkonadiModel::isCollectionBeingDeleted | ( | Akonadi::Collection::Id | ) | const |
Definition at line 1105 of file akonadimodel.cpp.
|
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.
|
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.
|
static |
Return whether a collection is fully writable, i.e.
with create/delete/change rights and compatible with the current KAlarm calendar format.
- Parameters
-
format Updated 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.
|
signal |
|
inline |
Definition at line 142 of file akonadimodel.h.
QModelIndex AkonadiModel::itemIndex | ( | const Akonadi::Item & | ) | const |
|
signal |
Signal emitted when calendar migration/creation has completed.
|
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.
|
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.
|
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.
|
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:
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.