~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to calendar/libedata-cal/e-cal-backend.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
 
32
32
 
33
33
 
34
 
G_DEFINE_TYPE (ECalBackend, e_cal_backend, G_TYPE_OBJECT)
 
34
G_DEFINE_TYPE (ECalBackend, e_cal_backend, G_TYPE_OBJECT);
35
35
 
36
36
/* Private part of the CalBackend structure */
37
37
struct _ECalBackendPrivate {
85
85
static guint e_cal_backend_signals[LAST_SIGNAL];
86
86
 
87
87
static void e_cal_backend_finalize (GObject *object);
 
88
static void e_cal_backend_remove_client_private (ECalBackend *backend, EDataCal *cal, gboolean weak_unref);
88
89
 
89
90
 
90
91
 
287
288
        priv->clients_mutex = g_mutex_new ();
288
289
        priv->last_percent_notified = 0;
289
290
 
290
 
        /* FIXME bonobo_object_ref/unref? */
291
 
        priv->queries = e_list_new ((EListCopyFunc) bonobo_object_ref, (EListFreeFunc) bonobo_object_unref, NULL);
 
291
        priv->queries = e_list_new((EListCopyFunc) g_object_ref, (EListFreeFunc) g_object_unref, NULL);
292
292
        priv->queries_mutex = g_mutex_new ();
293
293
}
294
294
 
325
325
 *
326
326
 * Gets the #ESource associated with the given backend.
327
327
 *
328
 
 * Return value: The #ESource for the backend.
 
328
 * Returns: The #ESource for the backend.
329
329
 */
330
330
ESource *
331
331
e_cal_backend_get_source (ECalBackend *backend)
347
347
 * Queries the URI of a calendar backend, which must already have an open
348
348
 * calendar.
349
349
 *
350
 
 * Return value: The URI where the calendar is stored.
 
350
 * Returns: The URI where the calendar is stored.
351
351
 **/
352
352
const gchar *
353
353
e_cal_backend_get_uri (ECalBackend *backend)
368
368
 *
369
369
 * Gets the kind of components the given backend stores.
370
370
 *
371
 
 * Return value: The kind of components for this backend.
 
371
 * Returns: The kind of components for this backend.
372
372
 */
373
373
icalcomponent_kind
374
374
e_cal_backend_get_kind (ECalBackend *backend)
386
386
static void
387
387
cal_destroy_cb (gpointer data, GObject *where_cal_was)
388
388
{
389
 
        ECalBackend *backend = E_CAL_BACKEND (data);
390
 
 
391
 
        e_cal_backend_remove_client (backend, (EDataCal *) where_cal_was);
392
 
}
393
 
 
394
 
static void
395
 
listener_died_cb (gpointer cnx, gpointer data)
396
 
{
397
 
        EDataCal *cal = E_DATA_CAL (data);
398
 
 
399
 
        if (ORBit_small_get_connection_status (e_data_cal_get_listener(cal)) == ORBIT_CONNECTION_DISCONNECTED)
400
 
                e_cal_backend_remove_client (e_data_cal_get_backend (cal), cal);
401
 
}
402
 
 
403
 
static void
404
 
last_client_gone (ECalBackend *backend)
405
 
{
406
 
        g_signal_emit (backend, e_cal_backend_signals[LAST_CLIENT_GONE], 0);
 
389
        e_cal_backend_remove_client_private (E_CAL_BACKEND (data),
 
390
                                             (EDataCal *) where_cal_was, FALSE);
407
391
}
408
392
 
409
393
/**
426
410
 
427
411
        priv = backend->priv;
428
412
 
429
 
        bonobo_object_set_immortal (BONOBO_OBJECT (cal), TRUE);
430
 
 
431
413
        g_object_weak_ref (G_OBJECT (cal), cal_destroy_cb, backend);
432
414
 
433
 
        ORBit_small_listen_for_broken (e_data_cal_get_listener (cal), G_CALLBACK (listener_died_cb), cal);
434
 
 
435
415
        g_mutex_lock (priv->clients_mutex);
436
416
        priv->clients = g_list_append (priv->clients, cal);
437
417
        g_mutex_unlock (priv->clients_mutex);
438
418
}
439
419
 
440
 
/**
441
 
 * e_cal_backend_remove_client:
442
 
 * @backend: An #ECalBackend object.
443
 
 * @cal: An #EDataCal object.
444
 
 *
445
 
 * Removes a client from the list of connected clients to the given backend.
446
 
 */
