KiCad PCB EDA Suite
aboutinfo.h
Go to the documentation of this file.
1 /*
2  * This program source code file is part of KiCad, a free EDA CAD application.
3  *
4  * Copyright (C) 2014 Rafael Sokolowski <Rafael.Sokolowski@web.de>
5  * Copyright (C) 2014-2015 KiCad Developers, see CHANGELOG.TXT for contributors.
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, you may find one here:
19  * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20  * or you may search the http://www.gnu.org website for the version 2 license,
21  * or you may write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23  */
24 
25 #ifndef ABOUTAPPINFO_H
26 #define ABOUTAPPINFO_H
27 
28 #include <wx/aboutdlg.h>
29 #include <wx/bitmap.h>
30 #include <wx/dynarray.h>
31 
32 class Contributor;
33 
34 WX_DECLARE_OBJARRAY( Contributor, Contributors );
35 
36 
43 {
44 public:
46  virtual ~AboutAppInfo() {};
47 
48  void AddDeveloper( const Contributor* developer )
49  {
50  if( developer != NULL )
51  developers.Add( developer );
52  }
53 
54  void AddDocWriter( const Contributor* docwriter )
55  {
56  if( docwriter != NULL )
57  docwriters.Add( docwriter );
58  }
59 
60  void AddArtist( const Contributor* artist )
61  {
62  if( artist != NULL )
63  artists.Add( artist );
64  }
65 
66  void AddTranslator( const Contributor* translator )
67  {
68  if( translator != NULL )
69  translators.Add( translator );
70  }
71 
72  void AddPackager( const Contributor* packager )
73  {
74  if( packager != NULL )
75  packagers.Add( packager );
76  }
77 
78  Contributors GetDevelopers() { return developers; }
79  Contributors GetDocWriters() { return docwriters; }
80  Contributors GetArtists() { return artists; }
81  Contributors GetTranslators() { return translators; }
82  Contributors GetPackagers() { return packagers; }
83 
84  void SetDescription( const wxString& text ) { description = text; }
85  wxString& GetDescription() { return description; }
86 
87  void SetLicense( const wxString& text ) { license = text; }
88  wxString& GetLicense() { return license; }
89 
90  void SetCopyright( const wxString& text ) { copyright = text; }
91  wxString GetCopyright()
92  {
93  wxString copyrightText = copyright;
94 
95 #if wxUSE_UNICODE
96  const wxString utf8_copyrightSign = wxString::FromUTF8( "\xc2\xa9" );
97  copyrightText.Replace( "(c)", utf8_copyrightSign );
98  copyrightText.Replace( "(C)", utf8_copyrightSign );
99 #endif // wxUSE_UNICODE
100 
101  return copyrightText;
102  }
103 
104  void SetAppName( const wxString& name ) { appName = name; }
105  wxString& GetAppName() { return appName; }
106 
107  void SetBuildVersion( const wxString& version ) { buildVersion = version; }
108  wxString& GetBuildVersion() { return buildVersion; }
109 
110  void SetLibVersion( const wxString& version ) { libVersion = version; }
111  wxString& GetLibVersion() { return libVersion; }
112 
113  void SetIcon( const wxIcon& icon ) { appIcon = icon; }
114  wxIcon& GetIcon() { return appIcon; }
115 
116 private:
117  Contributors developers;
118  Contributors docwriters;
119  Contributors artists;
120  Contributors translators;
121  Contributors packagers;
122 
123  wxString description;
124  wxString license;
125 
126  wxString copyright; // Todo: copyright sign in unicode
127  wxString appName;
128  wxString buildVersion;
129  wxString libVersion;
130 
131  wxIcon appIcon;
132 };
133 
134 
148 {
149 public:
150  Contributor( const wxString& name,
151  const wxString& email,
152  const wxString& category = wxEmptyString,
153  wxBitmap* icon = NULL ) :
154  m_checked( false )
155  { m_name = name; m_email = email; m_category = category; m_icon = icon; }
156 
157  virtual ~Contributor() {}
158 
159  wxString& GetName() { return m_name; }
160  wxString& GetEMail() { return m_email; }
161  wxString& GetCategory() { return m_category; }
162  wxBitmap* GetIcon() { return m_icon; }
163  void SetChecked( bool status ) { m_checked = status; }
164  bool IsChecked() { return m_checked; }
165 
166 private:
167  wxString m_name;
168  wxString m_email;
169  wxString m_category;
170  wxBitmap* m_icon;
171  bool m_checked;
172 };
173 
174 #endif // ABOUTAPPINFO_H
wxString & GetName()
Definition: aboutinfo.h:159
WX_DECLARE_OBJARRAY(Contributor, Contributors)
void AddDocWriter(const Contributor *docwriter)
Definition: aboutinfo.h:54
void SetDescription(const wxString &text)
Definition: aboutinfo.h:84
void SetBuildVersion(const wxString &version)
Definition: aboutinfo.h:107
wxString buildVersion
Definition: aboutinfo.h:128
void AddArtist(const Contributor *artist)
Definition: aboutinfo.h:60
void AddPackager(const Contributor *packager)
Definition: aboutinfo.h:72
bool IsChecked()
Definition: aboutinfo.h:164
wxString appName
Definition: aboutinfo.h:127
wxBitmap * GetIcon()
Definition: aboutinfo.h:162
wxBitmap * m_icon
Definition: aboutinfo.h:170
Contributors packagers
Definition: aboutinfo.h:121
wxString m_email
Definition: aboutinfo.h:168
void SetIcon(const wxIcon &icon)
Definition: aboutinfo.h:113
wxString license
Definition: aboutinfo.h:124
wxString & GetDescription()
Definition: aboutinfo.h:85
Contributor(const wxString &name, const wxString &email, const wxString &category=wxEmptyString, wxBitmap *icon=NULL)
Definition: aboutinfo.h:150
virtual ~Contributor()
Definition: aboutinfo.h:157
wxString & GetCategory()
Definition: aboutinfo.h:161
Contributors GetDevelopers()
Definition: aboutinfo.h:78
wxString & GetLicense()
Definition: aboutinfo.h:88
wxString m_name
Definition: aboutinfo.h:167
void SetAppName(const wxString &name)
Definition: aboutinfo.h:104
wxIcon & GetIcon()
Definition: aboutinfo.h:114
wxString description
Definition: aboutinfo.h:123
void AddDeveloper(const Contributor *developer)
Definition: aboutinfo.h:48
Contributors artists
Definition: aboutinfo.h:119
virtual ~AboutAppInfo()
Definition: aboutinfo.h:46
wxString m_category
Definition: aboutinfo.h:169
A contributor, a person which was involved in the development of the application or which has contrib...
Definition: aboutinfo.h:147
wxIcon appIcon
Definition: aboutinfo.h:131
wxString GetCopyright()
Definition: aboutinfo.h:91
wxString & GetBuildVersion()
Definition: aboutinfo.h:108
Contributors GetTranslators()
Definition: aboutinfo.h:81
Contributors docwriters
Definition: aboutinfo.h:118
Contributors translators
Definition: aboutinfo.h:120
Contributors GetPackagers()
Definition: aboutinfo.h:82
An object of this class is meant to be used to store application specific information like who has co...
Definition: aboutinfo.h:42
wxString & GetLibVersion()
Definition: aboutinfo.h:111
void SetLicense(const wxString &text)
Definition: aboutinfo.h:87
void SetChecked(bool status)
Definition: aboutinfo.h:163
Contributors developers
Definition: aboutinfo.h:117
void AddTranslator(const Contributor *translator)
Definition: aboutinfo.h:66
Contributors GetDocWriters()
Definition: aboutinfo.h:79
const char * name
Contributors GetArtists()
Definition: aboutinfo.h:80
wxString & GetAppName()
Definition: aboutinfo.h:105
bool m_checked
Definition: aboutinfo.h:171
void SetCopyright(const wxString &text)
Definition: aboutinfo.h:90
void SetLibVersion(const wxString &version)
Definition: aboutinfo.h:110
wxString copyright
Definition: aboutinfo.h:126
wxString & GetEMail()
Definition: aboutinfo.h:160
wxString libVersion
Definition: aboutinfo.h:129