3
// GNOME Do is the legal property of its developers, whose names are too
4
// numerous to list here. Please refer to the COPYRIGHT file distributed with
5
// this source distribution.
7
// This program is free software: you can redistribute it and/or modify
8
// it under the terms of the GNU General Public License as published by
9
// the Free Software Foundation, either version 3 of the License, or
10
// (at your option) any later version.
12
// This program is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
// You should have received a copy of the GNU General Public License
18
// along with this program. If not, see <http://www.gnu.org/licenses/>.
21
using System.Collections;
22
using System.Collections.Generic;
28
public class NotesItemSource : IItemSource
33
/// When creating an instance of this item source get the initial
34
/// list of tomboy notes
36
public NotesItemSource ()
38
notes = new List<IItem> ();
42
/// This name is used during startup to descript the name
43
/// of this item source parser
45
/// <param name="item">
46
/// A <see cref="IItem"/>
49
/// A <see cref="ICollection`1"/>
53
return "Tomboy Note Indexer";
57
public string Description {
59
return "Loads up tomboy notes for searching";
69
public Type[] SupportedItemTypes {
78
/// The Items in this case is the list of notes we've loaded
80
/// <param name="item">
81
/// A <see cref="IItem"/>
84
/// A <see cref="ICollection`1"/>
86
public ICollection<IItem> Items {
90
public ICollection<IItem> ChildrenOfItem (IItem item)
96
/// This method run in the constructor to find the notes we can get
99
public void UpdateItems ()
101
TomboyDBus tb = new TomboyDBus();
102
foreach(string title in tb.GetAllNoteTitles ()) {
103
notes.Add (new NoteItem (title));