1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: declaration of wxAboutDialog class
4 // Author: Vadim Zeitlin
7 // Copyright: (c) 2006 Vadim Zeitlin <vadim@wxwindows.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_ABOUTDLG_H_
12 #define _WX_ABOUTDLG_H_
21 // ----------------------------------------------------------------------------
22 // wxAboutDialogInfo: information shown by the standard "About" dialog
23 // ----------------------------------------------------------------------------
25 class WXDLLIMPEXP_ADV wxAboutDialogInfo
28 // all fields are initially uninitialized
29 wxAboutDialogInfo() { }
31 // accessors for various simply fields
32 // -----------------------------------
34 // name of the program, if not used defaults to wxApp::GetAppDisplayName()
35 void SetName(const wxString
& name
) { m_name
= name
; }
36 wxString
GetName() const
37 { return m_name
.empty() ? wxTheApp
->GetAppDisplayName() : m_name
; }
39 // version should contain program version without "version" word (e.g.,
40 // "1.2" or "RC2") while longVersion may contain the full version including
41 // "version" word (e.g., "Version 1.2" or "Release Candidate 2")
43 // if longVersion is empty, it is automatically constructed from version
45 // generic and gtk native: use short version only, as a suffix to the
46 // program name msw and osx native: use long version
47 void SetVersion(const wxString
& version
,
48 const wxString
& longVersion
= wxString());
50 bool HasVersion() const { return !m_version
.empty(); }
51 const wxString
& GetVersion() const { return m_version
; }
52 const wxString
& GetLongVersion() const { return m_longVersion
; }
54 // brief, but possibly multiline, description of the program
55 void SetDescription(const wxString
& desc
) { m_description
= desc
; }
56 bool HasDescription() const { return !m_description
.empty(); }
57 const wxString
& GetDescription() const { return m_description
; }
59 // short string containing the program copyright information
60 void SetCopyright(const wxString
& copyright
) { m_copyright
= copyright
; }
61 bool HasCopyright() const { return !m_copyright
.empty(); }
62 const wxString
& GetCopyright() const { return m_copyright
; }
64 // long, multiline string containing the text of the program licence
65 void SetLicence(const wxString
& licence
) { m_licence
= licence
; }
66 void SetLicense(const wxString
& licence
) { m_licence
= licence
; }
67 bool HasLicence() const { return !m_licence
.empty(); }
68 const wxString
& GetLicence() const { return m_licence
; }
70 // icon to be shown in the dialog, defaults to the main frame icon
71 void SetIcon(const wxIcon
& icon
) { m_icon
= icon
; }
72 bool HasIcon() const { return m_icon
.Ok(); }
73 wxIcon
GetIcon() const;
75 // web site for the program and its description (defaults to URL itself if
77 void SetWebSite(const wxString
& url
, const wxString
& desc
= wxEmptyString
)
80 m_urlDesc
= desc
.empty() ? url
: desc
;
83 bool HasWebSite() const { return !m_url
.empty(); }
85 const wxString
& GetWebSiteURL() const { return m_url
; }
86 const wxString
& GetWebSiteDescription() const { return m_urlDesc
; }
88 // accessors for the arrays
89 // ------------------------
91 // the list of developers of the program
92 void SetDevelopers(const wxArrayString
& developers
)
93 { m_developers
= developers
; }
94 void AddDeveloper(const wxString
& developer
)
95 { m_developers
.push_back(developer
); }
97 bool HasDevelopers() const { return !m_developers
.empty(); }
98 const wxArrayString
& GetDevelopers() const { return m_developers
; }
100 // the list of documentation writers
101 void SetDocWriters(const wxArrayString
& docwriters
)
102 { m_docwriters
= docwriters
; }
103 void AddDocWriter(const wxString
& docwriter
)
104 { m_docwriters
.push_back(docwriter
); }
106 bool HasDocWriters() const { return !m_docwriters
.empty(); }
107 const wxArrayString
& GetDocWriters() const { return m_docwriters
; }
109 // the list of artists for the program art
110 void SetArtists(const wxArrayString
& artists
)
111 { m_artists
= artists
; }
112 void AddArtist(const wxString
& artist
)
113 { m_artists
.push_back(artist
); }
115 bool HasArtists() const { return !m_artists
.empty(); }
116 const wxArrayString
& GetArtists() const { return m_artists
; }
118 // the list of translators
119 void SetTranslators(const wxArrayString
& translators
)
120 { m_translators
= translators
; }
121 void AddTranslator(const wxString
& translator
)
122 { m_translators
.push_back(translator
); }
124 bool HasTranslators() const { return !m_translators
.empty(); }
125 const wxArrayString
& GetTranslators() const { return m_translators
; }
128 // implementation only
129 // -------------------
131 // "simple" about dialog shows only textual information (with possibly
132 // default icon but without hyperlink nor any long texts such as the
134 bool IsSimple() const
135 { return !HasWebSite() && !HasIcon() && !HasLicence(); }
137 // get the description and credits (i.e. all of developers, doc writers,
138 // artists and translators) as a one long multiline string
139 wxString
GetDescriptionAndCredits() const;
141 // returns the copyright with the (C) string substituted by the Unicode
143 wxString
GetCopyrightToDisplay() const;
158 wxArrayString m_developers
,
164 // functions to show the about dialog box
165 WXDLLIMPEXP_ADV
void wxAboutBox(const wxAboutDialogInfo
& info
, wxWindow
* parent
= NULL
);
167 #endif // wxUSE_ABOUTDLG
169 #endif // _WX_ABOUTDLG_H_