1 /*
2  * xed-app.h
3  * This file is part of xed
4  *
5  * Copyright (C) 2005 - Paolo Maggi
6  *
7  * This program is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 /*
24  * Modified by the xed Team, 2005. See the AUTHORS file for a
25  * list of people on the xed Team.
26  * See the ChangeLog files for a list of changes.
27  *
28  * $Id$
29  */
30 
31 #ifndef __XED_APP_H__
32 #define __XED_APP_H__
33 
34 #include <gtk/gtk.h>
35 
36 #include <xed/xed-window.h>
37 
38 G_BEGIN_DECLS
39 
40 #define XED_TYPE_APP              (xed_app_get_type())
41 #define XED_APP(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), XED_TYPE_APP, XedApp))
42 #define XED_APP_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), XED_TYPE_APP, XedAppClass))
43 #define XED_IS_APP(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), XED_TYPE_APP))
44 #define XED_IS_APP_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), XED_TYPE_APP))
45 #define XED_APP_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), XED_TYPE_APP, XedAppClass))
46 
47 typedef struct _XedApp          XedApp;
48 typedef struct _XedAppPrivate   XedAppPrivate;
49 typedef struct _XedAppClass     XedAppClass;
50 
51 struct _XedApp
52 {
53     GtkApplication parent;
54 
55     /*< private > */
56     XedAppPrivate *priv;
57 };
58 
59 struct _XedAppClass
60 {
61     GtkApplicationClass parent_class;
62 
63     // gboolean (*last_window_destroyed) (XedApp *app);
64 
65     gboolean (*show_help)             (XedApp      *app,
66                                        GtkWindow   *parent,
67                                        const gchar *name,
68                                        const gchar *link_id);
69 
70     gchar *(*help_link_id)            (XedApp      *app,
71                                        const gchar *name,
72                                        const gchar *link_id);
73 
74     void (*set_window_title)          (XedApp      *app,
75                                        XedWindow   *window,
76                                        const gchar *title);
77 };
78 
79 /* Public methods */
80 GType xed_app_get_type (void) G_GNUC_CONST;
81 
82 XedWindow *xed_app_create_window (XedApp    *app,
83                                   GdkScreen *screen);
84 
85 GList *xed_app_get_main_windows (XedApp *app);
86 
87 GList *xed_app_get_documents (XedApp *app);
88 
89 /* Returns a newly allocated list with all the views */
90 GList *xed_app_get_views (XedApp *app);
91 
92 gboolean xed_app_show_help (XedApp      *app,
93                             GtkWindow   *parent,
94                             const gchar *name,
95                             const gchar *link_id);
96 
97 void xed_app_set_window_title (XedApp      *app,
98                                XedWindow   *window,
99                                const gchar *title);
100 
101 /* Non exported functions */
102 XedWindow *_xed_app_restore_window (XedApp      *app,
103                                     const gchar *role);
104 
105 /* global print config */
106 GtkPageSetup *_xed_app_get_default_page_setup (XedApp         *app);
107 void _xed_app_set_default_page_setup (XedApp       *app,
108                                       GtkPageSetup *page_setup);
109 GtkPrintSettings *_xed_app_get_default_print_settings (XedApp *app);
110 void _xed_app_set_default_print_settings (XedApp           *app,
111                                           GtkPrintSettings *settings);
112 
113 GObject *_xed_app_get_settings (XedApp *app);
114 
115 G_END_DECLS
116 
117 #endif  /* __XED_APP_H__  */
118