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