TinkerCell Core 1.0
TinkerCell's Core library providing all basic functionalities
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Slots | Friends
Tinkercell::Tool Class Reference

everything other than the main window is a tool More...

#include <Tool.h>

Inheritance diagram for Tinkercell::Tool:
Inheritance graph
[legend]
Collaboration diagram for Tinkercell::Tool:
Collaboration graph
[legend]

List of all members.

Public Slots

virtual void select (int i=0)
 what happens when this tool is selected
virtual void deselect (int i=0)
 what happens when this tool is deselected
virtual void addAction (const QIcon &, const QString &text=QString(), const QString &tooltip=QString())
 add an action that will be displayed in the context menu when specific items with this tool in their tools list are selected
virtual void addGraphicsItem (ToolGraphicsItem *)
 add a graphics item that will be displayed on the current scene when specific items with this tool in their tools list are selected

Signals

void selected ()
 this tool is selected
void deselected ()
 this tool is deselected

Public Member Functions

 Tool ()
 constructor
 ~Tool ()
 destructor. removes graphicsItem and toolButton is not 0
 Tool (const QString &Name, const QString &category=QString(), QWidget *parent=0)
 constructor
virtual bool setMainWindow (MainWindow *main)
 set the main window for this tool
ConsoleWindowconsole ()
 console window (same as mainWindow->console())
GraphicsScenecurrentScene () const
 the main window's current scene
TextEditorcurrentTextEditor () const
 the main window's current text editor
NetworkHandlecurrentNetwork () const
 the main window's current network
NetworkWindowcurrentWindow () const
 the main window's current network's current window
QPair< QList< ItemHandle * >
, QList< QGraphicsItem * > > 
getItemsFromFile (const QString &filename)
 get the items inside a file. Some tool must implement this function and connect to the getItemsFromFile signal. The Core library does not implement a read file function.

Static Public Member Functions

static QString homeDir ()
 same as MainWindow::homeDir
static QString tempDir ()
 same as MainWindow::tempDir

Public Attributes

QString name
 name of this tool
QString category
 category that this tool belongs in
QString description
 brief description of this tool
MainWindowmainWindow
 main window for this tool

Protected Slots

virtual void actionTriggered (QAction *action)
 context menu action triggered

Friends

class GraphicsScene
class TextEditor
class MainWindow
class NetworkHandle
class ToolGraphicsItem

Detailed Description

everything other than the main window is a tool

Definition at line 40 of file Tool.h.


Constructor & Destructor Documentation

Tinkercell::Tool::Tool ( )

constructor

Definition at line 59 of file Tool.cpp.

Tinkercell::Tool::~Tool ( )

destructor. removes graphicsItem and toolButton is not 0

Definition at line 46 of file Tool.cpp.

Tinkercell::Tool::Tool ( const QString &  Name,
const QString &  category = QString(),
QWidget *  parent = 0 
)

constructor

Parameters:
QStringname
QStringcategory (default = empty)
QWidget*parent (default = 0)

Definition at line 66 of file Tool.cpp.


Member Function Documentation

void Tinkercell::Tool::actionTriggered ( QAction *  action) [protected, virtual, slot]

context menu action triggered

Definition at line 85 of file Tool.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Tinkercell::Tool::addAction ( const QIcon &  icon,
const QString &  text = QString(),
const QString &  tooltip = QString() 
) [virtual, slot]

add an action that will be displayed in the context menu when specific items with this tool in their tools list are selected

Definition at line 161 of file Tool.cpp.

void Tinkercell::Tool::addGraphicsItem ( ToolGraphicsItem item) [virtual, slot]

add a graphics item that will be displayed on the current scene when specific items with this tool in their tools list are selected

Definition at line 168 of file Tool.cpp.

ConsoleWindow * Tinkercell::Tool::console ( )

console window (same as mainWindow->console())

Definition at line 154 of file Tool.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

NetworkHandle * Tinkercell::Tool::currentNetwork ( ) const

the main window's current network

Returns:
NetworkHandle* current network handle

Definition at line 132 of file Tool.cpp.

Here is the call graph for this function:

GraphicsScene * Tinkercell::Tool::currentScene ( ) const

the main window's current scene

Definition at line 118 of file Tool.cpp.

Here is the call graph for this function:

TextEditor * Tinkercell::Tool::currentTextEditor ( ) const

the main window's current text editor

Definition at line 125 of file Tool.cpp.

Here is the call graph for this function:

NetworkWindow * Tinkercell::Tool::currentWindow ( ) const

the main window's current network's current window

Returns:
NetworkWindow* current network window

Definition at line 111 of file Tool.cpp.

Here is the call graph for this function:

void Tinkercell::Tool::deselect ( int  i = 0) [virtual, slot]

what happens when this tool is deselected

Definition at line 100 of file Tool.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Tinkercell::Tool::deselected ( ) [signal]

this tool is deselected

Here is the caller graph for this function:

QPair< QList< ItemHandle * >, QList< QGraphicsItem * > > Tinkercell::Tool::getItemsFromFile ( const QString &  filename)

get the items inside a file. Some tool must implement this function and connect to the getItemsFromFile signal. The Core library does not implement a read file function.

Parameters:
QString&file that is selected by user
Returns:
QPair< QList<ItemHandle*>, QList<QGraphicsItem*> > list of handles and graphics items inside the file
void

Definition at line 174 of file Tool.cpp.

Here is the call graph for this function:

QString Tinkercell::Tool::homeDir ( ) [static]

same as MainWindow::homeDir

Definition at line 139 of file Tool.cpp.

void Tinkercell::Tool::select ( int  i = 0) [virtual, slot]

what happens when this tool is selected

Definition at line 92 of file Tool.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void Tinkercell::Tool::selected ( ) [signal]

this tool is selected

Here is the caller graph for this function:

bool Tinkercell::Tool::setMainWindow ( MainWindow main) [virtual]

set the main window for this tool

Reimplemented in Tinkercell::AbstractInputWindow.

Definition at line 70 of file Tool.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

QString Tinkercell::Tool::tempDir ( ) [static]

same as MainWindow::tempDir

Definition at line 144 of file Tool.cpp.


Friends And Related Function Documentation

friend class GraphicsScene [friend]

Definition at line 136 of file Tool.h.

friend class MainWindow [friend]

Definition at line 138 of file Tool.h.

friend class NetworkHandle [friend]

Definition at line 139 of file Tool.h.

friend class TextEditor [friend]

Definition at line 137 of file Tool.h.

friend class ToolGraphicsItem [friend]

Definition at line 140 of file Tool.h.


Member Data Documentation

category that this tool belongs in

Definition at line 49 of file Tool.h.

brief description of this tool

Definition at line 51 of file Tool.h.

main window for this tool

Definition at line 53 of file Tool.h.

name of this tool

Definition at line 47 of file Tool.h.


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