| Flutter Linux Embedder |

Macros | Enumerations | Functions | Variables
fl_method_response.h File Reference
`#include <glib-object.h>`
`#include <gmodule.h>`
`#include "fl_value.h"`

Go to the source code of this file.

## Macros
#define | FL_METHOD_RESPONSE_ERROR fl_method_response_error_quark()

## Enumerations
enum | FlMethodResponseError { FL_METHOD_RESPONSE_ERROR_FAILED , FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR , FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED }

## Functions
G_MODULE_EXPORT GQuark | fl_method_response_error_quark (void) G_GNUC_CONST
G_MODULE_EXPORT | G_DECLARE_DERIVABLE_TYPE (FlMethodResponse, fl_method_response, FL, METHOD_RESPONSE, GObject) struct _FlMethodResponseClass
G_MODULE_EXPORT | G_DECLARE_FINAL_TYPE (FlMethodSuccessResponse, fl_method_success_response, FL, METHOD_SUCCESS_RESPONSE, FlMethodResponse) G_MODULE_EXPORT G_DECLARE_FINAL_TYPE(FlMethodErrorResponse
G_MODULE_EXPORT FlMethodResponse G_MODULE_EXPORT | G_DECLARE_FINAL_TYPE (FlMethodNotImplementedResponse, fl_method_not_implemented_response, FL, METHOD_NOT_IMPLEMENTED_RESPONSE, FlMethodResponse) FlValue *fl_method_response_get_result(FlMethodResponse *response
FlMethodSuccessResponse * | fl_method_success_response_new (FlValue *result)
FlValue * | fl_method_success_response_get_result (FlMethodSuccessResponse *response)

## Variables
G_MODULE_EXPORT | fl_method_error_response
G_MODULE_EXPORT | FL
G_MODULE_EXPORT | METHOD_ERROR_RESPONSE
G_MODULE_EXPORT FlMethodResponse G_MODULE_EXPORT GError ** | error

## Macro Definition Documentation

## ◆ FL_METHOD_RESPONSE_ERROR

#define FL_METHOD_RESPONSE_ERROR fl_method_response_error_quark()

FlMethodResponseError: @FL_METHOD_RESPONSE_ERROR_FAILED: Call failed due to an unspecified error. @FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR: An error was returned by the other side of the channel. @FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED: The requested method is not implemented.

Errors set by `fl_method_response_get_result` when the method call response is not #FlMethodSuccessResponse.

Definition at line 30 of file fl_method_response.h.

## Enumeration Type Documentation

## ◆ FlMethodResponseError

enum FlMethodResponseError

Enumerator
FL_METHOD_RESPONSE_ERROR_FAILED |
FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR |
FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED |

Definition at line 32 of file fl_method_response.h.

32 {
33 FL_METHOD_RESPONSE_ERROR_FAILED,
34 FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR,
35 FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED,
36 } FlMethodResponseError;
FlMethodResponseError
FlMethodResponseError
Definition: fl_method_response.h:32
FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED
@ FL_METHOD_RESPONSE_ERROR_NOT_IMPLEMENTED
Definition: fl_method_response.h:35
FL_METHOD_RESPONSE_ERROR_FAILED
@ FL_METHOD_RESPONSE_ERROR_FAILED
Definition: fl_method_response.h:33
FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR
@ FL_METHOD_RESPONSE_ERROR_REMOTE_ERROR
Definition: fl_method_response.h:34

## Function Documentation

## ◆ fl_method_response_error_quark()

G_MODULE_EXPORT GQuark fl_method_response_error_quark | ( | void |  | ) |

## ◆ fl_method_success_response_get_result()

FlValue* fl_method_success_response_get_result | ( | FlMethodSuccessResponse * | response | ) |

fl_method_success_response_get_result: @response: an #FlMethodSuccessResponse.

Gets the result of the method call.

Returns: an FlValue.

Definition at line 138 of file fl_method_response.cc.

139 {
140 g_return_val_if_fail(FL_IS_METHOD_SUCCESS_RESPONSE(self), nullptr);
141 return self->result;
142 }

Referenced by decode_response_with_success(), fl_method_codec_encode_response(), fl_method_response_get_result(), fl_test_application_activate(), set_client(), set_editing_state(), and TEST().

## ◆ fl_method_success_response_new()

FlMethodSuccessResponse* fl_method_success_response_new | ( | FlValue * | result | ) |

fl_method_success_response_new:

Returns
  : (allow-none): the FlValue returned by the method call or NULL.

Creates a response to a method call when that method has successfully completed.

Returns: a new #FlMethodResponse.

Definition at line 126 of file fl_method_response.cc.

127 {
128 FlMethodSuccessResponse* self = FL_METHOD_SUCCESS_RESPONSE(
129 g_object_new(fl_method_success_response_get_type(), nullptr));
130
131 if (result != nullptr) {
132 self->result = fl_value_ref(result);
133 }
134
135 return self;
136 }
fl_value_ref
G_MODULE_EXPORT FlValue * fl_value_ref(FlValue *self)
Definition: fl_value.cc:394

References fl_value_ref().

Referenced by activate_system_cursor(), clear_client(), clipboard_set_data(), fl_json_method_codec_decode_response(), fl_method_call_respond_success(), fl_platform_channel_make_system_request_app_exit_response(), fl_platform_channel_respond_clipboard_get_data(), fl_platform_channel_respond_clipboard_has_strings(), fl_standard_method_codec_decode_response(), fl_test_codec_decode_response(), get_keyboard_state(), hide(), set_editable_size_and_transform(), set_editing_state(), set_marked_text_rect(), show(), system_initialization_complete(), system_navigator_pop(), system_sound_play(), TEST(), and update_config().

## ◆ G_DECLARE_DERIVABLE_TYPE()

G_MODULE_EXPORT G_DECLARE_DERIVABLE_TYPE | ( | FlMethodResponse | ,
|  | fl_method_response | ,
|  | FL | ,
|  | METHOD_RESPONSE | ,
|  | GObject |
| ) |  |

Definition at line 42 of file fl_method_response.h.

48 {
49 GObjectClass parent_class;
50 };

## ◆ G_DECLARE_FINAL_TYPE() [1/2]

G_MODULE_EXPORT FlMethodResponse G_MODULE_EXPORT G_DECLARE_FINAL_TYPE | ( | FlMethodNotImplementedResponse | ,
|  | fl_method_not_implemented_response | ,
|  | FL | ,
|  | METHOD_NOT_IMPLEMENTED_RESPONSE | ,
|  | FlMethodResponse |
| ) |  |

FlMethodResponse:

#FlMethodResponse contains the information returned when an #FlMethodChannel method call returns. If you expect the method call to be successful use fl_method_response_get_result(). If you want to handle error cases then you should use code like:

|[ if (FL_IS_METHOD_SUCCESS_RESPONSE (response)) { FlValue *result = fl_method_success_response_get_result( FL_METHOD_SUCCESS_RESPONSE (response)); handle_result (result); } else if (FL_IS_METHOD_ERROR_RESPONSE (response)) { FlMethodErrorResponse *error_response = FL_METHOD_ERROR_RESPONSE (response); handle_error (fl_method_error_response_get_code (error_response), fl_method_error_response_get_message (error_response), fl_method_error_response_get_details (error_response)); } else if (FL_IS_METHOD_NOT_IMPLEMENTED_RESPONSE (response)) { handle_not_implemented (); } } ]| FlMethodSuccessResponse:

#FlMethodSuccessResponse is the #FlMethodResponse returned when a method call has successfully completed. The result of the method call is obtained using `fl_method_success_response_get_result`. FlMethodErrorResponse:

#FlMethodErrorResponse is the #FlMethodResponse returned when a method call results in an error. The error details are obtained using `fl_method_error_response_get_code`, `fl_method_error_response_get_message` and `fl_method_error_response_get_details`. FlMethodNotImplementedResponse:

#FlMethodNotImplementedResponse is the #FlMethodResponse returned when a method call is not implemented. fl_method_response_get_result: @response: an #FlMethodResponse. @error: (allow-none): #GError location to store the error occurring, or NULL to ignore. If `error` is not NULL, `*error` must be initialized (typically NULL, but an error from a previous call using GLib error handling is explicitly valid).

Gets the result of a method call, or an error if the response wasn't successful.

Returns: an FlValue or NULL on error.

## ◆ G_DECLARE_FINAL_TYPE() [2/2]

G_MODULE_EXPORT G_DECLARE_FINAL_TYPE | ( | FlMethodSuccessResponse | ,
|  | fl_method_success_response | ,
|  | FL | ,
|  | METHOD_SUCCESS_RESPONSE | ,
|  | FlMethodResponse |
| ) |  |

## Variable Documentation

## ◆ error

G_MODULE_EXPORT FlMethodResponse G_MODULE_EXPORT GError** error

Definition at line 139 of file fl_method_response.h.

## ◆ FL

G_MODULE_EXPORT FL

Definition at line 62 of file fl_method_response.h.

## ◆ fl_method_error_response

G_MODULE_EXPORT fl_method_error_response

Definition at line 61 of file fl_method_response.h.

## ◆ METHOD_ERROR_RESPONSE

G_MODULE_EXPORT METHOD_ERROR_RESPONSE

Definition at line 63 of file fl_method_response.h.