]>
Commit | Line | Data |
---|---|---|
ca7adbf8 VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/aboutdlg.h | |
3 | // Purpose: declaration of wxAboutDialog class | |
4 | // Author: Vadim Zeitlin | |
5 | // Created: 2006-10-07 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org> | |
8 | // Licence: wxWindows licence | |
9 | /////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_ABOUTDLG_H_ | |
12 | #define _WX_ABOUTDLG_H_ | |
13 | ||
14 | #include "wx/defs.h" | |
15 | ||
16 | #if wxUSE_ABOUTDLG | |
17 | ||
18 | #include "wx/app.h" | |
19 | #include "wx/icon.h" | |
20 | ||
21 | // ---------------------------------------------------------------------------- | |
22 | // wxAboutDialogInfo: information shown by the standard "About" dialog | |
23 | // ---------------------------------------------------------------------------- | |
24 | ||
b85db900 | 25 | class WXDLLIMPEXP_ADV wxAboutDialogInfo |
ca7adbf8 VZ |
26 | { |
27 | public: | |
28 | // all fields are initially uninitialized | |
29 | wxAboutDialogInfo() { } | |
30 | ||
31 | // accessors for various simply fields | |
32 | // ----------------------------------- | |
33 | ||
9cf3d218 | 34 | // name of the program, if not used defaults to wxApp::GetAppDisplayName() |
ca7adbf8 VZ |
35 | void SetName(const wxString& name) { m_name = name; } |
36 | wxString GetName() const | |
9cf3d218 | 37 | { return m_name.empty() ? wxTheApp->GetAppDisplayName() : m_name; } |
ca7adbf8 VZ |
38 | |
39 | // version of the program, in free format (but without "version" word) | |
40 | void SetVersion(const wxString& version) { m_version = version; } | |
41 | bool HasVersion() const { return !m_version.empty(); } | |
6679eeeb | 42 | const wxString& GetVersion() const { return m_version; } |
ca7adbf8 VZ |
43 | |
44 | // brief, but possibly multiline, description of the program | |
45 | void SetDescription(const wxString& desc) { m_description = desc; } | |
46 | bool HasDescription() const { return !m_description.empty(); } | |
6679eeeb | 47 | const wxString& GetDescription() const { return m_description; } |
ca7adbf8 VZ |
48 | |
49 | // short string containing the program copyright information | |
50 | void SetCopyright(const wxString& copyright) { m_copyright = copyright; } | |
51 | bool HasCopyright() const { return !m_copyright.empty(); } | |
6679eeeb | 52 | const wxString& GetCopyright() const { return m_copyright; } |
ca7adbf8 VZ |
53 | |
54 | // long, multiline string containing the text of the program licence | |
55 | void SetLicence(const wxString& licence) { m_licence = licence; } | |
56 | void SetLicense(const wxString& licence) { m_licence = licence; } | |
57 | bool HasLicence() const { return !m_licence.empty(); } | |
6679eeeb | 58 | const wxString& GetLicence() const { return m_licence; } |
ca7adbf8 VZ |
59 | |
60 | // icon to be shown in the dialog, defaults to the main frame icon | |
61 | void SetIcon(const wxIcon& icon) { m_icon = icon; } | |
62 | bool HasIcon() const { return m_icon.Ok(); } | |
a11a0ead | 63 | wxIcon GetIcon() const; |
ca7adbf8 VZ |
64 | |
65 | // web site for the program and its description (defaults to URL itself if | |
66 | // empty) | |
67 | void SetWebSite(const wxString& url, const wxString& desc = wxEmptyString) | |
68 | { | |
69 | m_url = url; | |
70 | m_urlDesc = desc.empty() ? url : desc; | |
71 | } | |
72 | ||
73 | bool HasWebSite() const { return !m_url.empty(); } | |
74 | ||
6679eeeb VS |
75 | const wxString& GetWebSiteURL() const { return m_url; } |
76 | const wxString& GetWebSiteDescription() const { return m_urlDesc; } | |
ca7adbf8 VZ |
77 | |
78 | // accessors for the arrays | |
79 | // ------------------------ | |
80 | ||
81 | // the list of developers of the program | |
82 | void SetDevelopers(const wxArrayString& developers) | |
83 | { m_developers = developers; } | |
84 | void AddDeveloper(const wxString& developer) | |
85 | { m_developers.push_back(developer); } | |
86 | ||
87 | bool HasDevelopers() const { return !m_developers.empty(); } | |
88 | const wxArrayString& GetDevelopers() const { return m_developers; } | |
89 | ||
90 | // the list of documentation writers | |
91 | void SetDocWriters(const wxArrayString& docwriters) | |
92 | { m_docwriters = docwriters; } | |
93 | void AddDocWriter(const wxString& docwriter) | |
94 | { m_docwriters.push_back(docwriter); } | |
95 | ||
96 | bool HasDocWriters() const { return !m_docwriters.empty(); } | |
97 | const wxArrayString& GetDocWriters() const { return m_docwriters; } | |
98 | ||
99 | // the list of artists for the program art | |
100 | void SetArtists(const wxArrayString& artists) | |
101 | { m_artists = artists; } | |
102 | void AddArtist(const wxString& artist) | |
103 | { m_artists.push_back(artist); } | |
104 | ||
105 | bool HasArtists() const { return !m_artists.empty(); } | |
106 | const wxArrayString& GetArtists() const { return m_artists; } | |
107 | ||
108 | // the list of translators | |
109 | void SetTranslators(const wxArrayString& translators) | |
110 | { m_translators = translators; } | |
111 | void AddTranslator(const wxString& translator) | |
112 | { m_translators.push_back(translator); } | |
113 | ||
114 | bool HasTranslators() const { return !m_translators.empty(); } | |
115 | const wxArrayString& GetTranslators() const { return m_translators; } | |
116 | ||
fd3f8f5c VZ |
117 | |
118 | // implementation only | |
119 | // ------------------- | |
120 | ||
121 | // "simple" about dialog shows only textual information (with possibly | |
122 | // default icon but without hyperlink nor any long texts such as the | |
123 | // licence text) | |
124 | bool IsSimple() const | |
125 | { return !HasWebSite() && !HasIcon() && !HasLicence(); } | |
126 | ||
127 | // get the description and credits (i.e. all of developers, doc writers, | |
128 | // artists and translators) as a one long multiline string | |
129 | wxString GetDescriptionAndCredits() const; | |
130 | ||
ca7adbf8 VZ |
131 | private: |
132 | wxString m_name, | |
133 | m_version, | |
134 | m_description, | |
135 | m_copyright, | |
136 | m_licence; | |
137 | ||
138 | wxIcon m_icon; | |
139 | ||
140 | wxString m_url, | |
141 | m_urlDesc; | |
142 | ||
143 | wxArrayString m_developers, | |
144 | m_docwriters, | |
145 | m_artists, | |
146 | m_translators; | |
147 | }; | |
148 | ||
149 | // functions to show the about dialog box | |
b85db900 | 150 | WXDLLIMPEXP_ADV void wxAboutBox(const wxAboutDialogInfo& info); |
ca7adbf8 VZ |
151 | |
152 | #endif // wxUSE_ABOUTDLG | |
153 | ||
154 | #endif // _WX_ABOUTDLG_H_ | |
155 |