Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 70 lines (48 sloc) 1.83 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
// Copyright © 2008-2012 Pioneer Developers. See AUTHORS.txt for details
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt

#ifndef _FORM_H
#define _FORM_H

#include "gui/Gui.h"

class FormController;

class Form : public Gui::Fixed {
public:
enum FormType { BLANK, FACE };

virtual FormType GetType() const = 0;

virtual const std::string &GetTitle() const { return m_title; }
void SetTitle(const std::string &title) { m_title = title; }

virtual void OnClose() { }

protected:
Form(FormController *controller, float w, float h) : Gui::Fixed(w, h), m_formController(controller) {}
virtual ~Form() {}

FormController *m_formController;

private:
std::string m_title;
};


class BlankForm : public Form {
public:
virtual Form::FormType GetType() const { return Form::BLANK; }

protected:
BlankForm(FormController *controller) : Form(controller, 780,400) {}
};


class FaceForm : public Form {
public:
virtual Form::FormType GetType() const { return Form::FACE; }

virtual Uint32 GetFaceFlags() const { return m_faceFlags; }
virtual Uint32 GetFaceSeed() const { return m_faceSeed; }
virtual std::string const& GetCharacterName() const { return m_characterName; }
virtual std::string const& GetCharacterTitle() const { return m_characterTitle; }

void SetFaceFlags(Uint32 flags) { m_faceFlags = flags; }
void SetFaceSeed(Uint32 seed) { m_faceSeed = seed; }
void SetCharacterName(const std::string& name) { m_characterName = name; }
void SetCharacterTitle(const std::string& title) { m_characterTitle = title; }

protected:
FaceForm(FormController *controller) :
Form(controller, 470,400), m_faceFlags(0), m_faceSeed(0),
m_characterName(""), m_characterTitle("") {}

private:
Uint32 m_faceFlags;
Uint32 m_faceSeed;
std::string m_characterName;
std::string m_characterTitle;
};


#endif
Something went wrong with that request. Please try again.