~ubuntu-branches/ubuntu/breezy/evolution-data-server/breezy

« back to all changes in this revision

Viewing changes to calendar/libedata-cal/e-data-cal-view.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Holbach
  • Date: 2005-10-10 11:30:56 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20051010113056-rb4vj4kbs8yxft85
Tags: 1.4.1-0ubuntu3
* debian/patches/camel-imap-store.c.patch:
  - Ubuntu 17465: apply patch from
  http://bugzilla.gnome.org/attachment.cgi?id=53234&action=view
  (additional NULL pointer check)

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 * Author: Federico Mena-Quintero <federico@ximian.com>
6
6
 *
7
7
 * This program is free software; you can redistribute it and/or
8
 
 * modify it under the terms of version 2 of the GNU General Public
 
8
 * modify it under the terms of version 2 of the GNU Lesser General Public
9
9
 * License as published by the Free Software Foundation.
10
10
 *
11
11
 * This program is distributed in the hope that it will be useful,
12
12
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
13
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
 
 * GNU General Public License for more details.
 
14
 * GNU Lesser General Public License for more details.
15
15
 *
16
 
 * You should have received a copy of the GNU General Public License
 
16
 * You should have received a copy of the GNU Lesser General Public License
17
17
 * along with this program; if not, write to the Free Software
18
18
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
19
19
 */
454
454
}
455
455
 
456
456
/**
457
 
 * e_data_cal_view_get_sexp
 
457
 * e_data_cal_view_get_text:
458
458
 * @query: A #EDataCalView object.
459
459
 *
460
460
 * Get the expression used for the given query.
461
461
 *
462
 
 * Returns: the query expression used to search.
 
462
 * Return value: the query expression used to search.
463
463
 */
464
464
const char *
465
465
e_data_cal_view_get_text (EDataCalView *query)
469
469
        return e_cal_backend_sexp_text (query->priv->sexp);
470
470
}
471
471
 
 
472
/**
 
473
 * e_data_cal_view_get_object_sexp:
 
474
 * @query: A query object.
 
475
 *
 
476
 * Get the #ECalBackendSExp object used for the given query.
 
477
 *
 
478
 * Return value: The expression object used to search.
 
479
 */
472
480
ECalBackendSExp *
473
481
e_data_cal_view_get_object_sexp (EDataCalView *query)
474
482
{
477
485
        return query->priv->sexp;
478
486
}
479
487
 
 
488
/**
 
489
 * e_data_cal_view_object_matches:
 
490
 * @query: A query object.
 
491
 * @object: Object to match.
 
492
 *
 
493
 * Compares the given @object to the regular expression used for the
 
494
 * given query.
 
495
 *
 
496
 * Return value: TRUE if the object matches the expression, FALSE if not.
 
497
 */
480
498
gboolean
481
499
e_data_cal_view_object_matches (EDataCalView *query, const char *object)
482
500
{
499
517
        *list = g_list_append (*list, value);
500
518
}
501
519
 
 
520
/**
 
521
 * e_data_cal_view_get_matched_objects:
 
522
 * @query: A query object.
 
523
 *
 
524
 * Gets the list of objects already matched for the given query.
 
525
 *
 
526
 * Return value: A list of matched objects.
 
527
 */
502
528
GList *
503
529
e_data_cal_view_get_matched_objects (EDataCalView *query)
504
530
{
514
540
        return list;
515
541
}
516
542
 
 
543
/**
 
544
 * e_data_cal_view_is_started:
 
545
 * @query: A query object.
 
546
 *
 
547
 * Checks whether the given query has already been started.
 
548
 *
 
549
 * Return value: TRUE if the query has already been started, FALSE otherwise.
 
550
 */
517
551
gboolean
518
552
e_data_cal_view_is_started (EDataCalView *query)
519
553
{
526
560
        return priv->started;
527
561
}
528
562
 
 
563
/**
 
564
 * e_data_cal_view_is_done:
 
565
 * @query: A query object.
 
566
 *
 
567
 * Checks whether the given query is already done. Being done means the initial
 
568
 * matching of objects have been finished, not that no more notifications about
 
569
 * changes will be sent. In fact, even after done, notifications will still be sent
 
570
 * if there are changes in the objects matching the query search expression.
 
571
 *
 
572
 * Return value: TRUE if the query is done, FALSE if still in progress.
 
573
 */
