Qtopia Home - Classes - Hierachy - Annotated - Functions - Licenses - Reference

calllist.h

This is the verbatim text of the calllist.h include file. It is provided only for illustration; the copyright remains with Trolltech.


/**********************************************************************
** Copyright (C) 2000-2005 Trolltech AS.  All rights reserved.
**
** This file is part of the Qtopia Environment.
**
** Licensees holding a valid license agreement from Trolltech or any of its
** authorized distributors may use this file in accordance with
** the License Agreement provided with the Licensed Software.
**
** 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/pricing.html or email sales@trolltech.com for
**   information about Trolltech's Commercial License Agreements.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
#ifndef CALLLIST_H
#define CALLLIST_H


#include <qobject.h>
#include <qstring.h>
#include <qdatetime.h>


class CallListItem;
class CallListItemPrivate;
class CallListPrivate;


class CallListItem
{
public:
    enum CallType { Dialed, Received, Missed };

    CallListItem();
    CallListItem( CallType type, const QString& number, const QDateTime& start,
	    const QDateTime &end );
    CallListItem( const CallListItem& info );
    ~CallListItem();

    bool operator== ( const CallListItem& other ) const;
    bool operator!= ( const CallListItem& other ) const
    {
	return !operator==(other);
    }
    CallListItem& operator= ( const CallListItem& other );

    CallType type() const;
    QString number() const;
    QDateTime start() const;
    QDateTime end() const;

    QT_STATIC_CONST CallListItem null;

private:
    CallListItemPrivate *d;
};


class CallList
{
public:
    CallList( const int &l = -1 );
    ~CallList();

    QValueList<CallListItem> raw() const;

    void record( CallListItem item, bool permitDuplicates=TRUE );

    uint count() const;
    CallListItem at( uint posn ) const;

    void clear();

    void setLimit( const int &l );
    int limit() const;

    void remove( uint posn );
    void remove( const QString& number );
    void remove( CallListItem::CallType type );

    int cursor() const;
    void setCursor( int posn );
    void diffCursor( int diff );

private:
    CallListPrivate *d;

    QString callListFilename();
    void load();
    void save();
    void internalRecord( CallListItem item, 
						bool permitDuplicates=FALSE );
    bool removeByNumber( const QString& number );
};


#endif // CALLLIST_H


Copyright © 2005 Trolltech Trademarks
Qtopia version 2.2.0