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.
187 lines
5.1 KiB
187 lines
5.1 KiB
15 years ago
|
/*
|
||
|
This file is part of the KDE project
|
||
|
Copyright (C) 2003 Tobias Koenig <tokoe@kde.org>
|
||
|
Copyright (C) 2004 Tobias Koenig <tokoe@kde.org>
|
||
|
Dirk Schmidt <fs@dirk.schmidt.net>
|
||
|
|
||
|
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 _KWMAILMERGE_KABC_H_
|
||
|
#define _KWMAILMERGE_KABC_H_
|
||
|
|
||
14 years ago
|
#include <tqdom.h>
|
||
|
#include <tqguardedptr.h>
|
||
15 years ago
|
|
||
12 years ago
|
#include <tdeabc/addressbook.h>
|
||
15 years ago
|
|
||
|
#include "KWMailMergeDataSource.h"
|
||
|
|
||
12 years ago
|
class KWMailMergeTDEABC: public KWMailMergeDataSource
|
||
15 years ago
|
{
|
||
|
Q_OBJECT
|
||
13 years ago
|
|
||
15 years ago
|
|
||
|
public:
|
||
12 years ago
|
KWMailMergeTDEABC( TDEInstance *inst, TQObject *parent );
|
||
|
~KWMailMergeTDEABC();
|
||
15 years ago
|
|
||
|
/**
|
||
|
Saves the mail merge list to the kword document.
|
||
|
*/
|
||
14 years ago
|
virtual void save( TQDomDocument&, TQDomElement& );
|
||
15 years ago
|
|
||
|
/**
|
||
|
Loads the mail merge list stored in the kword document.
|
||
|
*/
|
||
14 years ago
|
virtual void load( TQDomElement& );
|
||
15 years ago
|
|
||
|
/**
|
||
|
@param name The name of the value e.g. "Family name".
|
||
|
@param record The position of the the entry in mail merge list.
|
||
|
@return The value of the mail merge variable.
|
||
|
|
||
|
If @p record equals -1, @p name is returned.
|
||
|
*/
|
||
14 years ago
|
virtual class TQString getValue( const class TQString &name, int record = -1 ) const;
|
||
15 years ago
|
|
||
|
/**
|
||
|
@return The number of available contacts in mail merge list.
|
||
|
*/
|
||
|
virtual int getNumRecords() const;
|
||
|
|
||
|
/**
|
||
|
Only for compatability reasons.
|
||
|
|
||
|
@param force Hasn't any effect.
|
||
|
*/
|
||
|
virtual void refresh( bool force );
|
||
|
|
||
|
/**
|
||
12 years ago
|
Shows a KWMailMergeTDEABCConfig dialog for selecting entries from KAddressbook.
|
||
15 years ago
|
*/
|
||
14 years ago
|
virtual bool showConfigDialog( TQWidget*, int action);
|
||
15 years ago
|
|
||
|
protected:
|
||
12 years ago
|
friend class KWMailMergeTDEABCConfig;
|
||
15 years ago
|
|
||
|
/**
|
||
12 years ago
|
Adds an entry from TDEABC::StdAddressBook::self()
|
||
15 years ago
|
to the mail merge list.
|
||
|
|
||
12 years ago
|
To be called by KWMailMergeTDEABC::load() and
|
||
12 years ago
|
KWMailMergeTDEABCConfig::acceptSelection() only.
|
||
15 years ago
|
|
||
12 years ago
|
@param uid The entry's TDEABC::Addressee::uid().
|
||
15 years ago
|
*/
|
||
14 years ago
|
void addEntry( const TQString &uid );
|
||
15 years ago
|
|
||
|
/**
|
||
|
Adds a distribution list to the mail merge list.
|
||
|
|
||
12 years ago
|
To be called by KWMailMergeTDEABC::load() and
|
||
12 years ago
|
KWMailMergeTDEABCConfig::acceptSelection() only.
|
||
15 years ago
|
|
||
|
@param id The DistributionList::name().
|
||
|
*/
|
||
14 years ago
|
void addList( const TQString &id );
|
||
15 years ago
|
|
||
|
/**
|
||
|
Removes all entries and distribution lists from the mail merge list.
|
||
|
*/
|
||
|
void clear();
|
||
|
|
||
|
/**
|
||
|
@return All selected DistributionList::name().
|
||
|
|
||
12 years ago
|
To be called by KWMailMergeTDEABCConfig::initSelectedLists()
|
||
15 years ago
|
*/
|
||
14 years ago
|
virtual TQStringList lists() const;
|
||
15 years ago
|
|
||
|
/**
|
||
12 years ago
|
@return The TDEABC::Addressee::uid() of all individually selected
|
||
15 years ago
|
entries in mail merge list.
|
||
|
|
||
12 years ago
|
To be called by KWMailMergeTDEABCConfig::initSelectedAddressees()
|
||
15 years ago
|
*/
|
||
14 years ago
|
virtual TQStringList singleRecords() const;
|
||
15 years ago
|
|
||
|
private:
|
||
|
/**
|
||
12 years ago
|
The TDEABC::StdAddressBook::self().
|
||
15 years ago
|
*/
|
||
12 years ago
|
TDEABC::AddressBook* _addressBook;
|
||
15 years ago
|
|
||
|
/**
|
||
|
Just an Iterator.
|
||
|
*/
|
||
12 years ago
|
mutable TDEABC::AddressBook::ConstIterator _iterator;
|
||
15 years ago
|
|
||
|
/**
|
||
|
Just an Iterator.
|
||
|
*/
|
||
14 years ago
|
mutable TQStringList::ConstIterator _UIDIterator;
|
||
15 years ago
|
|
||
|
/**
|
||
14 years ago
|
The "real" mail merge list. A list of TQStrings. Each represents
|
||
12 years ago
|
the TDEABC::Addressee::uid() of a KAdressbook entry.
|
||
15 years ago
|
There is no UID twice in this list.
|
||
|
|
||
|
Needed because selected contacts may appear in a selected
|
||
|
distribution list, too. And we don't want to print it multiple.
|
||
|
*/
|
||
14 years ago
|
TQStringList _exclusiveUIDs;
|
||
15 years ago
|
|
||
|
/**
|
||
12 years ago
|
This list contains all the TDEABC::Addressee::uid() selected
|
||
12 years ago
|
individually with the KWMailMergeTDEABCConfig dialog.
|
||
15 years ago
|
*/
|
||
14 years ago
|
TQStringList _individualUIDs;
|
||
15 years ago
|
|
||
|
/**
|
||
12 years ago
|
This list contains all the TDEABC::Addressee::uid() from the distribution
|
||
12 years ago
|
lists selected with the KWMailMergeTDEABCConfig dialog.
|
||
15 years ago
|
*/
|
||
14 years ago
|
TQStringList _listUIDs;
|
||
15 years ago
|
|
||
|
/**
|
||
|
This list contains all the DistributionList::name() selected with the
|
||
12 years ago
|
KWMailMergeTDEABCConfig dialog.
|
||
15 years ago
|
*/
|
||
14 years ago
|
TQStringList _lists;
|
||
15 years ago
|
|
||
|
|
||
|
/**
|
||
12 years ago
|
Appends all TDEABC::Addressee::uid() of a distribution list to _listUIDs
|
||
15 years ago
|
and updates the mail merge list.
|
||
|
|
||
12 years ago
|
To be used by KWMailMergeTDEABCConfig::addList( const TQString &id )
|
||
15 years ago
|
only.
|
||
|
|
||
|
@param listName The DistributionList::name() of the distribution list.
|
||
|
*/
|
||
14 years ago
|
void parseList( const TQString& listName );
|
||
15 years ago
|
|
||
|
/**
|
||
|
Removes duplicate entries in the mail merge list.
|
||
|
*/
|
||
|
void makeUIDsExclusive();
|
||
|
|
||
|
};
|
||
|
|
||
|
#endif
|
||
|
|