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

kalarm

  • sources
  • kde-4.14
  • kdepim
  • kalarm
eventid.h
Go to the documentation of this file.
1 /*
2  * eventid.h - KAlarm unique event identifier for Akonadi
3  * Program: kalarm
4  * Copyright © 2012,2014 by David Jarvie <djarvie@kde.org>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef EVENTID_H
22 #define EVENTID_H
23 
24 #include <kalarmcal/kaevent.h>
25 #include <QPair>
26 #include <QDebug>
27 
28 using namespace KAlarmCal;
29 
38 struct EventId : public QPair<Akonadi::Collection::Id, QString>
39 {
40  EventId() {}
41  EventId(Akonadi::Collection::Id c, const QString& e)
42  : QPair<Akonadi::Collection::Id, QString>(c, e) {}
43  explicit EventId(const KAEvent& event)
44  : QPair<Akonadi::Collection::Id, QString>(event.collectionId(), event.id()) {}
46  explicit EventId(const QString& resourceEventId);
47  void clear() { first = -1; second.clear(); }
49  bool isEmpty() const { return second.isEmpty(); }
50 
51  Akonadi::Collection::Id collectionId() const { return first; }
52  QString eventId() const { return second; }
53  void setCollectionId(Akonadi::Collection::Id id) { first = id; }
54 };
55 
56 // Declare as a movable type (note that QString is movable).
57 Q_DECLARE_TYPEINFO(EventId, Q_MOVABLE_TYPE);
58 
59 inline QDebug operator<<(QDebug s, const EventId& id)
60 {
61  s.nospace() << "\"" << id.collectionId() << "::" << id.eventId().toLatin1().constData() << "\"";
62  return s.space();
63 }
64 
65 #endif // EVENTID_H
66 
67 // vim: et sw=4:
EventId::collectionId
Akonadi::Collection::Id collectionId() const
Definition: eventid.h:51
EventId::clear
void clear()
Definition: eventid.h:47
QDebug::nospace
QDebug & nospace()
Q_DECLARE_TYPEINFO
Q_DECLARE_TYPEINFO(EventId, Q_MOVABLE_TYPE)
EventId::eventId
QString eventId() const
Definition: eventid.h:52
EventId::EventId
EventId(Akonadi::Collection::Id c, const QString &e)
Definition: eventid.h:41
operator<<
QDebug operator<<(QDebug s, const EventId &id)
Definition: eventid.h:59
EventId::EventId
EventId(const KAEvent &event)
Definition: eventid.h:43
QString
QPair
QDebug::space
QDebug & space()
QDebug
EventId
Unique event identifier for Akonadi.
Definition: eventid.h:38
EventId::setCollectionId
void setCollectionId(Akonadi::Collection::Id id)
Definition: eventid.h:53
EventId::EventId
EventId()
Definition: eventid.h:40
EventId::isEmpty
bool isEmpty() const
Return whether the instance contains any data.
Definition: eventid.h:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:34:51 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