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

KCal Library

  • KCal
  • AssignmentVisitor
Public Member Functions
KCal::AssignmentVisitor Class Reference

#include <assignmentvisitor.h>

Inheritance diagram for KCal::AssignmentVisitor:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 AssignmentVisitor ()
virtual ~AssignmentVisitor ()
bool assign (IncidenceBase *target, const IncidenceBase *source)
virtual bool visit (Event *event)
virtual bool visit (Todo *todo)
virtual bool visit (Journal *journal)
virtual bool visit (FreeBusy *freebusy)

Detailed Description

Helper for type correct assignment of incidences via pointers.

This class provides a way of correctly assigning one incidence to another, given two IncidenceBase derived pointers. It effectively provides a virtual assignment method which first type checks the two pointers to ensure they reference the same incidence type, before performing the assignment.

Usage example:

  KCal::Incidence *currentIncidence; // assume this is set somewhere else
  KCal::Incidence *updatedIncidence; // assume this is set somewhere else

  KCal::AssignmentVisitor visitor;

  // assign
  if ( !visitor.assign(currentIncidence, updatedIncidence) ) {
    // not of same type
  }
Author:
Kevin Krammer <kevin.krammer@gmx.at>
Since:
4.3

Constructor & Destructor Documentation

AssignmentVisitor::AssignmentVisitor ( )

Creates a visitor instance.

Definition at line 40 of file assignmentvisitor.cpp.

AssignmentVisitor::~AssignmentVisitor ( ) [virtual]

Destroys the instance.

Definition at line 44 of file assignmentvisitor.cpp.


Member Function Documentation

bool AssignmentVisitor::assign ( IncidenceBase *  target,
const IncidenceBase *  source 
)

Assigns the incidence referenced by source to the incidence referenced by target, first ensuring that the source incidence can be cast to the same class as the target incidence.

Basically it is a virtual equivalent of

      *target = *source
Parameters:
targetpointer to the instance to assign to
sourcepointer to the instance to assign from
Returns:
false if the two objects are of different type

Definition at line 49 of file assignmentvisitor.cpp.

bool AssignmentVisitor::visit ( Event *  event) [virtual]

Tries to assign to the given event, using the source passed to assign().

Returns:
false if the source passed to assign() is not an Event

Reimplemented from KCal::IncidenceBase::Visitor.

Definition at line 63 of file assignmentvisitor.cpp.

bool AssignmentVisitor::visit ( Todo *  todo) [virtual]

Tries to assign to the given todo, using the source passed to assign().

Returns:
false if the source passed to assign() is not a Todo

Reimplemented from KCal::IncidenceBase::Visitor.

Definition at line 78 of file assignmentvisitor.cpp.

bool AssignmentVisitor::visit ( Journal *  journal) [virtual]

Tries to assign to the given journal, using the source passed to assign().

Returns:
false if the source passed to assign() is not a Journal

Reimplemented from KCal::IncidenceBase::Visitor.

Definition at line 93 of file assignmentvisitor.cpp.

bool AssignmentVisitor::visit ( FreeBusy *  freebusy) [virtual]

Tries to assign to the given freebusy, using the source passed to assign().

Returns:
false if the source passed to assign() is not a FreeBusy

Reimplemented from KCal::IncidenceBase::Visitor.

Definition at line 108 of file assignmentvisitor.cpp.


The documentation for this class was generated from the following files:
  • assignmentvisitor.h
  • assignmentvisitor.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2012 The KDE developers.
Generated on Mon May 14 2012 05:05:35 by doxygen 1.7.5 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KCal Library

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

kdepimlibs-4.8.3 API Reference

Skip menu "kdepimlibs-4.8.3 API Reference"
  • akonadi
  •   contact
  •   kmime
  • kabc
  • kalarmcal
  • kblog
  • kcal
  • kcalcore
  • kcalutils
  • kholidays
  • kimap
  • kioslave
  •   imap4
  •   mbox
  •   nntp
  • kldap
  • kmbox
  • kmime
  • kontactinterface
  • kpimidentities
  • kpimtextedit
  •   richtextbuilders
  • 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