/* 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 $ */ // -*-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") #define LIST "List" #define LISTFONT wxT(LIST"/Font") #define PRINT "Print" #define PHEADER PRINT"/Header" #define PRINTHFONT wxT(PHEADER"/Font") #define PTEXT PRINT"/Text" #define PRINTTFONT wxT(PTEXT"/Font") #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") enum Justif { LEFT, CENTER, RIGHT }; class ConfigDB { private: wxConfigBase* pConfig; enum Justif StrToJust(const wxString&); wxString JustToStr(enum Justif); enum Justif getJustif(const wxString&); void setJustif(const wxString&, enum Justif); 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); 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); public: ConfigDB(); wxFont ChooseFont(wxFrame*,wxFont); wxColour ChooseColour(wxFrame*,wxColour); // 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); // game drawing long getDxBegin(); long getDxText(int); long getDxEnd(); void setDxBegin(long); void setDxText(int,long); void setDxEnd(long); long getDyH1(); long getDyH2(); long getDyT1(); long getDyT2(); void setDyH1(long); void setDyH2(long); void setDyT1(long); void setDyT2(long); int getSpacesH(int); int getSpacesT(int); void setSpacesH(int,int); void setSpacesT(int,int); enum Justif getJustifH(int); enum Justif getJustifT(int); void setJustifH(int, enum Justif); void setJustifT(int, enum Justif); wxString getNameH(int); void setNameH(int, wxString); long getMarginX(); long getMarginY(); void setMarginX(long); void setMarginY(long); wxFont getFont(wxString); void setFont(wxString,wxFont); void setFontDefault(); wxColour getColour(wxString); void setColour(wxString,wxColour); void setColourDefault(); wxPrintData getPrintData(); void setPrintData(wxPrintData); wxPageSetupData getPageSetupData(); void setPageSetupData(wxPageSetupData); /** * 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(); }; #endif