]> git.saurik.com Git - wxWidgets.git/blame - interface/apptrait.h
remove wxTextAttr::CreateFont(); return wxNullFont from GetFont() if we have no font...
[wxWidgets.git] / interface / apptrait.h
CommitLineData
23324ae1
FM
1/////////////////////////////////////////////////////////////////////////////
2// Name: apptrait.h
3// Purpose: documentation for wxAppTraits class
4// Author: wxWidgets team
5// RCS-ID: $Id$
6// Licence: wxWindows license
7/////////////////////////////////////////////////////////////////////////////
8
9/**
10 @class wxAppTraits
11 @wxheader{apptrait.h}
7c913512 12
23324ae1
FM
13 The @b wxAppTraits class defines various configurable aspects of a wxApp.
14 You can access it using wxApp::GetTraits function and you can
15 create your own wxAppTraits overriding the
16 wxApp::CreateTraits function.
7c913512 17
23324ae1
FM
18 By default, wxWidgets creates a @c wxConsoleAppTraits object for console
19 applications
20 (i.e. those applications linked against wxBase library only - see the
21 @ref overview_librarieslist "Libraries list" page) and a @c wxGUIAppTraits
22 object for GUI
23 applications.
7c913512 24
23324ae1
FM
25 @library{wxbase}
26 @category{FIXME}
7c913512 27
23324ae1
FM
28 @seealso
29 @ref overview_wxappoverview "wxApp overview", wxApp
30*/
7c913512 31class wxAppTraits
23324ae1
FM
32{
33public:
34 /**
35 Called by wxWidgets to create the default configuration object for the
7c913512
FM
36 application. The default version creates a registry-based
37 wxRegConfig class under MSW and
38 wxFileConfig under all other platforms. The
39 wxApp wxApp::GetAppName and
23324ae1
FM
40 wxApp::GetVendorName methods are used to determine the
41 registry key or file name.
42 */
4cc4bfaf 43 virtual wxConfigBase* CreateConfig();
23324ae1
FM
44
45 /**
46 Creates the global font mapper object used for encodings/charset mapping.
47 */
4cc4bfaf 48 virtual wxFontMapper* CreateFontMapper();
23324ae1
FM
49
50 /**
51 Creates the default log target for the application.
52 */
4cc4bfaf 53 virtual wxLog* CreateLogTarget();
23324ae1
FM
54
55 /**
56 Creates the global object used for printing out messages.
57 */
4cc4bfaf 58 virtual wxMessageOutput* CreateMessageOutput();
23324ae1
FM
59
60 /**
61 Returns the renderer to use for drawing the generic controls (return value may
62 be @NULL
63 in which case the default renderer for the current platform is used);
64 this is used in GUI mode only and always returns @NULL in console.
23324ae1
FM
65 NOTE: returned pointer will be deleted by the caller.
66 */
4cc4bfaf 67 virtual wxRendererNative* CreateRenderer();
23324ae1
FM
68
69 /**
70 This method returns the name of the desktop environment currently
71 running in a Unix desktop. Currently only "KDE" or "GNOME" are
72 supported and the code uses the X11 session protocol vendor name
73 to figure out, which desktop environment is running. The method
74 returns an empty string otherwise and on all other platforms.
75 */
76 virtual wxString GetDesktopEnvironment();
77
78 /**
79 Returns the wxStandardPaths object for the application.
80 It's normally the same for wxBase and wxGUI except in the case of wxMac and
81 wxCocoa.
82 */
83 virtual wxStandardPaths GetStandardPaths();
84
85 /**
86 Returns the wxWidgets port ID used by the running program and eventually
87 fills the given pointers with the values of the major and minor digits
88 of the native toolkit currently used.
89 The version numbers returned are thus detected at run-time and not compile-time
90 (except when this is not possible e.g. wxMotif).
23324ae1
FM
91 E.g. if your program is using wxGTK port this function will return wxPORT_GTK
92 and
93 put in given pointers the versions of the GTK library in use.
23324ae1
FM
94 See wxPlatformInfo for more details.
95 */
4cc4bfaf
FM
96 virtual wxPortId GetToolkitVersion(int* major = NULL,
97 int* minor = NULL);
23324ae1
FM
98
99 /**
100 Returns @true if @c fprintf(stderr) goes somewhere, @false otherwise.
101 */
102 virtual bool HasStderr();
103
104 /**
105 Returns @true if the library was built as wxUniversal. Always returns
106 @false for wxBase-only apps.
107 */
108 bool IsUsingUniversalWidgets();
109
110 /**
111 Shows the assert dialog with the specified message in GUI mode or just prints
112 the string to stderr in console mode.
23324ae1
FM
113 Returns @true to suppress subsequent asserts, @false to continue as before.
114 */
4cc4bfaf 115 virtual bool ShowAssertDialog(const wxString& msg);
23324ae1 116};