Kexi API Documentation (2.0 alpha)

KexiBrowser Class Reference

#include <kexibrowser.h>

Inheritance diagram for KexiBrowser:

QWidget List of all members.

Detailed Description

The Main Kexi navigator widget.

Definition at line 51 of file kexibrowser.h.

Public Types

enum  Features {
  Writable = 1, ContextMenus = 2, Toolbar = 4, SingleClickOpensItemOptionEnabled = 8,
  DefaultFeatures
}

Public Slots

KexiBrowserItemaddGroup (KexiPart::Info &info)
KexiBrowserItemaddItem (KexiPart::Item &item)
void slotRemoveItem (const KexiPart::Item &item)
virtual void setFocus ()
void updateItemName (KexiPart::Item &item, bool dirty)
void selectItem (KexiPart::Item &item)
void clearSelection ()
void clear ()
void setReadOnly (bool set)
 Sets by main window to disable actions that may try to modify the project.
bool isReadOnly () const

Signals

void openItem (KexiPart::Item *, int viewMode)
void openOrActivateItem (KexiPart::Item *, int viewMode)
void newItem (KexiPart::Info *)
void removeItem (KexiPart::Item *)
void renameItem (KexiPart::Item *item, const QString &_newName, bool &succes)
void selectionChanged (KexiPart::Item *item)
void executeItem (KexiPart::Item *)
void exportItemAsDataTable (KexiPart::Item *)
void printItem (KexiPart::Item *)
void pageSetupForItem (KexiPart::Item *)

Public Member Functions

 KexiBrowser (QWidget *parent, KexiMainWindow *mainWin, int features=DefaultFeatures)
virtual ~KexiBrowser ()
void setProject (KexiProject *prj, const QString &itemsMimeType=QString::null, QString *partManagerErrorMessages=0)
QString itemsMimeType () const
KexiPart::ItemselectedPartItem () const
void installEventFilter (const QObject *filterObj)
virtual bool eventFilter (QObject *o, QEvent *e)
bool actionEnabled (const QCString &actionName) const

Protected Slots

void slotContextMenu (KListView *, QListViewItem *i, const QPoint &point)
void slotExecuteItem (QListViewItem *item)
void slotSelectionChanged (QListViewItem *i)
void slotSettingsChanged (int)
void slotNewObjectPopupAboutToShow ()
void slotNewObject ()
void slotOpenObject ()
void slotDesignObject ()
void slotEditTextObject ()
void slotRemove ()
void slotCut ()
void slotCopy ()
void slotPaste ()
void slotRename ()
void slotExecuteObject ()
void slotExportAsDataTable ()
void slotPrintItem ()
void slotPageSetupForItem ()

Protected Member Functions

void itemRenameDone ()
KexiBrowserItemaddItem (KexiPart::Item &item, KexiBrowserItem *parent, KexiPart::Info *info)

Protected Attributes

KexiMainWindowm_mainWin
int m_features
KexiBrowserListViewm_list
KActionCollection * m_actions
QAsciiDict< KexiBrowserItemm_baseItems
QIntDict< KexiBrowserItemm_normalItems
KPopupMenum_itemPopup
KPopupMenum_partPopup
KActionm_deleteAction
KActionm_renameAction
KActionm_newObjectAction
KActionm_openAction
KActionm_designAction
KActionm_editTextAction
KActionm_executeAction
KActionm_dataExportAction
KActionm_printAction
KActionm_pageSetupAction
KActionMenu * m_exportActionMenu
KPopupMenum_newObjectPopup
int m_itemPopupTitle_id
int m_partPopupTitle_id
int m_openAction_id
int m_designAction_id
int m_editTextAction_id
int m_executeAction_id
int m_exportActionMenu_id
int m_exportActionMenu_id_sep
int m_printAction_id
int m_pageSetupAction_id
int m_pageSetupAction_id_sep
KexiPart::Partm_prevSelectedPart
KToolBar * m_toolbar
KexiSmallToolButtonm_newObjectToolButton
KexiSmallToolButtonm_deleteObjectToolButton
QString m_itemsMimeType
bool m_singleClick: 1
bool m_readOnly: 1


