QCAD
Open Source 2D CAD
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RMainWindow Class Reference

Base class for an MDI main application window. More...

#include <RMainWindow.h>

Inheritance diagram for RMainWindow:
RProgressHandler RMessageHandler RMainWindowQt

List of all members.

Public Member Functions

void addBlockListener (RBlockListener *l)
 Adds a listener for block change / add / remove events.
void addCoordinateListener (RCoordinateListener *l)
 Adds a listener for coordinate events.
void addExportListener (RExportListener *l)
 Adds a listener for export events.
void addFocusListener (RFocusListener *l)
 Adds a listener for focus changes.
void addImportListener (RImportListener *l)
 Adds a listener for import events.
void addInterTransactionListener (RInterTransactionListener *l)
 Adds a listener for transaction in progress events.
void addLayerListener (RLayerListener *l)
 Adds a listener for layer change / add / remove events.
void addNewDocumentListener (RNewDocumentListener *l)
 Adds a listener for transaction in progress events.
void addPenListener (RPenListener *l)
 Adds a listener for pen change events.
void addPropertyListener (RPropertyListener *l)
 Adds a listener for property events.
void addSelectionListener (RSelectionListener *l)
 Adds a listener for selection events.
void addSnapListener (RSnapListener *l)
 Adds a listener for snap mode changes.
void addTransactionListener (RTransactionListener *l)
 Adds a listener for transaction events.
void addUcsListener (RUcsListener *l)
 Adds a listener for UCS change / add / remove events.
void addViewFocusListener (RViewFocusListener *l)
 Adds a listener for view focus changes.
void addViewListener (RViewListener *l)
 Adds a listener for view change / add / remove events.
virtual void escapeEvent ()=0
virtual QWidget * getChildWidget (const QString &name)=0
virtual RDocumentgetDocument ()=0
virtual RDocumentInterfacegetDocumentInterface ()=0
virtual int getHeight ()=0
virtual int getPositionX ()=0
virtual int getPositionY ()=0
virtual int getWidth ()=0
virtual void handleUserCommand (const QString &message)
virtual void handleUserInfo (const QString &message)
virtual void handleUserMessage (const QString &message)
virtual void handleUserWarning (const QString &message, bool messageBox=false)
virtual void move (int x, int y)=0
 Moves the application window to the given x / y position.
void notifyBlockListeners (RDocumentInterface *documentInterface)
 Notifies all block listeners that at least one block object has changed.
void notifyCoordinateListeners (RDocumentInterface *documentInterface)
 Notifies all coordinate listeners that the coordinate has changed to position.
void notifyExportListenersPost (RDocumentInterface *documentInterface)
 Notifies all Export listeners about post export event.
void notifyExportListenersPre (RDocumentInterface *documentInterface)
 Notifies all Export listeners about pre export event.
void notifyFocusListeners (RDocumentInterface *documentInterface)
 Notifies all focus listeners.
void notifyImportListenersPost (RDocumentInterface *documentInterface)
 Notifies all import listeners about post import event.
void notifyImportListenersPre (RDocumentInterface *documentInterface)
 Notifies all import listeners about pre import event.
void notifyInterTransactionListeners (RDocument *document, RTransaction *transaction=NULL)
 Notifies all transaction in progress listeners.
void notifyLayerListeners (RDocumentInterface *documentInterface)
 Notifies all layer listeners that at least one layer object has changed.
void notifyListeners (bool withNull=false)
void notifyNewDocumentListeners (RDocument *document, RTransaction *transaction)
 Notifies all transaction in progress listeners.
void notifyPenListeners (RDocumentInterface *documentInterface)
 Notifies all pen listeners that the current pen has changed.
void notifyPropertyListeners (RDocument *document, bool onlyChanges=false, RS::EntityType entityTypeFilter=RS::EntityAll)
 Notifies all property listeners that the current property has changed.
void notifyPropertyListeners (RDocument &document, REntity &entity)
 Notifies all property listeners that the current property is the given entity.
void notifyPropertyListeners ()
 Notifies all property listeners that no properties are currently relevant.
