]>
git.saurik.com Git - wxWidgets.git/blob - interface/apptrait.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: interface of wxAppTraits
4 // Author: wxWidgets team
6 // Licence: wxWindows license
7 /////////////////////////////////////////////////////////////////////////////
13 The wxAppTraits class defines various configurable aspects of a wxApp.
14 You can access it using wxApp::GetTraits() function and you can create your
15 own wxAppTraits overriding the wxApp::CreateTraits() function.
17 Note that wxAppTraits is an abstract class since it contains many
18 pure virtual functions.
19 In fact, by default, wxWidgets creates a @c wxConsoleAppTraits object for
20 console applications (i.e. those applications linked against wxBase library
21 only - see the @ref page_libs page) and a @c wxGUIAppTraits object for GUI
23 Both these classes are derived by wxAppTraits and represent concrete
24 implementation of the wxAppTraits interface.
27 @category{appmanagement}
29 @see @ref overview_app, wxApp
35 Called by wxWidgets to create the default configuration object for the
36 application. The default version creates a registry-based wxRegConfig
37 class under MSW and wxFileConfig under all other platforms.
39 The wxApp::GetAppName and wxApp::GetVendorName methods are used to
40 determine the registry key or file name.
42 virtual wxConfigBase
* CreateConfig();
45 Creates the global font mapper object used for encodings/charset mapping.
47 virtual wxFontMapper
* CreateFontMapper() = 0;
50 Creates a wxLog class for the application to use for logging errors.
51 The default implementation returns a new wxLogGui class.
55 virtual wxLog
* CreateLogTarget() = 0;
58 Creates the global object used for printing out messages.
60 virtual wxMessageOutput
* CreateMessageOutput() = 0;
63 Returns the renderer to use for drawing the generic controls (return
64 value may be @NULL in which case the default renderer for the current
65 platform is used); this is used in GUI mode only and always returns @NULL
68 @note the returned pointer needs to be deleted by the caller.
70 virtual wxRendererNative
* CreateRenderer() = 0;
73 This method returns the name of the desktop environment currently
74 running in a Unix desktop. Currently only "KDE" or "GNOME" are
75 supported and the code uses the X11 session protocol vendor name
76 to figure out, which desktop environment is running. The method
77 returns an empty string otherwise and on all other platforms.
79 virtual wxString
GetDesktopEnvironment() const = 0;
82 Returns the wxStandardPaths object for the application.
83 It's normally the same for wxBase and wxGUI except in the case of wxMac
86 @todo the real function returns a reference to wxStandardPathsBase;
87 user looking at these docs will write code:
88 wxStandardPaths &ref = ...->GetStandardPaths();
89 which won't compile...
91 virtual wxStandardPaths
& GetStandardPaths();
94 Returns the wxWidgets port ID used by the running program and eventually
95 fills the given pointers with the values of the major and minor digits
96 of the native toolkit currently used.
98 The version numbers returned are thus detected at run-time and not compile-time
99 (except when this is not possible e.g. wxMotif).
101 E.g. if your program is using wxGTK port this function will return wxPORT_GTK
102 and put in given pointers the versions of the GTK library in use.
103 See wxPlatformInfo for more details.
105 virtual wxPortId
GetToolkitVersion(int* major
= NULL
, int* minor
= NULL
) const = 0;
108 Returns @true if @c fprintf(stderr) goes somewhere, @false otherwise.
110 virtual bool HasStderr() = 0;
113 Returns @true if the library was built as wxUniversal.
114 Always returns @false for wxBase-only apps.
116 virtual bool IsUsingUniversalWidgets() const = 0;
119 Shows the assert dialog with the specified message in GUI mode or just prints
120 the string to stderr in console mode.
121 Returns @true to suppress subsequent asserts, @false to continue as before.
123 virtual bool ShowAssertDialog(const wxString
& msg
) = 0;