Member Enumeration Documentation

enum KexiBrowser::Features
 

Enumeration values:
Writable  the browser supports actions that modify the project (e.g. delete, rename)
ContextMenus  the browser supports context menu
Toolbar  the browser displays
SingleClickOpensItemOptionEnabled  enables "SingleClickOpensItem" option
DefaultFeatures  the default

Definition at line 56 of file kexibrowser.h.


Constructor & Destructor Documentation

KexiBrowser::KexiBrowser QWidget parent,
KexiMainWindow mainWin,
int  features = DefaultFeatures
 

Todo:
some of these actions can be supported once we deliver ACLs...
Todo:
1.1: just add "Delete" tooltip and what's this
Todo:
some of these actions can be supported once we deliver ACLs...

Definition at line 71 of file kexibrowser.cpp.

References ContextMenus, m_actions, m_dataExportAction, m_deleteAction, m_deleteObjectToolButton, m_designAction, m_designAction_id, m_editTextAction, m_editTextAction_id, m_executeAction, m_executeAction_id, m_exportActionMenu, m_exportActionMenu_id, m_exportActionMenu_id_sep, m_features, m_itemPopup, m_itemPopupTitle_id, m_list, m_mainWin, m_newObjectAction, m_newObjectPopup, m_newObjectToolButton, m_openAction, m_openAction_id, m_pageSetupAction, m_pageSetupAction_id, m_pageSetupAction_id_sep, m_partPopup, m_partPopupTitle_id, m_printAction, m_printAction_id, m_renameAction, selectionChanged(), setReadOnly(), KexiSmallToolButton::setTextLabel(), SingleClickOpensItemOptionEnabled, slotContextMenu(), slotDesignObject(), slotEditTextObject(), slotExecuteItem(), slotExecuteObject(), slotExportAsDataTable(), slotNewObject(), slotNewObjectPopupAboutToShow(), slotOpenObject(), slotPageSetupForItem(), slotPrintItem(), slotRemove(), slotRename(), slotSelectionChanged(), slotSettingsChanged(), Toolbar, KexiMainWindow::userMode(), and Writable.

KexiBrowser::~KexiBrowser  )  [virtual]
 

Definition at line 287 of file kexibrowser.cpp.


Member Function Documentation

bool KexiBrowser::actionEnabled const QCString &  actionName  )  const
 

Definition at line 801 of file kexibrowser.cpp.

References ContextMenus, m_exportActionMenu_id, m_features, and m_itemPopup.

KexiBrowserItem * KexiBrowser::addGroup KexiPart::Info info  )  [slot]
 

Definition at line 359 of file kexibrowser.cpp.

References KexiPart::Info::isVisibleInNavigator(), m_baseItems, m_list, and KexiPart::Info::mimeType().

Referenced by setProject().

KexiBrowserItem * KexiBrowser::addItem KexiPart::Item item,
KexiBrowserItem parent,
KexiPart::Info info
[protected]
 

Definition at line 377 of file kexibrowser.cpp.

References KexiPart::Item::identifier(), m_list, and m_normalItems.

KexiBrowserItem * KexiBrowser::addItem KexiPart::Item item  )  [slot]
 

Definition at line 370 of file kexibrowser.cpp.

References KexiBrowserItem::info(), m_baseItems, and KexiPart::Item::mimeType().

Referenced by KexiMainWindowImpl::newObject(), and setProject().

void KexiBrowser::clear  )  [slot]
 

Definition at line 849 of file kexibrowser.cpp.

References m_list.

Referenced by KexiMainWindowImpl::closeProject(), and setProject().

void KexiBrowser::clearSelection  )  [slot]
 

Definition at line 749 of file kexibrowser.cpp.

References m_list.

bool KexiBrowser::eventFilter QObject *  o,
QEvent *  e
[virtual]
 

Definition at line 560 of file kexibrowser.cpp.

References itemRenameDone(), m_list, slotDesignObject(), slotExecuteItem(), slotRemove(), and slotRename().

