librccui.h
Go to the documentation of this file.
/*
LibRCC - public interface
Copyright (C) 2005-2018 Suren A. Chilingaryan <csa@suren.me>
This library is free software; you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License version 2.1 or later
as published by the Free Software Foundation.
This library is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
for more details.
You should have received a copy of the GNU Lesser General Public License
along with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef _LIBRCC_UI_H
#define _LIBRCC_UI_H
#include <librcc.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct rcc_ui_context_t *rcc_ui_context;
/*******************************************************************************
************************************ Names *************************************
*******************************************************************************/
struct rcc_name_t {
const char *sn;
const char *name;
};
typedef struct rcc_name_t rcc_name;
typedef const char *rcc_option_value_name;
typedef rcc_option_value_name *rcc_option_value_names;
struct rcc_option_name_t {
rcc_option option;
const char *name;
rcc_option_value_names value_names;
};
typedef struct rcc_option_name_t rcc_option_name;
int rccUiSetLanguageNames(rcc_ui_context ctx, rcc_name *names);
int rccUiSetCharsetNames(rcc_ui_context ctx, rcc_name *names);
int rccUiSetEngineNames(rcc_ui_context ctx, rcc_name *names);
int rccUiSetOptionNames(rcc_ui_context ctx, rcc_option_name *names);
int rccUiSetClassNames(rcc_ui_context ctx);
/* page & boxes */
typedef const char *rcc_ui_box_name;
struct rcc_ui_language_frame_name_t {
const char *title;
rcc_ui_box_name language;
};
typedef struct rcc_ui_language_frame_name_t rcc_ui_language_frame_name;
struct rcc_ui_charset_frame_name_t {
const char *title;
};
typedef struct rcc_ui_charset_frame_name_t rcc_ui_charset_frame_name;
struct rcc_ui_engine_frame_name_t {
const char *title;
rcc_ui_box_name engine;
};
typedef struct rcc_ui_engine_frame_name_t rcc_ui_engine_frame_name;
struct rcc_ui_page_name_t {
const char *title;
rcc_ui_language_frame_name language;
rcc_ui_charset_frame_name charset;
rcc_ui_engine_frame_name engine;
};
typedef struct rcc_ui_page_name_t rcc_ui_page_name;
rcc_ui_page_name *rccUiGetDefaultPageName();
const char *rccUiGetLanguageName(rcc_ui_context ctx, rcc_language_id language_id);
const char *rccUiGetClassName(rcc_ui_context ctx, rcc_class_id class_id);
const char *rccUiGetCharsetName(rcc_ui_context ctx, rcc_language_id language_id, rcc_class_id class_id, rcc_charset_id charset_id);
const char *rccUiGetEngineName(rcc_ui_context ctx, rcc_language_id language_id, rcc_engine_id engine_id);
const char *rccUiGetOptionName(rcc_ui_context ctx, rcc_option option);
const char *rccUiGetOptionValueName(rcc_ui_context ctx, rcc_option option, rcc_option_value value);
/*******************************************************************************
************************************ API ***************************************
*******************************************************************************/
typedef void *rcc_ui_widget;
typedef void *rcc_ui_box;
typedef void *rcc_ui_frame;
typedef void *rcc_ui_page;
int rccUiInit();
void rccUiFree();
rcc_ui_context rccUiCreateContext(rcc_context rccctx);
void rccUiFreeContext(rcc_ui_context ctx);
int rccUiHideOption(rcc_ui_context ctx, rcc_option option);
int rccUiUnHideOption(rcc_ui_context ctx, rcc_option option);
int rccUiRestoreLanguage(rcc_ui_context ctx);
int rccUiRestore(rcc_ui_context ctx);
int rccUiUpdate(rcc_ui_context ctx);
rcc_ui_widget rccUiGetLanguageMenu(rcc_ui_context ctx);
rcc_ui_widget rccUiGetCharsetMenu(rcc_ui_context ctx, rcc_class_id id);
rcc_ui_widget rccUiGetEngineMenu(rcc_ui_context ctx);
rcc_ui_widget rccUiGetOptionMenu(rcc_ui_context ctx, rcc_option option);
rcc_ui_box rccUiGetLanguageBox(rcc_ui_context ctx, const char *title);
rcc_ui_box rccUiGetCharsetBox(rcc_ui_context ctx, rcc_class_id id, const char *title);
rcc_ui_box rccUiGetEngineBox(rcc_ui_context ctx, const char *title);
rcc_ui_box rccUiGetOptionBox(rcc_ui_context ctx, rcc_option option, const char *title);
rcc_ui_frame rccUiGetLanguageFrame(rcc_ui_context ctx, rcc_ui_language_frame_name *name);
rcc_ui_frame rccUiGetCharsetsFrame(rcc_ui_context ctx, rcc_ui_charset_frame_name *name);
rcc_ui_frame rccUiGetEngineFrame(rcc_ui_context ctx, rcc_ui_engine_frame_name *name);
rcc_ui_page rccUiGetPage(rcc_ui_context ctx, rcc_ui_page_name *name);
#ifdef __cplusplus
}
#endif
#endif /* _LIBRCC_UI_H */
librcc.h
rcc_charset_id
unsigned char rcc_charset_id
Definition librcc.h:58
rcc_option_value
int rcc_option_value
Definition librcc.h:436
rcc_class_id
int rcc_class_id
Definition librcc.h:75
rcc_language_id
unsigned char rcc_language_id
Definition librcc.h:43
rcc_engine_id
unsigned char rcc_engine_id
Definition librcc.h:71
rcc_option
enum rcc_option_t rcc_option
rcc_context
struct rcc_context_t * rcc_context
Definition librcc.h:78
rcc_ui_charset_frame_name
struct rcc_ui_charset_frame_name_t rcc_ui_charset_frame_name
Definition librccui.h:68
rccUiHideOption
int rccUiHideOption(rcc_ui_context ctx, rcc_option option)
rcc_ui_box_name
const char * rcc_ui_box_name
Definition librccui.h:59
rccUiFreeContext
void rccUiFreeContext(rcc_ui_context ctx)
rccUiGetClassName
const char * rccUiGetClassName(rcc_ui_context ctx, rcc_class_id class_id)
rcc_option_value_names
rcc_option_value_name * rcc_option_value_names
Definition librccui.h:42
rccUiGetLanguageFrame
rcc_ui_frame rccUiGetLanguageFrame(rcc_ui_context ctx, rcc_ui_language_frame_name *name)
rccUiSetLanguageNames
int rccUiSetLanguageNames(rcc_ui_context ctx, rcc_name *names)
rccUiRestoreLanguage
int rccUiRestoreLanguage(rcc_ui_context ctx)
rccUiUnHideOption
int rccUiUnHideOption(rcc_ui_context ctx, rcc_option option)
rccUiGetLanguageBox
rcc_ui_box rccUiGetLanguageBox(rcc_ui_context ctx, const char *title)
rccUiGetEngineMenu
rcc_ui_widget rccUiGetEngineMenu(rcc_ui_context ctx)
rcc_ui_engine_frame_name
struct rcc_ui_engine_frame_name_t rcc_ui_engine_frame_name
Definition librccui.h:73
rccUiSetClassNames
int rccUiSetClassNames(rcc_ui_context ctx)
rccUiGetEngineBox
rcc_ui_box rccUiGetEngineBox(rcc_ui_context ctx, const char *title)
rcc_ui_box
void * rcc_ui_box
Definition librccui.h:96
rccUiGetOptionBox
rcc_ui_box rccUiGetOptionBox(rcc_ui_context ctx, rcc_option option, const char *title)
rccUiGetCharsetsFrame
rcc_ui_frame rccUiGetCharsetsFrame(rcc_ui_context ctx, rcc_ui_charset_frame_name *name)
rcc_ui_page
void * rcc_ui_page
Definition librccui.h:98
rccUiGetLanguageName
const char * rccUiGetLanguageName(rcc_ui_context ctx, rcc_language_id language_id)
rccUiGetOptionName
const char * rccUiGetOptionName(rcc_ui_context ctx, rcc_option option)
rccUiSetOptionNames
int rccUiSetOptionNames(rcc_ui_context ctx, rcc_option_name *names)
rccUiUpdate
int rccUiUpdate(rcc_ui_context ctx)
rccUiInit
int rccUiInit()
rccUiGetOptionValueName
const char * rccUiGetOptionValueName(rcc_ui_context ctx, rcc_option option, rcc_option_value value)
rccUiGetCharsetBox
rcc_ui_box rccUiGetCharsetBox(rcc_ui_context ctx, rcc_class_id id, const char *title)
rccUiGetEngineName
const char * rccUiGetEngineName(rcc_ui_context ctx, rcc_language_id language_id, rcc_engine_id engine_id)
rcc_option_name
struct rcc_option_name_t rcc_option_name
Definition librccui.h:49
rccUiGetLanguageMenu
rcc_ui_widget rccUiGetLanguageMenu(rcc_ui_context ctx)
rccUiGetEngineFrame
rcc_ui_frame rccUiGetEngineFrame(rcc_ui_context ctx, rcc_ui_engine_frame_name *name)
rcc_name
struct rcc_name_t rcc_name
Definition librccui.h:39
rccUiSetCharsetNames
int rccUiSetCharsetNames(rcc_ui_context ctx, rcc_name *names)
rccUiGetCharsetName
const char * rccUiGetCharsetName(rcc_ui_context ctx, rcc_language_id language_id, rcc_class_id class_id, rcc_charset_id charset_id)
rccUiGetOptionMenu
rcc_ui_widget rccUiGetOptionMenu(rcc_ui_context ctx, rcc_option option)
rccUiCreateContext
rcc_ui_context rccUiCreateContext(rcc_context rccctx)
rcc_ui_context
struct rcc_ui_context_t * rcc_ui_context
Definition librccui.h:29
rcc_option_value_name
const char * rcc_option_value_name
Definition librccui.h:41
rcc_ui_frame
void * rcc_ui_frame
Definition librccui.h:97
rcc_ui_language_frame_name
struct rcc_ui_language_frame_name_t rcc_ui_language_frame_name
Definition librccui.h:64
rccUiSetEngineNames
int rccUiSetEngineNames(rcc_ui_context ctx, rcc_name *names)
rccUiGetCharsetMenu
rcc_ui_widget rccUiGetCharsetMenu(rcc_ui_context ctx, rcc_class_id id)
rccUiGetDefaultPageName
rcc_ui_page_name * rccUiGetDefaultPageName()
rccUiRestore
int rccUiRestore(rcc_ui_context ctx)
rccUiFree
void rccUiFree()
rcc_ui_widget
void * rcc_ui_widget
Definition librccui.h:95
rccUiGetPage
rcc_ui_page rccUiGetPage(rcc_ui_context ctx, rcc_ui_page_name *name)
rcc_ui_page_name
struct rcc_ui_page_name_t rcc_ui_page_name
Definition librccui.h:80
rcc_name_t
Definition librccui.h:35
rcc_name_t::name
const char * name
Definition librccui.h:37
rcc_name_t::sn
const char * sn
Definition librccui.h:36
rcc_option_name_t
Definition librccui.h:44
rcc_option_name_t::value_names
rcc_option_value_names value_names
Definition librccui.h:47
rcc_option_name_t::name
const char * name
Definition librccui.h:46
rcc_option_name_t::option
rcc_option option
Definition librccui.h:45
rcc_ui_charset_frame_name_t
Definition librccui.h:65
rcc_ui_charset_frame_name_t::title
const char * title
Definition librccui.h:66
rcc_ui_engine_frame_name_t
Definition librccui.h:69
rcc_ui_engine_frame_name_t::engine
rcc_ui_box_name engine
Definition librccui.h:71
rcc_ui_engine_frame_name_t::title
const char * title
Definition librccui.h:70
rcc_ui_language_frame_name_t
Definition librccui.h:60
rcc_ui_language_frame_name_t::language
rcc_ui_box_name language
Definition librccui.h:62
rcc_ui_language_frame_name_t::title
const char * title
Definition librccui.h:61
rcc_ui_page_name_t
Definition librccui.h:74
rcc_ui_page_name_t::language
rcc_ui_language_frame_name language
Definition librccui.h:76
rcc_ui_page_name_t::title
const char * title
Definition librccui.h:75
rcc_ui_page_name_t::engine
rcc_ui_engine_frame_name engine
Definition librccui.h:78
rcc_ui_page_name_t::charset
rcc_ui_charset_frame_name charset
Definition librccui.h:77