wxMaxima
Loading...
Searching...
No Matches
RecentDocuments.h
Go to the documentation of this file.
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2004-2015 Andrej Vodopivec <andrej.vodopivec@gmail.com>
4// Copyright (C) 2014-2018 Gunter Königsmann <wxMaxima@physikbuch.de>
5//
6// This program is free software; you can redistribute it and/or modify
7// it under the terms of the GNU General Public License as published by
8// the Free Software Foundation; either version 2 of the License, or
9// (at your option) any later version.
10//
11// This program is distributed in the hope that it will be useful,
12// but WITHOUT ANY WARRANTY; without even the implied warranty of
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14// GNU General Public License for more details.
15//
16//
17// You should have received a copy of the GNU General Public License
18// along with this program; if not, write to the Free Software
19// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20//
21// SPDX-License-Identifier: GPL-2.0+
22
29#ifndef RECENTDOCUMENTS_H
30#define RECENTDOCUMENTS_H
31
32#include <list>
33#include "precomp.h"
34#include <wx/wx.h>
35#include <wx/config.h>
36#include <wx/tokenzr.h>
37#include <wx/string.h>
38
39
42{
43public:
55 explicit RecentDocuments(const wxString &documentType);
57 void AddDocument(wxString name);
59 void Load();
61 void Save();
63 std::list<wxString> Get() const {return m_listOfFiles;}
69 wxString Get(int num) const;
71 virtual ~RecentDocuments(){Save();}
72private:
74 std::list<wxString> m_listOfFiles;
76 wxString m_documentType;
77};
78#endif
A class that maintains a list of recent documents.
Definition: RecentDocuments.h:42
virtual ~RecentDocuments()
Make sure that we save the list of recent documents on closing the program.
Definition: RecentDocuments.h:71
void Load()
Load the recent documents list.
Definition: RecentDocuments.cpp:31
void AddDocument(wxString name)
Add a new recent document.
Definition: RecentDocuments.cpp:80
std::list< wxString > Get() const
Get the list of recent documents.
Definition: RecentDocuments.h:63
void Save()
Save the recent documents list.
Definition: RecentDocuments.cpp:63