void KexiBrowser::executeItem KexiPart::Item  )  [signal]
 

Referenced by slotExecuteItem(), and slotExecuteObject().

void KexiBrowser::exportItemAsDataTable KexiPart::Item  )  [signal]
 

Referenced by slotExportAsDataTable().

void KexiBrowser::installEventFilter const QObject *  filterObj  ) 
 

Definition at line 552 of file kexibrowser.cpp.

References m_list.

Referenced by KexiMainWindowImpl::initNavigator().

bool KexiBrowser::isReadOnly  )  const [slot]
 

Definition at line 844 of file kexibrowser.cpp.

References m_readOnly.

void KexiBrowser::itemRenameDone  )  [protected]
 

Definition at line 691 of file kexibrowser.cpp.

References KexiBrowserItem::item(), m_features, m_list, KexiBrowserListView::nameEndsWithAsterisk, renameItem(), setFocus(), and Writable.

Referenced by eventFilter().

QString KexiBrowser::itemsMimeType  )  const
 

Returns:
items' mime type previously set by setProject. Returns empty string if setProject() was not executed yet or itemsMimeType argument of setProject() was empty (i.e. all mime types are displayed).

Definition at line 354 of file kexibrowser.cpp.

References m_itemsMimeType.

void KexiBrowser::newItem KexiPart::Info  )  [signal]
 

Referenced by slotNewObject().

void KexiBrowser::openItem KexiPart::Item ,
int  viewMode
[signal]
 

Referenced by slotDesignObject(), slotEditTextObject(), and slotOpenObject().

void KexiBrowser::openOrActivateItem KexiPart::Item ,
int  viewMode
[signal]
 

this signal is emmited when user double clicked (or single -depending on settings) or pressed return ky on the part item. This signal differs from openItem() signal in that if the object is already opened in view mode other than viewMode, the mode is not changed.

Referenced by slotExecuteItem().

void KexiBrowser::pageSetupForItem KexiPart::Item  )  [signal]
 

Referenced by slotPageSetupForItem().

void KexiBrowser::printItem KexiPart::Item  )  [signal]
 

Referenced by slotPrintItem().

void KexiBrowser::removeItem KexiPart::Item  )  [signal]
 

Referenced by slotRemove().

void KexiBrowser::renameItem KexiPart::Item item,
const QString _newName,
bool &  succes
[signal]
 

Referenced by itemRenameDone().

KexiPart::Item * KexiBrowser::selectedPartItem  )  const
 

Definition at line 795 of file kexibrowser.cpp.

References KexiBrowserItem::item(), and m_list.

Referenced by KexiMainWindowImpl::slotEditCopySpecialDataTable(), slotExecuteObject(), slotExportAsDataTable(), slotPageSetupForItem(), and slotPrintItem().

void KexiBrowser::selectionChanged KexiPart::Item item  )  [signal]
 

Referenced by KexiBrowser(), and slotSelectionChanged().

void KexiBrowser::selectItem KexiPart::Item item  )  [slot]
 

Definition at line 739 of file kexibrowser.cpp.

References KexiPart::Item::identifier(), m_list, and m_normalItems.

Referenced by KexiMainWindowImpl::highlightObject().

void KexiBrowser::setFocus  )  [virtual, slot]
 

Definition at line 717 of file kexibrowser.cpp.

References m_list.

Referenced by KexiMainWindowImpl::childClosed(), KexiMainWindowImpl::closeDialog(), KexiMainWindowImpl::initNavigator(), itemRenameDone(), and KexiMainWindowImpl::slotViewNavigator().

void KexiBrowser::setProject KexiProject prj,
const QString itemsMimeType = QString::null,
QString partManagerErrorMessages = 0
 

Sets project prj for this browser. If partManagerErrorMessages is not NULL it will be set to error message if there's a problem with loading any KexiPart. If itemsMimeType is empty (the default), items of all mime types are displayed, items for only one mime type are displayed. In the latter case, no group (parent) items are displayed. Previous items are removed.

Definition at line 291 of file kexibrowser.cpp.

