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

akonadi

  • Akonadi
  • CalendarBase
Public Types | Signals | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Akonadi::CalendarBase Class Reference

#include <calendarbase.h>

Inheritance diagram for Akonadi::CalendarBase:
Akonadi::ETMCalendar Akonadi::FetchJobCalendar

Public Types

typedef QSharedPointer< CalendarBase > Ptr
 

Signals

void createFinished (bool success, const QString &errorMessage)
 
void deleteFinished (bool success, const QString &errorMessage)
 
void modifyFinished (bool success, const QString &errorMessage)
 

Public Member Functions

 CalendarBase (QObject *parent=0)
 
 ~CalendarBase ()
 
bool addEvent (const KCalCore::Event::Ptr &event)
 
bool addIncidence (const KCalCore::Incidence::Ptr &incidence)
 
bool addJournal (const KCalCore::Journal::Ptr &journal)
 
bool addTodo (const KCalCore::Todo::Ptr &todo)
 
KCalCore::Incidence::List childIncidences (const Akonadi::Item::Id &parentId) const
 
KCalCore::Incidence::List childIncidences (const QString &parentUid) const
 
Akonadi::Item::List childItems (const Akonadi::Item::Id &parentId) const
 
Akonadi::Item::List childItems (const QString &parentUid) const
 
void deleteAllEvents ()
 
void deleteAllJournals ()
 
void deleteAllTodos ()
 
bool deleteEvent (const KCalCore::Event::Ptr &event)
 
bool deleteIncidence (const KCalCore::Incidence::Ptr &)
 
bool deleteJournal (const KCalCore::Journal::Ptr &journal)
 
bool deleteTodo (const KCalCore::Todo::Ptr &todo)
 
void endBatchAdding ()
 
Akonadi::IncidenceChanger * incidenceChanger () const
 
Akonadi::Item item (Akonadi::Item::Id) const
 
Akonadi::Item item (const KCalCore::Incidence::Ptr &incidence) const
 
Akonadi::Item item (const QString &uid) const
 
Akonadi::Item::List itemList (const KCalCore::Incidence::List &incidenceList) const
 
Akonadi::Item::List items () const
 
Akonadi::Item::List items (Akonadi::Collection::Id) const
 
bool modifyIncidence (const KCalCore::Incidence::Ptr &newIncidence)
 
void setWeakPointer (const QWeakPointer< Akonadi::CalendarBase > &pointer)
 
void startBatchAdding ()
 
QWeakPointer< CalendarBase > weakPointer () const
 

Protected Member Functions

 CalendarBase (CalendarBasePrivate *const d, QObject *parent)
 

Protected Attributes

QScopedPointer< CalendarBasePrivate > d_ptr
 

Detailed Description

The base class for all akonadi aware calendars.

Because it inherits KCalCore::Calendar, it provides seamless integration with KCalCore and KCalUtils libraries eliminating any need for adapter ( akonadi<->KCalCore ) classes.

See also
ETMCalendar
FetchJobCalendar
Author
Sérgio Martins sergi.nosp@m.o.ma.nosp@m.rtins.nosp@m.@kda.nosp@m.b.com
Since
4.11

Definition at line 50 of file calendarbase.h.

Member Typedef Documentation

◆ Ptr

typedef QSharedPointer<CalendarBase> Akonadi::CalendarBase::Ptr

Definition at line 54 of file calendarbase.h.

Constructor & Destructor Documentation

◆ CalendarBase() [1/2]

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

Constructs a CalendarBase object.

Definition at line 371 of file calendarbase.cpp.

◆ ~CalendarBase()

CalendarBase::~CalendarBase ( )

Destroys the calendar.

Definition at line 386 of file calendarbase.cpp.

◆ CalendarBase() [2/2]

CalendarBase::CalendarBase ( CalendarBasePrivate *const  d,
QObject *  parent 
)
protected

Definition at line 378 of file calendarbase.cpp.

Member Function Documentation

◆ addEvent()

bool CalendarBase::addEvent ( const KCalCore::Event::Ptr &  event)

Adds an Event to the calendar.

It's added to akonadi in the background

See also
createFinished().
Parameters
eventthe event to be added reimp

Definition at line 525 of file calendarbase.cpp.

◆ addIncidence()

bool CalendarBase::addIncidence ( const KCalCore::Incidence::Ptr &  incidence)

Adds an incidence to the calendar.

It's added to akonadi in the background

See also
createFinished().
Parameters
incidencethe incidence to add reimp

Definition at line 573 of file calendarbase.cpp.

