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

KCalCore Library

  • kcalcore
journal.cpp
Go to the documentation of this file.
1 /*
2  This file is part of the kcalcore library.
3 
4  Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library 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 GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public License
17  along with this library; see the file COPYING.LIB. If not, write to
18  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  Boston, MA 02110-1301, USA.
20 */
32 #include "journal.h"
33 #include "visitor.h"
34 
35 #include <KDebug>
36 
37 using namespace KCalCore;
38 
39 Journal::Journal() : d( 0 )
40 {
41 }
42 
43 Journal::~Journal()
44 {
45 }
46 
47 Incidence::IncidenceType Journal::type() const
48 {
49  return TypeJournal;
50 }
51 
52 QByteArray Journal::typeStr() const
53 {
54  return "Journal";
55 }
56 
57 Journal *Journal::clone() const
58 {
59  return new Journal( *this );
60 }
61 
62 IncidenceBase &Journal::assign( const IncidenceBase &other )
63 {
64  Incidence::assign( other );
65  return *this;
66 }
67 
68 bool Journal::equals( const IncidenceBase &journal ) const
69 {
70  return Incidence::equals( journal );
71 }
72 
73 bool Journal::accept( Visitor &v, IncidenceBase::Ptr incidence )
74 {
75  return v.visit( incidence.staticCast<Journal>() );
76 }
77 
78 KDateTime Journal::dateTime( DateTimeRole role ) const
79 {
80  switch ( role ) {
81  case RoleEnd:
82  case RoleEndTimeZone:
83  return KDateTime();
84  case RoleDisplayStart:
85  case RoleDisplayEnd:
86  return dtStart();
87  default:
88  return dtStart();
89  }
90 }
91 
92 void Journal::setDateTime( const KDateTime &dateTime, DateTimeRole role )
93 {
94  switch ( role ) {
95  case RoleDnD:
96  {
97  setDtStart( dateTime );
98  break;
99  }
100  default:
101  kDebug() << "Unhandled role" << role;
102  }
103 }
104 
105 void Journal::virtual_hook( int id, void *data )
106 {
107  Q_UNUSED( id );
108  Q_UNUSED( data );
109  Q_ASSERT( false );
110 }
111 
112 QLatin1String Journal::mimeType() const
113 {
114  return Journal::journalMimeType();
115 }
116 
117 /* static */
118 QLatin1String Journal::journalMimeType()
119 {
120  return QLatin1String( "application/x-vnd.akonadi.calendar.journal" );
121 }
122 
123 QLatin1String Journal::iconName( const KDateTime & ) const
124 {
125  return QLatin1String( "view-pim-journal" );
126 }
This file is part of the KDE documentation.
Documentation copyright © 1996-2013 The KDE developers.
Generated on Sat Jul 13 2013 01:24:52 by doxygen 1.8.3.1 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCalCore Library

Skip menu "KCalCore Library"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdepimlibs-4.10.5 API Reference

Skip menu "kdepimlibs-4.10.5 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