1 /* 2 * Photos - access, organize and share your photos on GNOME 3 * Copyright © 2014 – 2019 Red Hat, Inc. 4 * 5 * This program is free software: you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation, either version 3 of the License, or 8 * (at your option) any later version. 9 * 10 * This program is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 * GNU General Public License for more details. 14 * 15 * You should have received a copy of the GNU General Public License 16 * along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 /* Based on code from: 20 * + Documents 21 */ 22 23 #ifndef PHOTOS_SEARCHBAR_H 24 #define PHOTOS_SEARCHBAR_H 25 26 #include <gtk/gtk.h> 27 28 G_BEGIN_DECLS 29 30 #define PHOTOS_TYPE_SEARCHBAR (photos_searchbar_get_type ()) 31 G_DECLARE_DERIVABLE_TYPE (PhotosSearchbar, photos_searchbar, PHOTOS, SEARCHBAR, GtkSearchBar); 32 33 typedef struct _PhotosSearchbarPrivate PhotosSearchbarPrivate; 34 35 struct _PhotosSearchbarClass 36 { 37 GtkSearchBarClass parent_class; 38 39 /* virtual methods */ 40 void (*create_search_widgets) (PhotosSearchbar *self); 41 void (*entry_changed) (PhotosSearchbar *self); 42 void (*hide) (PhotosSearchbar *self); 43 void (*show) (PhotosSearchbar *self); 44 45 /* signals */ 46 void (*activate_result) (PhotosSearchbar *self); 47 }; 48 49 GtkWidget *photos_searchbar_new (void); 50 51 gboolean photos_searchbar_handle_event (PhotosSearchbar *self, GdkEventKey *event); 52 53 void photos_searchbar_hide (PhotosSearchbar *self); 54 55 gboolean photos_searchbar_is_focus (PhotosSearchbar *self); 56 57 void photos_searchbar_set_search_change_blocked (PhotosSearchbar *self, 58 gboolean search_change_blocked); 59 60 void photos_searchbar_set_search_container (PhotosSearchbar *self, 61 GtkWidget *search_container); 62 63 void photos_searchbar_set_search_entry (PhotosSearchbar *self, GtkWidget *search_entry); 64 65 void photos_searchbar_show (PhotosSearchbar *self); 66 67 G_END_DECLS 68 69 #endif /* PHOTOS_SEARCHBAR_H */ 70