dockBuddiesList.h
1 //------------------------------------------------------------------------------
2 // dockBuddiesList.h
3 //------------------------------------------------------------------------------
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301, USA.
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2009 "Blzut3" <admin@maniacsvault.net>
22 //------------------------------------------------------------------------------
23 
24 #ifndef __DOCKBUDDIESLIST_H__
25 #define __DOCKBUDDIESLIST_H__
26 
27 #include "serverapi/buddyinfo.h"
28 #include "serverapi/serverptr.h"
29 #include "dptr.h"
30 
31 #include <QDialog>
32 #include <QDockWidget>
33 
34 class MasterManager;
35 class QAbstractButton;
36 class QModelIndex;
37 
38 class DockBuddiesList : public QDockWidget
39 {
40  Q_OBJECT
41 
42  public:
43  enum ColumnId
44  {
45  BLCID_ID,
46  BLCID_BUDDY,
47  BLCID_LOCATION,
48 
49  HOW_MANY_BUDDIESLIST_COLUMNS
50  };
51 
52  DockBuddiesList(QWidget *parent=NULL);
53  ~DockBuddiesList();
54 
55  bool hasBuddy(const ServerPtr &server);
56 
57  public slots:
58  void addBuddy();
59  void scan(const MasterManager *master=NULL);
60 
61  signals:
62  void joinServer(const ServerPtr &server);
63  void scanCompleted();
64 
65  protected slots:
66  void deleteBuddy();
67  void followBuddy(const QModelIndex &index);
68  void patternsListContextMenu(const QPoint &pos) const;
69 
70  private:
72 
73  const MasterManager *masterClient;
74  bool save;
75 };
76 
77 class AddBuddyDlg : public QDialog
78 {
79  Q_OBJECT
80 
81  public:
82  AddBuddyDlg(QWidget *parent=NULL);
83  ~AddBuddyDlg();
84 
85  BuddyInfo::PatternType patternType() const;
86  QString pattern() const;
87 
88  protected slots:
89  void buttonBoxClicked(QAbstractButton *button);
90 
91  private:
93 };
94 
95 #endif /* __DOCKBUDDIESLIST_H__ */
Manager class for a number of MasterClient instances.
Definition: mastermanager.h:38