KCalUtils::DndFactory

Search for usage in LXR

#include <dndfactory.h>

Public Types

enum  PasteFlag { FlagTodosPasteAtDtStart = 1 , FlagPasteAtOriginalTime = 2 }
 
typedef QFlags< PasteFlagPasteFlags
 

Public Member Functions

 DndFactory (const KCalendarCore::Calendar::Ptr &cal)
 
bool copyIncidence (const KCalendarCore::Incidence::Ptr &)
 
bool copyIncidences (const KCalendarCore::Incidence::List &incidences)
 
QDragcreateDrag (const KCalendarCore::Incidence::Ptr &incidence, QObject *owner)
 
QDragcreateDrag (QObject *owner)
 
KCalendarCore::Calendar::Ptr createDropCalendar (QDropEvent *de)
 
KCalendarCore::Event::Ptr createDropEvent (const QMimeData *md)
 
KCalendarCore::Event::Ptr createDropEvent (QDropEvent *de)
 
KCalendarCore::Todo::Ptr createDropTodo (const QMimeData *md)
 
KCalendarCore::Todo::Ptr createDropTodo (QDropEvent *de)
 
QMimeDatacreateMimeData ()
 
QMimeDatacreateMimeData (const KCalendarCore::Incidence::Ptr &incidence)
 
void cutIncidence (const KCalendarCore::Incidence::Ptr &)
 
bool cutIncidences (const KCalendarCore::Incidence::List &incidences)
 
KCalendarCore::Incidence::Ptr pasteIncidence (const QDateTime &newDateTime=QDateTime(), PasteFlags pasteOptions=PasteFlags())
 
KCalendarCore::Incidence::List pasteIncidences (const QDateTime &newDateTime=QDateTime(), PasteFlags pasteOptions=PasteFlags())
 

Static Public Member Functions

static KCalendarCore::Calendar::Ptr createDropCalendar (const QMimeData *md)
 

Detailed Description

vCalendar/iCalendar Drag-and-Drop object factory.

This class implements functions to create Drag and Drop objects used for Drag-and-Drop and Copy-and-Paste.

Definition at line 46 of file dndfactory.h.

Member Typedef Documentation

◆ PasteFlags

Definition at line 57 of file dndfactory.h.

Member Enumeration Documentation

◆ PasteFlag

Enumerator
FlagTodosPasteAtDtStart 

If the cloned incidence is a to-do, the date/time passed to DndFactory::pasteIncidence() will change dtStart if this flag is on, changes dtDue otherwise.

FlagPasteAtOriginalTime 

If set, incidences will be pasted at the specified date but will preserve their original time.

Definition at line 49 of file dndfactory.h.

Constructor & Destructor Documentation

◆ DndFactory()

DndFactory::DndFactory ( const KCalendarCore::Calendar::Ptr & cal)
explicit

DndFactoryPrivate class that helps to provide binary compatibility between releases.

Definition at line 138 of file dndfactory.cpp.

Member Function Documentation

◆ copyIncidence()

bool DndFactory::copyIncidence ( const KCalendarCore::Incidence::Ptr & selectedInc)

Copy the incidence to clipboard/.

Definition at line 317 of file dndfactory.cpp.

◆ copyIncidences()

bool DndFactory::copyIncidences ( const KCalendarCore::Incidence::List & incidences)

Copies a list of incidences to the clipboard.

Definition at line 291 of file dndfactory.cpp.

◆ createDrag() [1/2]

QDrag * DndFactory::createDrag ( const KCalendarCore::Incidence::Ptr & incidence,
QObject * owner )

Create a drag object for a single incidence.

Definition at line 185 of file dndfactory.cpp.

◆ createDrag() [2/2]

QDrag * DndFactory::createDrag ( QObject * owner)

Create a drag object for the whole calendar.

Definition at line 154 of file dndfactory.cpp.

◆ createDropCalendar() [1/2]

Calendar::Ptr DndFactory::createDropCalendar ( const QMimeData * md)
static

Create the calendar that is contained in the mime data.

Definition at line 194 of file dndfactory.cpp.

◆ createDropCalendar() [2/2]

Calendar::Ptr DndFactory::createDropCalendar ( QDropEvent * de)

Create the calendar that is contained in the drop event's data.

Definition at line 207 of file dndfactory.cpp.

◆ createDropEvent() [1/2]

Event::Ptr DndFactory::createDropEvent ( const QMimeData * md)

Create Event object from mime data.

Definition at line 217 of file dndfactory.cpp.

◆ createDropEvent() [2/2]

Event::Ptr DndFactory::createDropEvent ( QDropEvent * de)

Create Event object from drop event.

Definition at line 232 of file dndfactory.cpp.

◆ createDropTodo() [1/2]

Todo::Ptr DndFactory::createDropTodo ( const QMimeData * md)

Create Todo object from mime data.

Definition at line 243 of file dndfactory.cpp.

◆ createDropTodo() [2/2]

Todo::Ptr DndFactory::createDropTodo ( QDropEvent * de)

Create Todo object from drop event.

Definition at line 259 of file dndfactory.cpp.

◆ createMimeData() [1/2]

QMimeData * DndFactory::createMimeData ( )
nodiscard

Create the mime data for the whole calendar.

Definition at line 145 of file dndfactory.cpp.

◆ createMimeData() [2/2]

QMimeData * DndFactory::createMimeData ( const KCalendarCore::Incidence::Ptr & incidence)

Create the mime data for a single incidence.

Definition at line 162 of file dndfactory.cpp.

◆ cutIncidence()

void DndFactory::cutIncidence ( const KCalendarCore::Incidence::Ptr & selectedIncidence)

Cut the incidence to the clipboard.

Definition at line 270 of file dndfactory.cpp.

◆ cutIncidences()

bool DndFactory::cutIncidences ( const KCalendarCore::Incidence::List & incidences)

Cuts a list of incidences to the clipboard.

Definition at line 277 of file dndfactory.cpp.

◆ pasteIncidence()

Incidence::Ptr DndFactory::pasteIncidence ( const QDateTime & newDateTime = QDateTime(),
PasteFlags pasteOptions = PasteFlags() )

This function clones the incidence that's in the clipboard and sets the clone's date/time to the specified newDateTime.

Parameters
newDateTimeThe new date/time that the incidence will have. If it's an event or journal, DTSTART will be set. If it's a to-do, DTDUE is set. If you wish another behaviour, like changing DTSTART on to-dos, specify pasteOptions. If newDateTime is invalid the original incidence's dateTime will be used, regardless of pasteOptions.
pasteOptionsControl how newDateTime changes the incidence's dates.
See also
PasteFlag.
Returns
A pointer to the cloned incidence.

Definition at line 367 of file dndfactory.cpp.

◆ pasteIncidences()

Incidence::List DndFactory::pasteIncidences ( const QDateTime & newDateTime = QDateTime(),
PasteFlags pasteOptions = PasteFlags() )

This function clones the incidences that are in the clipboard and sets the clone's date/time to the specified newDateTime.

See also
pasteIncidence()

Definition at line 324 of file dndfactory.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 26 2024 11:57:52 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.