peers.h 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * wpa_gui - Peers class
  3. * Copyright (c) 2009-2010, Atheros Communications
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License version 2 as
  7. * published by the Free Software Foundation.
  8. *
  9. * Alternatively, this software may be distributed under the terms of BSD
  10. * license.
  11. *
  12. * See README and COPYING for more details.
  13. */
  14. #ifndef PEERS_H
  15. #define PEERS_H
  16. #include <QObject>
  17. #include <QStandardItemModel>
  18. #include "wpamsg.h"
  19. #include "ui_peers.h"
  20. class WpaGui;
  21. class Peers : public QDialog, public Ui::Peers
  22. {
  23. Q_OBJECT
  24. public:
  25. Peers(QWidget *parent = 0, const char *name = 0,
  26. bool modal = false, Qt::WFlags fl = 0);
  27. ~Peers();
  28. void setWpaGui(WpaGui *_wpagui);
  29. void event_notify(WpaMsg msg);
  30. public slots:
  31. virtual void context_menu(const QPoint &pos);
  32. virtual void enter_pin();
  33. virtual void connect_pbc();
  34. virtual void learn_ap_config();
  35. virtual void ctx_refresh();
  36. virtual void ctx_p2p_start();
  37. virtual void ctx_p2p_stop();
  38. virtual void ctx_p2p_listen();
  39. virtual void ctx_p2p_start_group();
  40. virtual void ctx_p2p_remove_group();
  41. virtual void ctx_p2p_connect();
  42. virtual void ctx_p2p_req_pin();
  43. virtual void ctx_p2p_show_pin();
  44. virtual void ctx_p2p_display_pin();
  45. virtual void ctx_p2p_display_pin_pd();
  46. virtual void ctx_p2p_enter_pin();
  47. virtual void properties();
  48. virtual void ctx_hide_ap();
  49. virtual void ctx_show_ap();
  50. virtual void ctx_p2p_show_passphrase();
  51. virtual void ctx_p2p_start_persistent();
  52. virtual void ctx_p2p_invite();
  53. virtual void ctx_p2p_delete();
  54. protected slots:
  55. virtual void languageChange();
  56. virtual void closeEvent(QCloseEvent *event);
  57. private:
  58. void add_station(QString info);
  59. void add_stations();
  60. void add_single_station(const char *addr);
  61. bool add_bss(const char *cmd);
  62. void remove_bss(int id);
  63. void add_scan_results();
  64. void add_persistent(int id, const char *ssid, const char *bssid);
  65. void add_persistent_groups();
  66. void update_peers();
  67. QStandardItem * find_addr(QString addr);
  68. QStandardItem * find_addr_type(QString addr, int type);
  69. void add_p2p_group_client(QStandardItem *parent, QString params);
  70. QStandardItem * find_uuid(QString uuid);
  71. void done(int r);
  72. void remove_enrollee_uuid(QString uuid);
  73. QString ItemType(int type);
  74. void enable_persistent(int id);
  75. WpaGui *wpagui;
  76. QStandardItemModel model;
  77. QIcon *default_icon;
  78. QIcon *ap_icon;
  79. QIcon *laptop_icon;
  80. QIcon *group_icon;
  81. QIcon *invitation_icon;
  82. QStandardItem *ctx_item;
  83. bool hide_ap;
  84. };
  85. #endif /* PEERS_H */