void notifySelectionListeners (RDocumentInterface *documentInterface)
 Notifies all selection listeners that the current selection has changed.
void notifySnapListeners (RDocumentInterface *documentInterface)
 Notifies all snap mode listeners.
void notifyTransactionListeners (RDocument *document, RTransaction *transaction=NULL)
 Notifies all transaction listeners.
void notifyUcsListeners (RDocumentInterface *documentInterface)
 Notifies all UCS listeners that at least one UCS object has changed.
void notifyViewFocusListeners (RGraphicsView *view)
 Notifies all view focus listeners.
void notifyViewListeners (RDocumentInterface *documentInterface)
 Notifies all view listeners that at least one view object has changed.
virtual void postCloseEvent ()=0
virtual void postSelectionChangedEvent ()=0
virtual void postTransactionEvent (RTransaction &t, bool onlyChanges=false, RS::EntityType entityTypeFilter=RS::EntityAll)=0
void propertyChangeEvent (RPropertyEvent &event)
virtual void quit ()=0
 Closes the application window.
void removeBlockListener (RBlockListener *l)
void removeCoordinateListener (RCoordinateListener *l)
void removeExportListener (RExportListener *l)
void removeFocusListener (RFocusListener *l)
void removeImportListener (RImportListener *l)
void removeInterTransactionListener (RInterTransactionListener *l)
void removeLayerListener (RLayerListener *l)
void removeNewDocumentListener (RNewDocumentListener *l)
void removePenListener (RPenListener *l)
void removePropertyListener (RPropertyListener *l)
void removeSelectionListener (RSelectionListener *l)
void removeSnapListener (RSnapListener *l)
void removeTransactionListener (RTransactionListener *l)
void removeUcsListener (RUcsListener *l)
void removeViewFocusListener (RViewFocusListener *l)
void removeViewListener (RViewListener *l)
virtual void resize (int width, int height)=0
 Resizes the application window to the given width and height.
 RMainWindow ()
virtual void setCommandPrompt (const QString &text="")=0
virtual void setGraphicsViewCursor (const QCursor &cursor)=0
 Sets the cursor of all graphics views in all MDI children.
virtual void setLeftMouseTip (const QString &text="")=0
virtual void setRightMouseTip (const QString &text="")=0
void ucsSetEvent (const QString &ucsName)
 Called immediately after the user has activated a new UCS to be used as current UCS.
virtual ~RMainWindow ()
- Public Member Functions inherited from RProgressHandler
 RProgressHandler ()
virtual void setProgress (int value)=0
virtual void setProgressEnabled (bool on)
virtual void setProgressEnd ()=0
virtual void setProgressText (const QString &text="")=0

Static Public Member Functions

static RDocumentInterfacegetDocumentInterfaceStatic ()
static RMainWindowgetMainWindow ()
static bool hasMainWindow ()
static void installMessageHandler ()
static void messageHandler (QtMsgType type, const char *msg)

Protected Member Functions

virtual bool readSettings ()
 Restores the application window settings (size, position, ...).
virtual void writeSettings ()
 Stores the application window settings (size, position, ...).

Protected Attributes

QList< RBlockListener * > blockListeners
QList< RCoordinateListener * > coordinateListeners
QList< RExportListener * > exportListeners
QList< RFocusListener * > focusListeners
QList< RImportListener * > importListeners
QList
< RInterTransactionListener * > 
interTransactionListeners
QList< RLayerListener * > layerListeners
QMutex mutex
QList< RNewDocumentListener * > newDocumentListeners
QList< RPenListener * > penListeners
QList< RPropertyListener * > propertyListeners
QList< RSelectionListener * > selectionListeners
QList< RSnapListener * > snapListeners
QList< RTransactionListener * > transactionListeners
QList< RUcsListener * > ucsListeners
QList< RViewFocusListener * > viewFocusListeners
QList< RViewListener * > viewListeners
- Protected Attributes inherited from RProgressHandler
bool progressEnabled

Static Protected Attributes

static RMainWindowmainWindow = NULL
 Copyright (c) 2011-2014 by Andrew Mustun.

