1//---------------------------------------------------------------------------
2// This file is generated by wxPython's SIP generator.  Do not edit by hand.
3//
4// Copyright: (c) 2018 by Total Control Software
5// License:   wxWindows License
6//
7// This file will be included by _core.sip
8//
9//---------------------------------------------------------------------------
10
11//---------------------------------------------------------------------------
12
13enum wxLogLevelValues
14{
15    wxLOG_FatalError,
16    wxLOG_Error,
17    wxLOG_Warning,
18    wxLOG_Message,
19    wxLOG_Status,
20    wxLOG_Info,
21    wxLOG_Debug,
22    wxLOG_Trace,
23    wxLOG_Progress,
24    wxLOG_User,
25    wxLOG_Max
26};
27
28typedef unsigned long wxLogLevel;
29
30class wxLog
31{
32    %Docstring
33        wxLog class defines the interface for the log targets used by
34        wxWidgets logging functions as explained in the Logging Overview.
35    %End
36    %TypeHeaderCode
37        #include <wx/log.h>
38    %End
39
40public:
41    static
42    void AddTraceMask(
43        const wxString & mask
44    );
45    %Docstring
46        AddTraceMask(mask)
47
48        Add the mask to the list of allowed masks for wxLogTrace().
49    %End
50
51    static
52    void ClearTraceMasks();
53    %Docstring
54        ClearTraceMasks()
55
56        Removes all trace masks previously set with AddTraceMask().
57    %End
58
59    static
60    const wxArrayString & GetTraceMasks();
61    %Docstring
62        GetTraceMasks() -> ArrayString
63
64        Returns the currently allowed list of string trace masks.
65    %End
66
67    static
68    bool IsAllowedTraceMask(
69        const wxString & mask
70    );
71    %Docstring
72        IsAllowedTraceMask(mask) -> bool
73
74        Returns true if the mask is one of allowed masks for wxLogTrace().
75    %End
76
77    static
78    void RemoveTraceMask(
79        const wxString & mask
80    );
81    %Docstring
82        RemoveTraceMask(mask)
83
84        Remove the mask from the list of allowed masks for wxLogTrace().
85    %End
86
87    static
88    void DontCreateOnDemand();
89    %Docstring
90        DontCreateOnDemand()
91
92        Instructs wxLog to not create new log targets on the fly if there is
93        none currently (see GetActiveTarget()).
94    %End
95
96    static
97    wxLog * GetActiveTarget();
98    %Docstring
99        GetActiveTarget() -> Log
100
101        Returns the pointer to the active log target (may be NULL).
102    %End
103
104    static
105    wxLog * SetActiveTarget(
106        wxLog * logtarget   /Transfer/
107    )   /TransferBack/;
108    %Docstring
109        SetActiveTarget(logtarget) -> Log
110
111        Sets the specified log target as the active one.
112    %End
113
114    static
115    wxLog * SetThreadActiveTarget(
116        wxLog * logger   /Transfer/
117    )   /TransferBack/;
118    %Docstring
119        SetThreadActiveTarget(logger) -> Log
120
121        Sets a thread-specific log target.
122    %End
123
124    static
125    void FlushActive();
126    %Docstring
127        FlushActive()
128
129        Flushes the current log target if any, does nothing if there is none.
130    %End
131
132    static
133    void Resume();
134    %Docstring
135        Resume()
136
137        Resumes logging previously suspended by a call to Suspend().
138    %End
139
140    static
141    void Suspend();
142    %Docstring
143        Suspend()
144
145        Suspends the logging until Resume() is called.
146    %End
147
148    static
149    wxLogLevel GetLogLevel();
150    %Docstring
151        GetLogLevel() -> LogLevel
152
153        Returns the current log level limit.
154    %End
155
156    static
157    bool IsLevelEnabled(
158        wxLogLevel level,
159        wxString component
160    );
161    %Docstring
162        IsLevelEnabled(level, component) -> bool
163
164        Returns true if logging at this level is enabled for the current
165        thread.
166    %End
167
168    static
169    void SetComponentLevel(
170        const wxString & component,
171        wxLogLevel level
172    );
173    %Docstring
174        SetComponentLevel(component, level)
175
176        Sets the log level for the given component.
177    %End
178
179    static
180    void SetLogLevel(
181        wxLogLevel logLevel
182    );
183    %Docstring
184        SetLogLevel(logLevel)
185
186        Specifies that log messages with level greater (numerically) than
187        logLevel should be ignored and not sent to the active log target.
188    %End
189
190    static
191    bool EnableLogging(
192        bool enable = true
193    );
194    %Docstring
195        EnableLogging(enable=True) -> bool
196
197        Globally enable or disable logging.
198    %End
199
200    static
201    bool IsEnabled();
202    %Docstring
203        IsEnabled() -> bool
204
205        Returns true if logging is enabled at all now.
206    %End
207
208    static
209    bool GetRepetitionCounting();
210    %Docstring
211        GetRepetitionCounting() -> bool
212
213        Returns whether the repetition counting mode is enabled.
214    %End
215
216    static
217    void SetRepetitionCounting(
218        bool repetCounting = true
219    );
220    %Docstring
221        SetRepetitionCounting(repetCounting=True)
222
223        Enables logging mode in which a log message is logged once, and in
224        case exactly the same message successively repeats one or more times,
225        only the number of repetitions is logged.
226    %End
227
228    static
229    const wxString & GetTimestamp();
230    %Docstring
231        GetTimestamp() -> String
232
233        Returns the current timestamp format string.
234    %End
235
236    static
237    void SetTimestamp(
238        const wxString & format
239    );
240    %Docstring
241        SetTimestamp(format)
242
243        Sets the timestamp format prepended by the default log targets to all
244        messages.
245    %End
246
247    static
248    void DisableTimestamp();
249    %Docstring
250        DisableTimestamp()
251
252        Disables time stamping of the log messages.
253    %End
254
255    static
256    bool GetVerbose();
257    %Docstring
258        GetVerbose() -> bool
259
260        Returns whether the verbose mode is currently active.
261    %End
262
263    static
264    void SetVerbose(
265        bool verbose = true
266    );
267    %Docstring
268        SetVerbose(verbose=True)
269
270        Activates or deactivates verbose mode in which the verbose messages
271        are logged as the normal ones instead of being silently dropped.
272    %End
273
274    wxLogFormatter * SetFormatter(
275        wxLogFormatter * formatter
276    );
277    %Docstring
278        SetFormatter(formatter) -> LogFormatter
279
280        Sets the specified formatter as the active one.
281    %End
282
283    virtual
284    void Flush();
285    %Docstring
286        Flush()
287
288        Some of wxLog implementations, most notably the standard wxLogGui
289        class, buffer the messages (for example, to avoid showing the user a
290        zillion of modal message boxes one after another  which would be
291        really annoying).
292    %End
293
294    void LogRecord(
295        wxLogLevel level,
296        const wxString & msg,
297        const wxLogRecordInfo & info
298    );
299    %Docstring
300        LogRecord(level, msg, info)
301
302        Log the given record.
303    %End
304
305    public:
306
307
308
309protected:
310    virtual
311    void DoLogRecord(
312        wxLogLevel level,
313        const wxString & msg,
314        const wxLogRecordInfo & info
315    );
316    %Docstring
317        DoLogRecord(level, msg, info)
318
319        Called to log a new record.
320    %End
321
322    virtual
323    void DoLogTextAtLevel(
324        wxLogLevel level,
325        const wxString & msg
326    );
327    %Docstring
328        DoLogTextAtLevel(level, msg)
329
330        Called to log the specified string at given level.
331    %End
332
333    virtual
334    void DoLogText(
335        const wxString & msg
336    );
337    %Docstring
338        DoLogText(msg)
339
340        Called to log the specified string.
341    %End
342
343};  // end of class wxLog
344
345
346class wxLogGui : wxLog
347{
348    %Docstring
349        LogGui()
350
351        This is the default log target for the GUI wxWidgets applications.
352    %End
353    %TypeHeaderCode
354        #include <wx/log.h>
355    %End
356
357public:
358    wxLogGui();
359
360    virtual
361    void Flush();
362    %Docstring
363        Flush()
364
365        Presents the accumulated log messages, if any, to the user.
366    %End
367
368    private:
369        wxLogGui(const wxLogGui&);
370
371
372    private:
373        wxLogGui& operator=(const wxLogGui&);
374
375
376};  // end of class wxLogGui
377
378
379class wxLogNull
380{
381    %Docstring
382        LogNull()
383
384        This class allows you to temporarily suspend logging.
385    %End
386    %TypeHeaderCode
387        #include <wx/log.h>
388    %End
389
390public:
391    wxLogNull();
392
393    ~wxLogNull();
394
395};  // end of class wxLogNull
396
397
398class wxLogRecordInfo
399{
400    %Docstring
401        Information about a log record (unit of the log output).
402    %End
403    %TypeHeaderCode
404        #include <wx/log.h>
405    %End
406
407public:
408    const char * filename;
409
410    int line;
411
412    const char * func;
413
414    time_t timestamp;
415
416};  // end of class wxLogRecordInfo
417
418
419class wxLogChain : wxLog
420{
421    %Docstring
422        LogChain(logger)
423
424        This simple class allows you to chain log sinks, that is to install a
425        new sink but keep passing log messages to the old one instead of
426        replacing it completely as wxLog::SetActiveTarget does.
427    %End
428    %TypeHeaderCode
429        #include <wx/log.h>
430    %End
431
432public:
433    wxLogChain(
434        wxLog * logger
435    );
436
437    virtual
438    ~wxLogChain();
439
440    void DetachOldLog();
441    %Docstring
442        DetachOldLog()
443
444        Detaches the old log target so it won't be destroyed when the
445        wxLogChain object is destroyed.
446    %End
447
448    wxLog * GetOldLog() const;
449    %Docstring
450        GetOldLog() -> Log
451
452        Returns the pointer to the previously active log target (which may be
453        NULL).
454    %End
455
456    bool IsPassingMessages() const;
457    %Docstring
458        IsPassingMessages() -> bool
459
460        Returns true if the messages are passed to the previously active log
461        target (default) or false if PassMessages() had been called.
462    %End
463
464    void PassMessages(
465        bool passMessages
466    );
467    %Docstring
468        PassMessages(passMessages)
469
470        By default, the log messages are passed to the previously active log
471        target.
472    %End
473
474    void SetLog(
475        wxLog * logger
476    );
477    %Docstring
478        SetLog(logger)
479
480        Sets another log target to use (may be NULL).
481    %End
482
483    private:
484        wxLogChain(const wxLogChain&);
485
486
487    private:
488        wxLogChain& operator=(const wxLogChain&);
489
490
491    public:
492
493
494    %Property(name=OldLog, get=GetOldLog)
495};  // end of class wxLogChain
496
497
498class wxLogInterposer : wxLogChain
499{
500    %Docstring
501        LogInterposer()
502
503        A special version of wxLogChain which uses itself as the new log
504        target.
505    %End
506    %TypeHeaderCode
507        #include <wx/log.h>
508    %End
509
510public:
511    wxLogInterposer();
512
513};  // end of class wxLogInterposer
514
515
516class wxLogInterposerTemp : wxLogChain
517{
518    %Docstring
519        LogInterposerTemp()
520
521        A special version of wxLogChain which uses itself as the new log
522        target.
523    %End
524    %TypeHeaderCode
525        #include <wx/log.h>
526    %End
527
528public:
529    wxLogInterposerTemp();
530
531};  // end of class wxLogInterposerTemp
532
533
534class wxLogWindow : wxLogInterposer
535{
536    %Docstring
537        LogWindow(pParent, szTitle, show=True, passToOld=True)
538
539        This class represents a background log window: to be precise, it
540        collects all log messages in the log frame which it manages but also
541        passes them on to the log target which was active at the moment of its
542        creation.
543    %End
544    %TypeHeaderCode
545        #include <wx/log.h>
546    %End
547
548public:
549    wxLogWindow(
550        wxWindow * pParent,
551        const wxString & szTitle,
552        bool show = true,
553        bool passToOld = true
554    );
555
556    wxFrame * GetFrame() const;
557    %Docstring
558        GetFrame() -> Frame
559
560        Returns the associated log frame window.
561    %End
562
563    virtual
564    bool OnFrameClose(
565        wxFrame * frame
566    );
567    %Docstring
568        OnFrameClose(frame) -> bool
569
570        Called if the user closes the window interactively, will not be called
571        if it is destroyed for another reason (such as when program exits).
572    %End
573
574    virtual
575    void OnFrameDelete(
576        wxFrame * frame
577    );
578    %Docstring
579        OnFrameDelete(frame)
580
581        Called right before the log frame is going to be deleted: will always
582        be called unlike OnFrameClose().
583    %End
584
585    void Show(
586        bool show = true
587    );
588    %Docstring
589        Show(show=True)
590
591        Shows or hides the frame.
592    %End
593
594    public:
595
596
597    %Property(name=Frame, get=GetFrame)
598};  // end of class wxLogWindow
599
600
601class wxLogStderr : wxLog
602{
603    %Docstring
604        LogStderr()
605
606        This class can be used to redirect the log messages to a C file stream
607        (not to be confused with C++ streams).
608    %End
609    %TypeHeaderCode
610        #include <wx/log.h>
611    %End
612
613public:
614    wxLogStderr(
615    );
616
617    private:
618        wxLogStderr(const wxLogStderr&);
619
620
621    private:
622        wxLogStderr& operator=(const wxLogStderr&);
623
624
625};  // end of class wxLogStderr
626
627
628class wxLogBuffer : wxLog
629{
630    %Docstring
631        LogBuffer()
632
633        wxLogBuffer is a very simple implementation of log sink which simply
634        collects all the logged messages in a string (except the debug
635        messages which are output in the usual way immediately as we're
636        presumably not interested in collecting them for later).
637    %End
638    %TypeHeaderCode
639        #include <wx/log.h>
640    %End
641
642public:
643    wxLogBuffer();
644
645    virtual
646    void Flush();
647    %Docstring
648        Flush()
649
650        Shows all the messages collected so far to the user (using a message
651        box in the GUI applications or by printing them out to the console in
652        text mode) and clears the internal buffer.
653    %End
654
655    const wxString & GetBuffer() const;
656    %Docstring
657        GetBuffer() -> String
658
659        Returns the current buffer contains.
660    %End
661
662    private:
663        wxLogBuffer(const wxLogBuffer&);
664
665
666    private:
667        wxLogBuffer& operator=(const wxLogBuffer&);
668
669
670    public:
671
672
673    %Property(name=Buffer, get=GetBuffer)
674};  // end of class wxLogBuffer
675
676
677class wxLogTextCtrl : wxLog
678{
679    %Docstring
680        LogTextCtrl(pTextCtrl)
681
682        Using these target all the log messages can be redirected to a text
683        control.
684    %End
685    %TypeHeaderCode
686        #include <wx/log.h>
687    %End
688
689public:
690    wxLogTextCtrl(
691        wxTextCtrl * pTextCtrl
692    );
693
694    private:
695        wxLogTextCtrl(const wxLogTextCtrl&);
696
697
698    private:
699        wxLogTextCtrl& operator=(const wxLogTextCtrl&);
700
701
702};  // end of class wxLogTextCtrl
703
704
705class wxLogFormatter
706{
707    %Docstring
708        LogFormatter()
709
710        wxLogFormatter class is used to format the log messages.
711    %End
712    %TypeHeaderCode
713        #include <wx/log.h>
714    %End
715
716public:
717    wxLogFormatter();
718
719    virtual
720    wxString Format(
721        wxLogLevel level,
722        const wxString & msg,
723        const wxLogRecordInfo & info
724    ) const;
725    %Docstring
726        Format(level, msg, info) -> String
727
728        This function creates the full log message string.
729    %End
730
731
732protected:
733    virtual
734    wxString FormatTime(
735        time_t time
736    ) const;
737    %Docstring
738        FormatTime(time) -> String
739
740        This function formats the time stamp part of the log message.
741    %End
742
743};  // end of class wxLogFormatter
744
745
746void wxSafeShowMessage(
747    const wxString & title,
748    const wxString & text
749);
750%Docstring
751    SafeShowMessage(title, text)
752
753    This function shows a message to the user in a safe way and should be
754    safe to call even before the application has been initialized or if it
755    is currently in some other strange state (for example, about to
756    crash).
757%End
758
759unsigned long wxSysErrorCode();
760%Docstring
761    SysErrorCode() -> unsignedlong
762
763    Returns the error code from the last system call.
764%End
765
766wxString wxSysErrorMsg(
767    unsigned long errCode = 0
768);
769%Docstring
770    SysErrorMsg(errCode=0) -> String
771
772    Returns the error message corresponding to the given system error
773    code.
774%End
775
776void wxLogGeneric(
777    wxLogLevel level,
778    const wxString& message
779);
780%Docstring
781    LogGeneric(level, message)
782
783    Logs a message with the given wxLogLevel.
784%End
785
786void wxLogMessage(
787    const wxString& message
788);
789%Docstring
790    LogMessage(message)
791
792    For all normal, informational messages.
793%End
794
795void wxLogVerbose(
796    const wxString& message
797);
798%Docstring
799    LogVerbose(message)
800
801    For verbose output.
802%End
803
804void wxLogWarning(
805    const wxString& message
806);
807%Docstring
808    LogWarning(message)
809
810    For warnings - they are also normally shown to the user, but don't
811    interrupt the program work.
812%End
813
814void wxLogFatalError(
815    const wxString& message
816);
817%Docstring
818    LogFatalError(message)
819
820    Like wxLogError(), but also terminates the program with the exit code
821    3.
822%End
823
824void wxLogError(
825    const wxString& message
826);
827%Docstring
828    LogError(message)
829
830    The functions to use for error messages, i.e.
831%End
832
833void wxLogDebug(
834    const wxString& message
835);
836%Docstring
837    LogDebug(message)
838
839    The right functions for debug output.
840%End
841
842void wxLogStatus(
843    wxFrame * frame,
844    const wxString& message
845);
846%Docstring
847    LogStatus(frame, message)
848    LogStatus(message)
849
850    Messages logged by this function will appear in the statusbar of the
851    frame or of the top level application window by default (i.e.
852%End
853void wxLogStatus(
854    const wxString& message
855);
856
857
858void wxLogSysError(
859    const wxString& message
860);
861%Docstring
862    LogSysError(message)
863
864    Mostly used by wxWidgets itself, but might be handy for logging errors
865    after system call (API function) failure.
866%End
867
868
869//---------------------------------------------------------------------------
870
871