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.
176 lines
4.4 KiB
176 lines
4.4 KiB
14 years ago
|
//
|
||
|
// Copyright 2006 Jim Bublitz <jbublitz@nwinternet.com>
|
||
|
// Earlier copyrights 1998 - 2005 Jim Bublitz and/or Phil Thompson
|
||
|
// may also apply
|
||
|
|
||
|
|
||
|
// Generated by preSip
|
||
12 years ago
|
// module tdeabc version KDE 3.5.3
|
||
14 years ago
|
|
||
|
|
||
|
// This software 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 software 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 library; see the file COPYING.
|
||
|
// If not, write to the Free Software Foundation, Inc.,
|
||
|
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
|
||
12 years ago
|
namespace TDEABC
|
||
14 years ago
|
{
|
||
|
|
||
|
class DistributionList
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <distributionlist.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
|
|
||
|
class Entry
|
||
|
{
|
||
|
|
||
|
public:
|
||
12 years ago
|
typedef TQValueList<TDEABC::DistributionList::Entry> List;
|
||
14 years ago
|
Entry ();
|
||
12 years ago
|
Entry (const TDEABC::Addressee&, const TQString&);
|
||
|
TDEABC::Addressee addressee;
|
||
13 years ago
|
TQString email;
|
||
14 years ago
|
|
||
|
}; // class Entry
|
||
|
|
||
|
|
||
|
public:
|
||
12 years ago
|
DistributionList (TDEABC::DistributionListManager*, const TQString&);
|
||
13 years ago
|
void setName (const TQString&);
|
||
|
TQString name () const;
|
||
12 years ago
|
void insertEntry (const TDEABC::Addressee&, const TQString& = TQString ::null );
|
||
|
void removeEntry (const TDEABC::Addressee&, const TQString& = TQString ::null );
|
||
13 years ago
|
TQStringList emails () const;
|
||
12 years ago
|
TDEABC::DistributionList::Entry::List entries () const;
|
||
14 years ago
|
|
||
|
}; // class DistributionList
|
||
|
|
||
|
|
||
|
class DistributionListManager
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <distributionlist.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
12 years ago
|
DistributionListManager (TDEABC::AddressBook*);
|
||
|
TDEABC::DistributionList* list (const TQString&);
|
||
|
void insert (TDEABC::DistributionList*);
|
||
|
void remove (TDEABC::DistributionList*);
|
||
13 years ago
|
TQStringList listNames ();
|
||
14 years ago
|
bool load ();
|
||
|
bool save ();
|
||
|
|
||
|
}; // class DistributionListManager
|
||
|
|
||
|
|
||
|
%If ( KDE_3_1_0 - )
|
||
|
|
||
13 years ago
|
class DistributionListWatcher : TQObject
|
||
14 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <distributionlist.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
12 years ago
|
static TDEABC::DistributionListWatcher* self ();
|
||
14 years ago
|
|
||
|
signals:
|
||
|
void changed ();
|
||
|
|
||
|
protected:
|
||
|
DistributionListWatcher ();
|
||
|
~DistributionListWatcher ();
|
||
|
|
||
|
}; // class DistributionListWatcher
|
||
|
|
||
|
%End
|
||
|
|
||
12 years ago
|
}; // namespace TDEABC
|
||
14 years ago
|
|
||
|
|
||
|
|
||
12 years ago
|
%MappedType TDEABC::DistributionList::Entry::List
|
||
|
//converts a Python list of TDEABC::DistributionList::Entry
|
||
14 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <distributionlist.h>
|
||
|
%End
|
||
|
|
||
|
%ConvertFromTypeCode
|
||
|
if (!sipCpp)
|
||
|
return PyList_New(0);
|
||
|
|
||
|
// Create the list
|
||
|
PyObject *pylist;
|
||
|
if ((pylist = PyList_New(0)) == NULL)
|
||
|
return NULL;
|
||
|
|
||
12 years ago
|
TQValueList<TDEABC::DistributionList::Entry> *cpplist = (TQValueList<TDEABC::DistributionList::Entry> *)sipCpp;
|
||
14 years ago
|
PyObject *inst;
|
||
|
|
||
|
// Get it.
|
||
12 years ago
|
TQValueList<TDEABC::DistributionList::Entry>::Iterator it;
|
||
14 years ago
|
for( it = cpplist->begin(); it != cpplist->end(); ++it )
|
||
|
{
|
||
12 years ago
|
if (((inst = sipConvertFromNewType(new TDEABC::DistributionList::Entry (*it), sipType_TDEABC_DistributionList_Entry, NULL)) == NULL)
|
||
14 years ago
|
|| PyList_Append (pylist, inst) < 0)
|
||
|
{
|
||
|
Py_DECREF (pylist);
|
||
|
return NULL;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return pylist;
|
||
|
%End
|
||
|
|
||
|
|
||
|
%ConvertToTypeCode
|
||
|
if (sipIsErr == NULL)
|
||
|
return PyList_Check(sipPy);
|
||
|
|
||
12 years ago
|
TQValueList<TDEABC::DistributionList::Entry> *cpplist = new TQValueList<TDEABC::DistributionList::Entry>;
|
||
14 years ago
|
|
||
|
PyObject *elem;
|
||
12 years ago
|
TDEABC::DistributionList::Entry *cpp;
|
||
14 years ago
|
int iserr = 0;
|
||
|
|
||
|
for (int i = 0; i < PyList_Size (sipPy); i++)
|
||
|
{
|
||
|
elem = PyList_GET_ITEM (sipPy, i);
|
||
12 years ago
|
cpp = (TDEABC::DistributionList::Entry *)sipForceConvertToType(elem, sipType_TDEABC_DistributionList_Entry, sipTransferObj, SIP_NOT_NONE|SIP_NO_CONVERTORS, NULL, &iserr);
|
||
14 years ago
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
delete cpplist;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
cpplist->append (*cpp);
|
||
|
}
|
||
|
|
||
|
*sipCppPtr = cpplist;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
|
||
|
|