source: SMSSender/src/ui/VCMain/vcmain.h @ 60:cfa107cede67

3.0
Last change on this file since 60:cfa107cede67 was 60:cfa107cede67, checked in by Sämy Zehnder <saemy.zehnder@…>, 12 years ago
  • Remplaced deprecated _activated with _triggered in vcmain
File size: 2.7 KB
Line 
1#ifndef VCMAIN_H
2#define VCMAIN_H
3
4#include "ui_vcmain.h"
5
6#include <QStringListModel>
7#include <QMap>
8#include <QMainWindow>
9#include <QTreeWidgetItem>
10#include <QSortFilterProxyModel>
11
12#include <icontact.h>
13#include <igroup.h>
14
15#include "../../business/BCAccountLoadManager.h"
16
17#include "../models/accounttreemodel.h"
18#include "../models/contactgroupmodel.h"
19
20class VCMain : public QMainWindow{
21    Q_OBJECT
22
23public:
24        VCMain(QWidget *parent = 0);
25    ~VCMain() {};
26
27private:
28    Ui::VCMainClass ui;
29
30    AccountTreeModel*                 accountModel_;
31    QSortFilterProxyModel*            accountFilterModel_;
32
33    ContactGroupListModel*            contactGroupListModel_;
34    QSortFilterProxyModel*            contactGroupSortModel_;
35
36    QMap<QString, IAccount*>          accountStrToAccount;
37
38    QMap<QTreeWidgetItem*, IContact*> nodeToContact;
39    QMap<QTreeWidgetItem*, IGroup*>   nodeToGroup;
40
41    /* Recipient list */
42    bool            isContactNode(const QTreeWidgetItem* node);
43    bool            isGroupNode(const QTreeWidgetItem* node);
44    IContact*       getContactOfNode(const QTreeWidgetItem* node);
45    IGroup*         getGroupOfNode(const QTreeWidgetItem* node);
46    bool            isNodeContactOrHasContact(const QTreeWidgetItem* node, IContact* contact);
47    bool            isContactAlreadyRecipient(IContact* contact);
48    bool            isGroupAlreadyRecipient(IGroup* group);
49
50    void            addRecipient(IContact* contact, QTreeWidgetItem* parent = NULL);
51    void            addRecipient(IGroup* group);
52    void            removeRecipient(QTreeWidgetItem* node);
53    void            removeNode(QTreeWidgetItem* node);
54
55    QSet<IContact*> getRecipientContacts(bool withGroupContacts = true, QTreeWidgetItem* node = NULL);
56    QSet<IGroup*>   getRecipientGroups();
57
58    /* Account */
59    void reloadAccountList();
60
61    void enableSendBtnIfAllFilled();
62
63    void clearMessage();
64    void sendMessage();
65
66private slots:
67    void on_btnSend_clicked();
68
69    void on_btnAddRecipient_clicked();
70    void on_btnRemoveRecipient_clicked();
71    void on_treeRecipients_itemSelectionChanged();
72
73    void on_txtMessage_textChanged();
74    void on_selAccounts_currentIndexChanged(int index);
75
76    void on_lstContacts_completer_changed(const QString& text);
77
78    void on_actionNewMessage_triggered(bool checked);
79
80    void on_actionAccounts_triggered(bool checked);
81    void on_actionAddressBook_triggered(bool checked);
82        void on_actionPreferences_triggered(bool checked);
83        void on_actionAbout_triggered(bool checked);
84
85    void on_accountLoadStateChanged(IAccount* account, AccountLoadState state);
86    void on_accountLoaded(IAccount* account);
87    void on_accountLoadingFailed(IAccount* account, EException* exception);
88};
89
90#endif // VCMAIN_H
Note: See TracBrowser for help on using the repository browser.