◆ addJournal()

bool CalendarBase::addJournal ( const KCalCore::Journal::Ptr &  journal)

Adds a Journal to the calendar.

It's added to akonadi in the background

See also
createFinished().
Parameters
journalthe journal to add reimp

Definition at line 557 of file calendarbase.cpp.

◆ addTodo()

bool CalendarBase::addTodo ( const KCalCore::Todo::Ptr &  todo)

Adds a Todo to the calendar.

It's added to akonadi in the background

See also
createFinished().
Parameters
todothe todo to add reimp

Definition at line 541 of file calendarbase.cpp.

◆ childIncidences() [1/2]

KCalCore::Incidence::List CalendarBase::childIncidences ( const Akonadi::Item::Id &  parentId) const

Returns the child incidences of the parent identified by parentId.

Only the direct childs are returned

Parameters
parentIdidentifier of the parent item

Definition at line 455 of file calendarbase.cpp.

◆ childIncidences() [2/2]

KCalCore::Incidence::List CalendarBase::childIncidences ( const QString &  parentUid) const

Returns the child incidences of the parent identified by parentUid.

Only the direct childs are returned

Parameters
parentUididentifier of the parent incidence

Definition at line 475 of file calendarbase.cpp.

◆ childItems() [1/2]

Akonadi::Item::List CalendarBase::childItems ( const Akonadi::Item::Id &  parentId) const

Returns the child items of the parent identified by parentId.

Only the direct childs are returned

Parameters
parentIdidentifier of the parent item

Definition at line 490 of file calendarbase.cpp.

◆ childItems() [2/2]

Akonadi::Item::List CalendarBase::childItems ( const QString &  parentUid) const

Returns the child items of the parent identified by parentUid.

Only the direct childs are returned

Parameters
parentUididentifier of the parent incidence

Definition at line 510 of file calendarbase.cpp.

◆ createFinished

void Akonadi::CalendarBase::createFinished ( bool  success,
const QString &  errorMessage 
)
signal

This signal is emitted when an incidence is created in akonadi through add{Incidence,Event,Todo,Journal}.

Parameters
successthe success of the operation
errorMessageif success is false, contains the error message

◆ deleteAllEvents()

void CalendarBase::deleteAllEvents ( )

Reimplementation of KCalCore::Calendar::deleteAllEvents() that does nothing.

Do not use this.

A convenience function that makes it easy to have a massive data-loss is a bad idea.

Deprecated:

reimp

Definition at line 535 of file calendarbase.cpp.

◆ deleteAllJournals()

void CalendarBase::deleteAllJournals ( )

Reimplementation of KCalCore::Calendar::deleteAllJournals() that does nothing.

Do not use this.

A convenience function that makes it easy to have a massive data-loss is a bad idea.

Deprecated:

reimp

Definition at line 567 of file calendarbase.cpp.

◆ deleteAllTodos()

void CalendarBase::deleteAllTodos ( )

Reimplementation of KCalCore::Calendar::deleteAllTodos() that does nothing.

Do not use this.

A convenience function that makes it easy to have a massive data-loss is a bad idea.

Deprecated:

reimp

Definition at line 551 of file calendarbase.cpp.

◆ deleteEvent()

bool CalendarBase::deleteEvent ( const KCalCore::Event::Ptr &  event)

Deletes an Event from the calendar.

It's removed from akonadi in the background

See also
deleteFinished().
Parameters
eventthe event to be deleted reimp

Definition at line 530 of file calendarbase.cpp.

◆ deleteFinished

void Akonadi::CalendarBase::deleteFinished ( bool  success,
const QString &  errorMessage 
)
signal

This signal is emitted when an incidence is deleted in akonadi through delete{Incidence,Event,Todo,Journal} or deleteAll{Events,Todos,Journals}.

Parameters
successthe success of the operation
errorMessageif success is false, contains the error message

◆ deleteIncidence()

bool CalendarBase::deleteIncidence ( const KCalCore::Incidence::Ptr &  incidence)

Deletes an incidence from the calendar.

It's removed from akonadi in the background

See also
deleteFinished().
Parameters
incidencethe incidence to delete reimp

Definition at line 613 of file calendarbase.cpp.

◆ deleteJournal()

bool CalendarBase::deleteJournal ( const KCalCore::Journal::Ptr &  journal)

Deletes a Journal from the calendar.

It's removed from akonadi in the background

See also
deleteFinished().
Parameters
journalthe journal to delete reimp

Definition at line 562 of file calendarbase.cpp.

