tomain.h File Reference

#include <list>
#include <map>
#include <qmainwindow.h>
#include <qtimer.h>
#include <qtoolbutton.h>
#include "tobackground.h"
#include <qtoolbar.h>
#include "tomainwindow.h"

Go to the source code of this file.

Data Structures

class  toMain
class  toBusy
class  toPopupButton

Defines

#define TOPrinter   QPrinter
#define TODock   QWidget
#define TOFileDialog   QFileDialog
#define TOMessageBox   QMessageBox
#define TOCATCH

Functions

void toStatusMessage (const QString &str, bool save=false, bool log=true)
toMaintoMainWidget (void)
QString toSQLToAddress (toConnection &conn, const QString &sql)
QString toSQLString (toConnection &conn, const QString &address)
void toReadableColumn (QString &col)
QString toNow (toConnection &conn)
void toSetSessionType (const QString &str)
QString toGetSessionType (void)
QComboBoxtoRefreshCreate (QWidget *parent, const char *name=NULL, const QString &def=QString::null, QComboBox *item=NULL)
void toRefreshParse (toTimer *timer, const QString &str=QString::null)
bool toMonolithic (void)
QString toDeepCopy (const QString &str)
QToolBar * toAllocBar (QWidget *parent, const QString &name, const QString &db)
TODock * toAllocDock (const QString &name, const QString &db, const QPixmap &icon)
void toAttachDock (TODock *dock, QWidget *container, QMainWindow::ToolBarDock place)
int toSizeDecode (const QString &str)
template<class T>
toShift (std::list< T > &lst)
template<class T>
void toUnShift (std::list< T > &lst, const T &str)
template<class T>
toPop (std::list< T > &lst)
template<class T>
void toPush (std::list< T > &lst, const T &str)
template<class T>
std::list< T, std::allocator<
T > >::iterator 
toFind (typename std::list< T, std::allocator< T > > &lst, const T &str)
QString toGetToken (toMarkedText *text, int &curLine, int &pos, bool forward=true, bool comments=false)
QFont toStringToFont (const QString &str)
QString toFontToString (const QFont &fnt)
QString toHelpPath (void)
QCString toReadFile (const QString &filename)
bool toWriteFile (const QString &filename, const QCString &data)
bool toWriteFile (const QString &filename, const QString &data)
bool toCompareLists (QStringList &l1, QStringList &l2, unsigned int len)
void toSetEnv (const QCString &var, const QCString &val)
void toUnSetEnv (const QCString &var)
QString toOpenFilename (const QString &filename, const QString &filter, QWidget *parent)
QString toSaveFilename (const QString &filename, const QString &filter, QWidget *parent)
int toToolMenuIndex (void)
bool toIsIdent (QChar c)
QString toPluginPath (void)
std::list< QString > toStatusMessages (void)
QColor toChartColor (int index)
toConnection & toCurrentConnection (QObject *widget)
toToolWidget * toCurrentTool (QObject *widget)
bool toIsOracle (const toConnection &)
QString toSQLStripSpecifier (const QString &sql)
QString toSQLStripBind (const QString &sql)
QListViewItem * toFindItem (QListView *list, const QString &str)
void toToolCaption (toToolWidget *tool, const QString &caption)
template<class T>
max (T a, T b)
template<class T>
min (T a, T b)


Define Documentation

#define TOCATCH

Value:

catch (const QString &str) {\
      toStatusMessage(str);\
    }

Definition at line 813 of file tomain.h.

Referenced by toMain::addConnection(), toMain::commandCallback(), and toMain::toMain().

#define TODock   QWidget

Definition at line 89 of file tomain.h.

#define TOFileDialog   QFileDialog

Definition at line 90 of file tomain.h.

#define TOMessageBox   QMessageBox

Definition at line 93 of file tomain.h.

#define TOPrinter   QPrinter

Definition at line 88 of file tomain.h.

Referenced by toPieChart::editPrint().


Function Documentation

template<class T>
T max ( a,
b 
)

Get maximum number of a and b.

Definition at line 779 of file tomain.h.

00780 {
00781     return a > b ? a : b ;
00782 }

template<class T>
T min ( a,
b 
)

Get minimum number of a and b.

Definition at line 788 of file tomain.h.

00789 {
00790     return a < b ? a : b ;
00791 }

QToolBar* toAllocBar ( QWidget parent,
const QString &  name,
const QString &  db 
)

Allocate a toolbar. This is needed since Qt and KDE use different toolbars.

Parameters:
parent Parent of toolbar.
name Name of toolbar.
db Database name or empty if N/A.
Returns:
A newly created toolbar.

Referenced by toMain::toMain().

TODock* toAllocDock ( const QString &  name,
const QString &  db,
const QPixmap &  icon 
)

