diff --git a/KdepimLibsConfig.cmake.in b/KdepimLibsConfig.cmake.in index ae76e2e1d..33142e8dd 100644 --- a/KdepimLibsConfig.cmake.in +++ b/KdepimLibsConfig.cmake.in @@ -1,89 +1,90 @@ # KdepimLibs.cmake is generated by CMake from kdepimlibs/KdepimLibs.cmake.in # set the kdepimlibs version number set(KDEPIMLIBS_VERSION_MAJOR @KDEPIMLIBS_VERSION_MAJOR@) set(KDEPIMLIBS_VERSION_MINOR @KDEPIMLIBS_VERSION_MINOR@) set(KDEPIMLIBS_VERSION_PATCH @KDEPIMLIBS_VERSION_PATCH@) set(KDEPIMLIBS_VERSION "${KDEPIMLIBS_VERSION_MAJOR}.${KDEPIMLIBS_VERSION_MINOR}.${KDEPIMLIBS_VERSION_PATCH}") # set the directories if(NOT KDEPIMLIBS_INSTALL_DIR) set(KDEPIMLIBS_INSTALL_DIR "@CMAKE_INSTALL_PREFIX@") endif(NOT KDEPIMLIBS_INSTALL_DIR) set(KDEPIMLIBS_DATA_DIR "@KDEPIMLIBS_DATA_DIR@") set(KDEPIMLIBS_DBUS_INTERFACES_DIR "@KDEPIMLIBS_DBUS_INTERFACES_DIR@") set(KDEPIMLIBS_DBUS_SERVICES_DIR "@KDEPIMLIBS_DBUS_SERVICES_DIR@") set(KDEPIMLIBS_INCLUDE_DIR "@KDEPIMLIBS_INCLUDE_DIR@") set(KDEPIMLIBS_INCLUDE_DIRS "@KDEPIMLIBS_INCLUDE_DIR@" "@KDEPIMLIBS_INCLUDE_DIR@/KDE") set(KDEPIMLIBS_LIB_DIR "@KDEPIMLIBS_LIB_DIR@") -set(KDEPIMLIBS_BIN_DIR "@KDEPIMLIBS_BIN_DIR@") +set(KDEPIMLIBS_BIN_DIR "@KDEPIMLIBS_BIN_DIR@") set(KDEPIMLIBS_LIBEXEC_DIR "@KDEPIMLIBS_LIBEXEC_DIR@") set(KDEPIMLIBS_SBIN_DIR "@KDEPIMLIBS_SBIN_DIR@") set(KDEPIMLIBS_HTML_DIR "@KDEPIMLIBS_HTML_DIR@") set(KDEPIMLIBS_CONFIG_DIR "@KDEPIMLIBS_CONFIG_DIR@") -set(KDEPIMLIBS_ICON_DIR "@KDEPIMLIBS_ICON_DIR@") +set(KDEPIMLIBS_ICON_DIR "@KDEPIMLIBS_ICON_DIR@") set(KDEPIMLIBS_KCFG_DIR "@KDEPIMLIBS_KCFG_DIR@") set(KDEPIMLIBS_LOCALE_DIR "@KDEPIMLIBS_LOCALE_DIR@") set(KDEPIMLIBS_MIME_DIR "@KDEPIMLIBS_MIME_DIR@") set(KDEPIMLIBS_SOUND_DIR "@KDEPIMLIBS_SOUND_DIR@") set(KDEPIMLIBS_TEMPLATES_DIR "@KDEPIMLIBS_TEMPLATES_DIR@") set(KDEPIMLIBS_KCONF_UPDATE_DIR "@KDEPIMLIBS_KCONF_UPDATE_DIR@") set(KDEPIMLIBS_AUTOSTART_DIR "@KDEPIMLIBS_AUTOSTART_DIR@") set(KDEPIMLIBS_XDG_APPS_DIR "@KDEPIMLIBS_XDG_APPS_DIR@") set(KDEPIMLIBS_XDG_DIRECTORY_DIR "@KDEPIMLIBS_XDG_DIRECTORY_DIR@") set(KDEPIMLIBS_SYSCONF_DIR "@KDEPIMLIBS_SYSCONF_DIR@") set(KDEPIMLIBS_MAN_DIR "@KDEPIMLIBS_MAN_DIR@") set(KDEPIMLIBS_INFO_DIR "@KDEPIMLIBS_INFO_DIR@") set(KDEPIMLIBS_SERVICES_DIR "@KDEPIMLIBS_SERVICES_DIR@") set(KDEPIMLIBS_SERVICETYPES_DIR "@KDEPIMLIBS_SERVICETYPES_DIR@") # These two are just for compatibility with KDE 4.[01] set(KDEPIMLIBS4_DBUS_INTERFACES_DIR "${KDEPIMLIBS_DBUS_INTERFACES_DIR}") set(KDEPIMLIBS4_DBUS_SERVICES_DIR "${KDEPIMLIBS_DBUS_SERVICES_DIR}") set(CMAKE_MODULE_PATH "${KDEPIMLIBS_DATA_DIR}/cmake/modules" "${CMAKE_MODULE_PATH}" ) -# the exports file exports +# the exports file exports set(KDEPIMLIBS_TARGET_PREFIX @KDEPIMLIBS_TARGET_PREFIX@) # Make sure to load the exported targets only once # For the rest of this script it doesn't matter that much if(NOT TARGET KDEPIMLibs__kresources) get_filename_component(_currentDir "${CMAKE_CURRENT_LIST_FILE}" PATH) include("${_currentDir}/KDEPimLibsLibraryTargetsWithPrefix.cmake") endif(NOT TARGET KDEPIMLibs__kresources) macro(_KDEPIMLibs_Set_Lib_Vars _prefix _lib) set(KDEPIMLIBS_${_prefix}_LIBRARY ${KDEPIMLIBS_TARGET_PREFIX}${_lib}) set(KDEPIMLIBS_${_prefix}_LIBS ${KDEPIMLIBS_TARGET_PREFIX}${_lib}) # these two are set for compatibility with KDE 4.[01], Alex: set(KDE4_${_prefix}_LIBRARY ${KDEPIMLIBS_TARGET_PREFIX}${_lib}) set(KDE4_${_prefix}_LIBS ${KDEPIMLIBS_TARGET_PREFIX}${_lib}) endmacro(_KDEPIMLibs_Set_Lib_Vars) _kdepimlibs_set_lib_vars(AKONADI akonadi-kde) _kdepimlibs_set_lib_vars(AKONADI_CONTACT akonadi-contact) _kdepimlibs_set_lib_vars(AKONADI_KMIME akonadi-kmime) _kdepimlibs_set_lib_vars(AKONADI_KABC akonadi-kabc) +_kdepimlibs_set_lib_vars(AKONADI_KCAL akonadi-kcal) _kdepimlibs_set_lib_vars(GPGMEPP gpgmepp) _kdepimlibs_set_lib_vars(KABC kabc) _kdepimlibs_set_lib_vars(KBLOG kblog) _kdepimlibs_set_lib_vars(KCAL kcal) _kdepimlibs_set_lib_vars(KHOLIDAYS kholidays) _kdepimlibs_set_lib_vars(KIMAP kimap) _kdepimlibs_set_lib_vars(KLDAP kldap) _kdepimlibs_set_lib_vars(KMIME kmime) _kdepimlibs_set_lib_vars(KONTACTINTERFACE kontactinterface) _kdepimlibs_set_lib_vars(KPIMIDENTITIES kpimidentities) _kdepimlibs_set_lib_vars(KPIMTEXTEDIT kpimtextedit) _kdepimlibs_set_lib_vars(KPIMUTILS kpimutils) _kdepimlibs_set_lib_vars(KRESOURCES kresources) _kdepimlibs_set_lib_vars(KTNEF ktnef) _kdepimlibs_set_lib_vars(KXMLRPCCLIENT kxmlrpcclient) _kdepimlibs_set_lib_vars(MAILTRANSPORT mailtransport) _kdepimlibs_set_lib_vars(MICROBLOG microblog) _kdepimlibs_set_lib_vars(QGPGME qgpgme) _kdepimlibs_set_lib_vars(SYNDICATION syndication) diff --git a/akonadi/CMakeLists.txt b/akonadi/CMakeLists.txt index ca16f84af..07c9543d8 100644 --- a/akonadi/CMakeLists.txt +++ b/akonadi/CMakeLists.txt @@ -1,290 +1,291 @@ project(akonadi-kde) add_definitions( -DKDE_DEFAULT_DEBUG_AREA=5250 ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${KDE4_ENABLE_EXCEPTIONS}" ) if(CMAKE_COMPILE_GCOV) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage") endif(CMAKE_COMPILE_GCOV) if (KDE4_BUILD_TESTS) # only with this macro the AKONADI_TESTS_EXPORT macro will do something add_definitions(-DCOMPILING_TESTS) add_subdirectory( tests ) endif (KDE4_BUILD_TESTS) add_definitions( -DQT_NO_CAST_FROM_ASCII ) add_definitions( -DQT_NO_CAST_TO_ASCII ) add_subdirectory( kabc ) +add_subdirectory( kcal ) add_subdirectory( kmime ) add_subdirectory( contact ) include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${QT_QTDBUS_INCLUDE_DIR} ${Boost_INCLUDE_DIR} ${KDE4_INCLUDE_DIR} ${AKONADI_INCLUDE_DIR} ${AKONADI_INCLUDE_DIR}/akonadi/private ) # libakonadi-kde set( akonadikde_LIB_SRC entity.cpp # keep it at top to not break enable-final agentbase.cpp agentfilterproxymodel.cpp agentinstance.cpp agentinstancecreatejob.cpp agentinstancemodel.cpp agentinstancewidget.cpp agentmanager.cpp agenttype.cpp agenttypemodel.cpp agenttypewidget.cpp agenttypedialog.cpp asyncselectionhandler.cpp attribute.cpp attributefactory.cpp cachepolicy.cpp cachepolicypage.cpp changerecorder.cpp collection.cpp collectioncombobox.cpp collectioncopyjob.cpp collectioncreatejob.cpp collectiondeletejob.cpp collectiondialog.cpp collectionfilterproxymodel.cpp collectiongeneralpropertiespage.cpp collectionfetchjob.cpp collectionfetchscope.cpp collectionmodel.cpp collectionmodel_p.cpp collectionmodifyjob.cpp collectionmovejob.cpp collectionpathresolver.cpp collectionpropertiesdialog.cpp collectionpropertiespage.cpp collectionquotaattribute.cpp collectionrequester.cpp collectionrightsattribute.cpp collectionselectjob.cpp collectionstatistics.cpp collectionstatisticsdelegate.cpp collectionstatisticsjob.cpp collectionstatisticsmodel.cpp collectionsync.cpp collectionview.cpp dragdropmanager.cpp control.cpp entitycache.cpp entitydisplayattribute.cpp entityhiddenattribute.cpp entitylistview.cpp entitymimetypefiltermodel.cpp entityrightsfiltermodel.cpp entitytreemodel.cpp entitytreemodel_p.cpp entitytreeview.cpp entitytreeviewstatesaver.cpp erroroverlay.cpp exception.cpp favoritecollectionsmodel.cpp firstrun.cpp flatcollectionproxymodel.cpp item.cpp itemcreatejob.cpp itemcopyjob.cpp itemdeletejob.cpp itemfetchjob.cpp itemfetchscope.cpp itemmodel.cpp itemmonitor.cpp itemmovejob.cpp itemsearchjob.cpp itemserializer.cpp itemserializerplugin.cpp itemmodifyjob.cpp itemsync.cpp itemview.cpp job.cpp kdescendantsproxymodel.cpp krecursivefilterproxymodel.cpp linkjob.cpp mimetypechecker.cpp monitor.cpp monitor_p.cpp partfetcher.cpp pastehelper.cpp preprocessorbase.cpp preprocessorbase_p.cpp protocolhelper.cpp resourcebase.cpp resourcescheduler.cpp resourceselectjob.cpp resourcesynchronizationjob.cpp searchcreatejob.cpp selectionproxymodel.cpp selftestdialog.cpp session.cpp servermanager.cpp specialcollectionattribute.cpp specialcollections.cpp specialcollectionshelperjobs.cpp specialcollectionsrequestjob.cpp standardactionmanager.cpp statisticsproxymodel.cpp subscriptionjob.cpp subscriptionchangeproxymodel.cpp subscriptiondialog.cpp subscriptionmodel.cpp transactionjobs.cpp transactionsequence.cpp transportresourcebase.cpp unlinkjob.cpp # Temporary until ported to Qt-plugin framework pluginloader.cpp ) # DBus interfaces and adaptors set(akonadi_xml ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.NotificationManager.xml) set_source_files_properties(${akonadi_xml} PROPERTIES INCLUDE "notificationmessage_p.h") qt4_add_dbus_interface( akonadikde_LIB_SRC ${akonadi_xml} notificationmanagerinterface ) qt4_add_dbus_interfaces( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.AgentManager.xml ) qt4_add_dbus_interfaces( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Tracer.xml ) qt4_add_dbus_interfaces( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Agent.Control.xml ) qt4_add_dbus_adaptor( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Resource.xml resourcebase.h Akonadi::ResourceBase ) qt4_add_dbus_adaptor( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Preprocessor.xml preprocessorbase_p.h Akonadi::PreprocessorBasePrivate ) qt4_add_dbus_adaptor( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Agent.Status.xml agentbase.h Akonadi::AgentBase ) qt4_add_dbus_adaptor( akonadikde_LIB_SRC ${AKONADI_DBUS_INTERFACES_DIR}/org.freedesktop.Akonadi.Agent.Control.xml agentbase.h Akonadi::AgentBase ) qt4_add_dbus_adaptor( akonadikde_LIB_SRC interfaces/org.freedesktop.Akonadi.Resource.Transport.xml transportresourcebase_p.h Akonadi::TransportResourceBasePrivate ) kde4_add_ui_files( akonadikde_LIB_SRC cachepolicypage.ui collectiongeneralpropertiespage.ui subscriptiondialog.ui controlprogressindicator.ui selftestdialog.ui ) kde4_add_library( akonadi-kde SHARED ${akonadikde_LIB_SRC} ) macro_ensure_version( "4.2.0" ${KDE_VERSION} KDE_IS_AT_LEAST_42 ) target_link_libraries( akonadi-kde ${KDE4_SOLID_LIBS} ${QT_QTNETWORK_LIBRARY} ${QT_QTDBUS_LIBRARY} ${QT_QTSQL_LIBRARY} ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${AKONADI_COMMON_LIBRARIES} ) set( AKONADI_KDE_DEPS ${KDE4_KDEUI_LIBS} ${QT_QTDBUS_LIBRARY} ${QT_QTCORE_LIBRARY} ) if(KDE_IS_AT_LEAST_42) target_link_libraries( akonadi-kde LINK_INTERFACE_LIBRARIES ${AKONADI_KDE_DEPS}) else(KDE_IS_AT_LEAST_42) target_link_libraries( akonadi-kde ${AKONADI_KDE_DEPS}) endif(KDE_IS_AT_LEAST_42) set_target_properties( akonadi-kde PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} ) install( TARGETS akonadi-kde EXPORT kdepimlibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS} ) ########### install files ############### install( FILES akonadi_export.h agentbase.h agentfilterproxymodel.h agentinstance.h agentinstancecreatejob.h agentinstancemodel.h agentinstancewidget.h agentmanager.h agenttype.h agenttypemodel.h agenttypewidget.h agenttypedialog.h attribute.h attributefactory.h cachepolicy.h changerecorder.h collection.h collectioncombobox.h collectioncopyjob.h collectioncreatejob.h collectiondeletejob.h collectiondialog.h collectionfilterproxymodel.h collectionfetchjob.h collectionfetchscope.h collectionmodel.h collectionmodifyjob.h collectionmovejob.h collectionpropertiesdialog.h collectionpropertiespage.h collectionquotaattribute.h collectionrequester.h collectionstatisticsdelegate.h collectionstatisticsmodel.h collectionstatistics.h collectionstatisticsjob.h collectionview.h control.h entity.h entitydisplayattribute.h entityhiddenattribute.h entitylistview.h entitymimetypefiltermodel.h # Made private in 4.4 -- Stephen Kelly. # entityrightsfiltermodel.h entitytreemodel.h entitytreeview.h entitytreeviewstatesaver.h exception.h favoritecollectionsmodel.h item.h itemcreatejob.h itemcopyjob.h itemdeletejob.h itemfetchjob.h itemfetchscope.h itemmodel.h itemmodifyjob.h itemmonitor.h itemmovejob.h itempayloadinternals_p.h itemsearchjob.h itemserializerplugin.h itemsync.h itemview.h job.h linkjob.h mimetypechecker.h monitor.h partfetcher.h preprocessorbase.h qtest_akonadi.h resourcebase.h resourcesynchronizationjob.h searchcreatejob.h selectionproxymodel.h session.h servermanager.h specialcollections.h specialcollectionsrequestjob.h standardactionmanager.h statisticsproxymodel.h transactionjobs.h transactionsequence.h transportresourcebase.h unlinkjob.h DESTINATION ${INCLUDE_INSTALL_DIR}/akonadi COMPONENT Devel ) install( FILES collectionpathresolver_p.h DESTINATION ${INCLUDE_INSTALL_DIR}/akonadi/private COMPONENT Devel ) install( FILES kcfg2dbus.xsl DESTINATION ${DATA_INSTALL_DIR}/akonadi-kde ) diff --git a/akonadi/kcal/CMakeLists.txt b/akonadi/kcal/CMakeLists.txt new file mode 100644 index 000000000..2b97c22f6 --- /dev/null +++ b/akonadi/kcal/CMakeLists.txt @@ -0,0 +1,26 @@ +include_directories( + ${CMAKE_SOURCE_DIR}/ + ${QT_QTDBUS_INCLUDE_DIR} +) + +set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII ${KDE4_ENABLE_EXCEPTIONS}" ) + +########### next target ############### + +set( kcalakonadi_LIB_SRC + incidencemimetypevisitor.cpp +) + +kde4_add_library( akonadi-kcal SHARED ${kcalakonadi_LIB_SRC} ) + +target_link_libraries( akonadi-kcal kcal akonadi-kde ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} ) +set_target_properties( akonadi-kcal PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION} ) +install(TARGETS akonadi-kcal EXPORT kdepimlibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS}) + +########### install files ############### + +install( FILES + akonadi-kcal_export.h + incidencemimetypevisitor.h + DESTINATION ${INCLUDE_INSTALL_DIR}/akonadi/kcal COMPONENT Devel +) diff --git a/akonadi/kcal/akonadi-kcal_export.h b/akonadi/kcal/akonadi-kcal_export.h new file mode 100644 index 000000000..25a147d87 --- /dev/null +++ b/akonadi/kcal/akonadi-kcal_export.h @@ -0,0 +1,36 @@ +/* This file is part of the KDE project + Copyright (C) 2009 Kevin Krammer + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; see the file COPYING.LIB. If not, write to + the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. +*/ + +#ifndef AKONADI_KCAL_EXPORT_H +#define AKONADI_KCAL_EXPORT_H + +/* needed for KDE_EXPORT and KDE_IMPORT macros */ +#include + +#ifndef AKONADI_KCAL_EXPORT +# if defined(MAKE_AKONADI_KCAL_LIB) + /* We are building this library */ +# define AKONADI_KCAL_EXPORT KDE_EXPORT +# else + /* We are using this library */ +# define AKONADI_KCAL_EXPORT KDE_IMPORT +# endif +#endif + +#endif diff --git a/kcal/mimetypevisitor.cpp b/akonadi/kcal/incidencemimetypevisitor.cpp similarity index 68% rename from kcal/mimetypevisitor.cpp rename to akonadi/kcal/incidencemimetypevisitor.cpp index eaa702be4..0edb94d43 100644 --- a/kcal/mimetypevisitor.cpp +++ b/akonadi/kcal/incidencemimetypevisitor.cpp @@ -1,110 +1,110 @@ /* Copyright (c) 2008-2009 Kevin Krammer This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#include "mimetypevisitor.h" +#include "incidencemimetypevisitor.h" static QLatin1String sEventType( "application/x-vnd.akonadi.calendar.event" ); static QLatin1String sTodoType( "application/x-vnd.akonadi.calendar.todo" ); static QLatin1String sJournalType( "application/x-vnd.akonadi.calendar.journal" ); static QLatin1String sFreeBusyType( "application/x-vnd.akonadi.calendar.freebusy" ); -using namespace KCal; +using namespace Akonadi; -class MimeTypeVisitor::Private +class IncidenceMimeTypeVisitor::Private { public: QString mType; }; -MimeTypeVisitor::MimeTypeVisitor() : d( new Private() ) +IncidenceMimeTypeVisitor::IncidenceMimeTypeVisitor() : d( new Private() ) { } -MimeTypeVisitor::~MimeTypeVisitor() +IncidenceMimeTypeVisitor::~IncidenceMimeTypeVisitor() { delete d; } -bool MimeTypeVisitor::visit( Event *event ) +bool IncidenceMimeTypeVisitor::visit( KCal::Event *event ) { Q_UNUSED( event ); d->mType = sEventType; return true; } -bool MimeTypeVisitor::visit( Todo *todo ) +bool IncidenceMimeTypeVisitor::visit( KCal::Todo *todo ) { Q_UNUSED( todo ); d->mType = sTodoType; return true; } -bool MimeTypeVisitor::visit( Journal *journal ) +bool IncidenceMimeTypeVisitor::visit( KCal::Journal *journal ) { Q_UNUSED( journal ); d->mType = sJournalType; return true; } -bool MimeTypeVisitor::visit( FreeBusy *freebusy ) +bool IncidenceMimeTypeVisitor::visit( KCal::FreeBusy *freebusy ) { Q_UNUSED( freebusy ); d->mType = sFreeBusyType; return true; } -QString MimeTypeVisitor::mimeType() const +QString IncidenceMimeTypeVisitor::mimeType() const { return d->mType; } -QStringList MimeTypeVisitor::allMimeTypes() const +QStringList IncidenceMimeTypeVisitor::allMimeTypes() const { return QStringList() << sEventType << sTodoType << sJournalType << sFreeBusyType; } -QString MimeTypeVisitor::mimeType( IncidenceBase *incidence ) +QString IncidenceMimeTypeVisitor::mimeType( KCal::IncidenceBase *incidence ) { Q_ASSERT( incidence != 0 ); incidence->accept( *this ); return mimeType(); } -QString MimeTypeVisitor::eventMimeType() +QString IncidenceMimeTypeVisitor::eventMimeType() { return sEventType; } -QString MimeTypeVisitor::todoMimeType() +QString IncidenceMimeTypeVisitor::todoMimeType() { return sTodoType; } -QString MimeTypeVisitor::journalMimeType() +QString IncidenceMimeTypeVisitor::journalMimeType() { return sJournalType; } -QString MimeTypeVisitor::freeBusyMimeType() +QString IncidenceMimeTypeVisitor::freeBusyMimeType() { return sFreeBusyType; } // kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/kcal/mimetypevisitor.h b/akonadi/kcal/incidencemimetypevisitor.h similarity index 90% rename from kcal/mimetypevisitor.h rename to akonadi/kcal/incidencemimetypevisitor.h index 187e855b0..a66ef42fa 100644 --- a/kcal/mimetypevisitor.h +++ b/akonadi/kcal/incidencemimetypevisitor.h @@ -1,165 +1,166 @@ /* Copyright (c) 2008-2009 Kevin Krammer This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef KCAL_MIMETYPEVISITOR_H -#define KCAL_MIMETYPEVISITOR_H +#ifndef AKONADI_KCAL_INCIDENCEMIMETYPEVISITOR_H +#define AKONADI_KCAL_INCIDENCEMIMETYPEVISITOR_H -#include "kcal_export.h" -#include "incidencebase.h" +#include "akonadi-kcal_export.h" -namespace KCal { +#include + +namespace Akonadi { /** Helper for getting the Akonadi specific sub MIME type of a KCal::IncidenceBase item, e.g. getting "application/x-vnd.akonadi.calendar.event" for a KCal::Event. Usage example: creating Akonadi items for a list of incidences @code KCal::Incidence::List incidences; // assume it is filled somewhere else - KCalMimeTypeVisitor visitor; + IncidenceMimeTypeVisitor visitor; Akonadi::Item::List items; foreach ( Incidence *incidence, incidences ) { incidence->accept( visitor ); Akonadi::Item item( visitor.mimeType() ); item.setPayload( IncidencePtr( incidence->clone() ) ); items << item; } @endcode @since 4.4 */ -class KCAL_EXPORT MimeTypeVisitor : public KCal::IncidenceBase::Visitor +class AKONADI_KCAL_EXPORT IncidenceMimeTypeVisitor : public KCal::IncidenceBase::Visitor { public: /** Creates a visitor instance. Until its first visit mimeType() will return @c QString() */ - MimeTypeVisitor(); + IncidenceMimeTypeVisitor(); /** Destroys the instance */ - virtual ~MimeTypeVisitor(); + virtual ~IncidenceMimeTypeVisitor(); /** Sets the MIME type to "application/x-vnd.akonadi.calendar.event" @param event The Event to visit. Not used since the MIME type does not depend on instance specific properties. @return always returns @c true */ virtual bool visit( KCal::Event *event ); /** Sets the MIME type to "application/x-vnd.akonadi.calendar.todo" @param todo The Todo to visit. Not used since the MIME type does not depend on instance specific properties. @return always returns @c true */ virtual bool visit( KCal::Todo *todo ); /** Sets the MIME type to "application/x-vnd.akonadi.calendar.journal" @param journal The Journal to visit. Not used since the MIME type does not depend on instance specific properties. @return always returns @c true */ virtual bool visit( KCal::Journal *journal ); /** Sets the MIME type to "application/x-vnd.akonadi.calendar.freebusy" @param freebusy The FreeBusy to visit. Not used since the MIME type does not depend on instance specific properties. @return always returns @c true */ virtual bool visit( KCal::FreeBusy *freebusy ); /** Returns the Akonadi specific @c text/calendar sub MIME type of the last incidence visited by this instance. @return One of the Akonadi sub MIME types for calendar components or @c QString() if no incidence visited yet */ QString mimeType() const; /** Returns a list of all calendar component sub MIME types. */ QStringList allMimeTypes() const; /** Returns the Akonadi specific @c text/calendar sub MIME type of the given @p incidence. This is a convenience method, equivalent to @code incidence->accept( visitor ); return visitor.mimeType(); @endcode */ QString mimeType( KCal::IncidenceBase *incidence ); /** Returns the sub MIME type for Events */ static QString eventMimeType(); /** Returns the sub MIME type for Todos */ static QString todoMimeType(); /** Returns the sub MIME type for Journals */ static QString journalMimeType(); /** Returns the sub MIME type for FreeBusys */ static QString freeBusyMimeType(); private: //@cond PRIVATE class Private; Private *const d; //@endcond - Q_DISABLE_COPY( MimeTypeVisitor ) + Q_DISABLE_COPY( IncidenceMimeTypeVisitor ) }; } #endif // kate: space-indent on; indent-width 2; replace-tabs on; diff --git a/kcal/CMakeLists.txt b/kcal/CMakeLists.txt index a3b325968..aa46c7d65 100644 --- a/kcal/CMakeLists.txt +++ b/kcal/CMakeLists.txt @@ -1,190 +1,188 @@ project(kcal) set(LIBICAL_MIN_VERSION "0.42") find_package(Libical) macro_log_feature(LIBICAL_FOUND "libical" "Reference implementation of the iCalendar data type and serialization format" "http://sourceforge.net/projects/freeassociation" TRUE "${LIBICAL_MIN_VERSION}" "Required for the critical PIM kcal library.") add_definitions(-DKDE_DEFAULT_DEBUG_AREA=5800) include (ConfigureChecks.cmake) if(KDE4_BUILD_TESTS) add_definitions(-DCOMPILING_TESTS) endif(KDE4_BUILD_TESTS) include_directories( ${LIBICAL_INCLUDE_DIRS} ${LIBICAL_INCLUDE_DIRS}/libical ${CMAKE_CURRENT_SOURCE_DIR}/versit ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/kabc ${CMAKE_BINARY_DIR}/kabc ${KDE4_INCLUDE_DIR} ) set(libversit_SRCS ${CMAKE_SOURCE_DIR}/kcal/versit/vcc.c ${CMAKE_SOURCE_DIR}/kcal/versit/vobject.c ) ########### next target ############### set(kcal_LIB_SRCS ${libversit_SRCS} incidencebase.cpp incidence.cpp journal.cpp todo.cpp event.cpp freebusy.cpp freebusyperiod.cpp attendee.cpp attachment.cpp recurrencerule.cpp recurrence.cpp alarm.cpp customproperties.cpp calendar.cpp calendarlocal.cpp calformat.cpp vcalformat.cpp icalformat.cpp icalformat_p.cpp incidenceformatter.cpp vcaldrag.cpp icaldrag.cpp exceptions.cpp scheduler.cpp imipscheduler.cpp dummyscheduler.cpp calfilter.cpp person.cpp period.cpp duration.cpp dndfactory.cpp calstorage.cpp filestorage.cpp compat.cpp resourcecalendar.cpp resourcelocal.cpp resourcelocalconfig.cpp resourcelocaldir.cpp resourcelocaldirconfig.cpp resourcecached.cpp resourcecachedconfig.cpp calendarresources.cpp qtopiaformat.cpp htmlexport.cpp calendarnull.cpp freebusyurlstore.cpp confirmsavedialog.cpp icaltimezones.cpp kresult.cpp assignmentvisitor.cpp comparisonvisitor.cpp calhelper.cpp - mimetypevisitor.cpp tzmapping.cpp ) kde4_add_kcfg_files(kcal_LIB_SRCS htmlexportsettings.kcfgc ) kde4_add_library(kcal SHARED ${kcal_LIB_SRCS}) target_link_libraries(kcal ${KDE4_KDEUI_LIBS} ${KDE4_KIO_LIBS} ${QT_QTXML_LIBRARY} kresources kabc kpimutils ${LIBICAL_LIBRARIES}) target_link_libraries(kcal LINK_INTERFACE_LIBRARIES kresources kabc) set_target_properties(kcal PROPERTIES VERSION ${GENERIC_LIB_VERSION} SOVERSION ${GENERIC_LIB_SOVERSION}) install(TARGETS kcal EXPORT kdepimlibsLibraryTargets ${INSTALL_TARGETS_DEFAULT_ARGS}) ########### next target ############### set(kcal_local_PART_SRCS resourcelocal_plugin.cpp ) kde4_add_plugin(kcal_local ${kcal_local_PART_SRCS}) target_link_libraries(kcal_local ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} kcal kresources ) install(TARGETS kcal_local DESTINATION ${PLUGIN_INSTALL_DIR}) ########### next target ############### set(kcal_localdir_PART_SRCS resourcelocaldir_plugin.cpp ) kde4_add_plugin(kcal_localdir ${kcal_localdir_PART_SRCS}) target_link_libraries(kcal_localdir ${QT_QTGUI_LIBRARY} ${KDE4_KDECORE_LIBS} kcal kresources) install(TARGETS kcal_localdir DESTINATION ${PLUGIN_INSTALL_DIR}) add_subdirectory( tests ) ########### install files ############### install( FILES local.desktop localdir.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kresources/kcal) install( FILES alarm.h assignmentvisitor.h attachment.h attendee.h calendar.h calendarlocal.h calendarnull.h calendarresources.h calfilter.h calformat.h calstorage.h comparisonvisitor.h confirmsavedialog.h customproperties.h dndfactory.h duration.h event.h exceptions.h filestorage.h freebusy.h freebusycache.h freebusyperiod.h freebusyurlstore.h ${CMAKE_CURRENT_BINARY_DIR}/htmlexportsettings.h htmlexport.h icaldrag.h icalformat.h icaltimezones.h imipscheduler.h incidencebase.h incidence.h incidenceformatter.h journal.h kcal_export.h kcalversion.h listbase.h period.h person.h qtopiaformat.h recurrencerule.h recurrence.h resourcecached.h resourcecachedconfig.h resourcecalendar.h resourcelocalconfig.h resourcelocaldirconfig.h resourcelocaldir.h resourcelocal.h scheduler.h sortablelist.h todo.h vcaldrag.h vcalformat.h kresult.h calhelper.h - mimetypevisitor.h tzmapping.h DESTINATION ${INCLUDE_INSTALL_DIR}/kcal COMPONENT Devel) install( FILES kcal_manager.desktop DESTINATION ${SERVICES_INSTALL_DIR}/kresources)