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-2017 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 ~ABOUT_APP_INFO() {};
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() { return copyright; }
92 
93  void SetAppName( const wxString& name ) { appName = name; }
94  wxString& GetAppName() { return appName; }
95 
96  void SetBuildVersion( const wxString& version ) { buildVersion = version; }
97  wxString& GetBuildVersion() { return buildVersion; }
98 
99  void SetLibVersion( const wxString& version ) { libVersion = version; }
100  wxString& GetLibVersion() { return libVersion; }
101 
102  void SetAppIcon( const wxIcon& aIcon ) { m_appIcon = aIcon; }
103  wxIcon& GetAppIcon() { return m_appIcon; }
104 
105 private:
106  CONTRIBUTORS developers;
107  CONTRIBUTORS docwriters;
108  CONTRIBUTORS artists;
109  CONTRIBUTORS translators;
110  CONTRIBUTORS packagers;
111 
112  wxString description;
113  wxString license;
114 
115  wxString copyright;
116  wxString appName;
117  wxString buildVersion;
118  wxString libVersion;
119 
120  wxIcon m_appIcon;
121 };
122 
123 
137 {
138 public:
139  CONTRIBUTOR( const wxString& aName,
140  const wxString& aEmail,
141  const wxString& aCategory = wxEmptyString,
142  wxBitmap* aIcon = NULL )
143  {
144  m_checked = false;
145  m_name = aName;
146  m_email = aEmail;
147  m_category = aCategory;
148  m_icon = aIcon;
149  }
150 
151  virtual ~CONTRIBUTOR() {}
152 
153  wxString& GetName() { return m_name; }
154  wxString& GetEMail() { return m_email; }
155  wxString& GetCategory() { return m_category; }
156  wxBitmap* GetIcon() { return m_icon; }
157  void SetChecked( bool status ) { m_checked = status; }
158  bool IsChecked() { return m_checked; }
159 
160 private:
161  wxString m_name;
162  wxString m_email;
163  wxString m_category;
164  wxBitmap* m_icon;
165  bool m_checked;
166 };
167 
168 #endif // ABOUTAPPINFO_H
wxString copyright
Definition: aboutinfo.h:115
void SetCopyright(const wxString &text)
Definition: aboutinfo.h:90
CONTRIBUTORS GetTranslators()
Definition: aboutinfo.h:81
CONTRIBUTORS docwriters
Definition: aboutinfo.h:107
virtual ~ABOUT_APP_INFO()
Definition: aboutinfo.h:46
wxString & GetLibVersion()
Definition: aboutinfo.h:100
void AddTranslator(const CONTRIBUTOR *translator)
Definition: aboutinfo.h:66
void SetChecked(bool status)
Definition: aboutinfo.h:157
wxString & GetCategory()
Definition: aboutinfo.h:155
wxIcon m_appIcon
Definition: aboutinfo.h:120
void AddDocWriter(const CONTRIBUTOR *docwriter)
Definition: aboutinfo.h:54
wxString & GetName()
Definition: aboutinfo.h:153
wxString & GetBuildVersion()
Definition: aboutinfo.h:97
wxIcon & GetAppIcon()
Definition: aboutinfo.h:103
void SetAppIcon(const wxIcon &aIcon)
Definition: aboutinfo.h:102
An object of this class is meant to be used to store application specific information like who has co...
Definition: aboutinfo.h:42
wxString license
Definition: aboutinfo.h:113
wxString libVersion
Definition: aboutinfo.h:118
wxString & GetLicense()
Definition: aboutinfo.h:88
wxString description
Definition: aboutinfo.h:112
wxString m_category
Definition: aboutinfo.h:163
wxString appName
Definition: aboutinfo.h:116
wxString m_email
Definition: aboutinfo.h:162
CONTRIBUTORS GetDocWriters()
Definition: aboutinfo.h:79
void SetBuildVersion(const wxString &version)
Definition: aboutinfo.h:96
wxString buildVersion
Definition: aboutinfo.h:117
void SetDescription(const wxString &text)
Definition: aboutinfo.h:84
wxString & GetAppName()
Definition: aboutinfo.h:94
CONTRIBUTORS GetArtists()
Definition: aboutinfo.h:80
void SetLibVersion(const wxString &version)
Definition: aboutinfo.h:99
bool m_checked
Definition: aboutinfo.h:165
wxString GetCopyright()
Definition: aboutinfo.h:91
CONTRIBUTOR(const wxString &aName, const wxString &aEmail, const wxString &aCategory=wxEmptyString, wxBitmap *aIcon=NULL)
Definition: aboutinfo.h:139
CONTRIBUTORS translators
Definition: aboutinfo.h:109
wxBitmap * m_icon
Definition: aboutinfo.h:164
wxString m_name
Definition: aboutinfo.h:161
wxString & GetEMail()
Definition: aboutinfo.h:154
void AddArtist(const CONTRIBUTOR *artist)
Definition: aboutinfo.h:60
void SetLicense(const wxString &text)
Definition: aboutinfo.h:87
CONTRIBUTORS GetPackagers()
Definition: aboutinfo.h:82
wxBitmap * GetIcon()
Definition: aboutinfo.h:156
CONTRIBUTORS GetDevelopers()
Definition: aboutinfo.h:78
A contributor, a person which was involved in the development of the application or which has contrib...
Definition: aboutinfo.h:136
void AddPackager(const CONTRIBUTOR *packager)
Definition: aboutinfo.h:72
CONTRIBUTORS developers
Definition: aboutinfo.h:106
CONTRIBUTORS packagers
Definition: aboutinfo.h:110
void AddDeveloper(const CONTRIBUTOR *developer)
Definition: aboutinfo.h:48
const char * name
wxString & GetDescription()
Definition: aboutinfo.h:85
CONTRIBUTORS artists
Definition: aboutinfo.h:108
virtual ~CONTRIBUTOR()
Definition: aboutinfo.h:151
bool IsChecked()
Definition: aboutinfo.h:158
void SetAppName(const wxString &name)
Definition: aboutinfo.h:93
WX_DECLARE_OBJARRAY(CONTRIBUTOR, CONTRIBUTORS)