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.
161 lines
4.0 KiB
161 lines
4.0 KiB
13 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
|
||
13 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.
|
||
|
|
||
|
|
||
|
%If ( KDE_3_1_0 - )
|
||
12 years ago
|
namespace TDEABC
|
||
13 years ago
|
{
|
||
|
|
||
|
class Field
|
||
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <field.h>
|
||
|
%End
|
||
|
|
||
|
|
||
|
public:
|
||
12 years ago
|
typedef TQValueList<TDEABC::Field*> List;
|
||
13 years ago
|
|
||
|
enum FieldCategory
|
||
|
{
|
||
|
All,
|
||
|
Frequent,
|
||
|
Address,
|
||
|
Email,
|
||
|
Personal,
|
||
|
Organization,
|
||
|
CustomCategory
|
||
|
};
|
||
|
|
||
13 years ago
|
virtual TQString label ();
|
||
13 years ago
|
virtual int category ();
|
||
13 years ago
|
static TQString categoryLabel (int);
|
||
12 years ago
|
virtual TQString value (const TDEABC::Addressee&);
|
||
|
virtual bool setValue (TDEABC::Addressee&, const TQString&);
|
||
13 years ago
|
|
||
|
%If ( KDE_3_2_0 - )
|
||
12 years ago
|
TQString sortKey (const TDEABC::Addressee&);
|
||
13 years ago
|
%End
|
||
|
|
||
|
virtual bool isCustom ();
|
||
12 years ago
|
virtual bool equals (TDEABC::Field*);
|
||
|
static TDEABC::Field::List allFields ();
|
||
|
static TDEABC::Field::List defaultFields ();
|
||
|
static TDEABC::Field* createCustomField (const TQString&, int, const TQString&, const TQString&);
|
||
13 years ago
|
static void deleteFields ();
|
||
12 years ago
|
static void saveFields (TDEConfig*, const TQString&, const TDEABC::Field::List&);
|
||
|
static void saveFields (const TQString&, const TDEABC::Field::List&);
|
||
|
static TDEABC::Field::List restoreFields (TDEConfig*, const TQString&);
|
||
|
static TDEABC::Field::List restoreFields (const TQString&);
|
||
13 years ago
|
|
||
|
protected:
|
||
|
static void createField (int, int = 0);
|
||
|
static void createDefaultField (int, int = 0);
|
||
|
|
||
|
private:
|
||
12 years ago
|
//ig Field (TDEABC::Field::FieldImpl*);
|
||
13 years ago
|
~Field ();
|
||
|
//force
|
||
|
Field ();
|
||
|
//end
|
||
|
|
||
|
}; // class Field
|
||
|
|
||
12 years ago
|
}; // namespace TDEABC
|
||
13 years ago
|
|
||
|
%End
|
||
|
|
||
|
|
||
|
|
||
|
%If (KDE_3_1_0 - )
|
||
12 years ago
|
%MappedType TDEABC::Field::List
|
||
|
//converts a Python list of TDEABC::Field
|
||
13 years ago
|
{
|
||
|
%TypeHeaderCode
|
||
|
#include <field.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::Field *> *cpplist = (TQValueList<TDEABC::Field *> *)sipCpp;
|
||
13 years ago
|
PyObject *inst;
|
||
|
|
||
|
// Get it.
|
||
12 years ago
|
TQValueList<TDEABC::Field *>::Iterator it;
|
||
13 years ago
|
for( it = cpplist->begin(); it != cpplist->end(); ++it )
|
||
|
{
|
||
12 years ago
|
if (((inst = sipConvertFromType((TDEABC::Field *)(*it), sipType_TDEABC_Field, NULL)) == NULL)
|
||
13 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::Field *> *cpplist = new TQValueList<TDEABC::Field *>;
|
||
13 years ago
|
|
||
|
PyObject *elem;
|
||
12 years ago
|
TDEABC::Field *cpp;
|
||
13 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::Field *)sipForceConvertToType(elem, sipType_TDEABC_Field, sipTransferObj, SIP_NO_CONVERTORS, NULL, &iserr);
|
||
13 years ago
|
|
||
|
if (iserr)
|
||
|
{
|
||
|
*sipIsErr = 1;
|
||
|
delete cpplist;
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
cpplist->append (cpp);
|
||
|
}
|
||
|
|
||
|
*sipCppPtr = cpplist;
|
||
|
|
||
|
return 1;
|
||
|
%End
|
||
|
};
|
||
|
%End
|
||
|
|
||
|
|