References addGroup(), addItem(), clear(), KexiDB::getHTMLErrorMesage(), KexiProject::items(), m_itemsMimeType, m_list, and Kexi::partManager().

Referenced by KexiMainWindowImpl::initNavigator().

void KexiBrowser::setReadOnly bool  set  )  [slot]
 

Sets by main window to disable actions that may try to modify the project.

Does not disable actions like opening objects.

Definition at line 828 of file kexibrowser.cpp.

References m_deleteAction, m_features, m_newObjectAction, m_newObjectPopup, m_newObjectToolButton, m_readOnly, m_renameAction, and Toolbar.

Referenced by KexiBrowser(), and KexiMainWindowImpl::updateReadOnlyState().

void KexiBrowser::slotContextMenu KListView ,
QListViewItem i,
const QPoint &  point
[protected, slot]
 

Definition at line 414 of file kexibrowser.cpp.

References ContextMenus, KexiBrowserItem::info(), KexiPart::Part::instanceCaption(), KexiBrowserItem::item(), m_features, m_itemPopup, m_itemPopupTitle_id, m_list, m_partPopup, m_partPopupTitle_id, and Kexi::partManager().

Referenced by KexiBrowser().

void KexiBrowser::slotCopy  )  [protected, slot]
 

Definition at line 668 of file kexibrowser.cpp.

void KexiBrowser::slotCut  )  [protected, slot]
 

Definition at line 660 of file kexibrowser.cpp.

References m_features, and Writable.

void KexiBrowser::slotDesignObject  )  [protected, slot]
 

Definition at line 640 of file kexibrowser.cpp.

References Kexi::DesignViewMode, KexiBrowserItem::item(), m_designAction, m_list, and openItem().

Referenced by eventFilter(), and KexiBrowser().

void KexiBrowser::slotEditTextObject  )  [protected, slot]
 

Definition at line 650 of file kexibrowser.cpp.

References KexiBrowserItem::item(), m_editTextAction, m_list, openItem(), and Kexi::TextViewMode.

Referenced by KexiBrowser().

void KexiBrowser::slotExecuteItem QListViewItem item  )  [protected, slot]
 

Definition at line 450 of file kexibrowser.cpp.

References Kexi::DataViewMode, executeItem(), KexiBrowserItem::info(), KexiBrowserItem::item(), m_list, m_singleClick, and openOrActivateItem().

Referenced by eventFilter(), and KexiBrowser().

void KexiBrowser::slotExecuteObject  )  [protected, slot]
 

Definition at line 777 of file kexibrowser.cpp.

References executeItem(), m_executeAction, and selectedPartItem().

Referenced by KexiBrowser().

void KexiBrowser::slotExportAsDataTable  )  [protected, slot]
 

Definition at line 786 of file kexibrowser.cpp.

References exportItemAsDataTable(), m_dataExportAction, and selectedPartItem().

Referenced by KexiBrowser().

void KexiBrowser::slotNewObject  )  [protected, slot]
 

Definition at line 622 of file kexibrowser.cpp.

References KexiBrowserItem::info(), m_features, m_list, m_newObjectAction, newItem(), and Writable.

Referenced by KexiBrowser().

void KexiBrowser::slotNewObjectPopupAboutToShow  )  [protected, slot]
 

Todo:
err

Definition at line 758 of file kexibrowser.cpp.

References m_features, m_mainWin, m_newObjectPopup, KexiPart::nameForCreateAction(), Kexi::partManager(), and Toolbar.

Referenced by KexiBrowser().

void KexiBrowser::slotOpenObject  )  [protected, slot]
 

Definition at line 632 of file kexibrowser.cpp.

References Kexi::DataViewMode, KexiBrowserItem::item(), m_list, and openItem().

Referenced by KexiBrowser().

void KexiBrowser::slotPageSetupForItem  )  [protected, slot]
 

Definition at line 818 of file kexibrowser.cpp.

References m_pageSetupAction, pageSetupForItem(), and selectedPartItem().

Referenced by KexiBrowser().

void KexiBrowser::slotPaste  )  [protected, slot]
 

