RcFile Class Reference

Handle the storage and retrieval of configuration information and application settings. More...

#include <RcFile.h>

List of all members.

Public Types

enum  Parm {
  Home, DataPath, Pixelspace, BarLength,
  Grid, BarsToLoad, BackgroundColor, BorderColor,
  GridColor, PaperTradeMode, IndicatorPath, Crosshairs,
  DrawMode, DataPanelSize, ScaleToScreen, QuotePluginPath,
  GroupPath, PortfolioPath, TestPath, PlotFont,
  AppFont, NavAreaSize, LogScale, IndexPath,
  HelpFilePath, UserDocsPath, LastQuotePlugin, MainWindowSize,
  MainWindowPos, PrefDlgWindowSize, EditStockWindowSize, HelpWindowSize,
  BackTesterWindowSize, ScannerWindowSize, ScannerPath, Version,
  PlotSizes, ShowMenuBar, ShowExtraToolbar, COPath,
  LocalIndicatorsPath, FundamentalsPath, CurrentChart, IndicatorGroup,
  QuotePluginStorage, LastNewIndicator, PSButtonCount, PSButton,
  ShowSidePanel, ShowQuitBtn, ShowPrefBtn, ShowSidePanelBtn,
  ShowGridBtn, ShowScaleToScreenBtn, ShowCrosshairBtn, ShowPaperTradeBtn,
  ShowDrawModeBtn, ShowNewIndicatorBtn, ShowDataWindowBtn, ShowMainQuoteBtn,
  ShowHelpButton, ShowSlider, ShowBarsToLoadField, ShowBarSpSpinbox,
  ShowCmps15Btn, ShowCmpsDayBtn, ShowCmpsWkyBtn, ShowCmpsMtyBtn,
  ShowCmpsComboBox, PrefColorCount, PrefColor, ShowRecentCharts,
  LastAktiveNav, LastGroupUsed, LastChartDir, LastIndicatorUsed,
  LastDateTimeCOAdded, IndiGroupSplitterSize, MainToolBarPos, ChartToolBarPos,
  NavigatorPosition, NavigatorActiveButton, RecentChartsList, MAX_PARM
}

Public Member Functions

 RcFile ()
 ~RcFile ()
void loadData (Parm, QString &, const QString &=0)
void loadData (Parm, QString &, const int)
void loadData (Parm, int &, const int=-1)
void loadData (Parm, bool &)
void saveData (Parm, QString &, const QString &=0)
void saveData (Parm, QString &, const int)
void saveData (Parm, int, const int=-1)
void saveData (Parm, const bool)
void loadColor (Parm, QColor &)
void loadColor (Parm, QColor &, const int)
void saveColor (Parm, QColor &)
void saveColor (Parm, QColor &, const int)
void loadFont (Parm, QFont &)
void saveFont (Parm, QFont &)
void loadSplitterSize (Parm, QSplitter *, const QString &=0)
void saveSplitterSize (Parm, QSplitter *, const QString &=0)
void loadPoint (Parm, QPoint &, const int=-1)
void savePoint (Parm, const QPoint &, const int=-1)
void loadSize (Parm, QSize &, const int=-1)
void saveSize (Parm, const QSize &, const int=-1)

Private Attributes

char * Key [MAX_PARM]
char * Def [MAX_PARM]


Detailed Description

Handle the storage and retrieval of configuration information and application settings.

On most platforms they are stored in the ~/.qt/qtstalkerrc plain-text file. On "Mac OS X" they are stored in a binary plist.

See the Trolltech QSettings documentation and Qtstalker developer documentation.

Todo:
It is intended to replace the according functions located in the Config class. Because Config do more than only read/write stettings to and from the rc-file. But Config is often used/included to do only this.

Definition at line 48 of file RcFile.h.


Member Enumeration Documentation

enum RcFile::Parm

Available parameters.

Enumerator:
Home 
DataPath 
Pixelspace 
BarLength 
Grid 
BarsToLoad 
BackgroundColor 
BorderColor 
GridColor 
PaperTradeMode 
IndicatorPath 
Crosshairs 
DrawMode 
DataPanelSize 
ScaleToScreen 
QuotePluginPath 
GroupPath 
PortfolioPath 
TestPath 
PlotFont 
AppFont 
NavAreaSize 
LogScale 
IndexPath 
HelpFilePath 
UserDocsPath 
LastQuotePlugin 
MainWindowSize 
MainWindowPos 
PrefDlgWindowSize 
EditStockWindowSize 
HelpWindowSize 
BackTesterWindowSize 
ScannerWindowSize 
ScannerPath 
Version 
PlotSizes 
ShowMenuBar 
ShowExtraToolbar 
COPath 
LocalIndicatorsPath 
FundamentalsPath 
CurrentChart 
IndicatorGroup 
QuotePluginStorage 
LastNewIndicator 
PSButtonCount 
PSButton 
ShowSidePanel 
ShowQuitBtn 
ShowPrefBtn 
ShowSidePanelBtn 
ShowGridBtn 
ShowScaleToScreenBtn 
ShowCrosshairBtn 
ShowPaperTradeBtn 
ShowDrawModeBtn 
ShowNewIndicatorBtn 
ShowDataWindowBtn 
ShowMainQuoteBtn 
ShowHelpButton 
ShowSlider 
ShowBarsToLoadField 
ShowBarSpSpinbox 
ShowCmps15Btn 
ShowCmpsDayBtn 
ShowCmpsWkyBtn 
ShowCmpsMtyBtn 
ShowCmpsComboBox 
PrefColorCount 
PrefColor 
ShowRecentCharts 
LastAktiveNav 
LastGroupUsed 
LastChartDir 
LastIndicatorUsed 
LastDateTimeCOAdded 
IndiGroupSplitterSize 
MainToolBarPos 
ChartToolBarPos 
NavigatorPosition 
NavigatorActiveButton 
RecentChartsList 
MAX_PARM 

