sourceview: only cancel open operations when closing editor
[anjuta.git] / plugins / symbol-db / symbol-db-system.h
blob62b571895e898af6105758d0451a67e2fbbcf546
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3 * anjuta_trunk
4 * Copyright (C) Massimo Cora' 2008 <maxcvs@email.it>
5 *
6 * anjuta_trunk is free software.
7 *
8 * You may redistribute it and/or modify it under the terms of the
9 * GNU General Public License, as published by the Free Software
10 * Foundation; either version 2 of the License, or (at your option)
11 * any later version.
13 * anjuta_trunk 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.
16 * See the GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with anjuta_trunk. If not, write to:
20 * The Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor
22 * Boston, MA 02110-1301, USA.
25 #ifndef _SYMBOL_DB_SYSTEM_H_
26 #define _SYMBOL_DB_SYSTEM_H_
28 #include <glib-object.h>
30 #include "symbol-db-engine.h"
32 G_BEGIN_DECLS
34 #define SYMBOL_TYPE_DB_SYSTEM (sdb_system_get_type ())
35 #define SYMBOL_DB_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), SYMBOL_TYPE_DB_SYSTEM, SymbolDBSystem))
36 #define SYMBOL_DB_SYSTEM_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), SYMBOL_TYPE_DB_SYSTEM, SymbolDBSystemClass))
37 #define SYMBOL_IS_DB_SYSTEM(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), SYMBOL_TYPE_DB_SYSTEM))
38 #define SYMBOL_IS_DB_SYSTEM_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), SYMBOL_TYPE_DB_SYSTEM))
39 #define SYMBOL_DB_SYSTEM_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), SYMBOL_TYPE_DB_SYSTEM, SymbolDBSystemClass))
41 typedef struct _SymbolDBSystemClass SymbolDBSystemClass;
42 typedef struct _SymbolDBSystem SymbolDBSystem;
43 typedef struct _SymbolDBSystemPriv SymbolDBSystemPriv;
45 #include "plugin.h"
47 struct _SymbolDBSystemClass
49 GObjectClass parent_class;
51 /* signals */
52 void (* single_file_scan_end) (void);
53 void (* scan_package_start) (guint num_files, const gchar *package);
54 void (* scan_package_end) (const gchar *package);
57 struct _SymbolDBSystem
59 GObject parent_instance;
60 SymbolDBSystemPriv *priv;
63 typedef void (*PackageParseableCallback) (SymbolDBSystem *sdbs,
64 gboolean is_parseable,
65 gpointer user_data);
68 GType sdb_system_get_type (void) G_GNUC_CONST;
70 SymbolDBSystem *
71 symbol_db_system_new (SymbolDBPlugin *sdb_plugin,
72 const SymbolDBEngine *sdbe);
74 /**
75 * Perform a check on db to see if the package_name is present or not.
77 gboolean
78 symbol_db_system_is_package_parsed (SymbolDBSystem *sdbs,
79 const gchar * package_name,
80 const gchar * package_version);
81 /**
82 * Test whether the package has a good cflags output, i.e. it's parseable.
83 * This function does not tell us anything about the db. It could be that
84 * the package is already on db.
85 * Because this function calls AnjutaLauncher inside, the answer is asynchronous.
86 * So user should put his gui in 'waiting/busy' status before going on, and of course
87 * he should also prepare a callback to receive the status.
89 void
90 symbol_db_system_is_package_parseable (SymbolDBSystem *sdbs,
91 const gchar * package_name,
92 PackageParseableCallback parseable_cb,
93 gpointer user_data);
95 /**
96 * Scan a package. We won't do a check if the package is really parseable, but only
97 * if it already exists on db. E.g. if a package has a wrong cflags string then
98 * the population won't start.
100 gboolean
101 symbol_db_system_scan_package (SymbolDBSystem *sdbs,
102 const gchar * package_name);
105 * Scan global db for unscanned files.
106 * @warning @param files_to_scan_array Must not to be freed by caller. They'll be
107 * freed inside this function. This for speed reasons.
108 * @warning @param languages_array Must not to be freed by caller. They'll be
109 * freed inside this function. This for speed reasons.
111 void
112 symbol_db_system_parse_aborted_package (SymbolDBSystem *sdbs,
113 GPtrArray *files_to_scan_array,
114 GPtrArray *languages_array);
115 G_END_DECLS
117 #endif /* _SYMBOL_DB_SYSTEM_H_ */