4
%% Copyright Ericsson AB 2008-2009. All Rights Reserved.
6
%% The contents of this file are subject to the Erlang Public License,
7
%% Version 1.1, (the "License"); you may not use this file except in
8
%% compliance with the License. You should have received a copy of the
9
%% Erlang Public License along with this software. If not, it can be
10
%% retrieved online at http://www.erlang.org/.
12
%% Software distributed under the License is distributed on an "AS IS"
13
%% basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14
%% the License for the specific language governing rights and limitations
18
%% This file is generated DO NOT EDIT
20
%% @doc See external documentation: <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html">wxHtmlEasyPrinting</a>.
21
%% @type wxHtmlEasyPrinting(). An object reference, The representation is internal
22
%% and can be changed without notice. It can't be used for comparsion
23
%% stored on disc or distributed for use on other nodes.
25
-module(wxHtmlEasyPrinting).
27
-export([destroy/1,getPageSetupData/1,getPrintData/1,new/0,new/1,pageSetup/1,
28
previewFile/2,previewText/2,previewText/3,printFile/2,printText/2,
29
printText/3,setFonts/3,setFonts/4,setFooter/2,setFooter/3,setHeader/2,
33
-export([parent_class/1]).
36
parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
38
%% @spec () -> wxHtmlEasyPrinting()
43
%% @spec ([Option]) -> wxHtmlEasyPrinting()
44
%% Option = {name, string()} | {parentWindow, wxWindow:wxWindow()}
45
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingwxhtmleasyprinting">external documentation</a>.
47
when is_list(Options) ->
48
MOpts = fun({name, Name}, Acc) -> Name_UC = unicode:characters_to_binary([Name,0]),[<<1:32/?UI,(byte_size(Name_UC)):32/?UI,(Name_UC)/binary, 0:(((8- ((0+byte_size(Name_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
49
({parentWindow, #wx_ref{type=ParentWindowT,ref=ParentWindowRef}}, Acc) -> ?CLASS(ParentWindowT,wxWindow),[<<2:32/?UI,ParentWindowRef:32/?UI>>|Acc];
50
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
51
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
52
wxe_util:construct(?wxHtmlEasyPrinting_new,
55
%% @spec (This::wxHtmlEasyPrinting()) -> wxPrintData:wxPrintData()
56
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintinggetprintdata">external documentation</a>.
57
getPrintData(#wx_ref{type=ThisT,ref=ThisRef}) ->
58
?CLASS(ThisT,wxHtmlEasyPrinting),
59
wxe_util:call(?wxHtmlEasyPrinting_GetPrintData,
62
%% @spec (This::wxHtmlEasyPrinting()) -> wxPageSetupDialogData:wxPageSetupDialogData()
63
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintinggetpagesetupdata">external documentation</a>.
64
getPageSetupData(#wx_ref{type=ThisT,ref=ThisRef}) ->
65
?CLASS(ThisT,wxHtmlEasyPrinting),
66
wxe_util:call(?wxHtmlEasyPrinting_GetPageSetupData,
69
%% @spec (This::wxHtmlEasyPrinting(), Htmlfile::string()) -> bool()
70
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingpreviewfile">external documentation</a>.
71
previewFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile)
72
when is_list(Htmlfile) ->
73
?CLASS(ThisT,wxHtmlEasyPrinting),
74
Htmlfile_UC = unicode:characters_to_binary([Htmlfile,0]),
75
wxe_util:call(?wxHtmlEasyPrinting_PreviewFile,
76
<<ThisRef:32/?UI,(byte_size(Htmlfile_UC)):32/?UI,(Htmlfile_UC)/binary, 0:(((8- ((0+byte_size(Htmlfile_UC)) band 16#7)) band 16#7))/unit:8>>).
78
%% @spec (This::wxHtmlEasyPrinting(), Htmltext::string()) -> bool()
79
%% @equiv previewText(This,Htmltext, [])
80
previewText(This,Htmltext)
81
when is_record(This, wx_ref),is_list(Htmltext) ->
82
previewText(This,Htmltext, []).
84
%% @spec (This::wxHtmlEasyPrinting(), Htmltext::string(), [Option]) -> bool()
85
%% Option = {basepath, string()}
86
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingpreviewtext">external documentation</a>.
87
previewText(#wx_ref{type=ThisT,ref=ThisRef},Htmltext, Options)
88
when is_list(Htmltext),is_list(Options) ->
89
?CLASS(ThisT,wxHtmlEasyPrinting),
90
Htmltext_UC = unicode:characters_to_binary([Htmltext,0]),
91
MOpts = fun({basepath, Basepath}, Acc) -> Basepath_UC = unicode:characters_to_binary([Basepath,0]),[<<1:32/?UI,(byte_size(Basepath_UC)):32/?UI,(Basepath_UC)/binary, 0:(((8- ((0+byte_size(Basepath_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
92
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
93
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
94
wxe_util:call(?wxHtmlEasyPrinting_PreviewText,
95
<<ThisRef:32/?UI,(byte_size(Htmltext_UC)):32/?UI,(Htmltext_UC)/binary, 0:(((8- ((0+byte_size(Htmltext_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
97
%% @spec (This::wxHtmlEasyPrinting(), Htmlfile::string()) -> bool()
98
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingprintfile">external documentation</a>.
99
printFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile)
100
when is_list(Htmlfile) ->
101
?CLASS(ThisT,wxHtmlEasyPrinting),
102
Htmlfile_UC = unicode:characters_to_binary([Htmlfile,0]),
103
wxe_util:call(?wxHtmlEasyPrinting_PrintFile,
104
<<ThisRef:32/?UI,(byte_size(Htmlfile_UC)):32/?UI,(Htmlfile_UC)/binary, 0:(((8- ((0+byte_size(Htmlfile_UC)) band 16#7)) band 16#7))/unit:8>>).
106
%% @spec (This::wxHtmlEasyPrinting(), Htmltext::string()) -> bool()
107
%% @equiv printText(This,Htmltext, [])
108
printText(This,Htmltext)
109
when is_record(This, wx_ref),is_list(Htmltext) ->
110
printText(This,Htmltext, []).
112
%% @spec (This::wxHtmlEasyPrinting(), Htmltext::string(), [Option]) -> bool()
113
%% Option = {basepath, string()}
114
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingprinttext">external documentation</a>.
115
printText(#wx_ref{type=ThisT,ref=ThisRef},Htmltext, Options)
116
when is_list(Htmltext),is_list(Options) ->
117
?CLASS(ThisT,wxHtmlEasyPrinting),
118
Htmltext_UC = unicode:characters_to_binary([Htmltext,0]),
119
MOpts = fun({basepath, Basepath}, Acc) -> Basepath_UC = unicode:characters_to_binary([Basepath,0]),[<<1:32/?UI,(byte_size(Basepath_UC)):32/?UI,(Basepath_UC)/binary, 0:(((8- ((0+byte_size(Basepath_UC)) band 16#7)) band 16#7))/unit:8>>|Acc];
120
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
121
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
122
wxe_util:call(?wxHtmlEasyPrinting_PrintText,
123
<<ThisRef:32/?UI,(byte_size(Htmltext_UC)):32/?UI,(Htmltext_UC)/binary, 0:(((8- ((0+byte_size(Htmltext_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
125
%% @spec (This::wxHtmlEasyPrinting()) -> ok
126
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingpagesetup">external documentation</a>.
127
pageSetup(#wx_ref{type=ThisT,ref=ThisRef}) ->
128
?CLASS(ThisT,wxHtmlEasyPrinting),
129
wxe_util:cast(?wxHtmlEasyPrinting_PageSetup,
132
%% @spec (This::wxHtmlEasyPrinting(), Normal_face::string(), Fixed_face::string()) -> ok
133
%% @equiv setFonts(This,Normal_face,Fixed_face, [])
134
setFonts(This,Normal_face,Fixed_face)
135
when is_record(This, wx_ref),is_list(Normal_face),is_list(Fixed_face) ->
136
setFonts(This,Normal_face,Fixed_face, []).
138
%% @spec (This::wxHtmlEasyPrinting(), Normal_face::string(), Fixed_face::string(), [Option]) -> ok
139
%% Option = {sizes, [integer()]}
140
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetfonts">external documentation</a>.
141
setFonts(#wx_ref{type=ThisT,ref=ThisRef},Normal_face,Fixed_face, Options)
142
when is_list(Normal_face),is_list(Fixed_face),is_list(Options) ->
143
?CLASS(ThisT,wxHtmlEasyPrinting),
144
Normal_face_UC = unicode:characters_to_binary([Normal_face,0]),
145
Fixed_face_UC = unicode:characters_to_binary([Fixed_face,0]),
146
MOpts = fun({sizes, Sizes}, Acc) -> [<<1:32/?UI,(length(Sizes)):32/?UI,
147
(<< <<C:32/?I>> || C <- Sizes>>)/binary, 0:(((0+length(Sizes)) rem 2)*32)>>|Acc];
148
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
149
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
150
wxe_util:cast(?wxHtmlEasyPrinting_SetFonts,
151
<<ThisRef:32/?UI,(byte_size(Normal_face_UC)):32/?UI,(Normal_face_UC)/binary, 0:(((8- ((0+byte_size(Normal_face_UC)) band 16#7)) band 16#7))/unit:8,(byte_size(Fixed_face_UC)):32/?UI,(Fixed_face_UC)/binary, 0:(((8- ((4+byte_size(Fixed_face_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
153
%% @spec (This::wxHtmlEasyPrinting(), Header::string()) -> ok
154
%% @equiv setHeader(This,Header, [])
155
setHeader(This,Header)
156
when is_record(This, wx_ref),is_list(Header) ->
157
setHeader(This,Header, []).
159
%% @spec (This::wxHtmlEasyPrinting(), Header::string(), [Option]) -> ok
160
%% Option = {pg, integer()}
161
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetheader">external documentation</a>.
162
setHeader(#wx_ref{type=ThisT,ref=ThisRef},Header, Options)
163
when is_list(Header),is_list(Options) ->
164
?CLASS(ThisT,wxHtmlEasyPrinting),
165
Header_UC = unicode:characters_to_binary([Header,0]),
166
MOpts = fun({pg, Pg}, Acc) -> [<<1:32/?UI,Pg:32/?UI>>|Acc];
167
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
168
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
169
wxe_util:cast(?wxHtmlEasyPrinting_SetHeader,
170
<<ThisRef:32/?UI,(byte_size(Header_UC)):32/?UI,(Header_UC)/binary, 0:(((8- ((0+byte_size(Header_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
172
%% @spec (This::wxHtmlEasyPrinting(), Footer::string()) -> ok
173
%% @equiv setFooter(This,Footer, [])
174
setFooter(This,Footer)
175
when is_record(This, wx_ref),is_list(Footer) ->
176
setFooter(This,Footer, []).
178
%% @spec (This::wxHtmlEasyPrinting(), Footer::string(), [Option]) -> ok
179
%% Option = {pg, integer()}
180
%% @doc See <a href="http://www.wxwidgets.org/manuals/stable/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetfooter">external documentation</a>.
181
setFooter(#wx_ref{type=ThisT,ref=ThisRef},Footer, Options)
182
when is_list(Footer),is_list(Options) ->
183
?CLASS(ThisT,wxHtmlEasyPrinting),
184
Footer_UC = unicode:characters_to_binary([Footer,0]),
185
MOpts = fun({pg, Pg}, Acc) -> [<<1:32/?UI,Pg:32/?UI>>|Acc];
186
(BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
187
BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
188
wxe_util:cast(?wxHtmlEasyPrinting_SetFooter,
189
<<ThisRef:32/?UI,(byte_size(Footer_UC)):32/?UI,(Footer_UC)/binary, 0:(((8- ((0+byte_size(Footer_UC)) band 16#7)) band 16#7))/unit:8, BinOpt/binary>>).
191
%% @spec (This::wxHtmlEasyPrinting()) -> ok
192
%% @doc Destroys this object, do not use object again
193
destroy(Obj=#wx_ref{type=Type}) ->
194
?CLASS(Type,wxHtmlEasyPrinting),
195
wxe_util:destroy(?DESTROY_OBJECT,Obj),