~ubuntu-branches/ubuntu/jaunty/gnome-do-plugins/jaunty-proposed

« back to all changes in this revision

Viewing changes to BundledLibraries/libgoogle-data-mono-1.4.0.2/src/core/atomlink.cs

  • Committer: Bazaar Package Importer
  • Author(s): Iain Lane, Daniel T Chen, Iain Lane
  • Date: 2009-03-18 00:40:51 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20090318004051-ujn1ja3kiu3ky7ru
Tags: 0.8.1.3+dfsg-0ubuntu1
[ Daniel T Chen ]
* New upstream release (LP: #344578)
  + Banshee plugin goes crazy if banshee isn't loaded first
    (LP: #289802)
  + gnome-do gCalculate plugin fails to display "times" symbol
    (LP: #274252)
  + Banshee-1 fails to build in Mono 2.0 (LP: #309188)
  + Pidgin 2.5.4 has incompatible dbus interface. s/uint/int/
    (LP: #314927)
  + Pidgin plugin hangs opening a chat if pidgin is unresponsive
    (LP: #315565)
  + twitter plugin still reports friend updates even when
    deactivated (LP: #317674)
  + Misspelling in microblogging plugin confirmation message
    (LP: #319433)
  + make install uses mdtool, but configure doesn't check for it
    (LP: #322951)
  + Virtualbox Icon in 2.10 are broken because of a new
    specification (LP: #323902)
  + Google Maps Plugin shouldn't always use route (LP: #324271)
  + Fix for Google Maps when using newlines and other special
    characters (LP: #324667)
  + VirtualBox failed to load icon (LP: #325712)
  + 'Read Man Pages' plugin makes Gnome-Do unresponsive
    (LP: #325935)
  + Search returns broken URLs (LP: #327855)
  + Default action for SSH hosts is "open" (LP: #328236)
  + Files and Folders Configuration doesn't use standard buttons
    (LP: #328236)
  + Window manager maximize action should focus if window is not
    currently focused (LP: #258893)
  + Locate plugin has no error message (LP: #262360)
  + Wishlist: Let user specify files and folders to ignore
    (LP: #263177)
  + ts-client plugin doesn't index subdirectories (LP: #322352)
  + Max 3000 items in Files and Folders plugin (LP: #324105)
  + putty cannot find host when running from gnome do
    (LP: #324282)
  + locate plugin with globbing (LP: #334798)
  + Twitter plugin encountered an error in UpdateFriends
    (LP: #317575)
  + gnome-terminal profiles no longer work (LP: #321977)
  + Creating a task using Remember the Milk plugin can fail if
    no task list is specified (LP: #324066)
  + bundled libraries makefile needs destdir (LP: #324704)
  + Typographical error in del.icio.us plugin (LP: #330525)
  + ImageShack fails to upload (LP: #337324)
* debian/copyright
  + Refresh for new upstream version; new plugins added.
* debian/patches/00_dfsg_autofoo.dpatch
  + Update for new upstream version
  + Don't build the YouTube plugin due to removal of shipped
    exes and dlls causing FTBFS
* debian/patches/02_ssh_respect_exec_arg.dpatch
  debian/patches/03_buildsystem_respect_mcs.dpatch
  debian/patches/04_fix_pidgin_dbus_ints.dpatch
  + Drop; fixed upstream

[ Iain Lane ]
* debian/rules: Update repackaging to not delete *.dll; upstream now ships
  source copies of google-gdata meaning we can now enable the Google and
  Youtube plugins.
* debian/patches/00_dfsg_autofoo: Drop, fixed by including and building
  these libs now. 
* debian/copyright: Update with information for google-gdata. 
* debian/patches/04_fix_pidgin_dbus_ints.dpatch: Add left out piece of patch
* debian/control: Bump gnome-do build-dep to require current version. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* Copyright (c) 2006 Google Inc.
 
2
 *
 
3
 * Licensed under the Apache License, Version 2.0 (the "License");
 
4
 * you may not use this file except in compliance with the License.
 
5
 * You may obtain a copy of the License at
 
6
 *
 
7
 *     http://www.apache.org/licenses/LICENSE-2.0
 
8
 *
 
9
 * Unless required by applicable law or agreed to in writing, software
 
10
 * distributed under the License is distributed on an "AS IS" BASIS,
 
11
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 
12
 * See the License for the specific language governing permissions and
 
13
 * limitations under the License.
 
14
*/
 
15
#region Using directives
 
16
 
 
17
#define USE_TRACING
 
18
 
 
19
using System;
 
20
using System.Xml;
 
21
using System.Globalization;
 
22
 
 
23
#endregion
 
24
 
 
25
//////////////////////////////////////////////////////////////////////
 
26
// <summary>Contains AtomLink, an object to represent the atom:link
 
27
// element.</summary> 
 
28
//////////////////////////////////////////////////////////////////////
 
29
namespace Google.GData.Client
 
30
{
 
31
 
 
32
    //////////////////////////////////////////////////////////////////////
 
33
    /// <summary>AtomLink represents an atom:link element
 
34
    /// atomLink = element atom:link {
 
35
    ///    atomCommonAttributes,
 
36
    ///    attribute href { atomUri },
 
37
    ///    attribute rel { atomNCName | atomUri }?,
 
38
    ///    attribute type { atomMediaType }?,
 
39
    ///    attribute hreflang { atomLanguageTag }?,
 
40
    ///    attribute title { text }?,
 
41
    ///    attribute length { text }?,
 
42
    ///    empty
 
43
    /// </summary> 
 
44
    //////////////////////////////////////////////////////////////////////
 
45
    public class AtomLink : AtomBase
 
46
    {
 
47
        /// <summary>property holder exposed over get/set</summary> 
 
48
        private AtomUri href;
 
49
        /// <summary>property holder exposed over get/set</summary> 
 
50
        private string rel;
 
51
        /// <summary>property holder exposed over get/set</summary> 
 
52
        private string type;
 
53
        /// <summary>property holder exposed over get/set</summary> 
 
54
        private string hreflang;
 
55
        /// <summary>property holder exposed over get/set</summary> 
 
56
        private string title;
 
57
        /// <summary>property holder exposed over get/set</summary> 
 
58
        private int length;
 
59
 
 
60
 
 
61
        /// <summary>HTML Link Type</summary> 
 
62
        public const string HTML_TYPE = "text/html";
 
63
 
 
64
        /// <summary>ATOM Link Type</summary>
 
65
        public const string ATOM_TYPE = "application/atom+xml";
 
66
 
 
67
        //////////////////////////////////////////////////////////////////////
 
68
        /// <summary>default empty constructor</summary> 
 
69
        //////////////////////////////////////////////////////////////////////
 
70
        public AtomLink()
 
71
        {
 
72
        }
 
73
        /////////////////////////////////////////////////////////////////////////////
 
74
 
 
75
 
 
76
        //////////////////////////////////////////////////////////////////////
 
77
        /// <summary>public AtomLink(string uri)</summary> 
 
78
        /// <param name="link">the uri for the link </param>
 
79
        //////////////////////////////////////////////////////////////////////
 
80
        public AtomLink(string link)
 
81
        {
 
82
            this.HRef = new AtomUri(link);
 
83
        }
 
84
        /// <summary>
 
85
        /// constructor used in atomfeed to create new links
 
86
        /// </summary>
 
87
        /// <param name="type">the type of link to create</param>
 
88
        /// <param name="rel">the rel value</param>
 
89
        public AtomLink(string type, string rel) 
 
90
        {
 
91
            this.Type = type;
 
92
            this.Rel = rel;
 
93
        }
 
94
 
 
95
        //////////////////////////////////////////////////////////////////////
 
96
        /// <summary>accessor method public Uri HRef</summary> 
 
97
        /// <returns> </returns>
 
98
        //////////////////////////////////////////////////////////////////////
 
99
        public AtomUri HRef
 
100
        {
 
101
            get {return this.href;}
 
102
            set {this.Dirty = true;  this.href = value;}
 
103
        }
 
104
        /////////////////////////////////////////////////////////////////////////////
 
105
 
 
106
        //////////////////////////////////////////////////////////////////////
 
107
        /// <summary>public string AbsoluteUri</summary> 
 
108
        //////////////////////////////////////////////////////////////////////
 
109
        public string AbsoluteUri
 
110
        {
 
111
            get
 
112
            {
 
113
                if (this.HRef != null)
 
114
                    return GetAbsoluteUri(this.HRef.ToString());
 
115
                return null;
 
116
            }
 
117
        }
 
118
        /////////////////////////////////////////////////////////////////////////////
 
119
 
 
120
 
 
121
 
 
122
        //////////////////////////////////////////////////////////////////////
 
123
        /// <summary>accessor method public string Rel</summary> 
 
124
        /// <returns> </returns>
 
125
        //////////////////////////////////////////////////////////////////////
 
126
        public string Rel
 
127
        {
 
128
            get {return this.rel;}
 
129
            set {this.Dirty = true;  this.rel = value;}
 
130
        }
 
131
        /////////////////////////////////////////////////////////////////////////////
 
132
 
 
133
        //////////////////////////////////////////////////////////////////////
 
134
        /// <summary>accessor method public string Type</summary> 
 
135
        /// <returns> </returns>
 
136
        //////////////////////////////////////////////////////////////////////
 
137
        public string Type
 
138
        {
 
139
            get {return this.type;}
 
140
            set {this.Dirty = true;  this.type = value;}
 
141
        }
 
142
        /////////////////////////////////////////////////////////////////////////////
 
143
 
 
144
        //////////////////////////////////////////////////////////////////////
 
145
        /// <summary>accessor method public string HrefLang</summary> 
 
146
        /// <returns> </returns>
 
147
        //////////////////////////////////////////////////////////////////////
 
148
        public string HRefLang
 
149
        {
 
150
            get {return this.hreflang;}
 
151
            set {this.Dirty = true;  this.hreflang = value;}
 
152
        }
 
153
        /////////////////////////////////////////////////////////////////////////////
 
154
 
 
155
 
 
156
        //////////////////////////////////////////////////////////////////////
 
157
        /// <summary>accessor method public int Lenght</summary> 
 
158
        /// <returns> </returns>
 
159
        //////////////////////////////////////////////////////////////////////
 
160
        public int Length
 
161
        {
 
162
            get {return this.length;}
 
163
            set {this.Dirty = true;  this.length = value;}
 
164
        }
 
165
        /////////////////////////////////////////////////////////////////////////////
 
166
 
 
167
        //////////////////////////////////////////////////////////////////////
 
168
        /// <summary>accessor method public string Title</summary> 
 
169
        /// <returns> </returns>
 
170
        //////////////////////////////////////////////////////////////////////
 
171
        public string Title
 
172
        {
 
173
            get {return this.title;}
 
174
            set {this.Dirty = true;  this.title = value;}
 
175
        }
 
176
        /////////////////////////////////////////////////////////////////////////////
 
177
 
 
178
 
 
179
        #region Persistence overloads
 
180
        //////////////////////////////////////////////////////////////////////
 
181
        /// <summary>Returns the constant representing this XML element.</summary> 
 
182
        //////////////////////////////////////////////////////////////////////
 
183
        public override string XmlName 
 
184
        {
 
185
            get { return AtomParserNameTable.XmlLinkElement; }
 
186
        }
 
187
        /////////////////////////////////////////////////////////////////////////////
 
188
 
 
189
 
 
190
        //////////////////////////////////////////////////////////////////////
 
191
        /// <summary>overridden to save attributes for this(XmlWriter writer)</summary> 
 
192
        /// <param name="writer">the xmlwriter to save into </param>
 
193
        //////////////////////////////////////////////////////////////////////
 
194
        protected override void SaveXmlAttributes(XmlWriter writer)
 
195
        {
 
196
            WriteEncodedAttributeString(writer, AtomParserNameTable.XmlAttributeHRef, this.HRef);
 
197
            WriteEncodedAttributeString(writer, AtomParserNameTable.XmlAttributeHRefLang, this.HRefLang);
 
198
            WriteEncodedAttributeString(writer, AtomParserNameTable.XmlAttributeRel, this.Rel);
 
199
            WriteEncodedAttributeString(writer, AtomParserNameTable.XmlAttributeType, this.Type);
 
200
            
 
201
                        if (this.length > 0)
 
202
            {
 
203
                WriteEncodedAttributeString(writer, AtomParserNameTable.XmlAttributeLength, this.Length.ToString(CultureInfo.InvariantCulture));
 
204
            }
 
205
            WriteEncodedAttributeString(writer, AtomParserNameTable.XmlTitleElement, this.Title);
 
206
                        base.SaveXmlAttributes(writer);
 
207
 
 
208
        }
 
209
        /////////////////////////////////////////////////////////////////////////////
 
210
 
 
211
 
 
212
        //////////////////////////////////////////////////////////////////////
 
213
        /// <summary>figures out if this object should be persisted</summary> 
 
214
        /// <returns> true, if it's worth saving</returns>
 
215
        //////////////////////////////////////////////////////////////////////
 
216
        public override bool ShouldBePersisted()
 
217
        {
 
218
            if (base.ShouldBePersisted() == true)
 
219
            {
 
220
                return true;
 
221
            }
 
222
            if (Utilities.IsPersistable(this.href))
 
223
            {
 
224
                return true;
 
225
            }
 
226
            if (Utilities.IsPersistable(this.hreflang))
 
227
            {
 
228
                return true;
 
229
            }
 
230
            if (Utilities.IsPersistable(this.rel))
 
231
            {
 
232
                return true;
 
233
            }
 
234
            if (Utilities.IsPersistable(this.type))
 
235
            {
 
236
                return true;
 
237
            }
 
238
            if (Utilities.IsPersistable(this.Length))
 
239
            {
 
240
                return true;
 
241
            }
 
242
 
 
243
            if (Utilities.IsPersistable(this.title))
 
244
            {
 
245
                return true;
 
246
            }
 
247
            return false;
 
248
        }
 
249
        /////////////////////////////////////////////////////////////////////////////
 
250
 
 
251
 
 
252
        #endregion
 
253
 
 
254
 
 
255
 
 
256
 
 
257
    }
 
258
    /////////////////////////////////////////////////////////////////////////////
 
259
 
 
260
} /////////////////////////////////////////////////////////////////////////////
 
261