1
// PidginAccountItemSource.cs
3
// Copyright (C) 2008 [name of author]
5
// This program is free software: you can redistribute it and/or modify
6
// it under the terms of the GNU General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
10
// This program is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
// GNU General Public License for more details.
15
// You should have received a copy of the GNU General Public License
16
// along with this program. If not, see <http://www.gnu.org/licenses/>.
20
using System.Collections.Generic;
24
namespace Do.Addins.Pidgin
26
public class PidginAccountItemSource : IItemSource
29
public PidginAccountItemSource ()
31
items = new List<IItem> ();
35
public string Name { get { return "Pidgin Accounts"; } }
36
public string Description { get { return "Available Pidgin IM Accounts"; } }
37
public string Icon { get { return "pidgin"; } }
39
public Type [] SupportedItemTypes {
42
typeof (PidginAccountItem),
47
public ICollection<IItem> Items {
51
public ICollection<IItem> ChildrenOfItem (IItem item)
56
public void UpdateItems ()
58
Pidgin.IPurpleObject prpl;
59
prpl = Pidgin.GetPurpleObject ();
64
foreach (int account in prpl.PurpleAccountsGetAll ()) {
65
proto = prpl.PurpleAccountGetProtocolName (account);
66
name = prpl.PurpleAccountGetUsername (account);
67
items.Add (new PidginAccountItem (name, proto, account));