2023-11-01 22:11:11 +01:00
|
|
|
// This file Copyright © Transmission authors and contributors.
|
2022-01-20 12:27:56 -06:00
|
|
|
// 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 13:13:21 -08:00
|
|
|
#include <libtransmission/tr-macros.h>
|
2007-02-07 07:35:33 +00:00
|
|
|
|
2022-12-26 17:43:20 -08:00
|
|
|
#include <giomm/actiongroup.h>
|
|
|
|
#include <glibmm/refptr.h>
|
|
|
|
#include <gtkmm/application.h>
|
|
|
|
#include <gtkmm/applicationwindow.h>
|
|
|
|
#include <gtkmm/builder.h>
|
2021-10-18 23:22:31 +03:00
|
|
|
|
2022-12-26 13:13:21 -08:00
|
|
|
#include <memory>
|
2021-12-14 11:43:27 +03:00
|
|
|
|
2021-11-01 03:11:23 +03:00
|
|
|
class Session;
|
2022-12-21 13:26:25 -08:00
|
|
|
class Torrent;
|
2021-10-18 23:22:31 +03:00
|
|
|
|
|
|
|
class MainWindow : public Gtk::ApplicationWindow
|
|
|
|
{
|
|
|
|
public:
|
2022-09-08 01:25:04 +03: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 23:22:31 +03:00
|
|
|
~MainWindow() override;
|
|
|
|
|
2021-12-14 11:43:27 +03:00
|
|
|
TR_DISABLE_COPY_MOVE(MainWindow)
|
|
|
|
|
2021-10-18 23:22:31 +03:00
|
|
|
static std::unique_ptr<MainWindow> create(
|
|
|
|
Gtk::Application& app,
|
2022-08-26 19:45:46 -05:00
|
|
|
Glib::RefPtr<Gio::ActionGroup> const& actions,
|
2021-11-01 03:11:23 +03:00
|
|
|
Glib::RefPtr<Session> const& core);
|
2021-10-18 23:22:31 +03:00
|
|
|
|
2022-12-28 06:47:53 -08: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 13:26:25 -08:00
|
|
|
|
|
|
|
void select_all();
|
|
|
|
void unselect_all();
|
2021-10-18 23:22:31 +03:00
|
|
|
|
|
|
|
void set_busy(bool isBusy);
|
|
|
|
void refresh();
|
|
|
|
|
2022-12-21 13:26:25 -08:00
|
|
|
sigc::signal<void()>& signal_selection_changed();
|
|
|
|
|
2021-10-18 23:22:31 +03:00
|
|
|
private:
|
|
|
|
class Impl;
|
|
|
|
std::unique_ptr<Impl> const impl_;
|
|
|
|
};
|