447
 
void
448
 
e_cal_backend_remove_client (ECalBackend *backend, EDataCal *cal)
 
420
static void
 
421
e_cal_backend_remove_client_private (ECalBackend *backend, EDataCal *cal, gboolean weak_unref)
449
422
{
450
423
        ECalBackendPrivate *priv;
451
424
 
459
432
 
460
433
        priv = backend->priv;
461
434
 
 
435
        if (weak_unref)
 
436
                g_object_weak_unref (G_OBJECT (cal), cal_destroy_cb, backend);
 
437
 
462
438
        /* Disconnect */
463
439
        g_mutex_lock (priv->clients_mutex);
464
440
        priv->clients = g_list_remove (priv->clients, cal);
468
444
         * it may decide whether to kill the backend or not.
469
445
         */
470
446
        if (!priv->clients)
471
 
                last_client_gone (backend);
 
447
                g_signal_emit (backend, e_cal_backend_signals[LAST_CLIENT_GONE], 0);
 
448
}
 
449
 
 
450
/**
 
451
 * e_cal_backend_remove_client:
 
452
 * @backend: An #ECalBackend object.
 
453
 * @cal: An #EDataCal object.
 
454
 *
 
455
 * Removes a client from the list of connected clients to the given backend.
 
456
 */
 
457
void
 
458
e_cal_backend_remove_client (ECalBackend *backend, EDataCal *cal)
 
459
{
 
460
        e_cal_backend_remove_client_private (backend, cal, TRUE);
472
461
}
473
462
 
474
463
/**
499
488
 *
500
489
 * Gets the list of live queries being run on the given backend.
501
490
 *
502
 
 * Return value: The list of live queries.
 
491
 * Returns: The list of live queries.
503
492
 */
504
493
EList *
505
494
e_cal_backend_get_queries (ECalBackend *backend)
516
505
 * @query: An #EDataCalView object, previously added with @ref e_cal_backend_add_query.
517
506
 *
518
507
 * Removes query from the list of live queries for the backend.
 
508
 *
 
509
 * Since: 2.24
519
510
 **/
520
511
void
521
512
e_cal_backend_remove_query (ECalBackend *backend, EDataCalView *query)
538
529
 * must already have an open calendar.
539
530
 **/
540
531
void
541
 
e_cal_backend_get_cal_address (ECalBackend *backend, EDataCal *cal)
 
532
e_cal_backend_get_cal_address (ECalBackend *backend, EDataCal *cal, EServerMethodContext context)
542
533
{
543
534
        g_return_if_fail (backend != NULL);
544
535
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
545
536
 
546
537
        g_assert (CLASS (backend)->get_cal_address != NULL);
547
 
        (* CLASS (backend)->get_cal_address) (backend, cal);
 
538
        (* CLASS (backend)->get_cal_address) (backend, cal, context);
548
539
}
549
540
 
550
541
void
564
555
}
565
556
 
566
557
void
567
 
e_cal_backend_notify_cal_address (ECalBackend *backend, gchar *address)
 
558
e_cal_backend_notify_cal_address (ECalBackend *backend, EServerMethodContext context, gchar *address)
568
559
{
569
560
        ECalBackendPrivate *priv;
570
561
        GList *l;
572
563
        priv = backend->priv;
573
564
 
574
565
        for (l = priv->clients; l; l = l->next)
575
 
                e_data_cal_notify_cal_address (l->data, GNOME_Evolution_Calendar_Success, address);
 
566
                e_data_cal_notify_cal_address (l->data, context, GNOME_Evolution_Calendar_Success, address);
576
567
}
577
568
 
578
569
/**
583
574
 * Calls the get_alarm_email_address method on the given backend.
584
575
 */
585
576
void
586
 
e_cal_backend_get_alarm_email_address (ECalBackend *backend, EDataCal *cal)
 
577
e_cal_backend_get_alarm_email_address (ECalBackend *backend, EDataCal *cal, EServerMethodContext context)
587
578
{
588
579
        g_return_if_fail (backend != NULL);
589
580
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
590
581
 
591
582
        g_assert (CLASS (backend)->get_alarm_email_address != NULL);
592
 
        (* CLASS (backend)->get_alarm_email_address) (backend, cal);
 
583
        (* CLASS (backend)->get_alarm_email_address) (backend, cal, context);
593
584
}
594
585
 
