You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
134 lines
4.6 KiB
134 lines
4.6 KiB
15 years ago
|
/*
|
||
|
This file is part of the kolab resource - the implementation of the
|
||
|
Kolab storage format. See www.kolab.org for documentation on this.
|
||
|
|
||
|
Copyright (c) 2004 Bo Thorsen <bo@sonofthor.dk>
|
||
|
|
||
|
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.
|
||
|
|
||
|
In addition, as a special exception, the copyright holders give
|
||
|
permission to link the code of this program with any edition of
|
||
14 years ago
|
the TQt library by Trolltech AS, Norway (or with modified versions
|
||
|
of TQt that use the same license as TQt), and distribute linked
|
||
15 years ago
|
combinations including the two. You must obey the GNU General
|
||
|
Public License in all respects for all of the code used other than
|
||
14 years ago
|
TQt. If you modify this file, you may extend this exception to
|
||
15 years ago
|
your version of the file, but you are not obligated to do so. If
|
||
|
you do not wish to do so, delete this exception statement from
|
||
|
your version.
|
||
|
*/
|
||
|
|
||
|
#ifndef KNOTES_RESOURCEKOLAB_H
|
||
|
#define KNOTES_RESOURCEKOLAB_H
|
||
|
|
||
|
#include <resourcenotes.h>
|
||
|
#include <libkcal/incidencebase.h>
|
||
|
#include <libkcal/calendarlocal.h>
|
||
|
#include "../shared/resourcekolabbase.h"
|
||
|
#include "../shared/subresource.h"
|
||
13 years ago
|
#include <tdepimmacros.h>
|
||
15 years ago
|
|
||
|
|
||
|
namespace Kolab {
|
||
|
|
||
|
/**
|
||
|
* This class implements a KNotes resource that keeps its
|
||
|
* addresses in an IMAP folder in KMail (or other conforming email
|
||
|
* clients).
|
||
|
*/
|
||
|
class KDE_EXPORT ResourceKolab : public ResourceNotes,
|
||
|
public KCal::IncidenceBase::Observer,
|
||
|
public ResourceKolabBase
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
|
||
|
public:
|
||
12 years ago
|
ResourceKolab( const TDEConfig* );
|
||
15 years ago
|
virtual ~ResourceKolab();
|
||
|
|
||
|
/// Load resource data.
|
||
|
bool load();
|
||
|
|
||
|
/// Save resource data.
|
||
|
bool save();
|
||
|
|
||
|
/// Open the notes resource.
|
||
|
bool doOpen();
|
||
|
/// Close the notes resource.
|
||
|
void doClose();
|
||
|
|
||
|
bool addNote( KCal::Journal* );
|
||
|
|
||
|
bool deleteNote( KCal::Journal* );
|
||
|
|
||
14 years ago
|
KCal::Alarm::List alarms( const TQDateTime& from, const TQDateTime& to );
|
||
15 years ago
|
|
||
|
/// Reimplemented from IncidenceBase::Observer to know when a note was changed
|
||
|
void incidenceUpdated( KCal::IncidenceBase* );
|
||
|
|
||
|
/// The ResourceKolabBase methods called by KMail
|
||
14 years ago
|
bool fromKMailAddIncidence( const TQString& type, const TQString& resource,
|
||
14 years ago
|
TQ_UINT32 sernum, int format, const TQString& note );
|
||
14 years ago
|
void fromKMailDelIncidence( const TQString& type, const TQString& resource,
|
||
|
const TQString& uid );
|
||
|
void fromKMailRefresh( const TQString& type, const TQString& resource );
|
||
15 years ago
|
|
||
|
/// Listen to KMail changes in the amount of sub resources
|
||
14 years ago
|
void fromKMailAddSubresource( const TQString& type, const TQString& resource,
|
||
|
const TQString& label, bool writable,
|
||
15 years ago
|
bool alarmRelevant );
|
||
14 years ago
|
void fromKMailDelSubresource( const TQString& type, const TQString& resource );
|
||
15 years ago
|
|
||
14 years ago
|
void fromKMailAsyncLoadResult( const TQMap<TQ_UINT32, TQString>& map,
|
||
14 years ago
|
const TQString& type,
|
||
|
const TQString& folder );
|
||
15 years ago
|
|
||
|
/** Return the list of subresources. */
|
||
14 years ago
|
TQStringList subresources() const;
|
||
15 years ago
|
|
||
|
/** Is this subresource active? */
|
||
14 years ago
|
bool subresourceActive( const TQString& ) const;
|
||
15 years ago
|
|
||
14 years ago
|
/** Is this subresource writable? */
|
||
|
bool subresourceWritable( const TQString& ) const;
|
||
|
|
||
15 years ago
|
signals:
|
||
14 years ago
|
void signalSubresourceAdded( Resource*, const TQString&, const TQString& );
|
||
|
void signalSubresourceRemoved( Resource*, const TQString&, const TQString& );
|
||
15 years ago
|
|
||
|
private:
|
||
14 years ago
|
bool addNote( KCal::Journal* journal, const TQString& resource,
|
||
14 years ago
|
TQ_UINT32 sernum );
|
||
14 years ago
|
KCal::Journal* addNote( const TQString& data, const TQString& subresource,
|
||
14 years ago
|
TQ_UINT32 sernum, const TQString &mimetype );
|
||
15 years ago
|
|
||
14 years ago
|
bool loadSubResource( const TQString& resource, const TQString& mimetype );
|
||
15 years ago
|
|
||
14 years ago
|
TQString configFile() const {
|
||
15 years ago
|
return ResourceKolabBase::configFile( "knotes" );
|
||
|
}
|
||
|
|
||
|
KCal::CalendarLocal mCalendar;
|
||
|
|
||
|
// The list of subresources
|
||
|
Kolab::ResourceMap mSubResources;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
#endif // KNOTES_RESOURCEKOLAB_H
|