InfBuffer

InfBuffer — Abstract document interface

Synopsis


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


                    InfBuffer;
                    InfBufferIface;
gboolean            inf_buffer_get_modified             (InfBuffer *buffer);
void                inf_buffer_set_modified             (InfBuffer *buffer,
                                                         gboolean modified);

Object Hierarchy


  GInterface
   +----InfBuffer

Prerequisites

InfBuffer requires GObject.

Properties


  "modified"                 gboolean              : Read / Write

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.

Details

InfBuffer

typedef struct _InfBuffer InfBuffer;

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


InfBufferIface

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

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

The virtual methods of InfBuffer.

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.

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.

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.

buffer :

A InfBuffer.

modified :

Whether the buffer is considered modified or not.

Property Details

The "modified" property

  "modified"                 gboolean              : Read / Write

Whether the buffer was modified since it has been saved.

Default value: FALSE