595
586
/**
600
591
 * Calls the get_ldap_attribute method of the given backend.
601
592
 */
602
593
void
603
 
e_cal_backend_get_ldap_attribute (ECalBackend *backend, EDataCal *cal)
 
594
e_cal_backend_get_ldap_attribute (ECalBackend *backend, EDataCal *cal, EServerMethodContext context)
604
595
{
605
596
        g_return_if_fail (backend != NULL);
606
597
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
607
598
 
608
599
        g_assert (CLASS (backend)->get_ldap_attribute != NULL);
609
 
        (* CLASS (backend)->get_ldap_attribute) (backend, cal);
 
600
        (* CLASS (backend)->get_ldap_attribute) (backend, cal, context);
610
601
}
611
602
 
612
603
/**
617
608
 * Calls the get_static_capabilities method on the given backend.
618
609
 */
619
610
void
620
 
e_cal_backend_get_static_capabilities (ECalBackend *backend, EDataCal *cal)
 
611
e_cal_backend_get_static_capabilities (ECalBackend *backend, EDataCal *cal, EServerMethodContext context)
621
612
{
622
613
        g_return_if_fail (backend != NULL);
623
614
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
624
615
 
625
616
        g_assert (CLASS (backend)->get_static_capabilities != NULL);
626
 
        (* CLASS (backend)->get_static_capabilities) (backend, cal);
 
617
        (* CLASS (backend)->get_static_capabilities) (backend, cal, context);
627
618
}
628
619
 
629
620
/**
640
631
 * URI.
641
632
 */
642
633
void
643
 
e_cal_backend_open (ECalBackend *backend, EDataCal *cal, gboolean only_if_exists,
 
634
e_cal_backend_open (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, gboolean only_if_exists,
644
635
                    const gchar *username, const gchar *password)
645
636
{
646
637
        g_return_if_fail (backend != NULL);
647
638
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
648
639
 
649
640
        g_assert (CLASS (backend)->open != NULL);
650
 
        (* CLASS (backend)->open) (backend, cal, only_if_exists, username, password);
 
641
        (* CLASS (backend)->open) (backend, cal, context, only_if_exists, username, password);
 
642
}
 
643
 
 
644
/**
 
645
 * e_cal_backend_refresh:
 
646
 * @backend: A calendar backend.
 
647
 * @cal: An #EDataCal object.
 
648
 *
 
649
 * Refreshes the calendar being accessed by the given backend.
 
650
 *
 
651
 * Since: 2.30
 
652
 */
 
653
void
 
654
e_cal_backend_refresh (ECalBackend *backend, EDataCal *cal, EServerMethodContext context)
 
655
{
 
656
        g_return_if_fail (backend != NULL);
 
657
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
 
658
 
 
659
        g_assert (CLASS (backend)->refresh != NULL);
 
660
        (* CLASS (backend)->refresh) (backend, cal, context);
651
661
}
652
662
 
653
663
/**
658
668
 * Removes the calendar being accessed by the given backend.
659
669
 */
660
670
void
661
 
e_cal_backend_remove (ECalBackend *backend, EDataCal *cal)
 
671
e_cal_backend_remove (ECalBackend *backend, EDataCal *cal, EServerMethodContext context)
662
672
{
663
673
        g_return_if_fail (backend != NULL);
664
674
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
665
675
 
666
676
        g_assert (CLASS (backend)->remove != NULL);
667
 
        (* CLASS (backend)->remove) (backend, cal);
 
677
        (* CLASS (backend)->remove) (backend, cal, context);
668
678
}
669
679
 
670
680
/**
673
683
 *
674
684
 * Queries whether a calendar backend has been loaded yet.
675
685
 *
676
 
 * Return value: TRUE if the backend has been loaded with data, FALSE
 
686
 * Returns: TRUE if the backend has been loaded with data, FALSE
677
687
 * otherwise.
678
688
 */
679
689
gboolean
731
741
 *
732
742
 * Queries whether a calendar backend is connected remotely.
733
743
 *
734
 
 * Return value: The current mode the calendar is in
 
744
 * Returns: The current mode the calendar is in
735
745
 **/
736
746
CalMode
737
747
e_cal_backend_get_mode (ECalBackend *backend)
772
782
 * Calls the get_default_object method on the given backend.
773
783
 */
774
784
void
775
 
e_cal_backend_get_default_object (ECalBackend *backend, EDataCal *cal)
 
785
e_cal_backend_get_default_object (ECalBackend *backend, EDataCal *cal, EServerMethodContext context)
776
786
{
777
787
        g_return_if_fail (backend != NULL);
778
788
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
779
789
 
780
790
        g_assert (CLASS (backend)->get_default_object != NULL);
781
 
        (* CLASS (backend)->get_default_object) (backend, cal);
 
791
        (* CLASS (backend)->get_default_object) (backend, cal, context);
782
792
}
783
793
 
784
794
/**
792
802
 * identifier and its recurrence ID (if a recurrent appointment).
793
803
 */
794
804
void
795
 
e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid)
 
