|
Packit |
116408 |
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
|
|
Packit |
116408 |
/*
|
|
Packit |
116408 |
* Copyright (C) 2002 Mikael Hallendal <micke@imendio.com>
|
|
Packit |
116408 |
* Copyright (C) 2008 Imendio AB
|
|
Packit |
116408 |
* Copyright (C) 2017, 2018 Sébastien Wilmet <swilmet@gnome.org>
|
|
Packit |
116408 |
*
|
|
Packit |
116408 |
* This program is free software; you can redistribute it and/or
|
|
Packit |
116408 |
* modify it under the terms of the GNU General Public License as
|
|
Packit |
116408 |
* published by the Free Software Foundation; either version 2 of the
|
|
Packit |
116408 |
* License, or (at your option) any later version.
|
|
Packit |
116408 |
*
|
|
Packit |
116408 |
* This program is distributed in the hope that it will be useful,
|
|
Packit |
116408 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
116408 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
Packit |
116408 |
* General Public License for more details.
|
|
Packit |
116408 |
*
|
|
Packit |
116408 |
* You should have received a copy of the GNU General Public License
|
|
Packit |
116408 |
* along with this program; if not, see <http://www.gnu.org/licenses/>.
|
|
Packit |
116408 |
*/
|
|
Packit |
116408 |
|
|
Packit |
116408 |
#ifndef DH_LINK_H
|
|
Packit |
116408 |
#define DH_LINK_H
|
|
Packit |
116408 |
|
|
Packit |
116408 |
#include <glib-object.h>
|
|
Packit |
116408 |
|
|
Packit |
116408 |
G_BEGIN_DECLS
|
|
Packit |
116408 |
|
|
Packit |
116408 |
/**
|
|
Packit |
116408 |
* DhLinkType:
|
|
Packit |
116408 |
* @DH_LINK_TYPE_BOOK: The top-level page of a #DhBook.
|
|
Packit |
116408 |
* @DH_LINK_TYPE_PAGE: A page.
|
|
Packit |
116408 |
* @DH_LINK_TYPE_KEYWORD: Another kind of keyword.
|
|
Packit |
116408 |
* @DH_LINK_TYPE_FUNCTION: A function keyword.
|
|
Packit |
116408 |
* @DH_LINK_TYPE_STRUCT: A struct keyword.
|
|
Packit |
116408 |
* @DH_LINK_TYPE_MACRO: A macro keyword.
|
|
Packit |
116408 |
* @DH_LINK_TYPE_ENUM: An enum keyword.
|
|
Packit |
116408 |
* @DH_LINK_TYPE_TYPEDEF: A typedef keyword.
|
|
Packit |
116408 |
* @DH_LINK_TYPE_PROPERTY: A property keyword.
|
|
Packit |
116408 |
* @DH_LINK_TYPE_SIGNAL: A signal keyword.
|
|
Packit |
116408 |
*
|
|
Packit |
116408 |
* The type of the content the link points to.
|
|
Packit |
116408 |
*/
|
|
Packit |
116408 |
typedef enum {
|
|
Packit |
116408 |
DH_LINK_TYPE_BOOK,
|
|
Packit |
116408 |
DH_LINK_TYPE_PAGE,
|
|
Packit |
116408 |
DH_LINK_TYPE_KEYWORD,
|
|
Packit |
116408 |
DH_LINK_TYPE_FUNCTION,
|
|
Packit |
116408 |
DH_LINK_TYPE_STRUCT,
|
|
Packit |
116408 |
DH_LINK_TYPE_MACRO,
|
|
Packit |
116408 |
DH_LINK_TYPE_ENUM,
|
|
Packit |
116408 |
DH_LINK_TYPE_TYPEDEF,
|
|
Packit |
116408 |
DH_LINK_TYPE_PROPERTY,
|
|
Packit |
116408 |
DH_LINK_TYPE_SIGNAL
|
|
Packit |
116408 |
} DhLinkType;
|
|
Packit |
116408 |
|
|
Packit |
116408 |
/**
|
|
Packit |
116408 |
* DhLinkFlags:
|
|
Packit |
116408 |
* @DH_LINK_FLAGS_NONE: No flags set.
|
|
Packit |
116408 |
* @DH_LINK_FLAGS_DEPRECATED: The symbol that the link points to is deprecated.
|
|
Packit |
116408 |
*/
|
|
Packit |
116408 |
typedef enum {
|
|
Packit |
116408 |
DH_LINK_FLAGS_NONE = 0,
|
|
Packit |
116408 |
DH_LINK_FLAGS_DEPRECATED = 1 << 0
|
|
Packit |
116408 |
} DhLinkFlags;
|
|
Packit |
116408 |
|
|
Packit |
116408 |
typedef struct _DhLink DhLink;
|
|
Packit |
116408 |
|
|
Packit |
116408 |
#define DH_TYPE_LINK (dh_link_get_type ())
|
|
Packit |
116408 |
|
|
Packit |
116408 |
GType dh_link_get_type (void);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
DhLink * dh_link_new_book (const gchar *base_path,
|
|
Packit |
116408 |
const gchar *book_id,
|
|
Packit |
116408 |
const gchar *book_title,
|
|
Packit |
116408 |
const gchar *relative_url);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
DhLink * dh_link_new (DhLinkType type,
|
|
Packit |
116408 |
DhLink *book_link,
|
|
Packit |
116408 |
const gchar *name,
|
|
Packit |
116408 |
const gchar *relative_url);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
DhLink * dh_link_ref (DhLink *link);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
void dh_link_unref (DhLink *link);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
DhLinkType dh_link_get_link_type (DhLink *link);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
DhLinkFlags dh_link_get_flags (DhLink *link);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
void dh_link_set_flags (DhLink *link,
|
|
Packit |
116408 |
DhLinkFlags flags);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
const gchar *dh_link_get_name (DhLink *link);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
gboolean dh_link_match_relative_url (DhLink *link,
|
|
Packit |
116408 |
const gchar *relative_url);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
gboolean dh_link_belongs_to_page (DhLink *link,
|
|
Packit |
116408 |
const gchar *page_id);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
gchar * dh_link_get_uri (DhLink *link);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
const gchar *dh_link_get_book_title (DhLink *link);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
const gchar *dh_link_get_book_id (DhLink *link);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
gint dh_link_compare (gconstpointer a,
|
|
Packit |
116408 |
gconstpointer b);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
const gchar *dh_link_type_to_string (DhLinkType link_type);
|
|
Packit |
116408 |
|
|
Packit |
116408 |
G_END_DECLS
|
|
Packit |
116408 |
|
|
Packit |
116408 |
#endif /* DH_LINK_H */
|