![]() |
![]() |
![]() |
GdaBrowser hacking manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Signals |
BrowserFavoritesPrivate; enum BrowserFavoritesType; #define BROWSER_FAVORITES_NB_TYPES BrowserFavoritesAttributes; BrowserFavorites; BrowserFavorites * browser_favorites_new (GdaMetaStore *store
); gboolean browser_favorites_add (BrowserFavorites *bfav
,guint session_id
,BrowserFavoritesAttributes *fav
,gint order_key
,gint pos
,GError **error
); GSList * browser_favorites_list (BrowserFavorites *bfav
,guint session_id
,BrowserFavoritesType type
,gint order_key
,GError **error
); gboolean browser_favorites_delete (BrowserFavorites *bfav
,guint session_id
,BrowserFavoritesAttributes *fav
,GError **error
); void browser_favorites_free_list (GSList *fav_list
); void browser_favorites_reset_attributes (BrowserFavoritesAttributes *fav
); gint browser_favorites_find (BrowserFavorites *bfav
,guint session_id
,const gchar *contents
,BrowserFavoritesAttributes *out_fav
,GError **error
); gboolean browser_favorites_get (BrowserFavorites *bfav
,gint fav_id
,BrowserFavoritesAttributes *out_fav
,GError **error
);
Each connection uses a single BrowserFavorites object to manage its favorites,
see browser_connection_get_favorites()
.
typedef enum { BROWSER_FAVORITES_TABLES = 1 << 0, BROWSER_FAVORITES_DIAGRAMS = 1 << 1, BROWSER_FAVORITES_QUERIES = 1 << 2, BROWSER_FAVORITES_DATA_MANAGERS = 1 << 3 } BrowserFavoritesType;
Enum to identify favorite's types.
typedef struct { gint id; BrowserFavoritesType type; gchar *name; gchar *descr; gchar *contents; } BrowserFavoritesAttributes;
gint |
the favorite ID, or <0 if not saved |
BrowserFavoritesType |
the favorite's type |
gchar * |
the favorite's name |
gchar * |
the favorite's description |
gchar * |
the favorite's contents, depending on the favorite type |
BrowserFavorites * browser_favorites_new (GdaMetaStore *store
);
Creates a new BrowserFavorites object
|
|
Returns : |
the new object |
gboolean browser_favorites_add (BrowserFavorites *bfav
,guint session_id
,BrowserFavoritesAttributes *fav
,gint order_key
,gint pos
,GError **error
);
Add a new favorite, or replace an existing one. NOTE:
if fav->id
is < 0 then it's either an update or an insert (depending if fav->contents exists)
and if it's not it is an UPDATE
fav->type
can't be 0
fav->contents
can't be NULL
On success fav->id
contains the favorite's ID, otherwise it will contain -1.
if order_key
is negative, then no ordering is done and pos
is ignored.
|
|
|
|
|
|
|
|
|
|
|
|
Returns : |
GSList * browser_favorites_list (BrowserFavorites *bfav
,guint session_id
,BrowserFavoritesType type
,gint order_key
,GError **error
);
Extract some favorites.
|
a BrowserFavorites |
|
0 for now |
|
filter the type of attributes to be listed |
|
a key to order the listed favorites, such as ORDER_KEY_SCHEMA |
|
a place to store errors, or NULL
|
Returns : |
a new list of BrowserFavoritesAttributes pointers. The list has to
be freed using browser_favorites_free_list()
|
gboolean browser_favorites_delete (BrowserFavorites *bfav
,guint session_id
,BrowserFavoritesAttributes *fav
,GError **error
);
|
|
|
|
|
|
|
|
Returns : |
void browser_favorites_free_list (GSList *fav_list
);
Frees all the BrowserFavoritesAttributes of the fav_list
list, and frees the list
itself.
|
a list of BrowserFavoritesAttributes |
void browser_favorites_reset_attributes (BrowserFavoritesAttributes *fav
);
Resets fav
with empty attributes; it does not free fav
.
|
a pointer to a BrowserFavoritesAttributes |
gint browser_favorites_find (BrowserFavorites *bfav
,guint session_id
,const gchar *contents
,BrowserFavoritesAttributes *out_fav
,GError **error
);
Get all the information about a favorite from its id: fills the out_fav
pointed structure. Use browser_favorites_reset_attributes()
to reset out_fav
's contents.
Retuns: the requested's favorite ID, or -1 if not found
|
a BrowserFavorites |
|
0 for now |
|
the favorite's contents |
|
a BrowserFavoritesAttributes to be filled with the favorite's attributes, or NULL
|
|
a place to store errors, or NULL
|
Returns : |
gboolean browser_favorites_get (BrowserFavorites *bfav
,gint fav_id
,BrowserFavoritesAttributes *out_fav
,GError **error
);
Get all the information about a favorite from its id: fills the out_fav
pointed structure. Use browser_favorites_reset_attributes()
to reset out_fav
's contents.
Retuns: TRUE
if no error occurred.
|
a BrowserFavorites |
|
the favorite's ID |
|
a BrowserFavoritesAttributes to be filled with the favorite's attributes |
|
a place to store errors, or NULL
|
Returns : |
"favorites-changed"
signalvoid user_function (BrowserFavorites *browserfavorites, gpointer user_data) : Run First / Has Details
|
the object which received the signal. |
|
user data set when the signal handler was connected. |