805
e_cal_backend_get_object (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *uid, const gchar *rid)
796
806
{
797
807
        g_return_if_fail (backend != NULL);
798
808
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
799
809
        g_return_if_fail (uid != NULL);
800
810
 
801
811
        g_assert (CLASS (backend)->get_object != NULL);
802
 
        (* CLASS (backend)->get_object) (backend, cal, uid, rid);
 
812
        (* CLASS (backend)->get_object) (backend, cal, context, uid, rid);
803
813
}
804
814
 
805
815
/**
811
821
 * Calls the get_object_list method on the given backend.
812
822
 */
813
823
void
814
 
e_cal_backend_get_object_list (ECalBackend *backend, EDataCal *cal, const gchar *sexp)
 
824
e_cal_backend_get_object_list (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *sexp)
815
825
{
816
826
        g_return_if_fail (backend != NULL);
817
827
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
818
828
 
819
829
        g_assert (CLASS (backend)->get_object_list != NULL);
820
 
        (* CLASS (backend)->get_object_list) (backend, cal, sexp);
 
830
        (* CLASS (backend)->get_object_list) (backend, cal, context, sexp);
821
831
}
822
832
 
823
833
/**
831
841
 * on its unique identifier and its recurrence ID (if a recurrent appointment).
832
842
 */
833
843
void
834
 
e_cal_backend_get_attachment_list (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid)
 
844
e_cal_backend_get_attachment_list (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *uid, const gchar *rid)
835
845
{
836
846
        g_return_if_fail (backend != NULL);
837
847
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
838
848
        g_return_if_fail (uid != NULL);
839
849
 
840
850
        g_assert (CLASS (backend)->get_object != NULL);
841
 
        (* CLASS (backend)->get_attachment_list) (backend, cal, uid, rid);
 
851
        (* CLASS (backend)->get_attachment_list) (backend, cal, context, uid, rid);
842
852
}
843
853
 
844
854
/**
852
862
 * Gets a free/busy object for the given time interval
853
863
 */
854
864
void
855
 
e_cal_backend_get_free_busy (ECalBackend *backend, EDataCal *cal, GList *users, time_t start, time_t end)
 
865
e_cal_backend_get_free_busy (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, GList *users, time_t start, time_t end)
856
866
{
857
867
        g_return_if_fail (backend != NULL);
858
868
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
860
870
        g_return_if_fail (start <= end);
861
871
 
862
872
        g_assert (CLASS (backend)->get_free_busy != NULL);
863
 
        (* CLASS (backend)->get_free_busy) (backend, cal, users, start, end);
 
873
        (* CLASS (backend)->get_free_busy) (backend, cal, context, users, start, end);
864
874
}
865
875
 
866
876
/**
873
883
 * the last time the give change_id was seen
874
884
 */
875
885
void
876
 
e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, const gchar *change_id)
 
886
e_cal_backend_get_changes (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *change_id)
877
887
{
878
888
        g_return_if_fail (backend != NULL);
879
889
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
880
890
        g_return_if_fail (change_id != NULL);
881
891
 
882
892
        g_assert (CLASS (backend)->get_changes != NULL);
883
 
        (* CLASS (backend)->get_changes) (backend, cal, change_id);
 
893
        (* CLASS (backend)->get_changes) (backend, cal, context, change_id);
884
894
}
885
895
 
886
896
/**
894
904
 * to do whatever is needed to really discard the alarm.
895
905
 */
