syncevolution/src/backends/evolution/EvolutionMemoSource.h
Patrick Ohly a61b8590f3 backend API cleanup: removal of "const char *" return types
SyncConfig inherited "const char *" from the Funambol C++ API and some
other methods used the same approach for efficient access to plain
strings. However, this has the disadvantage that dynamically generated
strings cannot be returned. SyncConfig had to use an awkward
workaround with a local string cache.

This patch converts most of that code to a normal std::string return
value and removes the string cache.

Out-of-tree backends must be adapted, otherwise they won't compile.
2011-01-18 15:15:09 +01:00

58 lines
1.8 KiB
C++

/*
* Copyright (C) 2005-2009 Patrick Ohly <patrick.ohly@gmx.de>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) version 3.
*
* 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA
*/
#ifndef INCL_EVOLUTIONMEMOSOURCE
#define INCL_EVOLUTIONMEMOSOURCE
#include "config.h"
#include <EvolutionCalendarSource.h>
#include <syncevo/declarations.h>
SE_BEGIN_CXX
#ifdef ENABLE_ECAL
/**
* Implements access to Evolution memo lists (stored as calendars),
* exporting/importing the memos in plain UTF-8 text. Only the DESCRIPTION
* part of a memo is synchronized.
*/
class EvolutionMemoSource : public EvolutionCalendarSource
{
public:
EvolutionMemoSource(const SyncSourceParams &params) :
EvolutionCalendarSource(E_CAL_SOURCE_TYPE_JOURNAL, params) {}
//
// implementation of SyncSource
//
virtual InsertItemResult insertItem(const string &uid, const std::string &item, bool raw);
void readItem(const std::string &luid, std::string &item, bool raw);
virtual std::string getMimeType() const { return "text/plain"; }
virtual std::string getMimeVersion() const { return "1.0"; }
private:
bool isNativeType(const char *type);
};
#endif // ENABLE_ECAL
SE_END_CXX
#endif // INCL_EVOLUTIONMEMOSOURCE