casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
casa::TBView Class Reference

Current "view" or state of the browser that can be serialized. More...

#include <TBView.h>

Public Member Functions

 TBView ()
 Default Constructor. More...
 
 ~TBView ()
 
void addTableView (TBTableView *view)
 Adds the given table view to this view. More...
 
std::vector< TBTableView * > * getTableViews ()
 Returns the list of table views in this view. More...
 
void setLastOpenedDirectory (casacore::String str)
 Sets the last opened directory for this view. More...
 
casacore::String getLastOpenedDirectory ()
 Returns the last opened directory for this view. More...
 
int chooserHistoryLimit () const
 Gets/Sets the file chooser history limit. More...
 
void setChooserHistoryLimit (int histLimit)
 
bool saveToFile (casacore::String file)
 Saves this view in XML format to the given file. More...
 
bool saveToDefaultFile ()
 Equivalent to saveToFile(defaultFile()). More...
 

Static Public Member Functions

static TBViewloadFromFile (casacore::String file)
 Loads the view saved in the given file and returns it. More...
 
static TBViewloadFromDefaultFile ()
 Equivalent to loadFromFile(defaultFile()). More...
 
static casacore::String defaultFile ()
 Returns the default location to save and load a view: TBConstants::dotCasapyDir() + TBConstants::VIEW_SAVE_LOC. More...
 

Static Private Member Functions

static void fontElem (DOMElement *elem, QFontColor *font)
 Creates an XML element based upon the given QFontColor. More...
 
static QFontColorfontElem (DOMElement *elem)
 Creates a QFontColor based upon the given XML element. More...
 

Private Attributes

casacore::String lastOpenedDir
 Last opened directory. More...
 
int histLimit
 casacore::File chooser history limit. More...
 
std::vector< TBTableView * > views
 casacore::Table views. More...
 

Detailed Description

Current "view" or state of the browser that can be serialized.

Synopsis

The TBView defines the state of the browser and includes: the last opened directory, and the TBTableViews of all currently opened tables. TBView has methods to save to and load from a file on disk.

Definition at line 105 of file TBView.h.

Constructor & Destructor Documentation

casa::TBView::TBView ( )

Default Constructor.

casa::TBView::~TBView ( )

Member Function Documentation

void casa::TBView::addTableView ( TBTableView view)

Adds the given table view to this view.

int casa::TBView::chooserHistoryLimit ( ) const

Gets/Sets the file chooser history limit.

static casacore::String casa::TBView::defaultFile ( )
static

Returns the default location to save and load a view: TBConstants::dotCasapyDir() + TBConstants::VIEW_SAVE_LOC.

static void casa::TBView::fontElem ( DOMElement *  elem,
QFontColor font 
)
staticprivate

Creates an XML element based upon the given QFontColor.

static QFontColor* casa::TBView::fontElem ( DOMElement *  elem)
staticprivate

Creates a QFontColor based upon the given XML element.

casacore::String casa::TBView::getLastOpenedDirectory ( )

Returns the last opened directory for this view.

std::vector<TBTableView*>* casa::TBView::getTableViews ( )

Returns the list of table views in this view.

static TBView* casa::TBView::loadFromDefaultFile ( )
static

Equivalent to loadFromFile(defaultFile()).

static TBView* casa::TBView::loadFromFile ( casacore::String  file)
static

Loads the view saved in the given file and returns it.

If the file is invalid or there are other problems, NULL is returned.

bool casa::TBView::saveToDefaultFile ( )

Equivalent to saveToFile(defaultFile()).

bool casa::TBView::saveToFile ( casacore::String  file)

Saves this view in XML format to the given file.

void casa::TBView::setChooserHistoryLimit ( int  histLimit)
void casa::TBView::setLastOpenedDirectory ( casacore::String  str)

Sets the last opened directory for this view.

Member Data Documentation

int casa::TBView::histLimit
private

casacore::File chooser history limit.

Definition at line 155 of file TBView.h.

casacore::String casa::TBView::lastOpenedDir
private

Last opened directory.

Definition at line 152 of file TBView.h.

std::vector<TBTableView*> casa::TBView::views
private

casacore::Table views.

Definition at line 158 of file TBView.h.


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