Definition at line 674 of file kexibrowser.cpp.

References m_features, and Writable.

void KexiBrowser::slotPrintItem  )  [protected, slot]
 

Definition at line 809 of file kexibrowser.cpp.

References m_printAction, printItem(), and selectedPartItem().

Referenced by KexiBrowser().

void KexiBrowser::slotRemove  )  [protected, slot]
 

Definition at line 612 of file kexibrowser.cpp.

References KexiBrowserItem::item(), m_deleteAction, m_features, m_list, removeItem(), and Writable.

Referenced by eventFilter(), and KexiBrowser().

void KexiBrowser::slotRemoveItem const KexiPart::Item item  )  [slot]
 

Definition at line 392 of file kexibrowser.cpp.

References KexiPart::Item::identifier(), m_list, and m_normalItems.

void KexiBrowser::slotRename  )  [protected, slot]
 

Definition at line 682 of file kexibrowser.cpp.

References m_features, m_list, m_renameAction, and KexiBrowserListView::rename().

Referenced by eventFilter(), and KexiBrowser().

void KexiBrowser::slotSelectionChanged QListViewItem i  )  [protected, slot]
 

Definition at line 467 of file kexibrowser.cpp.

References ContextMenus, Kexi::DataViewMode, Kexi::DesignViewMode, KexiBrowserItem::info(), KexiBrowserItem::item(), m_deleteAction, m_deleteObjectToolButton, m_designAction, m_designAction_id, m_editTextAction, m_editTextAction_id, m_executeAction, m_executeAction_id, m_exportActionMenu, m_exportActionMenu_id, m_exportActionMenu_id_sep, m_features, m_itemPopup, m_newObjectAction, m_newObjectToolButton, m_openAction, m_openAction_id, m_pageSetupAction, m_pageSetupAction_id, m_pageSetupAction_id_sep, m_prevSelectedPart, m_printAction, m_printAction_id, m_readOnly, Kexi::partManager(), selectionChanged(), KexiSmallToolButton::setIconSet(), KexiPart::Part::supportedViewModes(), Kexi::TextViewMode, and Toolbar.

Referenced by KexiBrowser().

void KexiBrowser::slotSettingsChanged int   )  [protected, slot]
 

Definition at line 734 of file kexibrowser.cpp.

References m_singleClick.

Referenced by KexiBrowser().

void KexiBrowser::updateItemName KexiPart::Item item,
bool  dirty
[slot]
 

Definition at line 724 of file kexibrowser.cpp.

References KexiPart::Item::identifier(), m_features, m_normalItems, KexiPart::Item::name(), and Writable.

Referenced by KexiMainWindowImpl::closeDialog(), and KexiMainWindowImpl::slotDirtyFlagChanged().


Member Data Documentation

KActionCollection* KexiBrowser::m_actions [protected]
 

Definition at line 158 of file kexibrowser.h.

Referenced by KexiBrowser().

QAsciiDict<KexiBrowserItem> KexiBrowser::m_baseItems [protected]
 

Definition at line 159 of file kexibrowser.h.

Referenced by addGroup(), and addItem().

KAction * KexiBrowser::m_dataExportAction [protected]
 

Definition at line 162 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotExportAsDataTable().

KAction* KexiBrowser::m_deleteAction [protected]
 

Definition at line 162 of file kexibrowser.h.

Referenced by KexiBrowser(), setReadOnly(), slotRemove(), and slotSelectionChanged().

KexiSmallToolButton * KexiBrowser::m_deleteObjectToolButton [protected]
 

Definition at line 177 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotSelectionChanged().

KAction * KexiBrowser::m_designAction [protected]
 

Definition at line 162 of file kexibrowser.h.

Referenced by KexiBrowser(), slotDesignObject(), and slotSelectionChanged().

int KexiBrowser::m_designAction_id [protected]
 

Definition at line 169 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotSelectionChanged().

KAction * KexiBrowser::m_editTextAction [protected]
 

Definition at line 162 of file kexibrowser.h.

