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.
109 lines
3.2 KiB
109 lines
3.2 KiB
15 years ago
|
/*
|
||
|
addressbooklink.h - Manages operations involving the KDE Address Book
|
||
|
|
||
|
Copyright (c) 2005 Will Stephenson <lists@stevello.free-online.co.uk>
|
||
|
|
||
|
Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
|
||
|
|
||
|
*************************************************************************
|
||
|
* *
|
||
|
* 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 of the License, or (at your option) any later version. *
|
||
|
* *
|
||
|
*************************************************************************
|
||
|
*/
|
||
|
|
||
|
#ifndef KOPETEADDRESSBOOKLINK_H
|
||
|
#define KOPETEADDRESSBOOKLINK_H
|
||
|
|
||
|
#include "kopete_export.h"
|
||
|
|
||
|
// Goal is to have all the address book modifying code in one place
|
||
|
// Currently in
|
||
|
// *) Add Contact Wizard
|
||
|
// *) KopeteMetaContact
|
||
|
// *) KopeteAddrBookExport
|
||
11 years ago
|
// *) KABC Export Wizard - TODO - think about sequence of events when adding addressees AND writing their IM data. - Extra save should be unnecessary because we are sharing a tdeabc instance
|
||
15 years ago
|
// *) Select addressbook entry
|
||
|
|
||
12 years ago
|
namespace TDEABC
|
||
15 years ago
|
{
|
||
|
class AddressBook;
|
||
|
class Resource;
|
||
|
}
|
||
|
|
||
|
namespace Kopete
|
||
|
{
|
||
|
|
||
|
class MetaContact;
|
||
|
|
||
14 years ago
|
class KOPETE_EXPORT KABCPersistence : public TQObject
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
public:
|
||
|
/**
|
||
|
* \brief Retrieve the instance of AccountManager.
|
||
|
*
|
||
|
* The account manager is a singleton class of which only a single
|
||
|
* instance will exist. If no manager exists yet this function will
|
||
|
* create one for you.
|
||
|
*
|
||
|
* \return the instance of the AccountManager
|
||
|
*/
|
||
|
static KABCPersistence* self();
|
||
|
|
||
13 years ago
|
KABCPersistence( TQObject * parent = 0, const char * name = 0 );
|
||
15 years ago
|
~KABCPersistence();
|
||
|
/**
|
||
|
* @brief Access Kopete's KDE address book instance
|
||
|
*/
|
||
12 years ago
|
static TDEABC::AddressBook* addressBook();
|
||
15 years ago
|
/**
|
||
|
* @brief Change the KABC data associated with this metacontact
|
||
|
*
|
||
|
* The KABC exposed data changed, so change it in KABC.
|
||
|
* Replaces Kopete::MetaContact::updateKABC()
|
||
|
*/
|
||
|
void write( MetaContact * mc );
|
||
|
|
||
|
/**
|
||
|
* @brief Remove any KABC data for this meta contact
|
||
|
*/
|
||
|
void removeKABC( MetaContact * mc );
|
||
|
|
||
|
/**
|
||
|
* Check for any new addresses added to this contact's KABC entry
|
||
|
* and prompt if they should be added in Kopete too.
|
||
|
* @return whether any contacts were added from KABC.
|
||
|
*/
|
||
|
bool syncWithKABC( MetaContact * mc );
|
||
|
|
||
|
/**
|
||
|
* Request an address book write, will be delayed to bundle any others happening around the same time
|
||
|
*/
|
||
12 years ago
|
void writeAddressBook( const TDEABC::Resource * res );
|
||
15 years ago
|
protected:
|
||
|
|
||
15 years ago
|
static void splitField( const TQString &str, TQString &app, TQString &name, TQString &value );
|
||
15 years ago
|
|
||
|
void dumpAB();
|
||
|
protected slots:
|
||
|
/**
|
||
|
* Perform a delayed address book write
|
||
|
*/
|
||
|
void slotWriteAddressBook();
|
||
|
private:
|
||
|
static KABCPersistence * s_self;
|
||
12 years ago
|
static TDEABC::AddressBook* s_addressBook;
|
||
15 years ago
|
static bool s_addrBookWritePending;
|
||
12 years ago
|
static TQPtrList<TDEABC::Resource> s_pendingResources;
|
||
15 years ago
|
};
|
||
|
|
||
|
} // end namespace Kopete
|
||
|
|
||
|
#endif
|
||
|
|