Added About Dialog
[demorecorder] / src / Tagging.vala
1 /*  Demo Recorder for MAEMO 5
2 *   Copyright (C) 2010 Dru Moore <usr@dru-id.co.uk>
3 *   This program is free software; you can redistribute it and/or modify
4 *   it under the terms of the GNU General Public License version 2,
5 *   or (at your option) any later version, as published by the Free
6 *   Software Foundation
7 *
8 *   This program is distributed in the hope that it will be useful,
9 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
10 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 *   GNU General Public License for more details
12 *
13 *   You should have received a copy of the GNU General Public
14 *   License along with this program; if not, write to the
15 *   Free Software Foundation, Inc.,
16 *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 */
18 namespace IdWorks {
19
20   namespace Tagging {
21   
22     public struct Tag {
23       string tag;
24       GLib.Value value;
25       public string to_xml_string() {
26         return ("<Tag>\n" +
27                 "<tag type=\"%s\">%s</tag>\n" +
28                 "<value type=\"Value\">%s</value>\n" +
29                 "</Tag>\n").printf(
30                   value.type_name(), tag
31                   , value.strdup_contents()
32                 );
33       }
34       public void from_xml_node(Xml.Node* node) {
35         // Tag is root
36       }
37       public void from_xml_node_helper(Xml.Node* node) {
38         // Tag is below root
39       }
40       public static string taglist_to_xml_string(List<Tag?> taglist) {
41         string ret = "<TagList>\n";
42         for (int idx = 0; idx < taglist.length(); ++idx) {
43           ret += ((Tagging.Tag)taglist.nth_data(idx)).to_xml_string();
44         }
45         return ret + "</TagList>\n";
46       }
47       public static void taglist_from_xml_node_helper(Xml.Node* node, ref unowned List<Tag?> taglist) {
48       }
49       
50       public static void taglist_from_xml_node(Xml.Node* node, ref unowned List<Tag?> taglist) {
51       }
52     }
53   
54   }
55
56 }