Referenced by KexiBrowser(), slotEditTextObject(), and slotSelectionChanged().

int KexiBrowser::m_editTextAction_id [protected]
 

Definition at line 169 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotSelectionChanged().

KAction * KexiBrowser::m_executeAction [protected]
 

Definition at line 162 of file kexibrowser.h.

Referenced by KexiBrowser(), slotExecuteObject(), and slotSelectionChanged().

int KexiBrowser::m_executeAction_id [protected]
 

Definition at line 169 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotSelectionChanged().

KActionMenu* KexiBrowser::m_exportActionMenu [protected]
 

Definition at line 167 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotSelectionChanged().

int KexiBrowser::m_exportActionMenu_id [protected]
 

Definition at line 169 of file kexibrowser.h.

Referenced by actionEnabled(), KexiBrowser(), and slotSelectionChanged().

int KexiBrowser::m_exportActionMenu_id_sep [protected]
 

Definition at line 169 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotSelectionChanged().

int KexiBrowser::m_features [protected]
 

Definition at line 156 of file kexibrowser.h.

Referenced by actionEnabled(), itemRenameDone(), KexiBrowser(), setReadOnly(), slotContextMenu(), slotCut(), slotNewObject(), slotNewObjectPopupAboutToShow(), slotPaste(), slotRemove(), slotRename(), slotSelectionChanged(), and updateItemName().

KPopupMenu* KexiBrowser::m_itemPopup [protected]
 

Definition at line 161 of file kexibrowser.h.

Referenced by actionEnabled(), KexiBrowser(), slotContextMenu(), and slotSelectionChanged().

int KexiBrowser::m_itemPopupTitle_id [protected]
 

Definition at line 169 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotContextMenu().

QString KexiBrowser::m_itemsMimeType [protected]
 

Definition at line 178 of file kexibrowser.h.

Referenced by itemsMimeType(), and setProject().

KexiBrowserListView* KexiBrowser::m_list [protected]
 

Definition at line 157 of file kexibrowser.h.

Referenced by addGroup(), addItem(), clear(), clearSelection(), eventFilter(), installEventFilter(), itemRenameDone(), KexiBrowser(), selectedPartItem(), selectItem(), setFocus(), setProject(), slotContextMenu(), slotDesignObject(), slotEditTextObject(), slotExecuteItem(), slotNewObject(), slotOpenObject(), slotRemove(), slotRemoveItem(), and slotRename().

KexiMainWindow* KexiBrowser::m_mainWin [protected]
 

Definition at line 155 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotNewObjectPopupAboutToShow().

KAction * KexiBrowser::m_newObjectAction [protected]
 

Definition at line 162 of file kexibrowser.h.

Referenced by KexiBrowser(), setReadOnly(), slotNewObject(), and slotSelectionChanged().

KPopupMenu* KexiBrowser::m_newObjectPopup [protected]
 

Definition at line 168 of file kexibrowser.h.

Referenced by KexiBrowser(), setReadOnly(), and slotNewObjectPopupAboutToShow().

KexiSmallToolButton* KexiBrowser::m_newObjectToolButton [protected]
 

Definition at line 177 of file kexibrowser.h.

Referenced by KexiBrowser(), setReadOnly(), and slotSelectionChanged().

QIntDict<KexiBrowserItem> KexiBrowser::m_normalItems [protected]
 

Definition at line 160 of file kexibrowser.h.

Referenced by addItem(), selectItem(), slotRemoveItem(), and updateItemName().

KAction * KexiBrowser::m_openAction [protected]
 

Definition at line 162 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotSelectionChanged().

int KexiBrowser::m_openAction_id [protected]
 

Definition at line 169 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotSelectionChanged().

KAction * KexiBrowser::m_pageSetupAction [protected]
 

Definition at line 162 of file kexibrowser.h.

Referenced by KexiBrowser(), slotPageSetupForItem(), and slotSelectionChanged().

int KexiBrowser::m_pageSetupAction_id [protected]
 

Definition at line 169 of file kexibrowser.h.

Referenced by KexiBrowser(), and slotSelectionChanged().