eliot/wxwin/configdb.h

179 lines
5.2 KiB
C
Raw Normal View History

2004-04-08 11:43:06 +02:00
/* Eliot */
/* Copyright (C) 1999 Antoine Fraboulet */
/* Antoine.Fraboulet@free.fr */
/* */
/* This program is free software; you can redistribute it and/or modify */
/* it under the terms of the GNU General Public License as published by */
/* the Free Software Foundation; either version 2 of the License, or */
/* (at your option) any later version. */
/* */
/* This program is distributed in the hope that it will be useful, */
/* but WITHOUT ANY WARRANTY; without even the implied warranty of */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
/* GNU General Public License for more details. */
/* */
/* You should have received a copy of the GNU General Public License */
/* along with this program; if not, write to the Free Software */
/* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
/* $Id: configdb.h,v 1.3 2005/02/05 11:14:56 ipkiss Exp $ */
2004-04-08 11:43:06 +02:00
// -*-C++-*-
#ifndef _CONFIGDB_H
#define _CONFIGDB_H
#include "wx/dc.h"
#include "wx/font.h"
#include "wx/colour.h"
#include "wx/frame.h"
#include "wx/cmndata.h"
#include "wx/config.h"
#define BUTTON_FONT wxFont(8,wxDEFAULT,wxNORMAL,wxNORMAL)
#define BOARD "Board"
#define BCOLOURLINES wxT(BOARD"/Lines")
#define BCOLOURWX2 wxT(BOARD"/Wx2")
#define BCOLOURWX3 wxT(BOARD"/Wx3")
#define BCOLOURLX2 wxT(BOARD"/Lx2")
#define BCOLOURLX3 wxT(BOARD"/Lx3")
#define BCOLOURBACKGROUND wxT(BOARD"/Background")
#define BCOLOURLETTERS wxT(BOARD"/Letters")
#define BCOLOURTSTLETTERS wxT(BOARD"/TstLetters")
#define BOARDFONT wxT(BOARD"/Font")
2004-04-08 11:43:06 +02:00
#define LIST "List"
#define LISTFONT wxT(LIST"/Font")
2004-04-08 11:43:06 +02:00
#define PRINT "Print"
#define PHEADER PRINT"/Header"
#define PRINTHFONT wxT(PHEADER"/Font")
2004-04-08 11:43:06 +02:00
#define PTEXT PRINT"/Text"
#define PRINTTFONT wxT(PTEXT"/Font")
2004-04-08 11:43:06 +02:00
#define FRAME "Frames/"
#define FRAMEBOARD wxT(FRAME"Board")
#define FRAMEVERIF wxT(FRAME"Verif")
#define FRAMESEARCH wxT(FRAME"Search")
#define FRAMEPLUS1 wxT(FRAME"Plus1")
#define FRAMERACC wxT(FRAME"Racc")
#define FRAMEBENJ wxT(FRAME"Benj")
#define FRAMEBAG wxT(FRAME"Bag")
2004-04-08 11:43:06 +02:00
enum Justif { LEFT, CENTER, RIGHT };
class ConfigDB
2004-04-08 11:43:06 +02:00
{
private:
wxConfigBase* pConfig;
enum Justif StrToJust(const wxString&);
wxString JustToStr(enum Justif);
enum Justif getJustif(const wxString&);
2004-04-08 11:43:06 +02:00
void setJustif(const wxString&, enum Justif);
2004-04-08 11:43:06 +02:00
bool Read(const wxString&, bool);
long Read(const wxString&, long);
wxFont Read(const wxString&, wxFont);
wxColour Read(const wxString&, wxColour);
wxString ReadStr(const wxString&, wxString);
2004-04-08 11:43:06 +02:00
void Write(const wxString&, bool);
void Write(const wxString&, long);
void Write(const wxString&, wxFont);
void Write(const wxString&, wxColour);
void Write(const wxString&, wxString);
2004-04-08 11:43:06 +02:00
public:
ConfigDB();
2004-04-08 11:43:06 +02:00
wxFont ChooseFont(wxFrame*,wxFont);
wxColour ChooseColour(wxFrame*,wxColour);
2004-04-08 11:43:06 +02:00
// Dictionary
wxString getDicPath();
wxString getDicName();
wxString getTilePath();
wxString getTileName();
void setDicPath(wxString name,wxString name);
void setTilePath(wxString path,wxString name);
// page setup
long getOrientation();
void setOrientation(long);
2004-04-08 11:43:06 +02:00
// game drawing
long getDxBegin();
long getDxText(int);
long getDxEnd();
void setDxBegin(long);
void setDxText(int,long);
void setDxEnd(long);
2004-04-08 11:43:06 +02:00
long getDyH1();
long getDyH2();
long getDyT1();
long getDyT2();
void setDyH1(long);
void setDyH2(long);
void setDyT1(long);
void setDyT2(long);
2004-04-08 11:43:06 +02:00
int getSpacesH(int);
int getSpacesT(int);
void setSpacesH(int,int);
void setSpacesT(int,int);
2004-04-08 11:43:06 +02:00
enum Justif getJustifH(int);
enum Justif getJustifT(int);
void setJustifH(int, enum Justif);
void setJustifT(int, enum Justif);
2004-04-08 11:43:06 +02:00
wxString getNameH(int);
void setNameH(int, wxString);
2004-04-08 11:43:06 +02:00
long getMarginX();
long getMarginY();
void setMarginX(long);
void setMarginY(long);
2004-04-08 11:43:06 +02:00
wxFont getFont(wxString);
void setFont(wxString,wxFont);
void setFontDefault();
wxColour getColour(wxString);
void setColour(wxString,wxColour);
void setColourDefault();
2004-04-08 11:43:06 +02:00
wxPrintData getPrintData();
void setPrintData(wxPrintData);
wxPageSetupData getPageSetupData();
void setPageSetupData(wxPageSetupData);
/**
2004-04-08 11:43:06 +02:00
* frames
*/
wxSize getFrameSize(wxString);
wxPoint getFramePos(wxString);
int getFrameShow(wxString);
void setFrameSize(wxString,wxSize);
void setFramePos(wxString,wxPoint);
void setFrameShow(wxString,int);
void setFrameDefault();
void setJokerPlus1(bool);
void setRackChecking(bool);
bool getJokerPlus1();
bool getRackChecking();
float getPrintLineScale();
void setPrintLineScale(float);
void setFirstDefault();
2004-04-08 11:43:06 +02:00
};
#endif