• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ icalcomponent_get_first_property函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中icalcomponent_get_first_property函数的典型用法代码示例。如果您正苦于以下问题:C++ icalcomponent_get_first_property函数的具体用法?C++ icalcomponent_get_first_property怎么用?C++ icalcomponent_get_first_property使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了icalcomponent_get_first_property函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: get_vtimezone

/**
 * get ICalendar VTIMEZONE block from ECalComponentWithTZ
 *
 * @param  ectz
 *         An evolution event/task/note type which may contain a time zone.
 *
 * @return the ICalendar VTIMEZONE block
 */
static gchar*
get_vtimezone (const ECalComponentWithTZ *ectz)
{
	icalcomponent *icc = NULL;
	icalcomponent *cloned_icc = NULL;
	icalproperty *dtstamp = NULL;
	icalproperty *uid = NULL;
	gchar *ical_str = NULL;

	if (ectz == NULL || ectz->maincomp == NULL || ectz->timezone == NULL)
		return NULL;

	icc = e_cal_component_get_icalcomponent (ectz->timezone);
	cloned_icc = icalcomponent_new_clone (icc);

	/* uid and dtstamp are not needed (nor wanted) in timezone block */
	uid = icalcomponent_get_first_property(cloned_icc, ICAL_UID_PROPERTY);
	icalcomponent_remove_property (cloned_icc, uid);
	free(uid);
	dtstamp = icalcomponent_get_first_property(cloned_icc, ICAL_DTSTAMP_PROPERTY);
	icalcomponent_remove_property (cloned_icc, dtstamp);
	free(dtstamp);

	/* memory returned by *_as_ical_string() is owned by libical */
	ical_str = g_strdup (icalcomponent_as_ical_string (cloned_icc));
	icalcomponent_free (cloned_icc);

	return ical_str;
}
开发者ID:GNOME,项目名称:evolution-kolab,代码行数:37,代码来源:priv-common-e-to-i.c


示例2: icaltimezone_get_location_from_vtimezone

/** Gets the LOCATION or X-LIC-LOCATION property from a VTIMEZONE. */
static char*
icaltimezone_get_location_from_vtimezone (icalcomponent *component)
{
    icalproperty *prop;
    const char *location;
    const char *name;

    prop = icalcomponent_get_first_property (component,
					     ICAL_LOCATION_PROPERTY);
    if (prop) {
	location = icalproperty_get_location (prop);
	if (location)
	    return strdup (location);
    }

    prop = icalcomponent_get_first_property (component, ICAL_X_PROPERTY);
    while (prop) {
	name = icalproperty_get_x_name (prop);
	if (name && !strcasecmp (name, "X-LIC-LOCATION")) {
	    location = icalproperty_get_x (prop);
	    if (location)
		return strdup (location);
	}
	prop = icalcomponent_get_next_property (component,
						ICAL_X_PROPERTY);
    }

    return NULL;
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:30,代码来源:icaltimezone.c


示例3: create_simple_component

void create_simple_component(void)
{

    icalcomponent* calendar;
    icalproperty *version, *bogus;
      
    /* Create calendar and add properties */
    calendar = icalcomponent_new(ICAL_VCALENDAR_COMPONENT);

    ok("create vcalendar component", (calendar!=NULL));

    icalcomponent_add_property(
	calendar,
	icalproperty_new_version("2.0")
	);
    
    version = icalcomponent_get_first_property(calendar,ICAL_VERSION_PROPERTY);
    ok("version property added", (version!=NULL));

    bogus = icalcomponent_get_first_property(calendar,ICAL_DTSTART_PROPERTY);
    ok("bogus dtstart not found", (bogus == NULL));

    if (VERBOSE && calendar)
      printf("%s\n",icalcomponent_as_ical_string(calendar));

    icalcomponent_free(calendar);
}
开发者ID:EdgarChen,项目名称:mozilla-cvs-history,代码行数:27,代码来源:regression-component.c


示例4: icalproperty_string_to_kind

icalproperty *icallangbind_get_first_property(icalcomponent *c, const char *prop)
{
    icalproperty_kind kind = icalproperty_string_to_kind(prop);
    icalproperty *p;

    if (kind == ICAL_NO_PROPERTY) {
        return 0;
    }

    if (kind == ICAL_X_PROPERTY) {
        for (p = icalcomponent_get_first_property(c, kind);
             p != 0; p = icalcomponent_get_next_property(c, kind)) {

            if (strcmp(icalproperty_get_x_name(p), prop) == 0) {
                return p;
            }
        }
    } else {
        p = icalcomponent_get_first_property(c, kind);

        return p;
    }

    return 0;
}
开发者ID:nyz110,项目名称:libical,代码行数:25,代码来源:icallangbind.c


示例5: find_attendee

static icalproperty *
find_attendee (icalcomponent *ical_comp, const char *address)
{
	icalproperty *prop;

	if (address == NULL)
		return NULL;

	for (prop = icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY);
	     prop != NULL;
	     prop = icalcomponent_get_next_property (ical_comp, ICAL_ATTENDEE_PROPERTY)) {
		icalvalue *value;
		const char *attendee;
		char *text;

		value = icalproperty_get_value (prop);
		if (!value)
			continue;

		attendee = icalvalue_get_string (value);

		text = g_strdup (itip_strip_mailto (attendee));
		text = g_strstrip (text);
		if (!g_ascii_strcasecmp (address, text)) {
			g_free (text);
			break;
		}
		g_free (text);
	}

	return prop;
}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:32,代码来源:process-meeting.c