529
574
gboolean
530
575
e_data_cal_view_is_done (EDataCalView *query)
531
576
{
538
583
        return priv->done;
539
584
}
540
585
 
 
586
/**
 
587
 * e_data_cal_view_get_done_status:
 
588
 * @query: A query object.
 
589
 *
 
590
 * Gets the status code obtained when the initial matching of objects was done
 
591
 * for the given query.
 
592
 *
 
593
 * Return value: The query status.
 
594
 */
541
595
GNOME_Evolution_Calendar_CallStatus
542
596
e_data_cal_view_get_done_status (EDataCalView *query)
543
597
{
553
607
        return GNOME_Evolution_Calendar_Success;
554
608
}
555
609
 
 
610
/**
 
611
 * e_data_cal_view_notify_objects_added:
 
612
 * @query: A query object.
 
613
 * @objects: List of objects that have been added.
 
614
 *
 
615
 * Notifies all query listeners of the addition of a list of objects.
 
616
 */
556
617
void
557
618
e_data_cal_view_notify_objects_added (EDataCalView *query, const GList *objects)
558
619
{
598
659
        CORBA_free (obj_list._buffer);
599
660
}
600
661
 
 
662
/**
 
663
 * e_data_cal_view_notify_objects_added_1:
 
664
 * @query: A query object.
 
665
 * @object: The object that has been added.
 
666
 *
 
667
 * Notifies all the query listeners of the addition of a single object.
 
668
 */
601
669
void
602
670
e_data_cal_view_notify_objects_added_1 (EDataCalView *query, const char *object)
603
671
{
617
685
        e_data_cal_view_notify_objects_added (query, &objects);
618
686
}
619
687
 
 
688
/**
 
689
 * e_data_cal_view_notify_objects_modified:
 
690
 * @query: A query object.
 
691
 * @objects: List of modified objects.
 
692
 *
 
693
 * Notifies all query listeners of the modification of a list of objects.
 
694
 */
620
695
void
621
696
e_data_cal_view_notify_objects_modified (EDataCalView *query, const GList *objects)
622
697
{
662
737
        CORBA_free (obj_list._buffer);
663
738
}
664
739
 
 
740
/**
 
741
 * e_data_cal_view_notify_objects_modified_1:
 
742
 * @query: A query object.
 
743
 * @object: The modified object.
 
744
 *
 
745
 * Notifies all query listeners of the modification of a single object.
 
746
 */
665
747
void
666
748
e_data_cal_view_notify_objects_modified_1 (EDataCalView *query, const char *object)
667
749
{
681
763
        e_data_cal_view_notify_objects_modified (query, &objects);
682
764
}
683
765
 
 
766
/**
 
767
 * e_data_cal_view_notify_objects_removed:
 
768
 * @query: A query object.
 
769
 * @uids: List of UIDs for the objects that have been removed.
 
770
 *
 
771
 * Notifies all query listener of the removal of a list of objects.
 
772
 */
684
773
void
685
774
e_data_cal_view_notify_objects_removed (EDataCalView *query, const GList *uids)
686
775
{
726
815
        CORBA_free (uid_list._buffer);
727
816
}
728
817
 
 
818
/**
 
819
 * e_data_cal_view_notify_objects_removed:
 
820
 * @query: A query object.
 
821
 * @uid: UID of the removed object.
 
822
 *
 
823
 * Notifies all query listener of the removal of a single object.
 
824
 */
729
825
void
730
826
e_data_cal_view_notify_objects_removed_1 (EDataCalView *query, const char *uid)
731
827
{
745
841
        e_data_cal_view_notify_objects_removed (query, &uids);
746
842
}
747
843
 
 
844
/**
 
845
 * e_data_cal_view_notify_progress:
 
846
 * @query: A query object.
 
847
 * @message: Progress message to send to listeners.
 
848
 * @percent: Percentage completed.
 
849
 *
 
850
 * Notifies all query listeners of progress messages.
 
851
 */
748
852
void
749
853
e_data_cal_view_notify_progress (EDataCalView *query, const char *message, int percent)
750
854
{
771
875
        }
772
876
}
773
877
 
 
878
/**
 
879
 * e_data_cal_view_notify_done:
 
880
 * @query: A query object.
 
881
 * @status: Query completion status code.
 
882
 *
 
883
 * Notifies all query listeners of the completion of the query, including a
 
884
 * status code.
 
885
 */
774
886
void
775
887
e_data_cal_view_notify_done (EDataCalView *query, GNOME_Evolution_Calendar_CallStatus status)
776
888
{