Qtopia Home - Classes - Annotated - Functions - Qt Embedded |
|
This is the verbatim text of the phonebook.h include file. It is provided only for illustration; the copyright remains with Trolltech.
/**********************************************************************
** Copyright (C) 2000-2003 Trolltech AS. All rights reserved.
**
** This file is part of the Qtopia Environment.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef PHONEBOOK_H
#define PHONEBOOK_H
#include "phone.h"
#include <qstringlist.h>
#include <qvaluelist.h>
class PhoneBookPrivate;
class QDataStream;
class PhoneBookEntry
{
public:
PhoneBookEntry() { _index = 0; }
~PhoneBookEntry() {}
//methods to satisfy qvaluelist
PhoneBookEntry( const PhoneBookEntry &other )
{
_index = other._index;
_number = other._number;
_text = other._text;
}
PhoneBookEntry &operator=( const PhoneBookEntry &other )
{
_index = other._index;
_number = other._number;
_text = other._text;
return *this;
}
bool operator==( const PhoneBookEntry &other )
{
return _index == other._index;
}
uint index() const { return _index; }
void setIndex( uint value ) { _index = value; }
QString number() const { return _number; }
void setNumber( const QString& value ) { _number = value; }
QString text() const { return _text; }
void setText( const QString& value ) { _text = value; }
private:
uint _index;
QString _number;
QString _text;
};
QDataStream &operator>>( QDataStream&, PhoneBookEntry& );
QDataStream &operator<<( QDataStream&, const PhoneBookEntry& );
class PhoneBook : public QObject
{
Q_OBJECT
friend class PhoneLine;
friend class PhoneLinePrivate;
private:
PhoneBook( PhoneBookPrivate *d, QObject *parent );
~PhoneBook();
public:
PhoneLine& line() const;
void getEntries( const QString& store = "SM" );
void add( const QString& number, const QString& text, const QString& store = "SM", bool flush = TRUE );
void remove( uint index, const QString& store = "SM", bool flush = TRUE );
void update( uint index, const QString& number, const QString& text, const QString& store = "SM", bool flush = TRUE );
void flush( const QString& store = "SM" );
signals:
// Receive the list of entries in a particular storage area.
// Occurs whenever the list is explicitly requested with "getEntries",
// or the list is modified by "add", "remove", or "update".
void entries( const PhoneLine& line, const QString& store, const QValueList<PhoneBookEntry>& list );
private:
PhoneBookPrivate *d;
};
#endif // PHONEBOOK_H
| Copyright © 2001-2004 Trolltech | Trademarks | Qtopia version 2.0.1
|