示例6: icalmessage_get_inner

static icalproperty *icalmessage_find_attendee(icalcomponent *comp, const char *user)
{
    icalcomponent *inner = icalmessage_get_inner(comp);
    icalproperty *p, *attendee = 0;
    char *luser = lowercase(user);

    for (p = icalcomponent_get_first_property(inner, ICAL_ATTENDEE_PROPERTY);
         p != 0;
         p = icalcomponent_get_next_property(inner, ICAL_ATTENDEE_PROPERTY)) {

        char *lattendee;

        lattendee = lowercase(icalproperty_get_attendee(p));

        if (strstr(lattendee, user) != 0) {
            free(lattendee);
            attendee = p;
            break;
        }

        free(lattendee);
    }

    free(luser);

    return attendee;
}
开发者ID:cyrusimap,项目名称:libical,代码行数:27,代码来源:icalmessage.c


示例7: icalerror_check_arg_rz

icalcomponent *icalmessage_new_delegate_request(icalcomponent *c,
                                                const char *user,
                                                const char *delegatee, const char *msg)
{
    icalcomponent *reply;
    icalproperty *attendee;
    icalcomponent *inner;
    icalparameter *delegateeParam;

    icalerror_check_arg_rz(c, "c");

    reply = icalmessage_new_reply_base(c, user, msg);
    inner = icalmessage_get_inner(reply);

    if (reply == 0) {
        return 0;
    }

    icalcomponent_set_method(reply, ICAL_METHOD_REQUEST);

    attendee = icalcomponent_get_first_property(inner, ICAL_ATTENDEE_PROPERTY);

    icalproperty_set_parameter(attendee, icalparameter_new_partstat(ICAL_PARTSTAT_DELEGATED));

    icalproperty_set_parameter(attendee, icalparameter_new_delegatedto(delegatee));

    delegateeParam = icalparameter_new_delegatedfrom(icalproperty_get_attendee(attendee));
    icalcomponent_add_property(
        inner,
        icalproperty_vanew_attendee(delegatee, delegateeParam, 0));
    icalparameter_free(delegateeParam);
    return reply;
}
开发者ID:cyrusimap,项目名称:libical,代码行数:33,代码来源:icalmessage.c


示例8: icomp_x_prop_set