Definition at line 58 of file RcFile.h.


Constructor & Destructor Documentation

RcFile::RcFile (  ) 

Constructor.

Definition at line 37 of file RcFile.cpp.

References AppFont, BackgroundColor, BackTesterWindowSize, BarLength, BarsToLoad, BorderColor, ChartToolBarPos, COPath, Crosshairs, CurrentChart, DataPanelSize, DataPath, Def, DrawMode, EditStockWindowSize, FundamentalsPath, Grid, GridColor, GroupPath, HelpFilePath, HelpWindowSize, Home, IndexPath, IndicatorGroup, IndicatorPath, Key, LastAktiveNav, LastChartDir, LastDateTimeCOAdded, LastGroupUsed, LastIndicatorUsed, LastNewIndicator, LastQuotePlugin, LocalIndicatorsPath, LogScale, MainToolBarPos, MainWindowPos, MainWindowSize, NavAreaSize, NavigatorActiveButton, NavigatorPosition, PaperTradeMode, Pixelspace, PlotFont, PlotSizes, PortfolioPath, PrefColor, PrefColorCount, PrefDlgWindowSize, PSButton, PSButtonCount, QuotePluginPath, QuotePluginStorage, RecentChartsList, ScaleToScreen, ScannerPath, ScannerWindowSize, ShowBarSpSpinbox, ShowBarsToLoadField, ShowCmps15Btn, ShowCmpsComboBox, ShowCmpsDayBtn, ShowCmpsMtyBtn, ShowCmpsWkyBtn, ShowCrosshairBtn, ShowDataWindowBtn, ShowDrawModeBtn, ShowExtraToolbar, ShowGridBtn, ShowHelpButton, ShowMainQuoteBtn, ShowMenuBar, ShowNewIndicatorBtn, ShowPaperTradeBtn, ShowPrefBtn, ShowQuitBtn, ShowRecentCharts, ShowScaleToScreenBtn, ShowSidePanel, ShowSidePanelBtn, ShowSlider, TestPath, UserDocsPath, and Version.

RcFile::~RcFile (  ) 

Destructor.

Definition at line 211 of file RcFile.cpp.


Member Function Documentation

void RcFile::loadData ( Parm  name,
QString &  value,
const QString &  s = 0 
)

Definition at line 220 of file RcFile.cpp.

References Def, and Key.

Referenced by GroupPage::addChartToGroup(), GroupPage::addGroupItem(), QtstalkerApp::addIndicatorButton(), IndicatorPage::addLocalIndicator(), ChartPage::ChartPage(), ChartToolbar::ChartToolbar(), Config::check034Conversion(), Preferences::createCTPage(), Preferences::createETPage(), Preferences::createMTPage(), ChartPage::deleteChart(), GroupPage::deleteGroup(), IndicatorPage::deleteIndicator(), IndicatorPage::deleteIndicatorGroup(), ChartPage::dumpSymbol(), ChartPage::exportChart(), ChartPage::exportSymbol(), ExtraToolbar::ExtraToolbar(), GroupPage::groupNoSelection(), GroupPage::GroupPage(), HelpWindow::HelpWindow(), IndicatorPage::IndicatorPage(), loadColor(), loadData(), loadFont(), loadPoint(), NavigatorTab::loadSettings(), Preferences::loadSettings(), loadSize(), loadSplitterSize(), MainMenubar::MainMenubar(), IndicatorPage::newIndicator(), ChartToolbar::ps1ButtonClicked(), ChartToolbar::ps2ButtonClicked(), ChartToolbar::ps3ButtonClicked(), QtstalkerApp::QtstalkerApp(), ExtraToolbar::slotAddRecentChart(), QtstalkerApp::slotDeleteIndicator(), IndicatorPlot::slotIndicatorHelp(), QtstalkerApp::slotIndicatorSummary(), QtstalkerApp::slotLoadMainToolbarSettings(), QtstalkerApp::slotQuotes(), ExtraToolbar::slotRecentChartSelected(), ExtraToolbar::slotRemoveRecentCharts(), ExtraToolbar::slotSetButtonView(), ChartToolbar::slotSetButtonView(), and IndicatorPage::updateList().

