[KLF Backend][KLF Tools][KLF Home]
KLatexFormula Project
Public Slots | Signals | Public Member Functions | Protected Member Functions
KLFSideWidgetManagerBase Class Reference

Abstract core functionality of showing/hiding a KLFSideWidget. More...

#include <klfsidewidget.h>

Inheritance diagram for KLFSideWidgetManagerBase:
Inheritance graph
[legend]
Collaboration diagram for KLFSideWidgetManagerBase:
Collaboration graph
[legend]

List of all members.

Public Slots

virtual void showSideWidget (bool show)=0
 Show or hide the side widget.
void showSideWidget ()
void hideSideWidget (bool hide=true)
void toggleSideWidget ()
virtual void waitForShowHideActionFinished (int timeout_ms=2000)

Signals

void sideWidgetShown (bool shown)
 Emitted whenever the shown status of the side widget has changed.

Public Member Functions

 KLFSideWidgetManagerBase (QWidget *parentWidget=NULL, QWidget *sideWidget=NULL, bool requireSideWidgetParentConsistency=false, QObject *managerParent=NULL)
virtual ~KLFSideWidgetManagerBase ()
virtual QWidget * sideWidget () const
virtual QWidget * ourParentWidget () const
void setSideWidget (QWidget *widget)
void setOurParentWidget (QWidget *widget)
virtual bool sideWidgetVisible () const =0
 returns TRUE if the side widget is currently visible

Protected Member Functions

virtual void newSideWidgetSet (QWidget *oldSideWidget, QWidget *newSideWidget)
virtual void newParentWidgetSet (QWidget *oldParentWidget, QWidget *newParentWidget)
virtual bool showHideIsAnimating ()

Detailed Description

Abstract core functionality of showing/hiding a KLFSideWidget.

This class provides the interface for writing show/hide side widget managers. Side widget managers are responsible for managing the whole show/hide process of the side widget; this includes creating an extra container widget if nessecary (eg. a drawer on mac), initializing it, reparenting the side widget if needed, etc.

Three standard side widget managers are provided. KLFShowHideSideWidgetManager (like KLatexFormula expanded mode on windows/linux) simply shows or hides the side widget inside its original layout inside its parent. KLFFloatSideWidgetManager creates a floating tool window which contains the side widget. On Mac OS X, there is also KLFDrawerSideWidgetManager which creates a Mac OS X drawer associated to the original main widget.

In general, you will not need to interact with this class directly. Everything is done transparently through KLFSideWidget::setSideWidgetManager().

However, you may subclass this class to implement your own, customized, side widget managers. Consider subclassing KLFContainerSideWidgetManager or one of the above mentioned managers to profit from their functionality if you need it. Note the following points.

Definition at line 65 of file klfsidewidget.h.


Constructor & Destructor Documentation

KLFSideWidgetManagerBase::KLFSideWidgetManagerBase ( QWidget *  parentWidget = NULL,
QWidget *  sideWidget = NULL,
bool  requireSideWidgetParentConsistency = false,
QObject managerParent = NULL 
)
Warning:
This function does NOT initialize its internal pParentWidget and pSideWidget members---they are always initialized to NULL. Reason: subclasses should set these in their constructors via setSideWidget() and setOurParentWidget(), which then call newSideWidgetSet() etc., which passes through the virtual call (it does not in the base class constructor).

Definition at line 57 of file klfsidewidget.cpp.

References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, and KLF_INIT_PRIVATE.

Definition at line 75 of file klfsidewidget.cpp.

References KLF_DEBUG_BLOCK, KLF_DELETE_PRIVATE, KLF_FUNC_NAME, and setSideWidget().


Member Function Documentation

void KLFSideWidgetManagerBase::hideSideWidget ( bool  hide = true) [inline, slot]

a shortcut for showSideWidget(!hide). Needs not be reimplemented by subclasses.

Definition at line 118 of file klfsidewidget.h.

virtual void KLFSideWidgetManagerBase::newParentWidgetSet ( QWidget *  oldParentWidget,
QWidget *  newParentWidget 
) [inline, protected, virtual]

Called by setOurParentWidget(), once the new widget is set.

Reimplemented in KLFContainerSideWidgetManager, and KLFShowHideSideWidgetManager.

Definition at line 137 of file klfsidewidget.h.

Referenced by setOurParentWidget().

virtual void KLFSideWidgetManagerBase::newSideWidgetSet ( QWidget *  oldSideWidget,
QWidget *  newSideWidget 
) [inline, protected, virtual]

Called by setSideWidget(), once the new widget is set.