/** Set icalcomponent X-* property.
 *
 * @param comp iCal component.
 * @param key Property name (i.e. X-EEE-WHATEVER).
 * @param value Property value.
 */
static void icomp_x_prop_set(icalcomponent *comp, const char *key, const char *value)
{
    icalproperty *iter;

    g_return_if_fail(comp != NULL);
    g_return_if_fail(key != NULL);

again:
    for (iter = icalcomponent_get_first_property(comp, ICAL_X_PROPERTY);
         iter;
         iter = icalcomponent_get_next_property(comp, ICAL_X_PROPERTY))
    {
        const char *str = icalproperty_get_x_name(iter);

        if (str && !g_strcmp0(str, key))
        {
            icalcomponent_remove_property(comp, iter);
            icalproperty_free(iter);
            goto again;
        }
    }

    if (value)
    {
        iter = icalproperty_new_x(value);
        icalproperty_set_x_name(iter, key);
        icalcomponent_add_property(comp, iter);
    }
}
开发者ID:zonio,项目名称:evolution-3e,代码行数:35,代码来源:e-cal-backend-3e-utils.c


示例9: icalcomponent_get_first_component

icalproperty *icalcomponent_get_first_invitee(icalcomponent *comp)
{
    icalproperty *prop;

    if (icalcomponent_isa(comp) == ICAL_VPOLL_COMPONENT) {
        icalcomponent *vvoter =
            icalcomponent_get_first_component(comp, ICAL_VVOTER_COMPONENT);

        prop = icalcomponent_get_first_property(vvoter, ICAL_VOTER_PROPERTY);
    }
    else {
        prop = icalcomponent_get_first_property(comp, ICAL_ATTENDEE_PROPERTY);
    }

    return prop;
}
开发者ID:Distrotech,项目名称:cyrus-imapd,代码行数:16,代码来源:ical_support.c


示例10: update_objects

static gboolean
update_objects (ECal *client, icalcomponent *icalcomp)
{
	icalcomponent_kind kind;
	icalcomponent *vcal;
	gboolean success = TRUE;

	kind = icalcomponent_isa (icalcomp);

	if (kind == ICAL_VTODO_COMPONENT || kind == ICAL_VEVENT_COMPONENT) {
		vcal = e_cal_util_new_top_level ();
		if (icalcomponent_get_method (icalcomp) == ICAL_METHOD_CANCEL)
			icalcomponent_set_method (vcal, ICAL_METHOD_CANCEL);
		else
			icalcomponent_set_method (vcal, ICAL_METHOD_PUBLISH);
		icalcomponent_add_component (vcal, icalcomponent_new_clone (icalcomp));
	} else if (kind == ICAL_VCALENDAR_COMPONENT) {
		vcal = icalcomponent_new_clone (icalcomp);
		if (!icalcomponent_get_first_property (vcal, ICAL_METHOD_PROPERTY))
			icalcomponent_set_method (vcal, ICAL_METHOD_PUBLISH);
	} else
		return FALSE;

	if (!e_cal_receive_objects (client, vcal, NULL))
		success = FALSE;

	icalcomponent_free (vcal);

	return success;
}
开发者ID:ebbywiselyn,项目名称:evolution,代码行数:30,代码来源:icsimporter.c


示例11: view_event

void view_event(icalcomponent* calendar)
{
  //Ask user if they want null fields in addition to filled ones
  bool show_null_fields_too = yes_no_prompt("Do you want to view empty fields? (y/n)");
    
  icalcomponent* event = find_event(calendar);
  
  if (event == NULL)
  {
    append_action_to_closed_log("View event", false);
  }
  
  //Once user selects desired one, displays all needed fields  
  icalproperty* p;
  for(p = icalcomponent_get_first_property(event,ICAL_ANY_PROPERTY); p != 0; p = icalcomponent_get_next_property(event,ICAL_ANY_PROPERTY))
  {
    if ((icalproperty_get_comment(p) != NULL) || (show_null_fields_too))
    {
      cout << icalproperty_get_x_name(p) << ": ";
      cout << icalproperty_get_comment(p) << endl;
    }
  }
  
  append_action_to_closed_log("View event", true);
}
开发者ID:reflores,项目名称:csept,代码行数:25,代码来源:event_actions.cpp


