Frapper  1.0a
Public Slots | Signals | Public Member Functions | Static Public Attributes | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | List of all members
Frapper::Window Class Reference

Class for the application's windows, both the main window and additional windows. More...

#include <Window.h>

Inheritance diagram for Frapper::Window:
Inheritance graph
[legend]
Collaboration diagram for Frapper::Window:
Collaboration graph
[legend]

Public Slots

void updateWindowTitle (const QString &panelTypeName)
 Updates the window title according to the given panel type name if there is only one panel in the window.
 
void duplicatePanelFrame (PanelFrame *panelFrame)
 Duplicates the given panel frame by creating a new window.
 
void extractPanelFrame (PanelFrame *panelFrame)
 Extracts the given panel frame to a new window.
 
void closePanelFrame (PanelFrame *panelFrame)
 Closes and deletes the given panel.
 

Signals

void windowActivated (Window *window)
 Signal that is emitted when the window has become active.
 
void windowRenamed (Window *window)
 Signal that is emitted when the window's title has changed.
 
void windowClosed (Window *window, QCloseEvent *event)
 Signal that is emitted when the window has been closed.
 
void createWindowRequested (const QString &panelTypeName, const QPoint &position, const QSize &panelSize)
 Signal that is emitted when a new window should be created.
 
void viewPanelCreated (ViewPanel *viewPanel)
 Signal that is emitted when a ViewPanel-derived widget has been created for the window.
 
void nodeContextMenuRequested (const QPoint &position)
 Signal to notify connected objects that the context menu for creating new nodes should be displayed at the given position.
 

Public Member Functions

 Window (QObject *parent, const QString &applicationName, const QString &title, const QString &layoutName, bool isMainWindow=false)
 Constructor of the Window class.
 
virtual ~Window ()
 Destructor of the Window class.
 
void getLayoutSettings (QSettings &settings, QObject *rootChild) const
 Returns the window layout state.
 
QWidget * setLayoutSettings (QSettings &settings, QString index="0")
 Sets the window layout states.
 
void setLayoutIds (QObject *rootChild)
 Insert unique IDs to the splitter and panel wedget names.
 
bool isMainWindow ()
 Returns whether the window is the application's main window.
 
bool hasDocumentation ()
 Returns whether the window contains a documentation panel.
 
void showDocumentationMainPage ()
 Opens the documentation main page in the first documentation panel found in the window's layout.
 
QString title ()
 Returns the window's title.
 
void setTitle (const QString &title)
 Sets the window's title.
 
void setFullscreen (bool fullscreen)
 Set fullscreen.
 
void clearLayout ()
 Deletes all layout widgets on contral widget.
 

Static Public Attributes

static const QString DefaultLayout = "Default"
 The name of the default window layout.
 
static const QString SingleViewLayout = "Single View"
 The name of the window layout with only a single view.
 
static const QString FullscreenViewLayout = "Fullscreen View"
 The name of the window layout with a fullscreen view.
 

Protected Member Functions

void contextMenuEvent (QContextMenuEvent *event)
 Event handler for context menu events.
 
void changeEvent (QEvent *event)
 Event handler for widget state change events.
 
void closeEvent (QCloseEvent *event)
 Event handler for widget close events.
 

Private Slots

void applyDefaultLayout ()
 Apply the default layout on the window.
 
void applyViewportOnlyLayout ()
 Apply the viewport layout on the window, which means that only a viewport panel is displayed.
 

Private Member Functions

void applyLayout (const QString &layoutName, Panel::Type panelType=Panel::T_Viewport)
 Applies the layout with the given name to the window. The given panel type is used only in specific layouts.
 

Private Attributes

QString m_applicationName
 The name of the application that this window is a part of.
 
bool m_isMainWindow
 Flag that states whether the window is the application's main window.
 
QString m_title
 The window's title.
 

Detailed Description

Class for the application's windows, both the main window and additional windows.

Inheritance Diagram
dot_inline_dotgraph_19.png
[legend]

Constructor & Destructor Documentation

Frapper::Window::Window ( QObject *  parent,
const QString &  applicationName,
const QString &  title,
const QString &  layoutName,
bool  isMainWindow = false 
)

Constructor of the Window class.

Constructors and Destructors.

Creates a new application window using the given layout.

Parameters
parentThe parent object (should be the Application object).
applicationNameThe name of the application that the window will be a part of.
titleThe title to give to the new window.
layoutNameThe name of the layout to apply to the window.
isMainWindowFlag that states whether the window to create is the application's main window.

Constructor of the Window class.

Creates a new application window using the layout with the given name.

Parameters
parentThe parent object (should be the Application object).
applicationNameThe name of the application that the window will be a part of.
titleThe title to give to the new window.
layoutNameThe name of the layout to apply to the window.
isMainWindowFlag that states whether the window to create is the application's main window.
Frapper::Window::~Window ( )
virtual

Destructor of the Window class.

Defined virtual to guarantee that the destructor of a derived class will be called if the instance of the derived class is saved in a variable of its parent class type.

Member Function Documentation

void Frapper::Window::getLayoutSettings ( QSettings &  settings,
QObject *  rootChild 
) const

Returns the window layout state.

Public Functions.

Parameters
settingsThe window layout settings state reference.
rootChildThe root widget.

Returns the window layout state

Parameters
settingsThe window layout settings state reference.
rootChildThe root widget.
QWidget * Frapper::Window::setLayoutSettings ( QSettings &  settings,
QString  index = "0" 
)

Sets the window layout states.

Parameters
Thewindow layout settings state reference.
rootChildThe root widget.
void Frapper::Window::setLayoutIds ( QObject *  rootChild)

Insert unique IDs to the splitter and panel wedget names.

bool Frapper::Window::isMainWindow ( )

Returns whether the window is the application's main window.

Returns
True if the window is the application's main window, otherwise False.
bool Frapper::Window::hasDocumentation ( )

Returns whether the window contains a documentation panel.

Returns
True if the window contains a documentation panel, otherwise False.
void Frapper::Window::showDocumentationMainPage ( )

Opens the documentation main page in the first documentation panel found in the window's layout.

QString Frapper::Window::title ( )

Returns the window's title.

Returns
The window's title.
void Frapper::Window::setTitle ( const QString &  title)

Sets the window's title.

Parameters
titleThe title to set for the window.
void Frapper::Window::setFullscreen ( bool  fullscreen)

Set fullscreen.

void Frapper::Window::clearLayout ( )

Deletes all layout widgets on contral widget.

void Frapper::Window::updateWindowTitle ( const QString &  panelTypeName)
slot

Updates the window title according to the given panel type name if there is only one panel in the window.

Public Slots.

Parameters
panelTypeNameThe name of the new panel type.

Updates the window title according to the given panel type name if there is only one panel in the window.

Parameters
panelTypeNameThe name of the new panel type.
void Frapper::Window::duplicatePanelFrame ( PanelFrame panelFrame)
slot

Duplicates the given panel frame by creating a new window.

Duplicates the given panel by creating a new window.

Parameters
panelFrameThe panel frame to duplicate.
void Frapper::Window::extractPanelFrame ( PanelFrame panelFrame)
slot

Extracts the given panel frame to a new window.

Parameters
panelFrameThe panel frame to extract to a new window.
void Frapper::Window::closePanelFrame ( PanelFrame panelFrame)
slot

Closes and deletes the given panel.

Closes and deletes the given panel frame.

Parameters
panelFrameThe panel frame to close.
void Frapper::Window::windowActivated ( Window window)
signal

Signal that is emitted when the window has become active.

Parameters
windowThe window that was activated.
void Frapper::Window::windowRenamed ( Window window)
signal

Signal that is emitted when the window's title has changed.

Parameters
windowThe window whose title has been changed.
void Frapper::Window::windowClosed ( Window window,
QCloseEvent *  event 
)
signal

Signal that is emitted when the window has been closed.

Parameters
windowThe window that has been closed.
eventThe object containing details about the window close event.
void Frapper::Window::createWindowRequested ( const QString &  panelTypeName,
const QPoint &  position,
const QSize &  panelSize 
)
signal

Signal that is emitted when a new window should be created.

Parameters
panelTypeNameThe name of the panel type that the new window should contain.
positionThe position for the new window.
panelSizeThe size of the panel to be contained in the new window.
void Frapper::Window::viewPanelCreated ( ViewPanel viewPanel)
signal

Signal that is emitted when a ViewPanel-derived widget has been created for the window.

Parameters
viewPanelThe ViewPanel-derived widget that has been created for the window.
void Frapper::Window::nodeContextMenuRequested ( const QPoint &  position)
signal

Signal to notify connected objects that the context menu for creating new nodes should be displayed at the given position.

Parameters
positionThe position at which to display the node context menu.
void Frapper::Window::contextMenuEvent ( QContextMenuEvent *  event)
protected

Event handler for context menu events.

Protected Events.

Parameters
eventThe object that contains details about the event.

Event handler for context menu events.

Parameters
eventThe object that contains details about the event.
void Frapper::Window::changeEvent ( QEvent *  event)
protected

Event handler for widget state change events.

Parameters
eventThe object that contains details about the event.
void Frapper::Window::closeEvent ( QCloseEvent *  event)
protected

Event handler for widget close events.

Parameters
eventThe object that contains details about the event.
void Frapper::Window::applyLayout ( const QString &  layoutName,
Panel::Type  panelType = Panel::T_Viewport 
)
private

Applies the layout with the given name to the window. The given panel type is used only in specific layouts.

Private Functions.

Parameters
layoutNameThe name of the layout to apply to the window.
panelTypeA panel type that is used only in specific layout.

Applies the layout with the given name to the window. The given panel type is used only in specific layouts.

Parameters
layoutNameThe name of the layout to apply to the window.
panelTypeA panel type that is used only in specific layout.
void Frapper::Window::applyDefaultLayout ( )
privateslot

Apply the default layout on the window.

Private Slots.

void Frapper::Window::applyViewportOnlyLayout ( )
privateslot

Apply the viewport layout on the window, which means that only a viewport panel is displayed.

Member Data Documentation

const QString Frapper::Window::DefaultLayout = "Default"
static

The name of the default window layout.

Static Constants.

const QString Frapper::Window::SingleViewLayout = "Single View"
static

The name of the window layout with only a single view.

const QString Frapper::Window::FullscreenViewLayout = "Fullscreen View"
static

The name of the window layout with a fullscreen view.

QString Frapper::Window::m_applicationName
private

The name of the application that this window is a part of.

bool Frapper::Window::m_isMainWindow
private

Flag that states whether the window is the application's main window.

QString Frapper::Window::m_title
private

The window's title.


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