Reimplemented in KLFFloatSideWidgetManager, KLFContainerSideWidgetManager, and KLFShowHideSideWidgetManager.

Definition at line 134 of file klfsidewidget.h.

Referenced by setSideWidget().

QWidget * KLFSideWidgetManagerBase::ourParentWidget ( ) const [virtual]

Changes our main widget to widget. If we're in parent side widget consistency mode, also adjusts the parent of the current side widget.

Definition at line 94 of file klfsidewidget.cpp.

References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfDbg, and newParentWidgetSet().

Referenced by KLFShowHideSideWidgetManager::eventFilter(), KLFContainerSideWidgetManager::init(), KLFShowHideSideWidgetManager::KLFShowHideSideWidgetManager(), KLFShowHideSideWidgetManager::newSideWidgetSet(), and KLFShowHideSideWidgetManager::showSideWidget().

void KLFSideWidgetManagerBase::setSideWidget ( QWidget *  widget)

Sets the side widget we will be managing to widget. If parent side widget consistency is set to TRUE (see constructor), then the parent of the new widget is adjusted to ourParentWidget() if necessary.

Definition at line 112 of file klfsidewidget.cpp.

References KLF_DEBUG_BLOCK, KLF_FUNC_NAME, klfDbg, newSideWidgetSet(), and sideWidget().

Referenced by KLFContainerSideWidgetManager::init(), KLFShowHideSideWidgetManager::KLFShowHideSideWidgetManager(), and ~KLFSideWidgetManagerBase().

virtual bool KLFSideWidgetManagerBase::showHideIsAnimating ( ) [inline, protected, virtual]

In case you are implementing an animation for the show/hide process, then this function should return TRUE as long as the animation is in progress, and should return FALSE once the animation is done.

See also waitForShowHideActionFinished().

Definition at line 146 of file klfsidewidget.h.

Referenced by waitForShowHideActionFinished().

virtual void KLFSideWidgetManagerBase::showSideWidget ( bool  show) [pure virtual, slot]

Show or hide the side widget.

Subclasses must implement here their method of showing and hiding the side widget. This might be, for example, showing or hiding an external container widget which contains the side widget.

Note that once you've reimplemented showSideWidget(bool), then showSideWidget(), hideSideWidget(bool), and toggleSideWidget() automatically work correctly by calling your reimplementation.

Implemented in KLFFloatSideWidgetManager, KLFContainerSideWidgetManager, and KLFShowHideSideWidgetManager.

a shortcut for showSideWidget(true). Needs not be reimplemented by subclasses.

Definition at line 116 of file klfsidewidget.h.

References showSideWidget().

Referenced by KLFContainerSideWidgetManager::eventFilter(), showSideWidget(), and KLFFloatSideWidgetManager::showSideWidget().

QWidget * KLFSideWidgetManagerBase::sideWidget ( ) const [virtual]
void KLFSideWidgetManagerBase::sideWidgetShown ( bool  shown) [signal]

Emitted whenever the shown status of the side widget has changed.

Subclasses must emit this signal in their showSideWidget() implementation. It is also up to the subclass to emit it in their newSideWidgetSet() implementation with a consistent initial value.

Referenced by KLFShowHideSideWidgetManager::newSideWidgetSet(), KLFContainerSideWidgetManager::newSideWidgetSet(), and KLFContainerSideWidgetManager::showSideWidget().

virtual bool KLFSideWidgetManagerBase::sideWidgetVisible ( ) const [pure virtual]

returns TRUE if the side widget is currently visible

Subclasses must reimplement to provide functionality. The base class has no way of knowing if the side widget is considered shown or hidden.

Implemented in KLFFloatSideWidgetManager, KLFContainerSideWidgetManager, and KLFShowHideSideWidgetManager.

a shortcut for showSideWidget(!sideWidgetVisible()). Needs not be reimplemented by subclasses.

Definition at line 121 of file klfsidewidget.h.

void KLFSideWidgetManagerBase::waitForShowHideActionFinished ( int  timeout_ms = 2000) [virtual, slot]

In case there is an animation for showing/hiding the widget, you may call this function to wait until the animation is done. See also showHideIsAnimating().

This function needs not be reimplemented. The default implementation loops (while not freezing the GUI) and periodically checks for showHideIsAnimating(), until that function returns FALSE or the given timeout is reached.

Definition at line 140 of file klfsidewidget.cpp.

References QTime::elapsed(), klfDbg, showHideIsAnimating(), and QTime::start().


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

Generated by doxygen 1.7.6.1. The KLatexFormula website is hosted on sourceforge.net