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_wxprinter.html">wxPrinter</a>. 22%% @type wxPrinter(). 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(wxPrinter). 27-include("wxe.hrl"). 28-export([createAbortWindow/3,destroy/1,getAbort/1,getLastError/0,getPrintDialogData/1, 29 new/0,new/1,print/3,print/4,printDialog/2,reportError/4,setup/2]). 30 31%% inherited exports 32-export([parent_class/1]). 33 34-export_type([wxPrinter/0]). 35%% @hidden 36parent_class(_Class) -> erlang:error({badtype, ?MODULE}). 37 38-type wxPrinter() :: wx:wx_object(). 39%% @equiv new([]) 40-spec new() -> wxPrinter(). 41 42new() -> 43 new([]). 44 45%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxprinter.html#wxprinterwxprinter">external documentation</a>. 46-spec new([Option]) -> wxPrinter() when 47 Option :: {'data', wxPrintDialogData:wxPrintDialogData()}. 48new(Options) 49 when is_list(Options) -> 50 MOpts = fun({data, #wx_ref{type=DataT,ref=DataRef}}, Acc) -> ?CLASS(DataT,wxPrintDialogData),[<<1:32/?UI,DataRef:32/?UI>>|Acc]; 51 (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, 52 BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)), 53 wxe_util:construct(?wxPrinter_new, 54 <<BinOpt/binary>>). 55 56%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxprinter.html#wxprintercreateabortwindow">external documentation</a>. 57-spec createAbortWindow(This, Parent, Printout) -> wxWindow:wxWindow() when 58 This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout(). 59createAbortWindow(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=PrintoutT,ref=PrintoutRef}) -> 60 ?CLASS(ThisT,wxPrinter), 61 ?CLASS(ParentT,wxWindow), 62 ?CLASS(PrintoutT,wxPrintout), 63 wxe_util:call(?wxPrinter_CreateAbortWindow, 64 <<ThisRef:32/?UI,ParentRef:32/?UI,PrintoutRef:32/?UI>>). 65 66%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxprinter.html#wxprintergetabort">external documentation</a>. 67-spec getAbort(This) -> boolean() when 68 This::wxPrinter(). 69getAbort(#wx_ref{type=ThisT,ref=ThisRef}) -> 70 ?CLASS(ThisT,wxPrinter), 71 wxe_util:call(?wxPrinter_GetAbort, 72 <<ThisRef:32/?UI>>). 73 74%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxprinter.html#wxprintergetlasterror">external documentation</a>. 75%%<br /> Res = ?wxPRINTER_NO_ERROR | ?wxPRINTER_CANCELLED | ?wxPRINTER_ERROR 76-spec getLastError() -> wx:wx_enum(). 77getLastError() -> 78 wxe_util:call(?wxPrinter_GetLastError, 79 <<>>). 80 81%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxprinter.html#wxprintergetprintdialogdata">external documentation</a>. 82-spec getPrintDialogData(This) -> wxPrintDialogData:wxPrintDialogData() when 83 This::wxPrinter(). 84getPrintDialogData(#wx_ref{type=ThisT,ref=ThisRef}) -> 85 ?CLASS(ThisT,wxPrinter), 86 wxe_util:call(?wxPrinter_GetPrintDialogData, 87 <<ThisRef:32/?UI>>). 88 89%% @equiv print(This,Parent,Printout, []) 90-spec print(This, Parent, Printout) -> boolean() when 91 This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout(). 92 93print(This,Parent,Printout) 94 when is_record(This, wx_ref),is_record(Parent, wx_ref),is_record(Printout, wx_ref) -> 95 print(This,Parent,Printout, []). 96 97%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxprinter.html#wxprinterprint">external documentation</a>. 98-spec print(This, Parent, Printout, [Option]) -> boolean() when 99 This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout(), 100 Option :: {'prompt', boolean()}. 101print(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=PrintoutT,ref=PrintoutRef}, Options) 102 when is_list(Options) -> 103 ?CLASS(ThisT,wxPrinter), 104 ?CLASS(ParentT,wxWindow), 105 ?CLASS(PrintoutT,wxPrintout), 106 MOpts = fun({prompt, Prompt}, Acc) -> [<<1:32/?UI,(wxe_util:from_bool(Prompt)):32/?UI>>|Acc]; 107 (BadOpt, _) -> erlang:error({badoption, BadOpt}) end, 108 BinOpt = list_to_binary(lists:foldl(MOpts, [<<0:32>>], Options)), 109 wxe_util:call(?wxPrinter_Print, 110 <<ThisRef:32/?UI,ParentRef:32/?UI,PrintoutRef:32/?UI, 0:32,BinOpt/binary>>). 111 112%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxprinter.html#wxprinterprintdialog">external documentation</a>. 113-spec printDialog(This, Parent) -> wxDC:wxDC() when 114 This::wxPrinter(), Parent::wxWindow:wxWindow(). 115printDialog(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}) -> 116 ?CLASS(ThisT,wxPrinter), 117 ?CLASS(ParentT,wxWindow), 118 wxe_util:call(?wxPrinter_PrintDialog, 119 <<ThisRef:32/?UI,ParentRef:32/?UI>>). 120 121%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxprinter.html#wxprinterreporterror">external documentation</a>. 122-spec reportError(This, Parent, Printout, Message) -> 'ok' when 123 This::wxPrinter(), Parent::wxWindow:wxWindow(), Printout::wxPrintout:wxPrintout(), Message::unicode:chardata(). 124reportError(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef},#wx_ref{type=PrintoutT,ref=PrintoutRef},Message) 125 when ?is_chardata(Message) -> 126 ?CLASS(ThisT,wxPrinter), 127 ?CLASS(ParentT,wxWindow), 128 ?CLASS(PrintoutT,wxPrintout), 129 Message_UC = unicode:characters_to_binary([Message,0]), 130 wxe_util:cast(?wxPrinter_ReportError, 131 <<ThisRef:32/?UI,ParentRef:32/?UI,PrintoutRef:32/?UI,(byte_size(Message_UC)):32/?UI,(Message_UC)/binary, 0:(((8- ((0+byte_size(Message_UC)) band 16#7)) band 16#7))/unit:8>>). 132 133%% @doc See <a href="http://www.wxwidgets.org/manuals/2.8.12/wx_wxprinter.html#wxprintersetup">external documentation</a>. 134-spec setup(This, Parent) -> boolean() when 135 This::wxPrinter(), Parent::wxWindow:wxWindow(). 136setup(#wx_ref{type=ThisT,ref=ThisRef},#wx_ref{type=ParentT,ref=ParentRef}) -> 137 ?CLASS(ThisT,wxPrinter), 138 ?CLASS(ParentT,wxWindow), 139 wxe_util:call(?wxPrinter_Setup, 140 <<ThisRef:32/?UI,ParentRef:32/?UI>>). 141 142%% @doc Destroys this object, do not use object again 143-spec destroy(This::wxPrinter()) -> 'ok'. 144destroy(Obj=#wx_ref{type=Type}) -> 145 ?CLASS(Type,wxPrinter), 146 wxe_util:destroy(?DESTROY_OBJECT,Obj), 147 ok. 148