896
906
void
897
 
e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *auid)
 
907
e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *uid, const gchar *auid)
898
908
{
899
909
        g_return_if_fail (backend != NULL);
900
910
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
902
912
        g_return_if_fail (auid != NULL);
903
913
 
904
914
        g_assert (CLASS (backend)->discard_alarm != NULL);
905
 
        (* CLASS (backend)->discard_alarm) (backend, cal, uid, auid);
 
915
        (* CLASS (backend)->discard_alarm) (backend, cal, context, uid, auid);
906
916
}
907
917
 
908
918
/**
914
924
 * Calls the create_object method on the given backend.
915
925
 */
916
926
void
917
 
e_cal_backend_create_object (ECalBackend *backend, EDataCal *cal, const gchar *calobj)
 
927
e_cal_backend_create_object (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *calobj)
918
928
{
919
929
        g_return_if_fail (backend != NULL);
920
930
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
921
931
        g_return_if_fail (calobj != NULL);
922
932
 
923
933
        if (CLASS (backend)->create_object)
924
 
                (* CLASS (backend)->create_object) (backend, cal, calobj);
 
934
                (* CLASS (backend)->create_object) (backend, cal, context, calobj);
925
935
        else
926
 
                e_data_cal_notify_object_created (cal, GNOME_Evolution_Calendar_PermissionDenied, NULL, NULL);
 
936
                e_data_cal_notify_object_created (cal, context, PermissionDenied, NULL, NULL);
927
937
}
928
938
 
929
939
/**
936
946
 * Calls the modify_object method on the given backend.
937
947
 */
938
948
void
939
 
e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, const gchar *calobj, CalObjModType mod)
 
949
e_cal_backend_modify_object (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *calobj, CalObjModType mod)
940
950
{
941
951
        g_return_if_fail (backend != NULL);
942
952
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
943
953
        g_return_if_fail (calobj != NULL);
944
954
 
945
955
        if (CLASS (backend)->modify_object)
946
 
                (* CLASS (backend)->modify_object) (backend, cal, calobj, mod);
 
956
                (* CLASS (backend)->modify_object) (backend, cal, context, calobj, mod);
947
957
        else
948
 
                e_data_cal_notify_object_removed (cal, GNOME_Evolution_Calendar_PermissionDenied, NULL, NULL, NULL);
 
958
                e_data_cal_notify_object_removed (cal, context, PermissionDenied, NULL, NULL, NULL);
949
959
}
950
960
 
951
961
/**
960
970
 * clients about the change.
961
971
 */
962
972
void
963
 
e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, const gchar *uid, const gchar *rid, CalObjModType mod)
 
973
e_cal_backend_remove_object (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *uid, const gchar *rid, CalObjModType mod)
964
974
{
965
975
        g_return_if_fail (backend != NULL);
966
976
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
967
977
        g_return_if_fail (uid != NULL);
968
978
 
969
979
        g_assert (CLASS (backend)->remove_object != NULL);
970
 
        (* CLASS (backend)->remove_object) (backend, cal, uid, rid, mod);
 
980
        (* CLASS (backend)->remove_object) (backend, cal, context, uid, rid, mod);
971
981
}
972
982
 
973
983
/**
979
989
 * Calls the receive_objects method on the given backend.
980
990
 */
981
991
void
982
 
e_cal_backend_receive_objects (ECalBackend *backend, EDataCal *cal, const gchar *calobj)
 
992
e_cal_backend_receive_objects (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *calobj)
983
993
{
984
994
        g_return_if_fail (backend != NULL);
985
995
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
986
996
        g_return_if_fail (calobj != NULL);
987
997
 
988
998
        g_assert (CLASS (backend)->receive_objects != NULL);
989
 
        (* CLASS (backend)->receive_objects) (backend, cal, calobj);
 
999
        (* CLASS (backend)->receive_objects) (backend, cal, context, calobj);
990
1000
}
991
1001
 
992
1002
/**
998
1008
 * Calls the send_objects method on the given backend.
999
1009
 */
1000
1010
void
1001
 
e_cal_backend_send_objects (ECalBackend *backend, EDataCal *cal, const gchar *calobj)
 