◆ deleteTodo()

bool CalendarBase::deleteTodo ( const KCalCore::Todo::Ptr &  todo)

Deletes a Todo from the calendar.

It's removed from akonadi in the background

See also
deleteFinished().
Parameters
todothe todo to delete reimp

Definition at line 546 of file calendarbase.cpp.

◆ endBatchAdding()

void CalendarBase::endBatchAdding ( )

Tells the Calendar that you stoped adding a batch of incidences.

See also
startBatchAdding() reimp

Definition at line 653 of file calendarbase.cpp.

◆ incidenceChanger()

IncidenceChanger * CalendarBase::incidenceChanger ( ) const

Returns the IncidenceChanger used by this calendar to make changes in akonadi.

Use this if you need the defaults used by CalendarBase.

Definition at line 642 of file calendarbase.cpp.

◆ item() [1/3]

Akonadi::Item CalendarBase::item ( Akonadi::Item::Id  id) const

Returns the Item with id or an invalid Item if not found.

Definition at line 390 of file calendarbase.cpp.

◆ item() [2/3]

Akonadi::Item Akonadi::CalendarBase::item ( const KCalCore::Incidence::Ptr &  incidence) const

Returns the Item containing the incidence with uid uid or an invalid Item if the incidence isn't found.

◆ item() [3/3]

Akonadi::Item CalendarBase::item ( const QString &  uid) const

Returns the Item containing the incidence with uid uid or an invalid Item if the incidence isn't found.

See also
Use item(Incidence::Ptr) instead where possible. This function doesn't take exceptions (recurrenceId) into account (and thus always returns the main event).

Definition at line 402 of file calendarbase.cpp.

◆ itemList()

Akonadi::Item::List CalendarBase::itemList ( const KCalCore::Incidence::List &  incidenceList) const

Returns the item list that corresponds to the incidenceList.

Definition at line 440 of file calendarbase.cpp.

◆ items() [1/2]

Akonadi::Item::List CalendarBase::items ( ) const

Returns the list of items contained in this calendar.

See also
incidences()

Definition at line 428 of file calendarbase.cpp.

◆ items() [2/2]

Akonadi::Item::List CalendarBase::items ( Akonadi::Collection::Id  id) const

Returns the list of items contained in this calendar that belong to the specified collection.

See also
incidences() // TODO_KDE5: merge with items() overload
Since
4.12

Definition at line 434 of file calendarbase.cpp.

◆ modifyFinished

void Akonadi::CalendarBase::modifyFinished ( bool  success,
const QString &  errorMessage 
)
signal

This signal is emitted when an incidence is modified in akonadi through modifyIncidence().

Parameters
successthe success of the operation
errorMessageif success is false, contains the error message

◆ modifyIncidence()

bool CalendarBase::modifyIncidence ( const KCalCore::Incidence::Ptr &  newIncidence)

Modifies an incidence.

The incidence with the same uid as newIncidence will be updated with the contents of

Parameters
newIncidencethe incidence to modify

Definition at line 621 of file calendarbase.cpp.

◆ setWeakPointer()

void CalendarBase::setWeakPointer ( const QWeakPointer< Akonadi::CalendarBase > &  pointer)

Sets the weak pointer that's associated with this instance.

Use this if later on you need to cast sender() into a QSharedPointer

QWeakPointer<CalendarBase> weakPtr = qobject_cast<CalendarBase*>( sender() )->weakPointer();
CalendarBase::Ptr calendar( weakPtr.toStrongRef() );
See also
weakPointer()

Definition at line 630 of file calendarbase.cpp.

◆ startBatchAdding()

void CalendarBase::startBatchAdding ( )

Call this to tell the calendar that you're adding a batch of incidences.

So it doesn't, for example, ask the destination for each incidence.

See also
endBatchAdding() reimp

Definition at line 648 of file calendarbase.cpp.

◆ weakPointer()

QWeakPointer< CalendarBase > CalendarBase::weakPointer ( ) const

Returns the weak pointer set with setWeakPointer().

The default is an invalid weak pointer.

See also
setWeakPointer()

Definition at line 636 of file calendarbase.cpp.

Member Data Documentation

◆ d_ptr

QScopedPointer<CalendarBasePrivate> Akonadi::CalendarBase::d_ptr
protected

Definition at line 294 of file calendarbase.h.


The documentation for this class was generated from the following files:
  • calendarbase.h
  • calendarbase.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu Jul 21 2022 00:00:00 by doxygen 1.9.5 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
  • Modules
  • 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