Allocate a new docked window. This is needed since Qt and KDE docks windows differently (Qt 2.x doesn't even have support for docked windows). Observe that you must attach a dock using toAttachDock after allocating it.

Parameters:
name Name of window.
db Database name or empty if N/A.
icon Icon of new dock.
Returns:
A newly allocated fock.

void toAttachDock ( TODock *  dock,
QWidget container,
QMainWindow::ToolBarDock  place 
)

Attach a dock to a specified position.

Parameters:
dock Dock to attach
container Whatever container is supposed to be in the dock window.
place Where to place the dock.

QColor toChartColor ( int  index  ) 

Get a color for a chart item.

Parameters:
index Indicating which chart item to get color for.

Definition at line 79 of file tolinechart.cpp.

References ChartColors.

Referenced by toLineChart::paintChart(), toPieChart::paintChart(), and toLineChart::paintLegend().

00080 {
00081   return ChartColors[index%(sizeof(ChartColors)/sizeof(QColor))];
00082 }

bool toCompareLists ( QStringList &  l1,
QStringList &  l2,
unsigned int  len 
)

Compare two string lists.

Parameters:
l1 First list to compare.
l2 Second list to compare.
len Length of lists to compare.
Returns:
True if all first len elements match.

toConnection& toCurrentConnection ( QObject widget  ) 

Return the connection most closely associated with a widget. Currently connections are only stored in toToolWidgets.

Returns:
Reference toConnection object closest to the current.

toToolWidget* toCurrentTool ( QObject widget  ) 

Return the tool widget most closely associated with a widget.

Returns:
Pointer to tool widget.

QString toDeepCopy ( const QString &  str  ) 

Make a deep copy of a string. Usefull when sharing copying strings between threads.

Parameters:
str String to copy
Returns:
Copied string.

template<class T>
std::list<T,std::allocator<T> >::iterator toFind ( typename std::list< T, std::allocator< T > > &  lst,
const T &  str 
)

Find if an item exists in a list.

Parameters:
lst List to search for value.
str Object to search for.

Definition at line 623 of file tomain.h.

00624 {
00625   for(typename std::list<T,std::allocator<T> >::iterator i=lst.begin();i!=lst.end();i++)
00626     if (*i==str)
00627       return i;
00628   return lst.end();
00629 }

QListViewItem* toFindItem ( QListView *  list,
const QString &  str 
)

Find an item in a listview.

Parameters:
list The list to search for the item.
str The string to search for. You can specify parent/child with : in the string.

QString toFontToString ( const QFont &  fnt  ) 

Convert a font to a string representation.

Parameters:
fnt Font to convert.
Returns:
String representation of font.

QString toGetSessionType ( void   ) 

Get current session type (Style)

Returns:
A string describing the current style.
See also:
toSetSessionType

QString toGetToken ( toMarkedText *  text,
int &  curLine,
int &  pos,
bool  forward = true,
bool  comments = false 
)

Get next SQL token from an editor.

Parameters:
text Editor to get token from
curLine Current line when parsing, modified when calling.
pos Current position when parsing, modified when calling.
forward If true go forward from current position, otherwise backward.
comments Include comments as tokens
Returns:
String with next token in editor

QString toHelpPath ( void   ) 

Get the path to the help directory.

Returns:
Path to the help directory.

bool toIsIdent ( QChar  c  )  [inline]

Check if a character is valid for an identifier in Oracle.

Parameters:
c Character to check
Returns:
True if it is a valid Oracle identifier.

Definition at line 711 of file tomain.h.

00712 {
00713   return c.isLetterOrNumber()||c=='_'||c=='%'||c=='$'||c=='#';
00714 }

bool toIsOracle ( const toConnection &   ) 

Check if this connection is an oracle connection.

toMain* toMainWidget ( void   ) 

Get a pointer to the main window

Returns:
Pointer to main window.

Referenced by toMain::commandCallback(), toMain::displayMessage(), and toMain::toMain().

bool toMonolithic ( void   ) 

Get information about wether this TOra has plugin support or not.

Returns:
True if plugin support is enabled.

QString toNow ( toConnection &  conn  ) 

Get the current database time in the current sessions dateformat.

Parameters:
conn Connection to get address from.
Returns:
String with the current date and time.

QString toOpenFilename ( const QString &  filename,
const QString &  filter,
QWidget parent 
)

Pop up a dialog and choose a file to open.

Parameters:
filename Default filename to open.
filter Filter of filenames (See QFileDialog)
parent Parent of dialog.
Returns:
Selected filename.

QString toPluginPath ( void   ) 

Get installation directory of application (Plugin directory on unix, installation target on windows).

Returns:
String containing directory

template<class T>
T toPop ( std::list< T > &  lst  ) 

Pop the last value out of a list.

Parameters:
lst List to pop value from (Also modified).
Returns:
The value in the list of objects.

Definition at line 596 of file tomain.h.

00597 {
00598   if (lst.begin()==lst.end()) {
00599     T ret;
00600     return ret;
00601   }
00602   T ret=(*lst.rbegin());
00603   lst.pop_back();
00604   return ret;
00605 }

template<class T>
void toPush ( std::list< T > &  lst,
const T &  str 
)

Push an object to the end of a list.

Parameters:
lst List to push value in from of.
str Object to push.

Definition at line 611 of file tomain.h.

Referenced by toMain::connections(), and toMain::displayMessage().

00612 {
00613   lst.push_back(str);
00614 }

void toReadableColumn ( QString &  col  ) 

Make a column name more readable.

Parameters:
col Name of column name, will be modified.

QCString toReadFile ( const QString &  filename  ) 

Read file from filename.

Parameters:
filename Filename to read file from.
Returns:
Contents of file.
Exceptions:
QString describing I/O problem.

QComboBox* toRefreshCreate ( QWidget parent,
const char *  name = NULL,
const QString &  def = QString::null,
QComboBox item = NULL 
)

Create or fill a combobox with refresh intervals.

Parameters:
parent Parent of created combobox.
name Name of created combobox.
def Default value of the combobox.
item Combo box to fill. If not specified a new combobox is created.

void toRefreshParse ( toTimer timer,
const QString &  str = QString::null 
)

Set a timer with the value from a refresh combobox (See toRefreshCreate).

Parameters:
timer Timer to set timeout in.
str String from currentText of combobox. If empty, set to default.

QString toSaveFilename ( const QString &  filename,
const QString &  filter,
QWidget parent 
)

Pop up a dialog and choose a file to save to.

Parameters:
filename Default filename to open.
filter Filter of filenames (See QFileDialog)
parent Parent of dialog.
Returns:
Selected filename.

void toSetEnv ( const QCString &  var,
const QCString &  val 
)

Set environment variable.

Parameters:
var Variable name to set.
val Value to set variable to.

void toSetSessionType ( const QString &  str  ) 

Set the current session type (Style)

Parameters:
str Session to set, can be any of Motif, Motif Plus, SGI, CDE, Windows and Platinum
Exceptions:
QString if style not available.

template<class T>
T toShift ( std::list< T > &  lst  ) 

Shift the first value out of a list.

Parameters:
lst List to shift value from (Also modified).
Returns:
The first value in the list.

Definition at line 572 of file tomain.h.

Referenced by toMain::displayMessage().

00573 {
00574   if (lst.begin()==lst.end()) {
00575     T ret;
00576     return ret;
00577   }
00578   T ret=(*lst.begin());
00579   lst.erase(lst.begin());
00580   return ret;
00581 }

int toSizeDecode ( const QString &  str  ) 

Decode a size string this basically converts "KB" to 1024, "MB" to 1024KB and everything else to 1.

Returns:
Multiplier specified by string.

QString toSQLString ( toConnection &  conn,
const QString &  address 
)

Get the full SQL of an address (See toSQLToAddress) from the SGA.

Parameters:
conn Connection to get address from
sql Address of SQL.
Returns:
String with SQL of statement.
Exceptions:
QString if address not found.

QString toSQLStripBind ( const QString &  sql  ) 

Strip extra binds and replace with empty strings.

Parameters:
sql The sql to strip.
Returns:
Return a string containing the same statement without binds.

QString toSQLStripSpecifier ( const QString &  sql  ) 

Strip extra bind specifier from an SQL statement. (That means the extra <***> part after the bind variable.

Parameters:
sql The sql to strip.
Returns:
Return a string containing the same statement without qualifiers, which means the sql sent to Oracle and available in the SGA.

QString toSQLToAddress ( toConnection &  conn,
const QString &  sql 
)

Get an address to a SQL statement in the SGA. The address has the form 'address:hash_value' which are resolved from the v$sqltext_with_newlines view in Oracle.

Parameters:
conn Connection to get address from
sql Statement to get address for.
Returns:
String with address in.
Exceptions:
QString if address not found.

void toStatusMessage ( const QString &  str,
bool  save = false,
bool  log = true 
)

Display a message in the statusbar of the main window.

Parameters:
str Message to display
save If true don't remove the message after a specified interval.
log Log message. Will never log saved messages.

Referenced by toMain::toMain().

std::list<QString> toStatusMessages ( void   ) 

Get a list of the latest status messages that have been shown.

Referenced by toMain::statusMenu().

QFont toStringToFont ( const QString &  str  ) 

Convert a string representation to a font structure.

Parameters:
str String representing the font.
Returns:
Font structure represented by the string.
See also:
toFontToString

void toToolCaption ( toToolWidget *  tool,
const QString &  caption 
)

Set or change title of a tool window.

Parameters:
tool Widget of tool.
caption Caption to set to the tool.

int toToolMenuIndex ( void   ) 

Get index of menu to insert tool specific menu at.

Returns:
Index of the tool menu entry.

void toUnSetEnv ( const QCString &  var  ) 

Delete an environment variable.

Parameters:
var Environment variable to delete.

template<class T>
void toUnShift ( std::list< T > &  lst,
const T &  str 
)

Push an object to the beginning of a list.

Parameters:
lst List to push value in from of.
str Object to push.

Definition at line 587 of file tomain.h.

00588 {
00589   lst.insert(lst.begin(),str);
00590 }

bool toWriteFile ( const QString &  filename,
const QString &  data 
)

Write file to filename.

Parameters:
filename Filename to write file to.
data Data to write to file.

bool toWriteFile ( const QString &  filename,
const QCString &  data 
)

Write file to filename.

Parameters:
filename Filename to write file to.
data Data to write to file.


Generated on Sat Dec 15 00:01:29 2007 for BulmaGes by  doxygen 1.5.1