Detailed Description

Base class for an MDI main application window.

Scriptable:
This class is wrapped for script environments.

Constructor & Destructor Documentation

RMainWindow::RMainWindow ( )
RMainWindow::~RMainWindow ( )
virtual

Member Function Documentation

void RMainWindow::addBlockListener ( RBlockListener l)

Adds a listener for block change / add / remove events.

void RMainWindow::addCoordinateListener ( RCoordinateListener l)

Adds a listener for coordinate events.

This can for example be a widget that displays the current coordinate.

void RMainWindow::addExportListener ( RExportListener l)

Adds a listener for export events.

void RMainWindow::addFocusListener ( RFocusListener l)

Adds a listener for focus changes.

void RMainWindow::addImportListener ( RImportListener l)

Adds a listener for import events.

void RMainWindow::addInterTransactionListener ( RInterTransactionListener l)

Adds a listener for transaction in progress events.

void RMainWindow::addLayerListener ( RLayerListener l)

Adds a listener for layer change / add / remove events.

void RMainWindow::addNewDocumentListener ( RNewDocumentListener l)

Adds a listener for transaction in progress events.

void RMainWindow::addPenListener ( RPenListener l)

Adds a listener for pen change events.

void RMainWindow::addPropertyListener ( RPropertyListener l)

Adds a listener for property events.

This can for example be a widget that displays the properties of selected entities or the current action.

void RMainWindow::addSelectionListener ( RSelectionListener l)

Adds a listener for selection events.

This can for example be a widget that displays the number of selected entities.

void RMainWindow::addSnapListener ( RSnapListener l)

Adds a listener for snap mode changes.

This can for example be a snap status widget.

void RMainWindow::addTransactionListener ( RTransactionListener l)

Adds a listener for transaction events.

This can for example be an undo or redo button.

void RMainWindow::addUcsListener ( RUcsListener l)

Adds a listener for UCS change / add / remove events.

This can for example be a widget that displays all UCS objects.

void RMainWindow::addViewFocusListener ( RViewFocusListener l)

Adds a listener for view focus changes.

void RMainWindow::addViewListener ( RViewListener l)

Adds a listener for view change / add / remove events.

virtual void RMainWindow::escapeEvent ( )
pure virtual

Implemented in RMainWindowQt.

virtual QWidget* RMainWindow::getChildWidget ( const QString &  name)
pure virtual

Implemented in RMainWindowQt.

virtual RDocument* RMainWindow::getDocument ( )
pure virtual
Returns:
Pointer to the document that is currently open and has the focus or NULL if no document is open.

Implemented in RMainWindowQt.

virtual RDocumentInterface* RMainWindow::getDocumentInterface ( )
pure virtual
Returns:
Pointer to the document interface of the document that is currently open and has the focus or NULL if no document is open.

Implemented in RMainWindowQt.

RDocumentInterface * RMainWindow::getDocumentInterfaceStatic ( )
static
Returns:
Pointer to the document interface of the current document (e.g. the active MDI window) or NULL if no document is open.
virtual int RMainWindow::getHeight ( )
pure virtual
Returns:
Height of the main application window.

Implemented in RMainWindowQt.

RMainWindow * RMainWindow::getMainWindow ( )
static

Reimplemented in RMainWindowQt.

virtual int RMainWindow::getPositionX ( )
pure virtual
Returns:
X position of the main application window (distance from left of screen).

Implemented in RMainWindowQt.

virtual int RMainWindow::getPositionY ( )
pure virtual
Returns:
Y position of the main application window (distance from top of screen).

Implemented in RMainWindowQt.

virtual int RMainWindow::getWidth ( )
pure virtual
Returns:
Width of the main application window.

Implemented in RMainWindowQt.

virtual void RMainWindow::handleUserCommand ( const QString &  message)
inlinevirtual

Implements RMessageHandler.

Reimplemented in RMainWindowQt.

virtual void RMainWindow::handleUserInfo ( const QString &  message)
inlinevirtual

Implements RMessageHandler.

