Kexi API Documentation (2.0 alpha)

KexiReportView Class Reference

#include <kexireportview.h>

Inheritance diagram for KexiReportView:

KexiViewBase QWidget KexiActionProxy List of all members.

Detailed Description

The FormPart's view.

This class presents a single view used inside KexiDialogBase. It takes care of saving/loading report, of enabling actions when needed. One KexiReportView object is instantiated for data view mode (preview == true in constructor), and second KexiReportView object is instantiated for design view mode (preview == false in constructor).

Definition at line 62 of file kexireportview.h.

Public Types

enum  ResizeMode { ResizeAuto = 0, ResizeDefault = ResizeAuto, ResizeFixed = 1, NoResize = 2 }

Public Slots

virtual void show ()

Public Member Functions

 KexiReportView (KexiMainWindow *win, QWidget *parent, const char *name, KexiDB::Connection *conn)
virtual ~KexiReportView ()
KexiDB::Connectionconnection ()
virtual QSize preferredSizeHint (const QSize &otherSize)
int resizeMode () const

Protected Slots

void slotPropertySetSwitched (KoProperty::Set *set, bool forceReload=false)
void slotDirty (KFormDesigner::Form *f, bool isDirty)
void slotFocus (bool in)

Protected Member Functions

virtual tristate beforeSwitchTo (int mode, bool &dontStore)
virtual tristate afterSwitchFrom (int mode)
virtual KoProperty::Set * propertySet ()
virtual KexiDB::SchemaDatastoreNewData (const KexiDB::SchemaData &sdata, bool &cancel)
virtual tristate storeData (bool dontAsk=false)
KexiReportPart::TempDatatempData () const
KexiReportPartreportPart () const
void disableWidgetActions ()
void enableFormActions ()
KFormDesigner::Formform () const
void setForm (KFormDesigner::Form *f)
void initForm ()
void loadForm ()
virtual void resizeEvent (QResizeEvent *)


Member Enumeration Documentation

enum KexiReportView::ResizeMode
 

Enumeration values:
ResizeAuto 
ResizeDefault 
ResizeFixed 
NoResize 

Definition at line 67 of file kexireportview.h.


Constructor & Destructor Documentation

KexiReportView::KexiReportView KexiMainWindow win,
QWidget parent,
const char *  name,
KexiDB::Connection conn
 

Todo:
skip this if ther're no borders

Definition at line 83 of file kexireportview.cpp.

References Kexi::DataViewMode, KexiViewBase::dirty(), KexiViewBase::focus(), initForm(), KexiActionProxy::plugSharedAction(), KexiViewBase::propertySetSwitched(), reportPart(), KFormDesigner::FormManager::self(), KexiScrollView::setResizingEnabled(), KexiViewBase::setViewWidget(), KexiScrollView::setWidget(), slotDirty(), slotFocus(), slotPropertySetSwitched(), and KexiViewBase::viewMode().

KexiReportView::~KexiReportView  )  [virtual]
 

Definition at line 155 of file kexireportview.cpp.

References KexiViewBase::propertySetSwitched().


Member Function Documentation

tristate KexiReportView::afterSwitchFrom int  mode  )  [protected, virtual]
 

called by KexiDialogBase::switchToViewMode() right after dialog is switched to new mode By default does nothing. Reimplement this if you need to do something after switching to this view.

Returns:
true if you accept or false if a error occupied and view shouldn't change If there is no error but switching should be just cancelled (probably after showing some info messages), you need to return cancelled.

Reimplemented from KexiViewBase.

Definition at line 264 of file kexireportview.cpp.

References Kexi::DataViewMode, Kexi::DesignViewMode, initForm(), KexiScrollView::setWidget(), tempData(), and KexiViewBase::viewMode().

tristate KexiReportView::beforeSwitchTo int  mode,
bool &  dontStore
[protected, virtual]
 

called by KexiDialogBase::switchToViewMode() right before dialog is switched to new mode By default does nothing. Reimplement this if you need to do something before switching to this view.

Returns:
true if you accept or false if a error occupied and view shouldn't change If there is no error but switching should be just cancelled (probably after showing some info messages), you need to return cancelled. Set dontStore to true (it's false by default) if you want to avoid data storing by storeData() or storeNewData().

Reimplemented from KexiViewBase.

Definition at line 247 of file kexireportview.cpp.

References Kexi::DataViewMode, KexiViewBase::dirty(), form(), KFormDesigner::FormIO::saveFormToString(), tempData(), and KexiViewBase::viewMode().

KexiDB::Connection* KexiReportView::connection  )  [inline]
 

Definition at line 77 of file kexireportview.h.

Referenced by KexiSubReport::setReportName().

void KexiReportView::disableWidgetActions  )  [protected]
 

void KexiReportView::enableFormActions  )  [protected]
 

KFormDesigner::Form * KexiReportView::form  )  const [protected]
 

Definition at line 165 of file kexireportview.cpp.

References Kexi::DataViewMode, tempData(), and KexiViewBase::viewMode().

Referenced by beforeSwitchTo(), initForm(), loadForm(), slotDirty(), slotFocus(), and storeData().

void KexiReportView::initForm  )  [protected]
 

Definition at line 183 of file kexireportview.cpp.

References Kexi::DataViewMode, form(), KexiReportPart::library(), loadForm(), KexiViewBase::mainWin(), KexiViewBase::parentDialog(), KexiScrollView::refreshContentsSize(), KFormDesigner::FormManager::self(), KexiReportScrollView::setForm(), setForm(), and KexiViewBase::viewMode().

Referenced by afterSwitchFrom(), and KexiReportView().

void KexiReportView::loadForm  )  [protected]
 

