2019-09-10 11:19:01 +02:00
|
|
|
// SPDX-License-Identifier: GPL-2.0+
|
2019-09-25 13:13:40 +02:00
|
|
|
/*
|
2019-10-01 09:20:35 +02:00
|
|
|
* Copyright (C) 2010 - 2017 Red Hat, Inc.
|
2017-03-31 14:45:46 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef _NM_META_SETTING_ACCESS_H__
|
|
|
|
|
#define _NM_META_SETTING_ACCESS_H__
|
|
|
|
|
|
|
|
|
|
#include "nm-meta-setting.h"
|
|
|
|
|
#include "nm-meta-setting-desc.h"
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2017-04-12 10:13:41 +02:00
|
|
|
NMSetting *nm_meta_setting_info_editor_new_setting (const NMMetaSettingInfoEditor *setting_info,
|
|
|
|
|
NMMetaAccessorSettingInitType init_type);
|
|
|
|
|
|
2017-04-11 11:31:27 +02:00
|
|
|
const NMMetaSettingInfoEditor *nm_meta_setting_info_editor_find_by_name (const char *setting_name, gboolean use_alias);
|
2017-03-31 14:45:46 +02:00
|
|
|
const NMMetaSettingInfoEditor *nm_meta_setting_info_editor_find_by_gtype (GType gtype);
|
cli: split tracking of meta data out of NmcOutputField
When generating output data, nmcli iterates over a list of
property-descriptors (nmc_fields_ip4_config), creates an intermediate
array (output_data) and finally prints it.
However, previously both the meta data (nmc_fields_ip4_config) and
the intermediate format use the same type NmcOutputField. This means,
certain fields are relevant to describe a property, and other fields
are output/formatting fields.
Split this up. Now, the meta data is tracked in form of an NMMetaAbstractInfo
lists. This separates the information about properties from intermediate steps
during creation of the output.
Note that currently functions like print_ip4_config() still have all the
knowledge about how to generate the output. That is wrong, instead, the
meta data (NMMetaAbstractInfo) should describe how to create the output
and then all those functions could be replaced. This means, later we want
to add more knowledge to the NMMetaAbstractInfo, so it is important to
keep them separate from NmcOutputField.
2017-03-31 19:18:16 +02:00
|
|
|
const NMMetaSettingInfoEditor *nm_meta_setting_info_editor_find_by_setting (NMSetting *setting);
|
2017-03-31 14:45:46 +02:00
|
|
|
|
|
|
|
|
const NMMetaPropertyInfo *nm_meta_setting_info_editor_get_property_info (const NMMetaSettingInfoEditor *setting_info,
|
|
|
|
|
const char *property_name);
|
|
|
|
|
const NMMetaPropertyInfo *nm_meta_property_info_find_by_name (const char *setting_name,
|
2017-03-31 16:16:06 +02:00
|
|
|
const char *property_name);
|
2017-03-31 14:45:46 +02:00
|
|
|
const NMMetaPropertyInfo *nm_meta_property_info_find_by_setting (NMSetting *setting,
|
2017-03-31 16:16:06 +02:00
|
|
|
const char *property_name);
|
2017-03-31 14:45:46 +02:00
|
|
|
|
2019-03-31 11:36:09 +02:00
|
|
|
gboolean nm_meta_setting_info_editor_has_secrets (const NMMetaSettingInfoEditor *setting_info);
|
|
|
|
|
|
2017-03-31 14:45:46 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
cli: split tracking of meta data out of NmcOutputField
When generating output data, nmcli iterates over a list of
property-descriptors (nmc_fields_ip4_config), creates an intermediate
array (output_data) and finally prints it.
However, previously both the meta data (nmc_fields_ip4_config) and
the intermediate format use the same type NmcOutputField. This means,
certain fields are relevant to describe a property, and other fields
are output/formatting fields.
Split this up. Now, the meta data is tracked in form of an NMMetaAbstractInfo
lists. This separates the information about properties from intermediate steps
during creation of the output.
Note that currently functions like print_ip4_config() still have all the
knowledge about how to generate the output. That is wrong, instead, the
meta data (NMMetaAbstractInfo) should describe how to create the output
and then all those functions could be replaced. This means, later we want
to add more knowledge to the NMMetaAbstractInfo, so it is important to
keep them separate from NmcOutputField.
2017-03-31 19:18:16 +02:00
|
|
|
const NMMetaSettingInfoEditor *const*nm_meta_setting_infos_editor_p (void);
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2017-04-06 15:14:23 +02:00
|
|
|
const char *nm_meta_abstract_info_get_name (const NMMetaAbstractInfo *abstract_info, gboolean for_header);
|
2017-04-05 15:48:53 +02:00
|
|
|
|
|
|
|
|
const NMMetaAbstractInfo *const*nm_meta_abstract_info_get_nested (const NMMetaAbstractInfo *abstract_info,
|
|
|
|
|
guint *out_len,
|
|
|
|
|
gpointer *nested_to_free);
|
|
|
|
|
|
2017-04-04 15:23:39 +02:00
|
|
|
gconstpointer nm_meta_abstract_info_get (const NMMetaAbstractInfo *abstract_info,
|
|
|
|
|
const NMMetaEnvironment *environment,
|
|
|
|
|
gpointer environment_user_data,
|
|
|
|
|
gpointer target,
|
2018-04-30 13:01:20 +02:00
|
|
|
gpointer target_data,
|
2017-04-04 15:23:39 +02:00
|
|
|
NMMetaAccessorGetType get_type,
|
|
|
|
|
NMMetaAccessorGetFlags get_flags,
|
2017-04-06 15:14:23 +02:00
|
|
|
NMMetaAccessorGetOutFlags *out_flags,
|
2018-02-27 15:34:49 +01:00
|
|
|
gboolean *out_is_default,
|
2017-04-04 15:23:39 +02:00
|
|
|
gpointer *out_to_free);
|
|
|
|
|
|
2017-04-10 16:38:35 +02:00
|
|
|
const char *const*nm_meta_abstract_info_complete (const NMMetaAbstractInfo *abstract_info,
|
2017-04-11 15:48:04 +02:00
|
|
|
const NMMetaEnvironment *environment,
|
|
|
|
|
gpointer environment_user_data,
|
2017-04-11 15:48:04 +02:00
|
|
|
const NMMetaOperationContext *operation_context,
|
2017-04-10 16:38:35 +02:00
|
|
|
const char *text,
|
2019-04-23 21:35:19 +02:00
|
|
|
gboolean *out_complete_filename,
|
2017-04-10 16:38:35 +02:00
|
|
|
char ***out_to_free);
|
|
|
|
|
|
2017-04-05 15:48:53 +02:00
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
2017-04-12 15:19:26 +02:00
|
|
|
char *nm_meta_abstract_info_get_nested_names_str (const NMMetaAbstractInfo *abstract_info, const char *name_prefix);
|
|
|
|
|
char *nm_meta_abstract_infos_get_names_str (const NMMetaAbstractInfo *const*fields_array, const char *name_prefix);
|
|
|
|
|
|
|
|
|
|
/*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
const NMMetaAbstractInfo *info;
|
|
|
|
|
const char *self_selection;
|
|
|
|
|
const char *sub_selection;
|
|
|
|
|
guint idx;
|
|
|
|
|
} NMMetaSelectionItem;
|
|
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
|
const guint num;
|
|
|
|
|
const NMMetaSelectionItem items[];
|
|
|
|
|
} NMMetaSelectionResultList;
|
|
|
|
|
|
|
|
|
|
NMMetaSelectionResultList *nm_meta_selection_create_all (const NMMetaAbstractInfo *const* fields_array);
|
|
|
|
|
NMMetaSelectionResultList *nm_meta_selection_create_parse_one (const NMMetaAbstractInfo *const* fields_array,
|
|
|
|
|
const char *fields_prefix,
|
|
|
|
|
const char *fields_str,
|
|
|
|
|
gboolean validate_nested,
|
|
|
|
|
GError **error);
|
|
|
|
|
NMMetaSelectionResultList *nm_meta_selection_create_parse_list (const NMMetaAbstractInfo *const* fields_array,
|
|
|
|
|
const char *fields_str,
|
|
|
|
|
gboolean validate_nested,
|
|
|
|
|
GError **error);
|
|
|
|
|
|
2017-03-31 14:45:46 +02:00
|
|
|
#endif /* _NM_META_SETTING_ACCESS_H__ */
|