| 1 | /* File: gui_file_action.h; Copyright and License: see below */ |
| 2 | |
| 3 | #ifndef GUI_FILE_ACTION_H |
| 4 | #define GUI_FILE_ACTION_H |
| 5 | |
| 6 | /* public file for the doxygen documentation: */ |
| 7 | /*! |
| 8 | * \file |
| 9 | * \brief Switches the currently used data_file |
| 10 | */ |
| 11 | |
| 12 | #include "gui_simple_message_to_user.h" |
| 13 | #include "wrap/gui_button.h" |
| 14 | #include "io_data_file.h" |
| 15 | #include "ctrl_controller.h" |
| 16 | #include "gui_gtk.h" |
| 17 | |
| 18 | /*! |
| 19 | * \brief attributes of the file manager |
| 20 | */ |
| 21 | struct gui_file_action_struct { |
| 22 | ctrl_controller_t *controller; /*!< pointer to external ctrl_controller_t */ |
| 23 | io_data_file_t *data_file; /*!< pointer to external io_data_file_t */ |
| 24 | gui_simple_message_to_user_t *message_to_user; /*!< pointer to external gui_simple_message_to_user_t */ |
| 25 | }; |
| 26 | |
| 27 | typedef struct gui_file_action_struct gui_file_action_t; |
| 28 | |
| 29 | /*! |
| 30 | * \brief initializes the main window |
| 31 | * |
| 32 | * \param this_ pointer to own object attributes |
| 33 | * \param controller pointer to the controller object to use |
| 34 | * \param data_file pointer to the data_file object to use |
| 35 | * \param message_to_user pointer to the message_to_user object to use |
| 36 | */ |
| 37 | void gui_file_action_init( gui_file_action_t *this_, |
| 38 | ctrl_controller_t *controller, |
| 39 | io_data_file_t *data_file, |
| 40 | gui_simple_message_to_user_t *message_to_user |
| 41 | ); |
| 42 | |
| 43 | /*! |
| 44 | * \brief destroys the main window |
| 45 | * |
| 46 | * \param this_ pointer to own object attributes |
| 47 | */ |
| 48 | void gui_file_action_destroy( gui_file_action_t *this_ ); |
| 49 | |
| 50 | /*! |
| 51 | * \brief switches the data_file to the new file |
| 52 | * |
| 53 | * \param this_ pointer to own object attributes |
| 54 | * \param filename filename of the file to open, must not be NULL |
| 55 | */ |
| 56 | u8_error_t gui_file_action_use_db( gui_file_action_t *this_, const char *filename ); |
| 57 | |
| 58 | /*! |
| 59 | * \brief saves the data_file |
| 60 | * |
| 61 | * Errors are reported directly to the user via (*this_).message_to_user. |
| 62 | * |
| 63 | * \param this_ pointer to own object attributes |
| 64 | * \return U8_ERROR_NONE if save was successful |
| 65 | */ |
| 66 | u8_error_t gui_file_action_save( gui_file_action_t *this_ ); |
| 67 | |
| 68 | #endif /* GUI_FILE_ACTION_H */ |
| 69 | |
| 70 | |
| 71 | /* |
| 72 | Copyright 2016-2026 Andreas Warnke |
| 73 | |
| 74 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 75 | you may not use this file except in compliance with the License. |
| 76 | You may obtain a copy of the License at |
| 77 | |
| 78 | http://www.apache.org/licenses/LICENSE-2.0 |
| 79 | |
| 80 | Unless required by applicable law or agreed to in writing, software |
| 81 | distributed under the License is distributed on an "AS IS" BASIS, |
| 82 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 83 | See the License for the specific language governing permissions and |
| 84 | limitations under the License. |
| 85 | */ |