File: PathButton.h

package info (click to toggle)
transmission 4.1.0~beta3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 47,800 kB
  • sloc: cpp: 223,954; python: 6,998; javascript: 6,211; ansic: 5,826; sh: 771; xml: 550; makefile: 73
file content (57 lines) | stat: -rw-r--r-- 1,599 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// This file Copyright © Mnemosyne LLC.
// It may be used under GPLv2 (SPDX: GPL-2.0-only), GPLv3 (SPDX: GPL-3.0-only),
// or any future license endorsed by Mnemosyne LLC.
// License text can be found in the licenses/ folder.

#pragma once

#include "GtkCompat.h"

#include <glibmm/propertyproxy.h>
#include <glibmm/refptr.h>
#include <glibmm/ustring.h>
#include <gtkmm/builder.h>
#include <gtkmm/filechooser.h>
#include <gtkmm/filefilter.h>

#if GTKMM_CHECK_VERSION(4, 0, 0)
#include <gtkmm/button.h>
#else
#include <gtkmm/filechooserbutton.h>
#endif

#include <list>
#include <memory>
#include <string>

class PathButton : public IF_GTKMM4(Gtk::Button, Gtk::FileChooserButton)
{
    using BaseWidgetType = IF_GTKMM4(Gtk::Button, Gtk::FileChooserButton);

public:
    PathButton();
    PathButton(BaseObjectType* cast_item, Glib::RefPtr<Gtk::Builder> const& builder);
    PathButton(PathButton&&) = delete;
    PathButton(PathButton const&) = delete;
    PathButton& operator=(PathButton&&) = delete;
    PathButton& operator=(PathButton const&) = delete;
    ~PathButton() override;

    void set_shortcut_folders(std::list<std::string> const& value);

#if GTKMM_CHECK_VERSION(4, 0, 0)
    std::string get_filename() const;
    void set_filename(std::string const& value);

    void add_filter(Glib::RefPtr<Gtk::FileFilter> const& value);

    Glib::PropertyProxy<Gtk::FileChooser::Action> property_action();
    Glib::PropertyProxy<Glib::ustring> property_title();

    sigc::signal<void()>& signal_selection_changed();
#endif

private:
    class Impl;
    std::unique_ptr<Impl> const impl_;
};