1 /* -*- Mode: C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /*
3  *  Copyright © 2000-2003 Marco Pesenti Gritti
4  *  Copyright © 2011 Igalia S.L.
5  *
6  *  This file is part of Epiphany.
7  *
8  *  Epiphany is free software: you can redistribute it and/or modify
9  *  it under the terms of the GNU General Public License as published by
10  *  the Free Software Foundation, either version 3 of the License, or
11  *  (at your option) any later version.
12  *
13  *  Epiphany is distributed in the hope that it will be useful,
14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  *  GNU General Public License for more details.
17  *
18  *  You should have received a copy of the GNU General Public License
19  *  along with Epiphany.  If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #pragma once
23 
24 #include <dazzle.h>
25 #include <webkit2/webkit2.h>
26 
27 #include "ephy-downloads-manager.h"
28 #include "ephy-encodings.h"
29 #include "ephy-gsb-service.h"
30 #include "ephy-history-service.h"
31 #include "ephy-password-manager.h"
32 #include "ephy-permissions-manager.h"
33 #include "ephy-search-engine-manager.h"
34 
35 G_BEGIN_DECLS
36 
37 typedef struct _EphyFiltersManager EphyFiltersManager;
38 
39 #define EPHY_TYPE_EMBED_SHELL (ephy_embed_shell_get_type ())
40 
41 G_DECLARE_DERIVABLE_TYPE (EphyEmbedShell, ephy_embed_shell, EPHY, EMBED_SHELL, DzlApplication)
42 
43 typedef enum
44 {
45   EPHY_EMBED_SHELL_MODE_BROWSER,
46   EPHY_EMBED_SHELL_MODE_STANDALONE,
47   EPHY_EMBED_SHELL_MODE_PRIVATE,
48   EPHY_EMBED_SHELL_MODE_INCOGNITO,
49   EPHY_EMBED_SHELL_MODE_APPLICATION,
50   EPHY_EMBED_SHELL_MODE_TEST,
51   EPHY_EMBED_SHELL_MODE_SEARCH_PROVIDER,
52   EPHY_EMBED_SHELL_MODE_AUTOMATION
53 } EphyEmbedShellMode;
54 
55 struct _EphyEmbedShellClass
56 {
57   DzlApplicationClass parent_class;
58 
59   void    (* restored_window)  (EphyEmbedShell *shell);
60 };
61 
62 EphyEmbedShell    *ephy_embed_shell_get_default                (void);
63 const char        *ephy_embed_shell_get_guid                   (EphyEmbedShell   *shell);
64 WebKitWebContext  *ephy_embed_shell_get_web_context            (EphyEmbedShell   *shell);
65 EphyHistoryService
66                   *ephy_embed_shell_get_global_history_service (EphyEmbedShell   *shell);
67 EphyGSBService    *ephy_embed_shell_get_global_gsb_service     (EphyEmbedShell   *shell);
68 EphyEncodings     *ephy_embed_shell_get_encodings              (EphyEmbedShell   *shell);
69 void               ephy_embed_shell_restored_window            (EphyEmbedShell   *shell);
70 void               ephy_embed_shell_set_page_setup             (EphyEmbedShell   *shell,
71                                                                 GtkPageSetup     *page_setup);
72 GtkPageSetup      *ephy_embed_shell_get_page_setup             (EphyEmbedShell   *shell);
73 void               ephy_embed_shell_set_print_settings         (EphyEmbedShell   *shell,
74                                                                 GtkPrintSettings *settings);
75 GtkPrintSettings  *ephy_embed_shell_get_print_settings         (EphyEmbedShell   *shell);
76 EphyEmbedShellMode ephy_embed_shell_get_mode                   (EphyEmbedShell   *shell);
77 void               ephy_embed_shell_clear_cache                (EphyEmbedShell   *shell);
78 void               ephy_embed_shell_set_thumbnail_path         (EphyEmbedShell   *shell,
79                                                                 const char       *url,
80                                                                 const char       *path);
81 void               ephy_embed_shell_schedule_thumbnail_update  (EphyEmbedShell   *shell,
82                                                                 EphyHistoryURL   *url);
83 EphyFiltersManager       *ephy_embed_shell_get_filters_manager      (EphyEmbedShell *shell);
84 EphyDownloadsManager     *ephy_embed_shell_get_downloads_manager    (EphyEmbedShell *shell);
85 EphyPermissionsManager   *ephy_embed_shell_get_permissions_manager  (EphyEmbedShell *shell);
86 EphySearchEngineManager  *ephy_embed_shell_get_search_engine_manager (EphyEmbedShell *shell);
87 EphyPasswordManager      *ephy_embed_shell_get_password_manager      (EphyEmbedShell *shell);
88 
89 void                     ephy_embed_shell_register_ucm_handler (EphyEmbedShell           *shell,
90                                                                 WebKitUserContentManager *ucm);
91 void                     ephy_embed_shell_unregister_ucm_handler (EphyEmbedShell           *shell,
92                                                                   WebKitUserContentManager *ucm);
93 
94 void                     ephy_embed_shell_pdf_handler_stop (EphyEmbedShell *shell,
95                                                             WebKitWebView  *web_view);
96 
97 G_END_DECLS
98