/*************************************************************************** * MainWindow.h * * Mon Dec 18 20:53:20 2006 * Copyright 2006 Fernando Tarín Morales * icemanf@gmail.com ****************************************************************************/ /* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA */ #ifndef _MAINWINDOW_H #define _MAINWINDOW_H #include #include #include #include "libtorrent/session.hpp" #include "libtorrent/ip_filter.hpp" #include "MenuBar.h" #include "NoteBookManager.h" #if HAVE_LIBNOTIFY #include "Notifications.h" #endif #include "StatusBar.h" #include "GuiSetupManager.h" #include "MakeTorrent.h" #include "SystemTray.h" #include "Utils.h" #include "Lince/Torrent.h" #include "Lince/TorrentsManager.h" #if HAVE_DBUS #define DBUS_API_SUBJECT_TO_CHANGE #include #include #define DBUS_NAME_LINCE "net.p2p.lince" #define DBUS_PATH_LINCE "/net/p2p/lince/addtorrent" #define DBUS_INTERFACE_LINCE "net.p2p.lince.addtorrent" #endif class MainWindow: public Gtk::Window{ protected: // Window properties int pos_x, pos_y, width, height; bool is_maximized; // Boxes. Gtk::VBox vbox; // NoteBook. NoteBookManager noteBookManager; // Menu bar. MenuBar menuBar; // Status Bar. StatusBar statusBar; // Setup Manager. GuiSetupManager guiSetupManager; // MakeTorrent MakeTorrent makeTorrentWindow; // Update Gui bool updateGui(); void updateGuiSetup(); void remove_torrent(Lince::Torrent *); void addMultipleTorrentsToSession(std::vector &); bool getSelectedTorrentPosition(Lince::torrentPosition &, bool); // SystemTray SystemTray systray; #if HAVE_LIBNOTIFY // Notifications Notifications notifications; #endif #if HAVE_DBUS DBusConnection* conn; #endif // isShown bool isShown; // Signals void on_signal_hide(); void on_signal_resize(GdkEventConfigure*); bool on_signal_state_event(GdkEventWindowState*); public: #if HAVE_DBUS MainWindow(DBusConnection*); #else MainWindow(); #endif ~MainWindow(); void make_torrent(); // Señales void signal_exit(); void select_torrent_file_dialog(); void stop_torrents(); void resume_torrents(); void remove_torrents(); void start_all_torrents(); void stop_all_torrents(); void recheck_torrent(); void move_torrent_up(); void move_torrent_down(); void move_torrent_top(); void move_torrent_bottom(); void add_torrents_tab() { noteBookManager.addTorrentsTab(); }; void add_options_tab() { noteBookManager.addOptionsTab(); noteBookManager.setOptionsFirstWindow(); }; void add_statistics_tab() { noteBookManager.addStatisticsTab(); }; void add_log_tab() { noteBookManager.addLogTab(); }; void add_search_tab() { noteBookManager.addSearchTab(); }; void add_tinfo_tab(const Gtk::TreeModel::Path&, Gtk::TreeViewColumn*, Glib::RefPtr&); void add_tinfo_tab_from_menu(); void remove_current_tab(); void set_torrent_upload_speed(int); void set_torrent_download_speed(int); void set_torrent_max_connections(int); void set_torrent_upload_slots(int); void set_torrent_share_ratio(double); void torrent_force_reannounce(); void edit_torrent_trackers(); void export_torrent(); void create_magnet_link(); void trackerLogin(); // Config options void set_upload_limit_from_systray(int); void set_download_limit_from_systray(int); void set_connections_limit_from_systray(int); void set_upload_slots_limit_from_systray(int); // System Tray void manage_window(); // This will add torrents and magnet links from requests (dbus, command_line, etc...) void load_file_from_request(const std::string&); void load_magnet_from_request(const std::string&); // This will add torrents found in the directory passed as argument void load_torrents_from_directory(); void show_config_options(); }; #endif /* _MAINWINDOW_H */