casa::TBView Class Reference

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

#include <TBView.h>

List of all members.

Public Member Functions

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

Static Public Member Functions

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

Static Private Member Functions

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

Private Attributes

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

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 String casa::TBView::defaultFile (  )  [static]

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

static QFontColor* casa::TBView::fontElem ( DOMElement *  elem  )  [static, private]

Creates a QFontColor based upon the given XML element.

static void casa::TBView::fontElem ( DOMElement *  elem,
QFontColor font 
) [static, private]

Creates an XML element based upon the given QFontColor.

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 ( 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 ( String  file  ) 

Saves this view in XML format to the given file.

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

Sets the last opened directory for this view.


Member Data Documentation

int casa::TBView::histLimit [private]

File chooser history limit.

Definition at line 155 of file TBView.h.

String casa::TBView::lastOpenedDir [private]

Last opened directory.

Definition at line 152 of file TBView.h.

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

Table views.

Definition at line 158 of file TBView.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1