示例12: icaldirset_add_uid

static void icaldirset_add_uid(icalcomponent* comp)
{
    char uidstring[ICAL_PATH_MAX];
    icalproperty *uid;
#ifndef WIN32
    struct utsname unamebuf;
#endif

    icalerror_check_arg_rv( (comp!=0), "comp");

    uid = icalcomponent_get_first_property(comp,ICAL_UID_PROPERTY);
    
    if (uid == 0) {
	
#ifndef WIN32
	uname(&unamebuf);
	
	snprintf(uidstring,sizeof(uidstring),"%d-%s",(int)getpid(),unamebuf.nodename);
#else
	snprintf(uidstring,sizeof(uidstring),"%d-%s",(int)getpid(),"WINDOWS");  /* FIX: There must be an easy get the system name */
#endif
	
	uid = icalproperty_new_uid(uidstring);
	icalcomponent_add_property(comp,uid);
    } else {
	strcpy(uidstring,icalproperty_get_uid(uid));
    }
}
开发者ID:SecareLupus,项目名称:Drood,代码行数:28,代码来源:icaldirset.c


示例13: scalix_appointment_get

gboolean
scalix_appointment_get (ScalixAppointment * comp, const char *key, char **value)
{
    icalcomponent *icomp;
    icalproperty *icalprop;
    const char *x_val;

    icomp = e_cal_component_get_icalcomponent (E_CAL_COMPONENT (comp));
    icalprop = icalcomponent_get_first_property (icomp, ICAL_X_PROPERTY);

    while (icalprop) {
        const char *x_name;

        x_name = icalproperty_get_x_name (icalprop);
        x_val = icalproperty_get_x (icalprop);

        if (!strcmp (x_name, key)) {
            break;
        }

        icalprop = icalcomponent_get_next_property (icomp, ICAL_X_PROPERTY);
    }

    if (icalprop) {
        *value = g_strdup (x_val);
        return TRUE;
    }

    *value = NULL;

    return FALSE;
}
开发者ID:GNOME,项目名称:evolution-scalix,代码行数:32,代码来源:scalix-appointment.c


示例14: scalix_appointment_unset

void
scalix_appointment_unset (ScalixAppointment * comp, const char *key)
{
    icalcomponent *icomp;
    icalproperty *icalprop;
    const char *x_val;
    GSList *list, *iter;

    list = NULL;
    icomp = e_cal_component_get_icalcomponent (E_CAL_COMPONENT (comp));
    icalprop = icalcomponent_get_first_property (icomp, ICAL_X_PROPERTY);

    while (icalprop) {
        const char *x_name;

        x_name = icalproperty_get_x_name (icalprop);
        x_val = icalproperty_get_x (icalprop);

        if (!strcmp (x_name, key)) {
            list = g_slist_prepend (list, icalprop);
        }

        icalprop = icalcomponent_get_next_property (icomp, ICAL_X_PROPERTY);
    }

    for (iter = list; iter; iter = iter->next) {
        icalprop = iter->data;
        icalcomponent_remove_property (icomp, icalprop);
        icalproperty_free (icalprop);
    }

    return;
}
开发者ID:GNOME,项目名称:evolution-scalix,代码行数:33,代码来源:scalix-appointment.c


示例15: action_calendar_taskpad_open_url_cb

static void
action_calendar_taskpad_open_url_cb (GtkAction *action,
                                     ECalShellView *cal_shell_view)
{
	EShellView *shell_view;
	EShellWindow *shell_window;
	ECalShellContent *cal_shell_content;
	ECalModelComponent *comp_data;
	ETaskTable *task_table;
	icalproperty *prop;
	const gchar *uri;
	GSList *list;

	shell_view = E_SHELL_VIEW (cal_shell_view);
	shell_window = e_shell_view_get_shell_window (shell_view);

	cal_shell_content = cal_shell_view->priv->cal_shell_content;
	task_table = e_cal_shell_content_get_task_table (cal_shell_content);

	list = e_task_table_get_selected (task_table);
	g_return_if_fail (list != NULL);
	comp_data = list->data;

	/* XXX We only open the URI of the first selected task. */
	prop = icalcomponent_get_first_property (
		comp_data->icalcomp, ICAL_URL_PROPERTY);
	g_return_if_fail (prop != NULL);

	uri = icalproperty_get_url (prop);
	e_show_uri (GTK_WINDOW (shell_window), uri);
}
开发者ID:Oliver-Luo,项目名称:evolution,代码行数:31,代码来源:e-cal-shell-view-taskpad.c


示例16: cond_ICalHaveItem

int cond_ICalHaveItem(StrBuf *Target, WCTemplputParams *TP)
{
	icalcomponent *cal = (icalcomponent *) CTX(CTX_ICAL);
	icalproperty *p;
	icalproperty_kind Kind;

	Kind = (icalproperty_kind) GetTemplateTokenNumber(Target, TP, 2, ICAL_ANY_PROPERTY);
	p = icalcomponent_get_first_property(cal, Kind);
	if (p != NULL) {
		WCTemplputParams *DynamicTP;
	
		DynamicTP = (WCTemplputParams*) malloc(sizeof(WCTemplputParams));
		StackDynamicContext (TP, 
				     DynamicTP, 
				     p,
				     CTX_ICALPROPERTY,
				     0,
				     TP->Tokens,
				     ReleaseIcalSubCtx,
				     TP->Tokens->Params[1]->lvalue);

		return 1;
	}
	return 0;
}
开发者ID:mingodad,项目名称:citadel,代码行数:25,代码来源:ical_subst.c


示例17: get_time_from_property

static time_t
get_time_from_property (icalcomponent         *ical,
                        icalproperty_kind      prop_kind,
                        struct icaltimetype (* get_prop_func) (const icalproperty *prop),
                        icaltimezone          *default_zone)
{
  icalproperty        *prop;
  struct icaltimetype  ical_time;
  icalparameter       *param;
  icaltimezone        *timezone = NULL;

  prop = icalcomponent_get_first_property (ical, prop_kind);
  if (!prop)
    return 0;

  ical_time = get_prop_func (prop);

  param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER);
  if (param)
    timezone = icaltimezone_get_builtin_timezone_from_tzid (icalparameter_get_tzid (param));
  else if (icaltime_is_utc (ical_time))
    timezone = icaltimezone_get_utc_timezone ();
  else
    timezone = default_zone;

  return icaltime_as_timet_with_zone (ical_time, timezone);
}
开发者ID:Devyani-Divs,项目名称:gnome-shell,代码行数:27,代码来源:gnome-shell-calendar-server.c


示例18: get_ical_is_all_day

static gboolean
get_ical_is_all_day (icalcomponent *ical,
                     time_t         start_time,
                     icaltimezone  *default_zone)
{
  icalproperty            *prop;
  struct tm               *start_tm;
  time_t                   end_time;
  struct icaldurationtype  duration;
  struct icaltimetype      start_icaltime;

  start_icaltime = icalcomponent_get_dtstart (ical);
  if (start_icaltime.is_date)
    return TRUE;

  start_tm = gmtime (&start_time);
  if (start_tm->tm_sec  != 0 ||
      start_tm->tm_min  != 0 ||
      start_tm->tm_hour != 0)
    return FALSE;

  if ((end_time = get_ical_end_time (ical, default_zone)))
    return (end_time - start_time) % 86400 == 0;

  prop = icalcomponent_get_first_property (ical, ICAL_DURATION_PROPERTY);
  if (!prop)
    return FALSE;

  duration = icalproperty_get_duration (prop);

  return icaldurationtype_as_int (duration) % 86400 == 0;
}
开发者ID:Devyani-Divs,项目名称:gnome-shell,代码行数:32,代码来源:gnome-shell-calendar-server.c


