00001 /* 00002 * Copyright 2009 Alexandros Frantzis, Michael Iatrou 00003 * 00004 * This file is part of libbls. 00005 * 00006 * libbls is free software: you can redistribute it and/or modify it under the 00007 * terms of the GNU Lesser General Public License as published by the Free Software 00008 * Foundation, either version 3 of the License, or (at your option) any later 00009 * version. 00010 * 00011 * libbls is distributed in the hope that it will be useful, but WITHOUT ANY 00012 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 00013 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 00014 * details. 00015 * 00016 * You should have received a copy of the GNU General Public License along with 00017 * libbls. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 00020 /** 00021 * @file buffer_action.h 00022 * 00023 * Buffer actions API 00024 */ 00025 #ifndef _BUFFER_ACTION_H 00026 #define _BUFFER_ACTION_H 00027 00028 #include "data_object.h" 00029 #include "buffer_event.h" 00030 00031 #ifdef __cplusplus 00032 extern "C" { 00033 #endif 00034 00035 /** 00036 * @defgroup buffer_action Buffer Action 00037 * 00038 * A buffer action abstracts the notion of a doable and undoable actions 00039 * on the buffer. 00040 * 00041 * There are many kinds of buffer actions (eg append, insert). To create 00042 * a buffer action one must use the specific constructor function. 00043 * 00044 * @{ 00045 */ 00046 00047 /** 00048 * Opaque type for buffer action ADT. 00049 */ 00050 typedef struct buffer_action buffer_action_t; 00051 00052 int buffer_action_do(buffer_action_t *action); 00053 00054 int buffer_action_undo(buffer_action_t *action); 00055 00056 int buffer_action_private_copy(buffer_action_t *action, data_object_t *dobj); 00057 00058 int buffer_action_to_event(buffer_action_t *action, 00059 struct bless_buffer_event_info *event_info); 00060 00061 int buffer_action_free(buffer_action_t *action); 00062 00063 /** @} */ 00064 00065 #ifdef __cplusplus 00066 } 00067 #endif 00068 00069 #endif /* _BUFFER_ACTION_H */ 00070