Reimplemented in RMainWindowQt.

virtual void RMainWindow::handleUserMessage ( const QString &  message)
inlinevirtual

Implements RMessageHandler.

Reimplemented in RMainWindowQt.

virtual void RMainWindow::handleUserWarning ( const QString &  message,
bool  messageBox = false 
)
inlinevirtual

Implements RMessageHandler.

Reimplemented in RMainWindowQt.

bool RMainWindow::hasMainWindow ( )
static
void RMainWindow::installMessageHandler ( )
static
void RMainWindow::messageHandler ( QtMsgType  type,
const char *  msg 
)
static
   \par Non-Scriptable:

This function is not available in script environments.

virtual void RMainWindow::move ( int  x,
int  y 
)
pure virtual

Moves the application window to the given x / y position.

Implemented in RMainWindowQt.

void RMainWindow::notifyBlockListeners ( RDocumentInterface documentInterface)

Notifies all block listeners that at least one block object has changed.

void RMainWindow::notifyCoordinateListeners ( RDocumentInterface documentInterface)

Notifies all coordinate listeners that the coordinate has changed to position.

void RMainWindow::notifyExportListenersPost ( RDocumentInterface documentInterface)

Notifies all Export listeners about post export event.

void RMainWindow::notifyExportListenersPre ( RDocumentInterface documentInterface)

Notifies all Export listeners about pre export event.

void RMainWindow::notifyFocusListeners ( RDocumentInterface documentInterface)

Notifies all focus listeners.

void RMainWindow::notifyImportListenersPost ( RDocumentInterface documentInterface)

Notifies all import listeners about post import event.

void RMainWindow::notifyImportListenersPre ( RDocumentInterface documentInterface)

Notifies all import listeners about pre import event.

void RMainWindow::notifyInterTransactionListeners ( RDocument document,
RTransaction transaction = NULL 
)

Notifies all transaction in progress listeners.

void RMainWindow::notifyLayerListeners ( RDocumentInterface documentInterface)

Notifies all layer listeners that at least one layer object has changed.

void RMainWindow::notifyListeners ( bool  withNull = false)
void RMainWindow::notifyNewDocumentListeners ( RDocument document,
RTransaction transaction 
)

Notifies all transaction in progress listeners.

void RMainWindow::notifyPenListeners ( RDocumentInterface documentInterface)

Notifies all pen listeners that the current pen has changed.

void RMainWindow::notifyPropertyListeners ( RDocument document,
bool  onlyChanges = false,
RS::EntityType  entityTypeFilter = RS::EntityAll 
)

Notifies all property listeners that the current property has changed.

void RMainWindow::notifyPropertyListeners ( RDocument document,
REntity entity 
)

Notifies all property listeners that the current property is the given entity.

void RMainWindow::notifyPropertyListeners ( )

Notifies all property listeners that no properties are currently relevant.

void RMainWindow::notifySelectionListeners ( RDocumentInterface documentInterface)

Notifies all selection listeners that the current selection has changed.

void RMainWindow::notifySnapListeners ( RDocumentInterface documentInterface)

Notifies all snap mode listeners.

void RMainWindow::notifyTransactionListeners ( RDocument document,
RTransaction transaction = NULL 
)

Notifies all transaction listeners.

void RMainWindow::notifyUcsListeners ( RDocumentInterface documentInterface)

Notifies all UCS listeners that at least one UCS object has changed.

void RMainWindow::notifyViewFocusListeners ( RGraphicsView view)

Notifies all view focus listeners.

void RMainWindow::notifyViewListeners ( RDocumentInterface documentInterface)

Notifies all view listeners that at least one view object has changed.

virtual void RMainWindow::postCloseEvent ( )
pure virtual

Implemented in RMainWindowQt.

virtual void RMainWindow::postSelectionChangedEvent ( )
pure virtual

Implemented in RMainWindowQt.

virtual void RMainWindow::postTransactionEvent ( RTransaction t,
bool  onlyChanges = false,
RS::EntityType  entityTypeFilter = RS::EntityAll 
)
pure virtual