示例19: gn_ical2todo_real

/* read the entry identified by id from the vcal file f and write it to the phone */
static int gn_ical2todo_real(icalcomponent *comp, gn_todo *ctodo, int id)
{
	icalcomponent *compresult = NULL;

	if (id < 1)
		id = 1;

	/* iterate through the component */
	iterate_cal(comp, 0, &id, &compresult, ICAL_VTODO_COMPONENT);

	if (!compresult) {
		dprintf("No component found.\n");
		return GN_ERR_EMPTYLOCATION;
	} else {
		icalproperty *priority = icalcomponent_get_first_property(compresult, ICAL_PRIORITY_PROPERTY);

		/* summary goes into text */
		/* TODO: UTF8 --> ascii */
		snprintf(ctodo->text, GN_TODO_MAX_LENGTH-1, "%s", icalcomponent_get_summary(compresult));

		/* priority */
		ctodo->priority = icalproperty_get_priority((const icalproperty *)priority);

		dprintf("Component found\n%s\n", icalcomponent_as_ical_string(compresult));
	}
	icalcomponent_free(compresult);

	return GN_ERR_NONE;
}
开发者ID:ihipop,项目名称:I-GNOKII,代码行数:30,代码来源:vcal.c


示例20: icalparser_new

void MainWindow::loadFromIcsFile()
{
    char* line;
    icalcomponent *c;
    icalparser *parser = icalparser_new();

    FILE* stream = fopen("/home/quentin/Public/test.ics", "r");

    icalparser_set_gen_data(parser, stream);

    do
    {
        line = icalparser_get_line(parser, read_stream);
        c = icalparser_add_line(parser, line);

        if (c != 0)
        {
            icalcomponent *inner = icalcomponent_get_first_component(c, ICAL_ANY_COMPONENT);
            while (inner != NULL)
            {
                if (icalcomponent_isa(inner) == ICAL_VTODO_COMPONENT)
                {
                    const char* name   = icalcomponent_get_summary(inner);
                    const char* uid    = icalcomponent_get_uid(inner);
                    icalproperty *p    = icalcomponent_get_first_property(inner, ICAL_RELATEDTO_PROPERTY);
                    const char* parent = icalproperty_get_relatedto(p);
                    addTask(name, uid, parent);
                }
                if (icalcomponent_isa(inner) == ICAL_VEVENT_COMPONENT)
                {
                    const char* name   = icalcomponent_get_summary(inner);
                    const char* uid    = icalcomponent_get_uid(inner);
                    icalproperty *p    = icalcomponent_get_first_property(inner, ICAL_RELATEDTO_PROPERTY);
                    const char* parent = icalproperty_get_relatedto(p);
                    p                  = icalcomponent_get_first_property(inner, ICAL_DTSTART_PROPERTY);
                    icaltimetype start = icalproperty_get_dtstart(p);
                    p                  = icalcomponent_get_first_property(inner, ICAL_DTEND_PROPERTY);
                    icaltimetype end   = icalproperty_get_dtend(p);
                    Task* task         = findTask(parent);
                    addEvent(task, uid, name, start, end);
                }
                inner = icalcomponent_get_next_component(c, ICAL_ANY_COMPONENT);
            }
        }

    } while (line != 0);
}
开发者ID:pyridiss,项目名称:Sablier,代码行数:47,代码来源:mainwindow.cpp



注:本文中的icalcomponent_get_first_property函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ icalerror_set_errno函数代码示例发布时间:2022-05-30
下一篇:
C++ icalcomponent_free函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap