Ardour  8.7-15-gadf511264b
searchbar.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Robin Gareus <robin@gareus.org>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
17  */
18 
19 #pragma once
20 
21 #include <gtkmm/entry.h>
22 #include <string>
23 
24 #include "widgets/visibility.h"
25 
26 namespace ArdourWidgets {
27 
29 {
30 public:
32  const std::string& placeholder_text = "Search...",
33  bool icon_click_resets = true);
34 
36  void reset ();
37 
38  /* emitted when the filter has been updated */
39  sigc::signal<void, const std::string&> signal_search_string_updated () { return sig_search_string_updated; }
40 
41 protected:
44 
47 
48  const std::string placeholder_text;
49  sigc::signal<void, const std::string&> sig_search_string_updated;
50 
51 private:
52  void search_string_changed () const;
53 
54  Glib::RefPtr<Gdk::Pixbuf> icon;
56 };
57 
58 } /* end namespace */
sigc::signal< void, const std::string & > signal_search_string_updated()
Definition: searchbar.h:39
bool focus_in_event(GdkEventFocus *)
void icon_clicked_event(Gtk::EntryIconPosition, const GdkEventButton *)
void search_string_changed() const
bool focus_out_event(GdkEventFocus *)
SearchBar(const std::string &placeholder_text="Search...", bool icon_click_resets=true)
Glib::RefPtr< Gdk::Pixbuf > icon
Definition: searchbar.h:54
const std::string placeholder_text
Definition: searchbar.h:48
bool key_press_event(GdkEventKey *)
sigc::signal< void, const std::string & > sig_search_string_updated
Definition: searchbar.h:49
EntryIconPosition
Definition: entry.h:60
#define LIBWIDGETS_API