1%%
2%% %CopyrightBegin%
3%%
4%% Copyright Ericsson AB 2008-2016. All Rights Reserved.
5%%
6%% Licensed under the Apache License, Version 2.0 (the "License");
7%% you may not use this file except in compliance with the License.
8%% You may obtain a copy of the License at
9%%
10%%     http://www.apache.org/licenses/LICENSE-2.0
11%%
12%% Unless required by applicable law or agreed to in writing, software
13%% distributed under the License is distributed on an "AS IS" BASIS,
14%% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15%% See the License for the specific language governing permissions and
16%% limitations under the License.
17%%
18%% %CopyrightEnd%
19%% This file is generated DO NOT EDIT
20
21%% @doc See external documentation: <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html">wxHtmlEasyPrinting</a>.
22%% @type wxHtmlEasyPrinting().  An object reference, The representation is internal
23%% and can be changed without notice. It can't be used for comparsion
24%% stored on disc or distributed for use on other nodes.
25
26-module(wxHtmlEasyPrinting).
27-include("wxe.hrl").
28-export([destroy/1,getPageSetupData/1,getPrintData/1,new/0,new/1,pageSetup/1,
29  previewFile/2,previewText/2,previewText/3,printFile/2,printText/2,
30  printText/3,setFonts/3,setFonts/4,setFooter/2,setFooter/3,setHeader/2,
31  setHeader/3]).
32
33%% inherited exports
34-export([parent_class/1]).
35
36-export_type([wxHtmlEasyPrinting/0]).
37%% @hidden
38parent_class(_Class) -> erlang:error({badtype, ?MODULE}).
39
40-type wxHtmlEasyPrinting() :: wx:wx_object().
41%% @equiv new([])
42-spec new() -> wxHtmlEasyPrinting().
43
44new() ->
45  new([]).
46
47%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingwxhtmleasyprinting">external documentation</a>.
48-spec new([Option]) -> wxHtmlEasyPrinting() when
49	Option :: {'name', unicode:chardata()}
50		 | {'parentWindow', wxWindow:wxWindow()}.
51new(Options)
52 when is_list(Options) ->
53  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];
54          ({parentWindow, #wx_ref{type=ParentWindowT,ref=ParentWindowRef}}, Acc) ->   ?CLASS(ParentWindowT,wxWindow),[<<2:32/?UI,ParentWindowRef:32/?UI>>|Acc];
55          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
56  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
57  wxe_util:construct(?wxHtmlEasyPrinting_new,
58  <<BinOpt/binary>>).
59
60%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintinggetprintdata">external documentation</a>.
61-spec getPrintData(This) -> wxPrintData:wxPrintData() when
62	This::wxHtmlEasyPrinting().
63getPrintData(#wx_ref{type=ThisT,ref=ThisRef}) ->
64  ?CLASS(ThisT,wxHtmlEasyPrinting),
65  wxe_util:call(?wxHtmlEasyPrinting_GetPrintData,
66  <<ThisRef:32/?UI>>).
67
68%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintinggetpagesetupdata">external documentation</a>.
69-spec getPageSetupData(This) -> wxPageSetupDialogData:wxPageSetupDialogData() when
70	This::wxHtmlEasyPrinting().
71getPageSetupData(#wx_ref{type=ThisT,ref=ThisRef}) ->
72  ?CLASS(ThisT,wxHtmlEasyPrinting),
73  wxe_util:call(?wxHtmlEasyPrinting_GetPageSetupData,
74  <<ThisRef:32/?UI>>).
75
76%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingpreviewfile">external documentation</a>.
77-spec previewFile(This, Htmlfile) -> boolean() when
78	This::wxHtmlEasyPrinting(), Htmlfile::unicode:chardata().
79previewFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile)
80 when ?is_chardata(Htmlfile) ->
81  ?CLASS(ThisT,wxHtmlEasyPrinting),
82  Htmlfile_UC = unicode:characters_to_binary([Htmlfile,0]),
83  wxe_util:call(?wxHtmlEasyPrinting_PreviewFile,
84  <<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>>).
85
86%% @equiv previewText(This,Htmltext, [])
87-spec previewText(This, Htmltext) -> boolean() when
88	This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata().
89
90previewText(This,Htmltext)
91 when is_record(This, wx_ref),?is_chardata(Htmltext) ->
92  previewText(This,Htmltext, []).
93
94%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingpreviewtext">external documentation</a>.
95-spec previewText(This, Htmltext, [Option]) -> boolean() when
96	This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata(),
97	Option :: {'basepath', unicode:chardata()}.
98previewText(#wx_ref{type=ThisT,ref=ThisRef},Htmltext, Options)
99 when ?is_chardata(Htmltext),is_list(Options) ->
100  ?CLASS(ThisT,wxHtmlEasyPrinting),
101  Htmltext_UC = unicode:characters_to_binary([Htmltext,0]),
102  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];
103          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
104  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
105  wxe_util:call(?wxHtmlEasyPrinting_PreviewText,
106  <<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>>).
107
108%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingprintfile">external documentation</a>.
109-spec printFile(This, Htmlfile) -> boolean() when
110	This::wxHtmlEasyPrinting(), Htmlfile::unicode:chardata().
111printFile(#wx_ref{type=ThisT,ref=ThisRef},Htmlfile)
112 when ?is_chardata(Htmlfile) ->
113  ?CLASS(ThisT,wxHtmlEasyPrinting),
114  Htmlfile_UC = unicode:characters_to_binary([Htmlfile,0]),
115  wxe_util:call(?wxHtmlEasyPrinting_PrintFile,
116  <<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>>).
117
118%% @equiv printText(This,Htmltext, [])
119-spec printText(This, Htmltext) -> boolean() when
120	This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata().
121
122printText(This,Htmltext)
123 when is_record(This, wx_ref),?is_chardata(Htmltext) ->
124  printText(This,Htmltext, []).
125
126%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingprinttext">external documentation</a>.
127-spec printText(This, Htmltext, [Option]) -> boolean() when
128	This::wxHtmlEasyPrinting(), Htmltext::unicode:chardata(),
129	Option :: {'basepath', unicode:chardata()}.
130printText(#wx_ref{type=ThisT,ref=ThisRef},Htmltext, Options)
131 when ?is_chardata(Htmltext),is_list(Options) ->
132  ?CLASS(ThisT,wxHtmlEasyPrinting),
133  Htmltext_UC = unicode:characters_to_binary([Htmltext,0]),
134  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];
135          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
136  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
137  wxe_util:call(?wxHtmlEasyPrinting_PrintText,
138  <<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>>).
139
140%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingpagesetup">external documentation</a>.
141-spec pageSetup(This) -> 'ok' when
142	This::wxHtmlEasyPrinting().
143pageSetup(#wx_ref{type=ThisT,ref=ThisRef}) ->
144  ?CLASS(ThisT,wxHtmlEasyPrinting),
145  wxe_util:cast(?wxHtmlEasyPrinting_PageSetup,
146  <<ThisRef:32/?UI>>).
147
148%% @equiv setFonts(This,Normal_face,Fixed_face, [])
149-spec setFonts(This, Normal_face, Fixed_face) -> 'ok' when
150	This::wxHtmlEasyPrinting(), Normal_face::unicode:chardata(), Fixed_face::unicode:chardata().
151
152setFonts(This,Normal_face,Fixed_face)
153 when is_record(This, wx_ref),?is_chardata(Normal_face),?is_chardata(Fixed_face) ->
154  setFonts(This,Normal_face,Fixed_face, []).
155
156%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetfonts">external documentation</a>.
157-spec setFonts(This, Normal_face, Fixed_face, [Option]) -> 'ok' when
158	This::wxHtmlEasyPrinting(), Normal_face::unicode:chardata(), Fixed_face::unicode:chardata(),
159	Option :: {'sizes', [integer()]}.
160setFonts(#wx_ref{type=ThisT,ref=ThisRef},Normal_face,Fixed_face, Options)
161 when ?is_chardata(Normal_face),?is_chardata(Fixed_face),is_list(Options) ->
162  ?CLASS(ThisT,wxHtmlEasyPrinting),
163  Normal_face_UC = unicode:characters_to_binary([Normal_face,0]),
164  Fixed_face_UC = unicode:characters_to_binary([Fixed_face,0]),
165  MOpts = fun({sizes, Sizes}, Acc) -> [<<1:32/?UI,(length(Sizes)):32/?UI,
166        (<< <<C:32/?I>> || C <- Sizes>>)/binary, 0:(((0+length(Sizes)) rem 2)*32)>>|Acc];
167          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
168  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
169  wxe_util:cast(?wxHtmlEasyPrinting_SetFonts,
170  <<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>>).
171
172%% @equiv setHeader(This,Header, [])
173-spec setHeader(This, Header) -> 'ok' when
174	This::wxHtmlEasyPrinting(), Header::unicode:chardata().
175
176setHeader(This,Header)
177 when is_record(This, wx_ref),?is_chardata(Header) ->
178  setHeader(This,Header, []).
179
180%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetheader">external documentation</a>.
181-spec setHeader(This, Header, [Option]) -> 'ok' when
182	This::wxHtmlEasyPrinting(), Header::unicode:chardata(),
183	Option :: {'pg', integer()}.
184setHeader(#wx_ref{type=ThisT,ref=ThisRef},Header, Options)
185 when ?is_chardata(Header),is_list(Options) ->
186  ?CLASS(ThisT,wxHtmlEasyPrinting),
187  Header_UC = unicode:characters_to_binary([Header,0]),
188  MOpts = fun({pg, Pg}, Acc) -> [<<1:32/?UI,Pg:32/?UI>>|Acc];
189          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
190  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
191  wxe_util:cast(?wxHtmlEasyPrinting_SetHeader,
192  <<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>>).
193
194%% @equiv setFooter(This,Footer, [])
195-spec setFooter(This, Footer) -> 'ok' when
196	This::wxHtmlEasyPrinting(), Footer::unicode:chardata().
197
198setFooter(This,Footer)
199 when is_record(This, wx_ref),?is_chardata(Footer) ->
200  setFooter(This,Footer, []).
201
202%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxhtmleasyprinting.html#wxhtmleasyprintingsetfooter">external documentation</a>.
203-spec setFooter(This, Footer, [Option]) -> 'ok' when
204	This::wxHtmlEasyPrinting(), Footer::unicode:chardata(),
205	Option :: {'pg', integer()}.
206setFooter(#wx_ref{type=ThisT,ref=ThisRef},Footer, Options)
207 when ?is_chardata(Footer),is_list(Options) ->
208  ?CLASS(ThisT,wxHtmlEasyPrinting),
209  Footer_UC = unicode:characters_to_binary([Footer,0]),
210  MOpts = fun({pg, Pg}, Acc) -> [<<1:32/?UI,Pg:32/?UI>>|Acc];
211          (BadOpt, _) -> erlang:error({badoption, BadOpt}) end,
212  BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)),
213  wxe_util:cast(?wxHtmlEasyPrinting_SetFooter,
214  <<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>>).
215
216%% @doc Destroys this object, do not use object again
217-spec destroy(This::wxHtmlEasyPrinting()) -> 'ok'.
218destroy(Obj=#wx_ref{type=Type}) ->
219  ?CLASS(Type,wxHtmlEasyPrinting),
220  wxe_util:destroy(?DESTROY_OBJECT,Obj),
221  ok.
222