summaryrefslogtreecommitdiff
path: root/winrt/mupdf_cpp/RectList.h
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2013-05-16 19:26:27 +0100
committerRobin Watts <robin.watts@artifex.com>2013-05-16 19:26:27 +0100
commit0451cf6d814f172f6370b46553865c66d0933c14 (patch)
tree9a571ef5495c955b6de7bc2f3e29124163100e56 /winrt/mupdf_cpp/RectList.h
parent5157d7cac960316e76ac408d1f6ec1d24867bdb7 (diff)
parent4a7e2298fff3a1972fda5c537a8c5e7c6d8f8292 (diff)
downloadmupdf-0451cf6d814f172f6370b46553865c66d0933c14.tar.xz
Merge branch 'winRT2'
Diffstat (limited to 'winrt/mupdf_cpp/RectList.h')
-rw-r--r--winrt/mupdf_cpp/RectList.h153
1 files changed, 153 insertions, 0 deletions
diff --git a/winrt/mupdf_cpp/RectList.h b/winrt/mupdf_cpp/RectList.h
new file mode 100644
index 00000000..5d802327
--- /dev/null
+++ b/winrt/mupdf_cpp/RectList.h
@@ -0,0 +1,153 @@
+#pragma once
+
+/* WinRT RectList class for binding a collection of rects to the xaml ui */
+using namespace Windows::UI::Xaml::Media::Imaging;
+using namespace Windows::UI::Xaml::Controls;
+using namespace Platform; /* For String */
+
+namespace mupdf_cpp
+{
+ [Windows::UI::Xaml::Data::Bindable] // in c++, adding this attribute to ref classes enables data binding for more info search for 'Bindable' on the page http://go.microsoft.com/fwlink/?LinkId=254639
+
+ public ref class RectList sealed
+ {
+ private:
+ int height;
+ int width;
+ int x;
+ int y;
+ String^ color;
+ /* These are used to store the link infomation */
+ int type;
+ int pagenum;
+ Windows::Foundation::Uri ^uri;
+ String^ index; // For identify which rectangle was tapped
+ public:
+ RectList(void);
+
+ property String^ Index
+ {
+ String^ get()
+ {
+ return ((String^) index);
+ }
+
+ void set(String^ value)
+ {
+ index = value;
+ }
+ }
+
+ property String^ Color
+ {
+ String^ get()
+ {
+ return (color);
+ }
+
+ void set(String^ value)
+ {
+ color = value;
+ }
+ }
+
+ property int Height
+ {
+ int get()
+ {
+ return ((int) height);
+ }
+
+ void set(int value)
+ {
+ if (value < 0)
+ {
+ throw ref new Platform::InvalidArgumentException();
+ }
+ height = value;
+ }
+ }
+
+ property int Width
+ {
+ int get()
+ {
+ return width;
+ }
+
+ void set(int value)
+ {
+ if (value < 0)
+ {
+ throw ref new Platform::InvalidArgumentException();
+ }
+ width = value;
+ }
+ }
+
+ property int X
+ {
+ int get()
+ {
+ return x;
+ }
+
+ void set(int value)
+ {
+ x = value;
+ }
+ }
+
+ property int Y
+ {
+ int get()
+ {
+ return y;
+ }
+
+ void set(int value)
+ {
+ y = value;
+ }
+ }
+
+ property int Type
+ {
+ int get()
+ {
+ return type;
+ }
+
+ void set(int value)
+ {
+ type = value;
+ }
+ }
+
+ property int PageNum
+ {
+ int get()
+ {
+ return pagenum;
+ }
+
+ void set(int value)
+ {
+ pagenum = value;
+ }
+ }
+
+ property Windows::Foundation::Uri^ Urilink
+ {
+ Windows::Foundation::Uri^ get()
+ {
+ return uri;
+ }
+
+ void set(Windows::Foundation::Uri^ value)
+ {
+ uri = value;
+ }
+ }
+ };
+}