casa
$Rev:20696$
|
Current "view" or state of the browser that can be serialized. More...
#include <TBView.h>
Public Member Functions | |
TBView () | |
Default Constructor. | |
~TBView () | |
void | addTableView (TBTableView *view) |
Adds the given table view to this view. | |
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 TBView * | loadFromFile (String file) |
Loads the view saved in the given file and returns it. | |
static TBView * | loadFromDefaultFile () |
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 QFontColor * | fontElem (DOMElement *elem) |
Creates a QFontColor based upon the given XML element. | |
Private Attributes | |
String | lastOpenedDir |
Last opened directory. | |
int | histLimit |
File chooser history limit. | |
vector< TBTableView * > | views |
Table views. |
Current "view" or state of the browser that can be serialized.
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.
Default Constructor.
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 void casa::TBView::fontElem | ( | DOMElement * | elem, |
QFontColor * | font | ||
) | [static, private] |
Creates an XML element based upon the given QFontColor.
static QFontColor* casa::TBView::fontElem | ( | DOMElement * | elem | ) | [static, private] |
Creates a QFontColor based upon the given XML element.
Returns the last opened directory for this view.
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.
int casa::TBView::histLimit [private] |
String casa::TBView::lastOpenedDir [private] |
vector<TBTableView*> casa::TBView::views [private] |