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.
115 lines
2.8 KiB
115 lines
2.8 KiB
15 years ago
|
/*
|
||
13 years ago
|
This file is part of tdepim.
|
||
15 years ago
|
|
||
|
Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
|
||
|
|
||
|
This program is free software; you can redistribute it and/or modify
|
||
|
it under the terms of the GNU General Public License as published by
|
||
|
the Free Software Foundation; either version 2 of the License, or
|
||
|
(at your option) any later version.
|
||
|
|
||
|
This program 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 General Public License for more details.
|
||
|
|
||
|
You should have received a copy of the GNU General Public License
|
||
|
along with this program; if not, write to the Free Software
|
||
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
#ifndef KABC_RESOURCESLOX_H
|
||
|
#define KABC_RESOURCESLOX_H
|
||
|
|
||
|
#include "sloxbase.h"
|
||
|
#include "webdavhandler.h"
|
||
|
|
||
13 years ago
|
#include <libtdepim/kabcresourcecached.h>
|
||
13 years ago
|
#include <tdepimmacros.h>
|
||
15 years ago
|
#include <kabc/addressee.h>
|
||
|
|
||
15 years ago
|
#include <tqmap.h>
|
||
|
#include <tqdom.h>
|
||
15 years ago
|
|
||
12 years ago
|
namespace TDEIO {
|
||
15 years ago
|
class DavJob;
|
||
|
class Job;
|
||
|
}
|
||
|
|
||
|
namespace KPIM {
|
||
|
class ProgressItem;
|
||
|
}
|
||
|
|
||
12 years ago
|
class TDEConfig;
|
||
15 years ago
|
|
||
|
namespace KABC {
|
||
|
|
||
|
class SloxPrefs;
|
||
|
|
||
|
class KDE_EXPORT ResourceSlox : public ResourceCached, public SloxBase
|
||
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
12 years ago
|
ResourceSlox( const TDEConfig * );
|
||
15 years ago
|
ResourceSlox( const KURL &url,
|
||
15 years ago
|
const TQString &user, const TQString &password );
|
||
15 years ago
|
~ResourceSlox();
|
||
|
|
||
12 years ago
|
void readConfig( const TDEConfig * );
|
||
|
void writeConfig( TDEConfig * );
|
||
15 years ago
|
|
||
|
SloxPrefs *prefs() const { return mPrefs; }
|
||
|
|
||
|
bool doOpen();
|
||
|
void doClose();
|
||
|
|
||
|
Ticket *requestSaveTicket();
|
||
|
void releaseSaveTicket( Ticket* );
|
||
|
|
||
|
bool load();
|
||
|
bool asyncLoad();
|
||
|
bool save( Ticket * );
|
||
|
bool asyncSave( Ticket * );
|
||
|
|
||
|
void setReadOnly( bool );
|
||
|
bool readOnly() const;
|
||
|
|
||
|
protected:
|
||
|
void init();
|
||
|
|
||
15 years ago
|
int phoneNumberType( const TQString &fieldName ) const;
|
||
|
void parseContactAttribute( const TQDomElement &e, Addressee &a );
|
||
15 years ago
|
|
||
15 years ago
|
void createAddresseeFields( TQDomDocument &doc, TQDomElement &prop, const Addressee &a );
|
||
13 years ago
|
void createAddressFields( TQDomDocument &doc, TQDomElement &parent,
|
||
15 years ago
|
const TQString &prefix, const KABC::Address &addr );
|
||
15 years ago
|
|
||
|
void uploadContacts();
|
||
|
|
||
|
protected slots:
|
||
12 years ago
|
void slotResult( TDEIO::Job *job );
|
||
|
void slotUploadResult( TDEIO::Job *job );
|
||
|
void slotProgress( TDEIO::Job *job, unsigned long percent );
|
||
15 years ago
|
|
||
|
void cancelDownload();
|
||
|
void cancelUpload();
|
||
|
|
||
|
private:
|
||
|
SloxPrefs *mPrefs;
|
||
|
|
||
12 years ago
|
TDEIO::DavJob *mDownloadJob;
|
||
|
TDEIO::DavJob *mUploadJob;
|
||
15 years ago
|
KPIM::ProgressItem *mDownloadProgress;
|
||
|
KPIM::ProgressItem *mUploadProgress;
|
||
|
|
||
|
WebdavHandler mWebdavHandler;
|
||
|
|
||
|
KABC::Addressee mUploadAddressee;
|
||
|
|
||
15 years ago
|
TQMap<int, TQStringList> mPhoneNumberSloxMap, mPhoneNumberOxMap;
|
||
15 years ago
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
#endif
|