1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 /* Copyright (C) 2002-2004 Novell, Inc.
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of version 2 of the GNU Lesser General Public
7 * License as published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
20 /* ExchangeHierarchyGAL: class for the Global Address List hierarchy
21 * of an Exchange storage. (Currently the "hierarchy" only contains
22 * a single folder, but see bugzilla #21029.)
29 #include "exchange-hierarchy-gal.h"
30 #include "exchange-account.h"
31 #include "e-folder-exchange.h"
32 #include "exchange-esource.h"
34 #include <libedataserver/e-source-list.h>
36 #define PARENT_TYPE EXCHANGE_TYPE_HIERARCHY
38 E2K_MAKE_TYPE (exchange_hierarchy_gal, ExchangeHierarchyGAL, NULL, NULL, PARENT_TYPE)
42 exchange_hierarchy_gal_new (ExchangeAccount *account,
43 const char *hierarchy_name,
44 const char *physical_uri_prefix)
46 ExchangeHierarchy *hier;
49 g_return_val_if_fail (EXCHANGE_IS_ACCOUNT (account), NULL);
50 g_return_val_if_fail (hierarchy_name != NULL, NULL);
51 g_return_val_if_fail (physical_uri_prefix != NULL, NULL);
53 hier = g_object_new (EXCHANGE_TYPE_HIERARCHY_GAL, NULL);
55 toplevel = e_folder_exchange_new (hier, hierarchy_name,
56 "contacts/ldap", NULL,
59 exchange_hierarchy_construct (hier, account,
60 EXCHANGE_HIERARCHY_GAL, toplevel,
63 add_folder_esource (hier->account, EXCHANGE_CONTACTS_FOLDER,
64 hierarchy_name, physical_uri_prefix);
66 g_object_unref (toplevel);