FreeCAD C++
Public Types | Public Member Functions | Protected Slots | List of all members
Gui::MDIView Class Reference

#include <Gui/MDIView.h>

Detailed Description

Base class of all windows belonging to a document. There are two ways of belonging to a document:

Public Types

enum  ViewMode { Child, TopLevel, FullScreen }
 MDI view mode enum. More...
 

Public Member Functions

 MDIView (Gui::Document *pcDocument, QWidget *parent, Qt::WindowFlags wflags=0)
 
 ~MDIView ()
 
virtual void onRelabel (Gui::Document *pDoc)
 get called when the document is updated
 
virtual bool onMsg (const char *pMsg, const char **ppReturn)
 Message handler.
 
virtual bool onHasMsg (const char *pMsg) const
 Message handler test.
 
virtual bool canClose (void)
 overwrite when checking on close state
 
virtual void deleteSelf ()
 delete itself
 
virtual void setCurrentViewMode (ViewMode mode)
 
template<typename _T >
_T getActiveObject (const char *name) const
 access getter for the active object list
 
- Public Member Functions inherited from Gui::BaseView
 BaseView (Gui::Document *pcDocument=0)
 
virtual ~BaseView ()
 
Gui::DocumentgetGuiDocument () const
 returns the document the view is attached to
 
App::DocumentgetAppDocument () const
 returns the document the view is attached to
 
bool isPassive (void) const
 indicates if the view is in passive mode
 
void setDocument (Gui::Document *pcDocument)
 sets the view to another document (called by Application)
 
void onClose (void)
 is sent from the document in order to close the document
 
virtual void onUpdate (void)
 get called when the document is updated
 
virtual void onRename (Gui::Document *)
 get called when the document is renamed (change of its internal name)
 
virtual const char * getName (void) const
 returns the name of the view (important for messages)
 
- Public Member Functions inherited from Base::BaseClass
 BaseClass ()
 Construction.
 
virtual ~BaseClass ()
 Destruction.
 

Protected Slots

virtual void windowStateChanged (MDIView *)
 

Printing

virtual void print ()
 
virtual void printPdf ()
 
virtual void printPreview ()
 
virtual void print (QPrinter *printer)
 

Member Enumeration Documentation

◆ ViewMode

MDI view mode enum.

Enumerator
Child 

Child viewing, view is docked inside the MDI application window

TopLevel 

The view becomes a top level window and can be moved outsinde the application window

FullScreen 

The view goes to full screen viewing

Constructor & Destructor Documentation

◆ MDIView()

Gui::MDIView::MDIView ( Gui::Document pcDocument,
QWidget *  parent,
Qt::WindowFlags  wflags = 0 
)

View constructor Attach the view to the given document. If the document is zero the view will attach to the active document. Be aware, there isn't always an active document.

◆ ~MDIView()

Gui::MDIView::~MDIView ( )

View destructor Detach the view from the document, if attached.

Member Function Documentation

◆ print()

virtual void Gui::MDIView::print ( )
virtual

Print content of view

Reimplemented in Gui::View3DInventor.

◆ printPdf()

virtual void Gui::MDIView::printPdf ( )
virtual

Print to PDF file

◆ printPreview()

virtual void Gui::MDIView::printPreview ( )
virtual

Show a preview dialog

◆ setCurrentViewMode()

virtual void Gui::MDIView::setCurrentViewMode ( ViewMode  mode)
virtual

If b is set to FullScreen the MDI view is displayed in full screen mode, if b is set to TopLevel then it is displayed as an own top-level window, otherwise (Normal) as tabbed window. For more hints refer to the Qt documentation to QWidget::showFullScreen ().

Reimplemented in Gui::View3DInventor.

◆ windowStateChanged

virtual void Gui::MDIView::windowStateChanged ( MDIView )
protectedvirtualslot

This method gets called from the main window this view is attached to whenever the window state of the active view changes. The default implementation does nothing.