KCalUtils

dndfactory.h
Go to the documentation of this file.
1 /*
2  This file is part of the kcalutils library.
3 
4  Copyright (c) 1998 Preston Brown <[email protected]>
5  Copyright (c) 2001,2002,2003 Cornelius Schumacher <[email protected]>
6  Copyright (C) 2003-2004 Reinhold Kainhofer <[email protected]>
7  Copyright (c) 2008 Thomas Thrainer <[email protected]>
8 
9  This library is free software; you can redistribute it and/or
10  modify it under the terms of the GNU Library General Public
11  License as published by the Free Software Foundation; either
12  version 2 of the License, or (at your option) any later version.
13 
14  This library is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  Library General Public License for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with this library; see the file COPYING.LIB. If not, write to
21  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
22  Boston, MA 02110-1301, USA.
23 */
33 #ifndef KCALUTILS_DNDFACTORY_H
34 #define KCALUTILS_DNDFACTORY_H
35 
36 #include "kcalutils_export.h"
37 
38 #include <KCalendarCore/Event>
39 #include <KCalendarCore/Journal>
40 #include <KCalendarCore/Todo>
41 #include <KCalendarCore/MemoryCalendar>
42 
43 #include <QDateTime>
44 
45 class QDrag;
46 class QDropEvent;
47 class QMimeData;
48 
49 namespace KCalUtils {
50 class DndFactoryPrivate;
58 class KCALUTILS_EXPORT DndFactory
59 {
60 public:
61 
62  enum PasteFlag {
63  FlagTodosPasteAtDtStart = 1,
66  FlagPasteAtOriginalTime = 2
68  };
69 
70  Q_DECLARE_FLAGS(PasteFlags, PasteFlag)
71 
72  explicit DndFactory(const KCalendarCore::MemoryCalendar::Ptr &cal);
73 
74  ~DndFactory();
75 
79  KCalendarCore::MemoryCalendar::Ptr createDropCalendar(QDropEvent *de);
80 
84  static KCalendarCore::MemoryCalendar::Ptr createDropCalendar(const QMimeData *md);
85 
89  QMimeData *createMimeData();
90 
94  QDrag *createDrag(QWidget *owner);
95 
99  QMimeData *createMimeData(const KCalendarCore::Incidence::Ptr &incidence);
100 
104  QDrag *createDrag(const KCalendarCore::Incidence::Ptr &incidence, QWidget *owner);
105 
109  KCalendarCore::Todo::Ptr createDropTodo(const QMimeData *md);
110 
114  KCalendarCore::Todo::Ptr createDropTodo(QDropEvent *de);
115 
119  KCalendarCore::Event::Ptr createDropEvent(const QMimeData *md);
120 
124  KCalendarCore::Event::Ptr createDropEvent(QDropEvent *de);
125 
129  void cutIncidence(const KCalendarCore::Incidence::Ptr &);
130 
134  bool copyIncidence(const KCalendarCore::Incidence::Ptr &);
135 
139  bool cutIncidences(const KCalendarCore::Incidence::List &incidences);
140 
144  bool copyIncidences(const KCalendarCore::Incidence::List &incidences);
145 
152  KCalendarCore::Incidence::List pasteIncidences(const QDateTime &newDateTime = QDateTime(), PasteFlags pasteOptions = PasteFlags());
153 
168  KCalendarCore::Incidence::Ptr pasteIncidence(const QDateTime &newDateTime = QDateTime(), PasteFlags pasteOptions = PasteFlags());
169 
170 private:
171  //@cond PRIVATE
172  Q_DISABLE_COPY(DndFactory)
173  DndFactoryPrivate *const d;
174  //@endcond
175 };
176 }
177 
178 #endif
vCalendar/iCalendar Drag-and-Drop object factory.
Definition: dndfactory.h:58
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Jul 1 2020 23:10:38 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.