void RcFile::loadData ( Parm  name,
QString &  value,
const   int 
)

Definition at line 233 of file RcFile.cpp.

References loadData().

void RcFile::loadData ( Parm  name,
int &  value,
const   int = -1 
)

Definition at line 240 of file RcFile.cpp.

References Def, and Key.

void RcFile::loadData ( Parm  name,
bool &  value 
)

Definition at line 254 of file RcFile.cpp.

References Def, and Key.

void RcFile::saveData ( Parm  name,
QString &  value,
const QString &  s = 0 
)

Definition at line 267 of file RcFile.cpp.

References Key.

Referenced by QtstalkerApp::barLengthChanged(), QtstalkerApp::loadChart(), IndicatorPage::newIndicator(), saveColor(), saveData(), saveFont(), savePoint(), NavigatorTab::saveSettings(), MainMenubar::saveSettings(), ExtraToolbar::saveSettings(), ChartToolbar::saveSettings(), saveSize(), saveSplitterSize(), Config::setup(), QtstalkerApp::slotChartUpdated(), IndicatorPage::slotGroupChanged(), QtstalkerApp::slotQuit(), QtstalkerApp::slotQuotes(), Preferences::slotSave(), ChartPage::~ChartPage(), and GroupPage::~GroupPage().

void RcFile::saveData ( Parm  name,
QString &  value,
const   int 
)

Definition at line 278 of file RcFile.cpp.

References saveData().

void RcFile::saveData ( Parm  name,
int  value,
const   int = -1 
)

Definition at line 285 of file RcFile.cpp.

References Key.

void RcFile::saveData ( Parm  name,
const   bool 
)

Definition at line 296 of file RcFile.cpp.

References Key.

void RcFile::loadColor ( Parm  name,
QColor &  color 
)

Definition at line 309 of file RcFile.cpp.

References loadData().

Referenced by QtstalkerApp::addIndicatorButton(), and Preferences::loadSettings().

void RcFile::loadColor ( Parm  name,
QColor &  color,
const   int 
)

Definition at line 316 of file RcFile.cpp.

References loadData().

void RcFile::saveColor ( Parm  name,
QColor &  color 
)

Definition at line 323 of file RcFile.cpp.

References saveData().

Referenced by Preferences::slotSave().

void RcFile::saveColor ( Parm  name,
QColor &  color,
const   int 
)

Definition at line 329 of file RcFile.cpp.

References saveData().

void RcFile::loadFont ( Parm  name,
QFont &  font 
)

Definition at line 335 of file RcFile.cpp.

References loadData().

Referenced by QtstalkerApp::addIndicatorButton(), Preferences::loadSettings(), and QtstalkerApp::QtstalkerApp().

void RcFile::saveFont ( Parm  name,
QFont &  font 
)

Definition at line 350 of file RcFile.cpp.

References saveData().

Referenced by Preferences::slotSave().

void RcFile::loadSplitterSize ( Parm  name,
QSplitter *  sp,
const QString &  n = 0 
)

Definition at line 361 of file RcFile.cpp.

References loadData().

Referenced by QtstalkerApp::QtstalkerApp(), and QtstalkerApp::slotLoadPlotSizes().

void RcFile::saveSplitterSize ( Parm  name,
QSplitter *  sp,
const QString &  n = 0 
)

Definition at line 376 of file RcFile.cpp.

References saveData().

Referenced by QtstalkerApp::slotQuit(), and QtstalkerApp::slotSavePlotSizes().

void RcFile::loadPoint ( Parm  name,
QPoint &  p,
const   int = -1 
)

Definition at line 389 of file RcFile.cpp.

References loadData().

Referenced by QtstalkerApp::QtstalkerApp().

void RcFile::savePoint ( Parm  name,
const QPoint &  p,
const   int = -1 
)

Definition at line 399 of file RcFile.cpp.

References saveData().

Referenced by QtstalkerApp::slotQuit().

void RcFile::loadSize ( Parm  name,
QSize &  sz,
const   int = -1 
)

Definition at line 406 of file RcFile.cpp.

References loadData().

Referenced by HelpWindow::HelpWindow(), Preferences::loadSettings(), QtstalkerApp::QtstalkerApp(), and StocksDialog::StocksDialog().

void RcFile::saveSize ( Parm  name,
const QSize &  sz,
const   int = -1 
)

Definition at line 416 of file RcFile.cpp.

References saveData().

Referenced by HelpWindow::exit(), QtstalkerApp::slotQuit(), Preferences::~Preferences(), and StocksDialog::~StocksDialog().


Member Data Documentation

char* RcFile::Key[MAX_PARM] [private]

Definition at line 150 of file RcFile.h.

Referenced by loadData(), RcFile(), and saveData().

char* RcFile::Def[MAX_PARM] [private]

Definition at line 151 of file RcFile.h.

Referenced by loadData(), and RcFile().


The documentation for this class was generated from the following files: