## InfBuffer InfBuffer — Abstract document interface |

## Functions

gboolean | inf_buffer_get_modified ()
void | inf_buffer_set_modified ()

## Properties

gboolean | modified | Read / Write

## Types and Values

| InfBuffer
struct | InfBufferInterface

## Object Hierarchy

        GInterface
        ╰── InfBuffer

## Prerequisites

InfBuffer requires GObject.

## Known Implementations

InfBuffer is implemented by InfChatBuffer.

## Includes

    #include <libinfinity/common/inf-buffer.h>

## Description

InfBuffer represents a document containing a session's content. It does not cope with keeping its content in-sync with other participants but just offers an interface to modify the document.

The InfBuffer interface itself is probably not too useful, but actual documents implementing functionality (such as text editing or graphics editing) need to implement this interface to be passed to InfSession.

## Functions

### inf_buffer_get_modified ()

    gboolean
    inf_buffer_get_modified (InfBuffer *buffer);

Indicates whether the buffer has been modified since the last call to `inf_buffer_set_modified()` set the modification flag to `FALSE`.

#### Parameters

buffer | A InfBuffer. |

#### Returns

Whether the buffer has been modified.

### inf_buffer_set_modified ()

    void
    inf_buffer_set_modified (InfBuffer *buffer,
                             gboolean modified);

Sets the modification flag of `buffer` to `modified` . You should normally set the flag to `FALSE` every time the document is saved onto disk. The buffer itself will set it to `TRUE` when it has been changed.

To get notified when the modification flag changes, connect to GObject::notify for the InfBuffer:modified property.

#### Parameters

buffer | A InfBuffer. |
modified | Whether the buffer is considered modified or not. |

## Types and Values

### InfBuffer

    typedef struct _InfBuffer InfBuffer;

InfBuffer is an opaque data type. You should only access it via the public API functions.

### struct InfBufferInterface

    struct InfBufferInterface {
      gboolean (*get_modified)(InfBuffer* buffer);

      void (*set_modified)(InfBuffer* buffer,
                           gboolean modified);
    };

The virtual methods of InfBuffer.

#### Members

`get_modified` () | Returns whether the buffer has been modified since the last call to `set_modified` set modified flag to `FALSE`. |
`set_modified` () | Set the current modified state of the buffer. |

## Property Details

### The `“modified”` property

      “modified”                 gboolean

Whether the buffer was modified since it has been saved.

Owner: InfBuffer

Flags: Read / Write

Default value: FALSE