source: SMSSender/src/business/BCContactManager.h @ 56:e63ceb8090cd

3.0
Last change on this file since 56:e63ceb8090cd was 56:e63ceb8090cd, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • Renamed accountmodel to accounttreemodel
  • Implemented creation of new contact if number is unknown in vcmain
  • Areacode is now in its own field in vceditcontact
  • Accountlist in vcmain is now controlled by a model (Needs filtering of only active ones)
  • Settingspath is dynamic and user-based now
File size: 1.4 KB
Line 
1/*
2 * ContactManager.h
3 *
4 *  Created on: May 17, 2009
5 *      Author: saemy
6 */
7
8#ifndef BC_CONTACTMANAGER_H_
9#define BC_CONTACTMANAGER_H_
10
11#include <QObject>
12#include <QMap>
13#include <QSet>
14
15#include <icontact.h>
16#include <snumber.h>
17
18class BCContactManager: public QObject {
19    Q_OBJECT
20
21public:
22    static BCContactManager* instance();
23
24    IContact*        getContact(int contactId) const;
25    QSet<IContact*>  getContactList() const;
26    void             saveContact(IContact* contact);
27    void             removeContact(int contactId);
28
29    IContact*        getContactByNumber(const SNumber number) const;
30
31signals:
32    void             contactAdded(IContact* contact);
33    void             contactUpdated(IContact* contact);
34    void             contactRemoved(IContact* contact);
35
36protected:
37    BCContactManager();
38    virtual ~BCContactManager(){};
39
40    virtual void     readContactsFromStorage();
41
42protected slots:
43    void             contactIdChanged(int oldId, int newId);
44    void             contactDataChanged();
45
46private:
47    static BCContactManager* instance_;
48
49    QMap<int, IContact*>     contactList_;
50
51    void                     addContactToList(IContact* contact);
52    void                     removeContactFromList(IContact* contact);
53};
54
55namespace BC {
56    class ContactManager: public BCContactManager {};
57} // namespace BC
58
59#endif /* CONTACTMANAGER_H_ */
Note: See TracBrowser for help on using the repository browser.