00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef CONTACTLIST_H
00018 #define CONTACTLIST_H
00019
00020 #include <list>
00021 #include <contact.h>
00022
00023
00024 typedef std::list<Contact>::iterator ContactListIterator;
00025 typedef std::list<Contact>::const_iterator ContactListConstIterator;
00026
00033 class ContactList
00034 {
00035 public:
00037 ContactList();
00038
00040 ~ContactList();
00041
00048 const Contact* addContact(const Contact& contact);
00049
00054 bool isContactInList(const Contact& contact);
00055
00060 bool removeContact(const int ID);
00061
00066 bool removeContact(const Contact& contact);
00067
00071 std::string toString() const;
00072
00077 ContactListConstIterator begin() const { return m_list.begin(); }
00078
00083 ContactListConstIterator end() const { return m_list.end(); }
00084
00086 void clear();
00087
00091 const Contact* const getContact(const int contactID) const;
00092
00096 Contact* getContact(const int contactID);
00097
00098 private:
00100 std::list<Contact> m_list;
00101
00102 };
00103
00104
00105 #endif
00106