KiCad PCB EDA Suite
Loading...
Searching...
No Matches
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 <[email protected]>
5 * Copyright The KiCad Developers, see AUTHORS.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, see <https://www.gnu.org/licenses/>.
19 */
20
21#ifndef ABOUTAPPINFO_H
22#define ABOUTAPPINFO_H
23
24#include <wx/aboutdlg.h>
25#include <wx/bitmap.h>
26#include <wx/dynarray.h>
27
29
30class CONTRIBUTOR;
31
33
34
41{
42public:
44 virtual ~ABOUT_APP_INFO() {};
45
46 void AddDeveloper( const CONTRIBUTOR* developer )
47 {
48 if( developer != NULL )
49 mDevelopers.Add( developer );
50 }
51
52 void AddDocWriter( const CONTRIBUTOR* docwriter )
53 {
54 if( docwriter != NULL )
55 mDocWriters.Add( docwriter );
56 }
57
58 void AddLibrarian( const CONTRIBUTOR* aLibrarian )
59 {
60 if( aLibrarian )
61 mLibrarians.Add( aLibrarian );
62 }
63
64 void AddArtist( const CONTRIBUTOR* artist )
65 {
66 if( artist != NULL )
67 mArtists.Add( artist );
68 }
69
70 void AddTranslator( const CONTRIBUTOR* translator )
71 {
72 if( translator != NULL )
73 mTranslators.Add( translator );
74 }
75
76 void AddPackager( const CONTRIBUTOR* packager )
77 {
78 if( packager != NULL )
79 mPackagers.Add( packager );
80 }
81
82 CONTRIBUTORS GetDevelopers() { return mDevelopers; }
83 CONTRIBUTORS GetDocWriters() { return mDocWriters; }
84 CONTRIBUTORS GetLibrarians() { return mLibrarians; }
85 CONTRIBUTORS GetArtists() { return mArtists; }
86 CONTRIBUTORS GetTranslators() { return mTranslators; }
87 CONTRIBUTORS GetPackagers() { return mPackagers; }
88
89 void SetDescription( const wxString& text ) { description = text; }
90 wxString& GetDescription() { return description; }
91
92 void SetLicense( const wxString& text ) { license = text; }
93 wxString& GetLicense() { return license; }
94
95 void SetAppName( const wxString& name ) { appName = name; }
96 wxString& GetAppName() { return appName; }
97
98 void SetBuildVersion( const wxString& version ) { buildVersion = version; }
99 wxString& GetBuildVersion() { return buildVersion; }
100
101 void SetBuildDate( const wxString& date ) { buildDate = date; }
102 wxString& GetBuildDate() { return buildDate; }
103
104 void SetLibVersion( const wxString& version ) { libVersion = version; }
105 wxString& GetLibVersion() { return libVersion; }
106
107 void SetAppIcon( const wxIcon& aIcon ) { m_appIcon = aIcon; }
108 wxIcon& GetAppIcon() { return m_appIcon; }
109
111 wxBitmap* CreateKiBitmap( BITMAPS aBitmap )
112 {
113 m_bitmaps.emplace_back( KiBitmapNew( aBitmap ) );
114 return m_bitmaps.back().get();
115 }
116
117private:
118 CONTRIBUTORS mDevelopers;
119 CONTRIBUTORS mDocWriters;
120 CONTRIBUTORS mLibrarians;
121 CONTRIBUTORS mArtists;
122 CONTRIBUTORS mTranslators;
123 CONTRIBUTORS mPackagers;
124
125 wxString description;
126 wxString license;
127
128 wxString appName;
129 wxString buildVersion;
130 wxString buildDate;
131 wxString libVersion;
132
133 wxIcon m_appIcon;
134
136 std::vector<std::unique_ptr<wxBitmap>> m_bitmaps;
137};
138
139
153{
154public:
155 CONTRIBUTOR( const wxString& aName, const wxString& aCategory,
156 const wxString& aUrl = wxEmptyString )
157 {
158 m_checked = false;
159 m_name = aName;
160 m_url = aUrl,
161 m_category = aCategory;
162 }
163
164 virtual ~CONTRIBUTOR() {}
165
166 wxString& GetName() { return m_name; }
167 wxString& GetUrl() { return m_url; }
168 wxString& GetCategory() { return m_category; }
169 void SetChecked( bool status ) { m_checked = status; }
170 bool IsChecked() { return m_checked; }
171
172private:
173 wxString m_name;
174 wxString m_url;
175 wxString m_category;
177};
178
179#endif // ABOUTAPPINFO_H
const char * name
WX_DECLARE_OBJARRAY(CONTRIBUTOR, CONTRIBUTORS)
wxBitmap * KiBitmapNew(BITMAPS aBitmap)
Allocate a wxBitmap on heap from a memory record, held in a BITMAPS.
Definition bitmap.cpp:206
BITMAPS
A list of all bitmap identifiers.
void AddDocWriter(const CONTRIBUTOR *docwriter)
Definition aboutinfo.h:52
CONTRIBUTORS GetPackagers()
Definition aboutinfo.h:87
wxString buildDate
Definition aboutinfo.h:130
CONTRIBUTORS GetLibrarians()
Definition aboutinfo.h:84
wxString description
Definition aboutinfo.h:125
std::vector< std::unique_ptr< wxBitmap > > m_bitmaps
Bitmaps to be freed when the dialog is closed.
Definition aboutinfo.h:136
CONTRIBUTORS mArtists
Definition aboutinfo.h:121
wxString & GetLibVersion()
Definition aboutinfo.h:105
wxString & GetAppName()
Definition aboutinfo.h:96
CONTRIBUTORS GetDevelopers()
Definition aboutinfo.h:82
void SetBuildDate(const wxString &date)
Definition aboutinfo.h:101
void AddTranslator(const CONTRIBUTOR *translator)
Definition aboutinfo.h:70
CONTRIBUTORS GetDocWriters()
Definition aboutinfo.h:83
wxString & GetBuildVersion()
Definition aboutinfo.h:99
wxString & GetBuildDate()
Definition aboutinfo.h:102
CONTRIBUTORS mDevelopers
Definition aboutinfo.h:118
CONTRIBUTORS mTranslators
Definition aboutinfo.h:122
void AddDeveloper(const CONTRIBUTOR *developer)
Definition aboutinfo.h:46
void SetAppName(const wxString &name)
Definition aboutinfo.h:95
void SetDescription(const wxString &text)
Definition aboutinfo.h:89
wxString appName
Definition aboutinfo.h:128
CONTRIBUTORS mLibrarians
Definition aboutinfo.h:120
void SetLibVersion(const wxString &version)
Definition aboutinfo.h:104
CONTRIBUTORS mPackagers
Definition aboutinfo.h:123
wxString libVersion
Definition aboutinfo.h:131
wxString & GetDescription()
Definition aboutinfo.h:90
wxBitmap * CreateKiBitmap(BITMAPS aBitmap)
Wrapper to manage memory allocation for bitmaps.
Definition aboutinfo.h:111
void AddArtist(const CONTRIBUTOR *artist)
Definition aboutinfo.h:64
void SetBuildVersion(const wxString &version)
Definition aboutinfo.h:98
CONTRIBUTORS GetTranslators()
Definition aboutinfo.h:86
virtual ~ABOUT_APP_INFO()
Definition aboutinfo.h:44
wxString license
Definition aboutinfo.h:126
wxIcon m_appIcon
Definition aboutinfo.h:133
void SetAppIcon(const wxIcon &aIcon)
Definition aboutinfo.h:107
CONTRIBUTORS GetArtists()
Definition aboutinfo.h:85
wxIcon & GetAppIcon()
Definition aboutinfo.h:108
wxString & GetLicense()
Definition aboutinfo.h:93
void SetLicense(const wxString &text)
Definition aboutinfo.h:92
CONTRIBUTORS mDocWriters
Definition aboutinfo.h:119
void AddLibrarian(const CONTRIBUTOR *aLibrarian)
Definition aboutinfo.h:58
wxString buildVersion
Definition aboutinfo.h:129
void AddPackager(const CONTRIBUTOR *packager)
Definition aboutinfo.h:76
A contributor, a person which was involved in the development of the application or which has contrib...
Definition aboutinfo.h:153
wxString m_category
Definition aboutinfo.h:175
CONTRIBUTOR(const wxString &aName, const wxString &aCategory, const wxString &aUrl=wxEmptyString)
Definition aboutinfo.h:155
wxString & GetName()
Definition aboutinfo.h:166
bool m_checked
Definition aboutinfo.h:176
wxString & GetUrl()
Definition aboutinfo.h:167
wxString & GetCategory()
Definition aboutinfo.h:168
wxString m_url
Definition aboutinfo.h:174
virtual ~CONTRIBUTOR()
Definition aboutinfo.h:164
bool IsChecked()
Definition aboutinfo.h:170
wxString m_name
Definition aboutinfo.h:173
void SetChecked(bool status)
Definition aboutinfo.h:169