source: SMSSender/lib/libdatatypes/src/business/BCGroup.h @ 43:10dd65d71f7f

3.0
Last change on this file since 43:10dd65d71f7f was 43:10dd65d71f7f, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • Did a lot of work...
File size: 1.3 KB
Line 
1/*
2 * BCGroup.h
3 *
4 *  Created on: Jun 20, 2009
5 *      Author: saemy
6 */
7
8#ifndef BCGROUP_H_
9#define BCGROUP_H_
10
11#include <QObject>
12#include <QMap>
13
14#include <igroup.h>
15
16class BCGroup: public QObject, public IGroup {
17    Q_OBJECT
18    Q_INTERFACES(IGroup)
19
20public:
21    BCGroup();
22
23    virtual int             id() const;
24    virtual QString         name() const;
25    virtual QImage          image() const;
26    virtual QSet<IContact*> contacts() const;
27
28    virtual void setId(int id);
29    virtual void setName(const QString& name);
30    virtual void setImage(const QImage& image);
31//    virtual void setContacts(const QSet<int>& contactIds);
32    virtual void setContacts(const QSet<IContact*>& contacts);
33
34    virtual void addContact(IContact* contact);
35    virtual void removeContact(int contactId);
36    virtual void removeContact(IContact* contact);
37
38    virtual GroupEventMapper* eventMapper() const;
39
40protected:
41    virtual IGroupEvents* groupEvents() const;
42
43protected slots:
44    void contactIdChanged(int oldId, int newId);
45
46private:
47    GroupEventMapper* eventMapper_;
48
49    int id_;
50    QString name_;
51    QMap<int, IContact*> contactList_;
52    QImage image_;
53
54    void addContactToList(IContact* contact);
55    void removeContactFromList(IContact* contact);
56};
57
58
59namespace BC {
60    class Group: public BCGroup {};
61} // namespace BC
62
63#endif /* BCGROUP_H_ */
Note: See TracBrowser for help on using the repository browser.