OSCAR-code/libs/sleeplib/profiles.h
2011-05-26 23:59:21 +10:00

67 lines
1.2 KiB
C++

/*
SleepLib Profiles Header
Author: Mark Watkins <jedimark64@users.sourceforge.net>
License: GPL
*/
#ifndef PROFILES_H
#define PROFILES_H
#include <wx/string.h>
#include <map>
#include "machine.h"
#include "preferences.h"
#include "tinyxml/tinyxml.h"
class Machine;
/**
* @class Profile
* @author Mark Watkins
* @date 28/04/11
* @file profiles.h
* @brief User profile system
*/
class Profile:public Preferences
{
public:
Profile(wxString name);
Profile();
virtual ~Profile();
map<MachineID,Machine *> machlist;
void AddMachine(Machine *m);
void LoadMachineData();
void Import(wxString path);
vector<Machine *> GetMachines(MachineType t);
Machine * GetMachine(MachineType t,wxDateTime date);
virtual void ExtraLoad(TiXmlHandle *root);
virtual TiXmlElement * ExtraSave();
};
extern Preferences *p_pref;
extern Preferences *p_layout;
#define pref (*p_pref)
#define layout (*p_layout)
extern Profile *profile;
namespace Profiles
{
extern map<wxString,Profile *> profiles;
void Scan(); // Initialize and load Profile
void Done(); // Save all Profile objects and clear list
Profile *Create(wxString name,wxString realname,wxString password);
Profile *Get(wxString name);
Profile *Get();
};
#endif //PROFILES_H