1 /**
2 * Whiteboard share with user dialog
3 *
4 * Authors:
5 * David Yip <yipdw@rose-hulman.edu>
6 * Jason Segal, Jonas Collaros, Stephen Montgomery, Brandi Soggs, Matthew Weinstock (original C/Gtk version)
7 *
8 * Copyright (c) 2004-2005 Authors
9 *
10 * Released under GNU GPL, read the file 'COPYING' for more information
11 */
13 #ifndef __WHITEBOARD_SHAREWITHUSER_DIALOG_H__
14 #define __WHITEBOARD_SHAREWITHUSER_DIALOG_H__
16 #include <gtkmm/liststore.h>
17 #include <gtkmm/treeview.h>
18 #include <gtkmm/scrolledwindow.h>
20 #include "verbs.h"
21 #include "ui/dialog/dialog.h"
22 #include "jabber_whiteboard/session-file-selector.h"
25 struct SPDesktop;
27 namespace Inkscape {
28 namespace Whiteboard {
29 class SessionManager;
30 }
31 namespace UI {
32 namespace Dialog {
34 class WhiteboardShareWithUserDialog : public Dialog {
35 public:
36 WhiteboardShareWithUserDialog() : Dialog("dialogs.whiteboard_sharewithuser", SP_VERB_DIALOG_WHITEBOARD_SHAREWITHUSER)
37 {
39 }
41 static WhiteboardShareWithUserDialog* create();
43 virtual ~WhiteboardShareWithUserDialog()
44 {
46 }
47 };
49 class WhiteboardShareWithUserDialogImpl : public WhiteboardShareWithUserDialog {
50 public:
51 WhiteboardShareWithUserDialogImpl();
52 ~WhiteboardShareWithUserDialogImpl();
53 void setSessionManager();
55 private:
56 // Response flags
57 static unsigned int const SHARE = 0;
58 static unsigned int const CANCEL = 2;
60 // GTK+ widgets
61 Gtk::HBox _connecttojidbox;
62 Gtk::HBox _buddylistbox;
63 Gtk::HBox _buttons;
65 Whiteboard::SessionFileSelectorBox _sfsbox;
67 Gtk::Entry _jid;
69 // more or less shamelessly stolen from gtkmm tutorial book
70 Glib::RefPtr< Gtk::ListStore > _buddylistdata;
71 Gtk::TreeView _buddylist;
72 class BuddyListModel : public Gtk::TreeModel::ColumnRecord {
73 public:
74 BuddyListModel()
75 {
76 add(jid);
77 }
79 Gtk::TreeModelColumn< std::string > jid;
80 };
81 BuddyListModel _blm;
83 Gtk::Label _labels[2];
84 Gtk::ScrolledWindow _listwindow;
86 Gtk::Button _share, _cancel;
88 // Construction and callback
89 void _construct();
90 void _respCallback(int resp);
91 void _listCallback();
93 // Buddy list management
94 void _fillBuddyList();
95 void _insertBuddy(std::string const& jid);
96 void _eraseBuddy(std::string const& jid);
98 // SessionManager and SPDesktop pointers
99 ::SPDesktop* _desktop;
100 Whiteboard::SessionManager* _sm;
101 };
104 }
106 }
108 }
110 #endif