1011
e_cal_backend_send_objects (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *calobj)
1002
1012
{
1003
1013
        g_return_if_fail (backend != NULL);
1004
1014
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
1005
1015
        g_return_if_fail (calobj != NULL);
1006
1016
 
1007
1017
        g_assert (CLASS (backend)->send_objects != NULL);
1008
 
        (* CLASS (backend)->send_objects) (backend, cal, calobj);
 
1018
        (* CLASS (backend)->send_objects) (backend, cal, context, calobj);
1009
1019
}
1010
1020
 
1011
1021
/**
1019
1029
 * can't be found.
1020
1030
 */
1021
1031
void
1022
 
e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, const gchar *tzid)
 
1032
e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *tzid)
1023
1033
{
1024
1034
        g_return_if_fail (backend != NULL);
1025
1035
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
1026
1036
        g_return_if_fail (tzid != NULL);
1027
1037
 
1028
1038
        g_assert (CLASS (backend)->get_timezone != NULL);
1029
 
        (* CLASS (backend)->get_timezone) (backend, cal, tzid);
 
1039
        (* CLASS (backend)->get_timezone) (backend, cal, context, tzid);
1030
1040
}
1031
1041
 
1032
1042
/**
1039
1049
 * DATE and floating DATE-TIME values.
1040
1050
 */
1041
1051
void
1042
 
e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, const gchar *tzobj)
 
1052
e_cal_backend_set_default_zone (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *tzobj)
1043
1053
{
1044
1054
        g_return_if_fail (backend != NULL);
1045
1055
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
1046
1056
        g_return_if_fail (tzobj != NULL);
1047
1057
 
1048
 
        (* CLASS (backend)->set_default_zone) (backend, cal, tzobj);
 
1058
        (* CLASS (backend)->set_default_zone) (backend, cal, context, tzobj);
1049
1059
}
1050
1060
 
1051
1061
/**
1063
1073
 *
1064
1074
 */
1065
1075
void
1066
 
e_cal_backend_set_default_timezone (ECalBackend *backend, EDataCal *cal, const gchar *tzid)
 
1076
e_cal_backend_set_default_timezone (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *tzid)
1067
1077
{
1068
1078
        g_return_if_fail (backend != NULL);
1069
1079
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
1070
1080
        g_return_if_fail (tzid != NULL);
1071
1081
 
1072
 
        (* CLASS (backend)->set_default_timezone) (backend, cal, tzid);
 
1082
        (* CLASS (backend)->set_default_timezone) (backend, cal, context, tzid);
1073
1083
}
1074
1084
 
1075
1085
/**
1081
1091
 * Add a timezone object to the given backend.
1082
1092
 */
1083
1093
void
1084
 
e_cal_backend_add_timezone (ECalBackend *backend, EDataCal *cal, const gchar *tzobj)
 
1094
e_cal_backend_add_timezone (ECalBackend *backend, EDataCal *cal, EServerMethodContext context, const gchar *tzobj)
1085
1095
{
1086
1096
        g_return_if_fail (E_IS_CAL_BACKEND (backend));
1087
1097
        g_return_if_fail (tzobj != NULL);
1088
1098
        g_return_if_fail (CLASS (backend)->add_timezone != NULL);
1089
1099
 
1090
 
        (* CLASS (backend)->add_timezone) (backend, cal, tzobj);
 
1100
        (* CLASS (backend)->add_timezone) (backend, cal, context, tzobj);
1091
1101
}
1092
1102
 
1093
1103
/**
1173
1183
        while (e_iterator_is_valid (iter)) {
1174
1184
                query = QUERY (e_iterator_get (iter));
1175
1185
 
1176
 
                bonobo_object_ref (query);
 
1186
                g_object_ref (query);
1177
1187
                if (e_data_cal_view_object_matches (query, calobj))
1178
1188
                        e_data_cal_view_notify_objects_added_1 (query, calobj);
1179
 
                bonobo_object_unref (query);
 
1189
                g_object_unref (query);
1180
1190
 
1181
1191
                e_iterator_next (iter);
1182
1192
        }
1217
1227
 *
1218
1228
 * This methods has to be used before e_cal_backend_notify_view_progress.
1219
1229
 * Sets last notified percent value to 0.
 
1230
 *
 
1231
 * Since: 2.24
1220
1232
 **/
