2022-01-20 18:27:56 +00:00
|
|
|
// This file Copyright © 2005-2022 Transmission authors and contributors.
|
|
|
|
// It may be used under the MIT (SPDX: MIT) license.
|
|
|
|
// License text can be found in the licenses/ folder.
|
2007-02-07 07:35:33 +00:00
|
|
|
|
2016-03-29 16:37:21 +00:00
|
|
|
#pragma once
|
2007-02-07 07:35:33 +00:00
|
|
|
|
2022-12-26 21:13:21 +00:00
|
|
|
#include <libtransmission/tr-macros.h>
|
2007-02-07 07:35:33 +00:00
|
|
|
|
2022-12-27 01:43:20 +00:00
|
|
|
#include <giomm/actiongroup.h>
|
|
|
|
#include <glibmm/refptr.h>
|
|
|
|
#include <gtkmm/application.h>
|
|
|
|
#include <gtkmm/applicationwindow.h>
|
|
|
|
#include <gtkmm/builder.h>
|
2021-10-18 20:22:31 +00:00
|
|
|
|
2022-12-26 21:13:21 +00:00
|
|
|
#include <memory>
|
2021-12-14 08:43:27 +00:00
|
|
|
|
2021-11-01 00:11:23 +00:00
|
|
|
class Session;
|
2022-12-21 21:26:25 +00:00
|
|
|
class Torrent;
|
2021-10-18 20:22:31 +00:00
|
|
|
|
|
|
|
class MainWindow : public Gtk::ApplicationWindow
|
|
|
|
{
|
|
|
|
public:
|
2022-09-07 22:25:04 +00:00
|
|
|
MainWindow(
|
|
|
|
BaseObjectType* cast_item,
|
|
|
|
Glib::RefPtr<Gtk::Builder> const& builder,
|
|
|
|
Gtk::Application& app,
|
|
|
|
Glib::RefPtr<Gio::ActionGroup> const& actions,
|
|
|
|
Glib::RefPtr<Session> const& core);
|
2021-10-18 20:22:31 +00:00
|
|
|
~MainWindow() override;
|
|
|
|
|
2021-12-14 08:43:27 +00:00
|
|
|
TR_DISABLE_COPY_MOVE(MainWindow)
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
static std::unique_ptr<MainWindow> create(
|
|
|
|
Gtk::Application& app,
|
2022-08-27 00:45:46 +00:00
|
|
|
Glib::RefPtr<Gio::ActionGroup> const& actions,
|
2021-11-01 00:11:23 +00:00
|
|
|
Glib::RefPtr<Session> const& core);
|
2021-10-18 20:22:31 +00:00
|
|
|
|
2022-12-28 14:47:53 +00:00
|
|
|
void for_each_selected_torrent(std::function<void(Glib::RefPtr<Torrent> const&)> const& callback) const;
|
|
|
|
bool for_each_selected_torrent_until(std::function<bool(Glib::RefPtr<Torrent> const&)> const& callback) const;
|
2022-12-21 21:26:25 +00:00
|
|
|
|
|
|
|
void select_all();
|
|
|
|
void unselect_all();
|
2021-10-18 20:22:31 +00:00
|
|
|
|
|
|
|
void set_busy(bool isBusy);
|
|
|
|
void refresh();
|
|
|
|
|
2022-12-21 21:26:25 +00:00
|
|
|
sigc::signal<void()>& signal_selection_changed();
|
|
|
|
|
2021-10-18 20:22:31 +00:00
|
|
|
private:
|
|
|
|
class Impl;
|
|
|
|
std::unique_ptr<Impl> const impl_;
|
|
|
|
};
|