]>
git.saurik.com Git - wxWidgets.git/blob - wxPython/wx/lib/pdfwin.py
1 #----------------------------------------------------------------------
3 # Purpose: A class that allows the use of the Acrobat PSF reader
8 # Created: 22-March-2004
10 # Copyright: (c) 2004 by Total Control Software
11 # Licence: wxWindows license
12 #----------------------------------------------------------------------
13 # This module was generated by the wx.activex.GernerateAXModule class
14 # (See also the genaxmodule script.)
19 clsID
= '{CA8A9780-280D-11CF-A24D-444553540000}'
20 progID
= 'AcroPDF.PDF.1'
24 # Create eventTypes and event binders
25 wxEVT_Error
= wx
.activex
.RegisterActiveXEvent('OnError')
26 wxEVT_Message
= wx
.activex
.RegisterActiveXEvent('OnMessage')
28 EVT_Error
= wx
.PyEventBinder(wxEVT_Error
, 1)
29 EVT_Message
= wx
.PyEventBinder(wxEVT_Message
, 1)
32 # Derive a new class from ActiveXWindow
33 class PDFWindow(wx
.activex
.ActiveXWindow
):
34 def __init__(self
, parent
, ID
=-1, pos
=wx
.DefaultPosition
,
35 size
=wx
.DefaultSize
, style
=0, name
='PDFWindow'):
36 wx
.activex
.ActiveXWindow
.__init
__(self
, parent
,
37 wx
.activex
.CLSID('{CA8A9780-280D-11CF-A24D-444553540000}'),
38 ID
, pos
, size
, style
, name
)
40 # Methods exported by the ActiveX object
41 def QueryInterface(self
, riid
):
42 return self
.CallAXMethod('QueryInterface', riid
)
45 return self
.CallAXMethod('AddRef')
48 return self
.CallAXMethod('Release')
50 def GetTypeInfoCount(self
):
51 return self
.CallAXMethod('GetTypeInfoCount')
53 def GetTypeInfo(self
, itinfo
, lcid
):
54 return self
.CallAXMethod('GetTypeInfo', itinfo
, lcid
)
56 def GetIDsOfNames(self
, riid
, rgszNames
, cNames
, lcid
):
57 return self
.CallAXMethod('GetIDsOfNames', riid
, rgszNames
, cNames
, lcid
)
59 def Invoke(self
, dispidMember
, riid
, lcid
, wFlags
, pdispparams
):
60 return self
.CallAXMethod('Invoke', dispidMember
, riid
, lcid
, wFlags
, pdispparams
)
62 def LoadFile(self
, fileName
):
63 return self
.CallAXMethod('LoadFile', fileName
)
65 def setShowToolbar(self
, On
):
66 return self
.CallAXMethod('setShowToolbar', On
)
68 def gotoFirstPage(self
):
69 return self
.CallAXMethod('gotoFirstPage')
71 def gotoLastPage(self
):
72 return self
.CallAXMethod('gotoLastPage')
74 def gotoNextPage(self
):
75 return self
.CallAXMethod('gotoNextPage')
77 def gotoPreviousPage(self
):
78 return self
.CallAXMethod('gotoPreviousPage')
80 def setCurrentPage(self
, n
):
81 return self
.CallAXMethod('setCurrentPage', n
)
83 def goForwardStack(self
):
84 return self
.CallAXMethod('goForwardStack')
86 def goBackwardStack(self
):
87 return self
.CallAXMethod('goBackwardStack')
89 def setPageMode(self
, pageMode
):
90 return self
.CallAXMethod('setPageMode', pageMode
)
92 def setLayoutMode(self
, layoutMode
):
93 return self
.CallAXMethod('setLayoutMode', layoutMode
)
95 def setNamedDest(self
, namedDest
):
96 return self
.CallAXMethod('setNamedDest', namedDest
)
99 return self
.CallAXMethod('Print')
101 def printWithDialog(self
):
102 return self
.CallAXMethod('printWithDialog')
104 def setZoom(self
, percent
):
105 return self
.CallAXMethod('setZoom', percent
)
107 def setZoomScroll(self
, percent
, left
, top
):
108 return self
.CallAXMethod('setZoomScroll', percent
, left
, top
)
110 def setView(self
, viewMode
):
111 return self
.CallAXMethod('setView', viewMode
)
113 def setViewScroll(self
, viewMode
, offset
):
114 return self
.CallAXMethod('setViewScroll', viewMode
, offset
)
116 def setViewRect(self
, left
, top
, width
, height
):
117 return self
.CallAXMethod('setViewRect', left
, top
, width
, height
)
119 def printPages(self
, from_
, to
):
120 return self
.CallAXMethod('printPages', from_
, to
)
122 def printPagesFit(self
, from_
, to
, shrinkToFit
):
123 return self
.CallAXMethod('printPagesFit', from_
, to
, shrinkToFit
)
126 return self
.CallAXMethod('printAll')
128 def printAllFit(self
, shrinkToFit
):
129 return self
.CallAXMethod('printAllFit', shrinkToFit
)
131 def setShowScrollbars(self
, On
):
132 return self
.CallAXMethod('setShowScrollbars', On
)
134 def GetVersions(self
):
135 return self
.CallAXMethod('GetVersions')
137 def setCurrentHightlight(self
, a
, b
, c
, d
):
138 return self
.CallAXMethod('setCurrentHightlight', a
, b
, c
, d
)
140 def setCurrentHighlight(self
, a
, b
, c
, d
):
141 return self
.CallAXMethod('setCurrentHighlight', a
, b
, c
, d
)
143 def postMessage(self
, strArray
):
144 return self
.CallAXMethod('postMessage', strArray
)
146 # Getters, Setters and properties
148 return self
.GetAXProp('src')
149 def _set_src(self
, src
):
150 self
.SetAXProp('src', src
)
151 src
= property(_get_src
, _set_src
)
153 def _get_messageHandler(self
):
154 return self
.GetAXProp('messageHandler')
155 def _set_messageHandler(self
, messageHandler
):
156 self
.SetAXProp('messageHandler', messageHandler
)
157 messagehandler
= property(_get_messageHandler
, _set_messageHandler
)
161 # --------------------
163 # type:string arg:string canGet:True canSet:True
166 # type:VT_VARIANT arg:VT_VARIANT canGet:True canSet:True
172 # --------------------
177 # in:True out:False optional:False type:unsupported type 29
179 # in:False out:True optional:False type:unsupported type 26
191 # in:False out:True optional:False type:int
197 # in:True out:False optional:False type:int
199 # in:True out:False optional:False type:int
201 # in:False out:True optional:False type:unsupported type 26
207 # in:True out:False optional:False type:unsupported type 29
209 # in:True out:False optional:False type:unsupported type 26
211 # in:True out:False optional:False type:int
213 # in:True out:False optional:False type:int
215 # in:False out:True optional:False type:int
221 # in:True out:False optional:False type:int
223 # in:True out:False optional:False type:unsupported type 29
225 # in:True out:False optional:False type:int
227 # in:True out:False optional:False type:int
229 # in:True out:False optional:False type:unsupported type 29
231 # in:False out:True optional:False type:VT_VARIANT
233 # in:False out:True optional:False type:unsupported type 29
235 # in:False out:True optional:False type:int
241 # in:True out:False optional:False type:string
247 # in:True out:False optional:False type:bool
265 # in:True out:False optional:False type:int
277 # in:True out:False optional:False type:string
283 # in:True out:False optional:False type:string
289 # in:True out:False optional:False type:string
301 # in:True out:False optional:False type:double
307 # in:True out:False optional:False type:double
309 # in:True out:False optional:False type:double
311 # in:True out:False optional:False type:double
317 # in:True out:False optional:False type:string
323 # in:True out:False optional:False type:string
325 # in:True out:False optional:False type:double
331 # in:True out:False optional:False type:double
333 # in:True out:False optional:False type:double
335 # in:True out:False optional:False type:double
337 # in:True out:False optional:False type:double
343 # in:True out:False optional:False type:int
345 # in:True out:False optional:False type:int
351 # in:True out:False optional:False type:int
353 # in:True out:False optional:False type:int
355 # in:True out:False optional:False type:bool
364 # in:True out:False optional:False type:bool
370 # in:True out:False optional:False type:bool
373 # retType: VT_VARIANT
375 # setCurrentHightlight
379 # in:True out:False optional:False type:int
381 # in:True out:False optional:False type:int
383 # in:True out:False optional:False type:int
385 # in:True out:False optional:False type:int
387 # setCurrentHighlight
391 # in:True out:False optional:False type:int
393 # in:True out:False optional:False type:int
395 # in:True out:False optional:False type:int
397 # in:True out:False optional:False type:int
403 # in:True out:False optional:False type:VT_VARIANT
409 # --------------------