1221
1233
void
1222
1234
e_cal_backend_notify_view_progress_start (ECalBackend *backend)
1262
1274
        while (e_iterator_is_valid (iter)) {
1263
1275
                query = QUERY (e_iterator_get (iter));
1264
1276
 
1265
 
                bonobo_object_ref (query);
 
1277
                g_object_ref (query);
1266
1278
 
1267
1279
                e_data_cal_view_notify_progress (query, message, percent);
1268
1280
 
1269
 
                bonobo_object_unref (query);
 
1281
                g_object_unref (query);
1270
1282
 
1271
1283
                e_iterator_next (iter);
1272
1284
        }
1301
1313
        while (e_iterator_is_valid (iter)) {
1302
1314
                query = QUERY (e_iterator_get (iter));
1303
1315
 
1304
 
                bonobo_object_ref (query);
 
1316
                g_object_ref (query);
1305
1317
 
1306
1318
                e_data_cal_view_notify_done (query, status);
1307
1319
 
1308
 
                bonobo_object_unref (query);
 
1320
                g_object_unref (query);
1309
1321
 
1310
1322
                e_iterator_next (iter);
1311
1323
        }
1346
1358
        while (e_iterator_is_valid (iter)) {
1347
1359
                query = QUERY (e_iterator_get (iter));
1348
1360
 
1349
 
                bonobo_object_ref (query);
 
1361
                g_object_ref (query);
1350
1362
                match_query_and_notify (query, old_object, object);
1351
 
                bonobo_object_unref (query);
 
1363
                g_object_unref (query);
1352
1364
 
1353
1365
                e_iterator_next (iter);
1354
1366
        }
1392
1404
        while (e_iterator_is_valid (iter)) {
1393
1405
                query = QUERY (e_iterator_get (iter));
1394
1406
 
1395
 
                bonobo_object_ref (query);
 
1407
                g_object_ref (query);
1396
1408
 
1397
1409
                if (object == NULL) {
1398
1410
                        /* if object == NULL, it means the object has been completely
1402
1414
                } else
1403
1415
                        match_query_and_notify (query, old_object, object);
1404
1416
 
1405
 
                bonobo_object_unref (query);
 
1417
                g_object_unref (query);
1406
1418
 
1407
1419
                e_iterator_next (iter);
1408
1420
        }
1409
1421
        g_object_unref (iter);
1410
1422
}
1411
1423
 
 
1424
/**
 
1425
 * e_cal_backend_notify_objects_added:
 
1426
 *
 
1427
 * Since: 2.24
 
1428
 **/
1412
1429
void
1413
1430
e_cal_backend_notify_objects_added (ECalBackend *backend, EDataCalView *query, const GList *objects)
1414
1431
{
1415
1432
        e_data_cal_view_notify_objects_added (query, objects);
1416
1433
}
1417
1434
 
 
1435
/**
 
1436
 * e_cal_backend_notify_objects_removed:
 
1437
 *
 
1438
 * Since: 2.24
 
1439
 **/
1418
1440
void
1419
1441
e_cal_backend_notify_objects_removed (ECalBackend *backend, EDataCalView *query, const GList *ids)
1420
1442
{
1421
1443
        e_data_cal_view_notify_objects_removed (query, ids);
1422
1444
}
1423
1445
 
 
1446
/**
 
1447
 * e_cal_backend_notify_objects_modified:
 
1448
 *
 
1449
 * Since: 2.24
 
1450
 **/
1424
1451
void
1425
1452
e_cal_backend_notify_objects_modified (ECalBackend *backend, EDataCalView *query, const GList *objects)
1426
1453
{
1438
1465
 **/
1439
1466
void
1440
1467
e_cal_backend_notify_mode (ECalBackend *backend,
1441
 
                           GNOME_Evolution_Calendar_CalListener_SetModeStatus status,
1442
 
                           GNOME_Evolution_Calendar_CalMode mode)
 
1468
                           EDataCalViewListenerSetModeStatus status,
 
1469
                           EDataCalMode mode)
1443
1470
{
1444
1471
        ECalBackendPrivate *priv = backend->priv;
1445
1472
        GList *l;
1499
1526
 *
1500
1527
 * Empties backend's cache with all notifications and so on, thus all listening
1501
1528
 * will know there is nothing in this backend.
 
1529
 *
 
1530
 * Since: 2.28
1502
1531
 **/
1503
1532
void
1504
1533
e_cal_backend_empty_cache (ECalBackend *backend, ECalBackendCache *cache)