1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * deepzoomimagetilesource.h
6 * Moonlight List (moonlight-list@lists.ximian.com)
8 * Copyright 2007-2009 Novell, Inc. (http://www.novell.com)
10 * See the LICENSE file included with the distribution for details.
14 #ifndef __DEEPZOOMIMAGETILESOURCE_H__
15 #define __DEEPZOOMIMAGETILESOURCE_H__
18 #include "multiscalesubimage.h"
19 #include "multiscaleimage.h"
20 #include "tilesource.h"
21 #include "downloader.h"
24 typedef void (*msi_cb
) (MultiScaleImage
*msi
);
26 /* @Version=2,Namespace=System.Windows.Media */
27 class DeepZoomImageTileSource
: public MultiScaleTileSource
{
29 msi_cb parsed_callback
;
30 msi_cb failed_callback
;
31 msi_cb sourcechanged_callback
;
32 MultiScaleImage
*cb_userdata
;
43 void UriSourceChanged ();
48 Cancellable
*get_resource_aborter
;
51 virtual ~DeepZoomImageTileSource ();
55 bool IsCollection () { return isCollection
;}
56 int GetMaxLevel () { return maxLevel
;}
58 /* @GenerateCBinding,GeneratePInvoke */
59 DeepZoomImageTileSource ();
60 DeepZoomImageTileSource (Uri
*uri
, bool nested
= false);
63 void DownloaderComplete ();
64 void DownloaderFailed ();
65 bool GetTileLayer (int level
, int x
, int y
, Uri
*uri
);
66 bool IsDownloaded () {return downloaded
; }
67 bool IsParsed () {return parsed
; }
69 virtual void OnPropertyChanged (PropertyChangedEventArgs
*args
, MoonError
*error
);
71 void XmlWrite (char* buffer
, gint32 offset
, gint32 n
);
73 void set_callbacks (msi_cb parsed
, msi_cb failed
, msi_cb source_changed
, MultiScaleImage
*userdata
)
75 parsed_callback
= parsed
;
76 failed_callback
= failed
;
77 sourcechanged_callback
= source_changed
;
78 cb_userdata
= userdata
;
85 /* @PropertyType=Uri,GenerateAccessors */
86 const static int UriSourceProperty
;
88 void SetUriSource (Uri
* value
);
91 void EndElement (void *info
, const char* el
);
94 #endif /* __DEEPZOOMIMAGETILESOURCE_H__ */