Definition at line 218 of file kexireportview.cpp.

References Kexi::DataViewMode, form(), kexipluginsdbg, KexiViewBase::loadDataBlock(), KFormDesigner::FormIO::loadFormFromString(), KexiViewBase::parentDialog(), tempData(), and KexiViewBase::viewMode().

Referenced by initForm().

QSize KexiReportView::preferredSizeHint const QSize &  otherSize  )  [virtual]
 

Returns:
preferred size hint, that can be used to resize the view. It is computed using maximum of (a) otherSize and (b) current KMDI dock area's size, so the view won't exceed this maximum size. The method is used e.g. in KexiDialogBase::sizeHint(). If you reimplement this method, do not forget to return value of yoursize.boundedTo( KexiViewBase::preferredSizeHint(otherSize) ).

Reimplemented from KexiViewBase.

Definition at line 432 of file kexireportview.cpp.

References KexiViewBase::preferredSizeHint().

virtual KoProperty::Set* KexiReportView::propertySet  )  [inline, protected, virtual]
 

Returns:
a property set for this view. For reimplementation. By default returns NULL.

Reimplemented from KexiViewBase.

Definition at line 102 of file kexireportview.h.

KexiReportPart* KexiReportView::reportPart  )  const [inline, protected]
 

Definition at line 109 of file kexireportview.h.

References KexiViewBase::part().

Referenced by KexiReportView().

void KexiReportView::resizeEvent QResizeEvent *   )  [protected, virtual]
 

Definition at line 441 of file kexireportview.cpp.

References Kexi::DataViewMode, KexiScrollView::refreshContentsSizeLater(), KexiScrollView::updateNavPanelGeometry(), and KexiViewBase::viewMode().

int KexiReportView::resizeMode  )  const [inline]
 

Definition at line 81 of file kexireportview.h.

Referenced by show(), and KexiReportScrollView::show().

void KexiReportView::setForm KFormDesigner::Form f  )  [protected]
 

Definition at line 174 of file kexireportview.cpp.

References Kexi::DataViewMode, tempData(), and KexiViewBase::viewMode().

Referenced by initForm().

void KexiReportView::show  )  [virtual, slot]
 

Reimplemented to update resize policy.

Definition at line 454 of file kexireportview.cpp.

References Kexi::DataViewMode, ResizeAuto, resizeMode(), and KexiViewBase::viewMode().

void KexiReportView::slotDirty KFormDesigner::Form f,
bool  isDirty
[protected, slot]
 

Definition at line 296 of file kexireportview.cpp.

References form(), and KexiViewBase::setDirty().

Referenced by KexiReportView().

void KexiReportView::slotFocus bool  in  )  [protected, slot]
 

Definition at line 469 of file kexireportview.cpp.

References form(), and KFormDesigner::FormManager::self().

Referenced by KexiReportView().

void KexiReportView::slotPropertySetSwitched KoProperty::Set *  set,
bool  forceReload = false
[protected, slot]
 

Definition at line 237 of file kexireportview.cpp.

References KexiViewBase::propertySetReloaded(), and KexiViewBase::propertySetSwitched().

Referenced by KexiReportView().

tristate KexiReportView::storeData bool  dontAsk = false  )  [protected, virtual]
 

Tells this view to store data changes on the backend. Called by KexiDialogBase::storeData(). Default implementation:

  • makes a deep copy of sdata
  • stores object schema data sdata in 'kexi__objects' internal table using Connection::storeObjectSchemaData(). If dontAsk is true, no question dialog will be shown to the user. The default is false.

Reimpelment this for your needs. Should return true on success or cancelled when the task should be cancelled.

See also:
storeNewData()

Reimplemented from KexiViewBase.

Definition at line 322 of file kexireportview.cpp.

References form(), kexipluginsdbg, KexiViewBase::parentDialog(), KFormDesigner::FormIO::saveFormToString(), KexiViewBase::storeDataBlock(), and tempData().

Referenced by storeNewData().

KexiDB::SchemaData * KexiReportView::storeNewData const KexiDB::SchemaData sdata,
bool &  cancel
[protected, virtual]
 

Tells this dialog to create and store data of the new object pointed by sdata on the backend. Called by KexiDialogBase::storeNewData(). Default implementation:

  • makes a deep copy of sdata
  • stores object schema data sdata in 'kexi__objects' internal table using Connection::storeObjectSchemaData(). Reimpelment this for your needs. Requirements:
  • deep copy of sdata should be made
  • schema data should be created at the backend (by calling KexiViewBase::storeNewData(const KexiDB::SchemaData& sdata)), or using Connection::storeObjectSchemaData() or more specialized method. For example, KexiAlterTableDialog uses Connection::createTable(TableSchema) for this (tableschema is SchemaData subclass) to store more information than just a schem adata. You should use such subclasses if needed. Should return newly created schema data object on success. In this case, do not store schema object yourself (make deep copy if needed).

Reimplemented from KexiViewBase.

Definition at line 303 of file kexireportview.cpp.

References KexiDB::SchemaData::id(), kexipluginsdbg, KexiDB::Connection::removeObject(), storeData(), and KexiViewBase::storeNewData().

KexiReportPart::TempData* KexiReportView::tempData  )  const [inline, protected]
 

Definition at line 107 of file kexireportview.h.

References KexiViewBase::parentDialog().

Referenced by afterSwitchFrom(), beforeSwitchTo(), form(), loadForm(), setForm(), and storeData().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for Kexi 2.0 alpha.
Documentation copyright © 2002-2007 the Kexi Team.
Generated on Tue Apr 1 20:50:22 2008 by doxygen 1.4.2 written by Dimitri van Heesch, © 1997-2003