KiCad PCB EDA Suite
Loading...
Searching...
No Matches
notifications_manager.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) 2023 Mark Roszko <[email protected]>
5 * Copyright (C) 2023 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, 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 NOTIFICATIONS_MANAGER_H
26#define NOTIFICATIONS_MANAGER_H
27
28#include <kicommon.h>
29#include <functional>
30#include <vector>
31
32class wxString;
33class KISTATUSBAR;
34struct NOTIFICATION;
36class wxWindow;
37class wxCloseEvent;
38
39
41{
42public:
43 wxString title;
44 wxString description;
45 wxString href;
46 wxString key;
47 wxString date;
48};
49
50
52{
53 friend class NOTIFICATION_LIST;
54
55public:
57
67 void CreateOrUpdate( const wxString& aKey, const wxString& aTitle, const wxString& aDescription,
68 const wxString& aHref = wxEmptyString );
69
75 void Remove( const wxString& aKey );
76
80 void Load();
81
85 void Save();
86
90 void ShowList( wxWindow* aParent, wxPoint aPos );
91
95 void RegisterStatusBar( KISTATUSBAR* aStatusBar );
96
100 void UnregisterStatusBar( KISTATUSBAR* aStatusBar );
101
102private:
106 void onListWindowClosed( wxCloseEvent& aEvent );
107
109 std::vector<NOTIFICATION> m_notifications;
110
112 std::vector<NOTIFICATIONS_LIST*> m_shownDialogs;
113
115 std::vector<KISTATUSBAR*> m_statusBars;
116
118 wxFileName m_destFileName;
119};
120
121#endif
KICAD_PLUGIN_EXPORT SCENEGRAPH * Load(char const *aFileName)
reads a model file and creates a generic display structure
KISTATUSBAR is a wxStatusBar suitable for Kicad manager.
Definition: kistatusbar.h:45
std::vector< KISTATUSBAR * > m_statusBars
The cached file path to read/write notifications on disk.
std::vector< NOTIFICATION > m_notifications
Currently shown notification lists.
std::vector< NOTIFICATIONS_LIST * > m_shownDialogs
Status bars registered for updates.
#define KICOMMON_API
Definition: kicommon.h:28
wxString key
Unique key to find a notification.
wxString description
Additional message displayed under title.
wxString title
Title of the notification.
wxString href
URL if any to link to for details.
wxString date
Date notification will display.