## GcalWindow GcalWindow — Main window of GNOME Calendar |

## Stability Level

Unstable, unless otherwise indicated

## Functions

void | gcal_window_new_event ()
void | gcal_window_set_search_mode ()
void | gcal_window_set_search_query ()
void | gcal_window_open_event_by_uuid ()

## Properties

icaltimetype * | active-date | Read / Write
GcalWindowViewType | active-view | Read / Write
GcalManager * | manager | Read / Write / Construct Only
gboolean | new-event-mode | Read / Write

## Types and Values

#define | GCAL_TYPE_WINDOW
| GcalWindow

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBin
                        ╰── GtkWindow
                            ╰── GtkApplicationWindow
                                ╰── GcalWindow

## Implemented Interfaces

GcalWindow implements AtkImplementorIface, GtkBuildable, GActionGroup and GActionMap.

## Description

GcalWindow is the main window of GNOME Calendar, and contains the views, the source dialog, the edit dialog, and manages the calendar toggler popover menu.

Besides that, GcalWindow is also responsible for GcalQuickAddPopover, and it responds to the “create-event” signal by positioning the quick add popover at the requested position.

#### Calendar popover

The calendar popover enables/disables the selected calendars. This is simply an UI for `gcal_manager_enable_source()` and `gcal_manager_disable_source()`.

The calendar popover also contains a button to open the source dialog.

#### Edit dialog

When an event is clicked, the views send the `event-activated` signal. GcalWindow responds to this signal opening GcalEditDialog with the clicked event.

When GcalEditDialog sends a response, GcalWindow reacts by either propagating to `gcal_manager_update_event()`, or hiding the delete event widgets from the views.

#### Source dialog

The interaction with the source dialog is almost none. GcalWindow just shows and hides it.

## Functions

### gcal_window_new_event ()

    void
    gcal_window_new_event (GcalWindow *self);

Makes GcalWindow create a new event.

#### Parameters

self | a GcalWindow |

### gcal_window_set_search_mode ()

    void
    gcal_window_set_search_mode (GcalWindow *self,
                                 gboolean enabled);

Sets whether GcalWindow is in search mode. This is used by GcalShellSearchProvider to respond to the user clicking on GNOME Calendar icon at the search.

#### Parameters

self | a GcalWindow |
enabled | whether the search mode is enabled or not |

### gcal_window_set_search_query ()

    void
    gcal_window_set_search_query (GcalWindow *self,
                                  const gchar *query);

Sets the search query of the search. GcalWindow only propagates this to the search bar, which ends up triggering the search.

#### Parameters

self | a GcalWindow |
query | sets the search query of `self` |

### gcal_window_open_event_by_uuid ()

    void
    gcal_window_open_event_by_uuid (GcalWindow *self,
                                    const gchar *uuid);

Tells `self` to open the event with `uuid` . When it fails to open the event, it waits for 2 seconds before trying again.

#### Parameters

self | a GcalWindow |
uuid | the unique identifier of the event to be opened |

## Types and Values

### GCAL_TYPE_WINDOW

    #define GCAL_TYPE_WINDOW                    (gcal_window_get_type ())

### GcalWindow

    typedef struct _GcalWindow GcalWindow;

## Property Details

### The `“active-date”` property

      “active-date”              icaltimetype *

The active/selected date.

Flags: Read / Write

### The `“active-view”` property

      “active-view”              GcalWindowViewType

The active view, eg: month, week, etc.

Flags: Read / Write

Default value: GCAL_WINDOW_VIEW_MONTH

### The `“manager”` property

      “manager”                  GcalManager *

The manager object.

Flags: Read / Write / Construct Only

### The `“new-event-mode”` property

      “new-event-mode”           gboolean

Whether the window is in new-event-mode or not.

Flags: Read / Write

Default value: FALSE