Implemented in RMainWindowQt.

void RMainWindow::propertyChangeEvent ( RPropertyEvent event)
virtual void RMainWindow::quit ( )
pure virtual

Closes the application window.

Implemented in RMainWindowQt.

bool RMainWindow::readSettings ( )
protectedvirtual

Restores the application window settings (size, position, ...).

Reimplemented in RMainWindowQt.

void RMainWindow::removeBlockListener ( RBlockListener l)
void RMainWindow::removeCoordinateListener ( RCoordinateListener l)
void RMainWindow::removeExportListener ( RExportListener l)
void RMainWindow::removeFocusListener ( RFocusListener l)
void RMainWindow::removeImportListener ( RImportListener l)
void RMainWindow::removeInterTransactionListener ( RInterTransactionListener l)
void RMainWindow::removeLayerListener ( RLayerListener l)
void RMainWindow::removeNewDocumentListener ( RNewDocumentListener l)
void RMainWindow::removePenListener ( RPenListener l)
void RMainWindow::removePropertyListener ( RPropertyListener l)
void RMainWindow::removeSelectionListener ( RSelectionListener l)
void RMainWindow::removeSnapListener ( RSnapListener l)
void RMainWindow::removeTransactionListener ( RTransactionListener l)
void RMainWindow::removeUcsListener ( RUcsListener l)
void RMainWindow::removeViewFocusListener ( RViewFocusListener l)
void RMainWindow::removeViewListener ( RViewListener l)
virtual void RMainWindow::resize ( int  width,
int  height 
)
pure virtual

Resizes the application window to the given width and height.

Implemented in RMainWindowQt.

virtual void RMainWindow::setCommandPrompt ( const QString &  text = "")
pure virtual

Implemented in RMainWindowQt.

virtual void RMainWindow::setGraphicsViewCursor ( const QCursor &  cursor)
pure virtual

Sets the cursor of all graphics views in all MDI children.

Necessary as workaround for Qt cursor bug (cursor inconsistent with multiple widgets on top of each other in MDI area).

Implemented in RMainWindowQt.

virtual void RMainWindow::setLeftMouseTip ( const QString &  text = "")
pure virtual

Implemented in RMainWindowQt.

virtual void RMainWindow::setRightMouseTip ( const QString &  text = "")
pure virtual

Implemented in RMainWindowQt.

void RMainWindow::ucsSetEvent ( const QString &  ucsName)

Called immediately after the user has activated a new UCS to be used as current UCS.

void RMainWindow::writeSettings ( )
protectedvirtual

Stores the application window settings (size, position, ...).

Reimplemented in RMainWindowQt.


Member Data Documentation

QList<RBlockListener*> RMainWindow::blockListeners
protected
QList<RCoordinateListener*> RMainWindow::coordinateListeners
protected
QList<RExportListener*> RMainWindow::exportListeners
protected
QList<RFocusListener*> RMainWindow::focusListeners
protected
QList<RImportListener*> RMainWindow::importListeners
protected
QList<RInterTransactionListener*> RMainWindow::interTransactionListeners
protected
QList<RLayerListener*> RMainWindow::layerListeners
protected
RMainWindow * RMainWindow::mainWindow = NULL
staticprotected

Copyright (c) 2011-2014 by Andrew Mustun.

All rights reserved.

This file is part of the QCAD project.

QCAD is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

QCAD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with QCAD.

QMutex RMainWindow::mutex
protected
QList<RNewDocumentListener*> RMainWindow::newDocumentListeners
protected
QList<RPenListener*> RMainWindow::penListeners
protected
QList<RPropertyListener*> RMainWindow::propertyListeners
protected
QList<RSelectionListener*> RMainWindow::selectionListeners
protected
QList<RSnapListener*> RMainWindow::snapListeners
protected
QList<RTransactionListener*> RMainWindow::transactionListeners
protected
QList<RUcsListener*> RMainWindow::ucsListeners
protected
QList<RViewFocusListener*> RMainWindow::viewFocusListeners
protected
QList<RViewListener*> RMainWindow::viewListeners
protected

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