KVIrc  4.9.2
DeveloperAPIs
Public Member Functions | Public Attributes | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
ClassEditorWidget Class Reference

The Class Editor module. More...

#include <ClassEditorWindow.h>

+ Inheritance diagram for ClassEditorWidget:

Public Member Functions

void build ()
 Builds the class! More...
 
 ClassEditorWidget (QWidget *pParent)
 Constructs the class editor object. More...
 
void cutItem (ClassEditorTreeWidgetItem *pItem)
 Removes the item from the tree. More...
 
void exportClasses (bool bSelectedOnly, bool bSingleFiles=false)
 Exports class to a file. More...
 
void exportSelectionInSinglesFiles (KviPointerList< ClassEditorTreeWidgetItem > *pList)
 Exports the current selection to single files. More...
 
ClassEditorTreeWidgetItemfindFunction (const QString &szFunctionName, ClassEditorTreeWidgetItem *pClass)
 Searches a function. More...
 
void loadNotBuiltClasses ()
 Loads non-built classes to a file. More...
 
virtual void loadProperties (KviConfigurationFile *pCfg)
 Called to load the window properties. More...
 
void saveNotBuiltClasses ()
 Saves non-built classes to a file. More...
 
virtual void saveProperties (KviConfigurationFile *pCfg)
 Called to save the window properties. More...
 
 ~ClassEditorWidget ()
 Destroys the class editor object. More...
 

Public Attributes

bool m_bSaving
 
QLabel * m_pClassNameLabel
 
QPushButton * m_pClassNameRenameButton
 
QMenu * m_pContextPopup
 
KviScriptEditorm_pEditor
 
QLabel * m_pFunctionNameLabel
 
QPushButton * m_pFunctionNameRenameButton
 
ClassEditorTreeWidgetItemm_pLastClickedItem
 
ClassEditorTreeWidgetItemm_pLastEditedItem
 
QLabel * m_pReminderLabel
 
QSplitter * m_pSplitter
 
ClassEditorTreeWidgetm_pTreeWidget
 
QString m_szDir
 

Protected Slots

void currentItemChanged (QTreeWidgetItem *pItem, QTreeWidgetItem *)
 
void customContextMenuRequested (QPoint)
 
void exportAll ()
 
void exportSelected ()
 
void exportSelectedSepFiles ()
 
void newClass ()
 
ClassEditorTreeWidgetItemnewItem (QString &szName, ClassEditorTreeWidgetItem::Type eType)
 
void newMemberFunction ()
 
void newNamespace ()
 
void recursiveCollapseItems (ClassEditorTreeWidgetItem *pItem)
 Called when we collapse an item recursively. More...
 
void removeSelectedItems ()
 Called when we want to remove all selected items. More...
 
void renameFunction ()
 
void renameItem ()
 
void searchReplace (const QString &szSearch, bool bReplace=false, const QString &szReplace="n")
 
void slotCollapseItems ()
 Called when we collapse an item. More...
 
void slotFind ()
 
void slotFindWord (const QString &)
 
void slotReplaceAll (const QString &szBefore, const QString &szAfter)
 Called when we replace text everywhere. More...
 

Protected Member Functions

void activateItem (QTreeWidgetItem *pItem)
 
void appendAllClassItems (KviPointerList< ClassEditorTreeWidgetItem > *pList)
 
void appendAllClassItemsRecursive (KviPointerList< ClassEditorTreeWidgetItem > *l, QTreeWidgetItem *pStartFrom)
 
void appendSelectedClassItems (KviPointerList< ClassEditorTreeWidgetItem > *pList)
 
void appendSelectedClassItemsRecursive (KviPointerList< ClassEditorTreeWidgetItem > *pList, QTreeWidgetItem *pStartFrom)
 
bool askForClassName (QString &szClassName, QString &szInheritsClassName, bool bEdit)
 
bool askForFunction (QString &szFunctionName, QString &szReminder, bool *pbInternal, const QString &szClassName, bool bRenameMode)
 
bool askForNamespaceName (const QString &szAction, const QString &szText, const QString &szInitialText, QString &szNameBuffer)
 
QString buildFullClassName (ClassEditorTreeWidgetItem *pItem)
 
void buildFullItemPath (ClassEditorTreeWidgetItem *pItem, QString &szBuffer)
 
bool classExists (QString &szName)
 Returns true if the class exists, false otherwise. More...
 
void createFullClass (KviKvsObjectClass *pClass, ClassEditorTreeWidgetItem *pItem, const QString &szClassName)
 
ClassEditorTreeWidgetItemcreateFullItem (const QString &szFullName)
 
ClassEditorTreeWidgetItemcreateFullItemRecursive (QTreeWidgetItem *pCurrent, QStringList &lNameSpaces, int &iLevel, bool bCreateNameSpace=0)
 
ClassEditorTreeWidgetItemcreateFullNamespace (const QString &szFullName)
 
void exportClassBuffer (QString &szBuffer, ClassEditorTreeWidgetItem *pItem)
 
ClassEditorTreeWidgetItemfindItem (const QString &szName)
 Searches an item. More...
 
ClassEditorTreeWidgetItemfindTopLevelItem (const QString &szName)
 
bool hasSelectedItems ()
 
void oneTimeSetup ()
 
void openParentItems (QTreeWidgetItem *pItem)
 
bool removeItem (ClassEditorTreeWidgetItem *pItem, KviPointerList< ClassEditorTreeWidgetItem > &lRemovedItems, bool *pbYesToAll)
 
void removeItemChildren (ClassEditorTreeWidgetItem *pItem, KviPointerList< ClassEditorTreeWidgetItem > &lRemovedItems)
 
void renameClass (ClassEditorTreeWidgetItem *pClass)
 Renames a class. More...
 
void renameNamespace (ClassEditorTreeWidgetItem *pNamespace)
 Renames a namespace. More...
 
void saveLastEditedItem ()
 
void searchInheritedClasses (const QString szClass, KviPointerList< ClassEditorTreeWidgetItem > &lInheritsedClasses)
 
void updateClassHierarchy (ClassEditorTreeWidgetItem *pClass)
 

Protected Attributes

KviPointerHashTable< QString,
ClassEditorTreeWidgetItem > * 
m_pClasses
 

Detailed Description

The Class Editor module.

Constructor & Destructor Documentation

ClassEditorWidget::ClassEditorWidget ( QWidget *  pParent)
ClassEditorWidget::~ClassEditorWidget ( )

Destroys the class editor object.

References KviPointerHashTable< Key, T >::clear(), and m_pClasses.

Member Function Documentation

void ClassEditorWidget::activateItem ( QTreeWidgetItem *  pItem)
protected
void ClassEditorWidget::appendAllClassItems ( KviPointerList< ClassEditorTreeWidgetItem > *  pList)
protected
void ClassEditorWidget::appendAllClassItemsRecursive ( KviPointerList< ClassEditorTreeWidgetItem > *  l,
QTreeWidgetItem *  pStartFrom 
)
protected

References KviPointerList< T >::append(), and i.

Referenced by renameNamespace().

void ClassEditorWidget::appendSelectedClassItems ( KviPointerList< ClassEditorTreeWidgetItem > *  pList)
protected
void ClassEditorWidget::appendSelectedClassItemsRecursive ( KviPointerList< ClassEditorTreeWidgetItem > *  pList,
QTreeWidgetItem *  pStartFrom 
)
protected
bool ClassEditorWidget::askForClassName ( QString &  szClassName,
QString &  szInheritsClassName,
bool  bEdit 
)
protected
bool ClassEditorWidget::askForFunction ( QString &  szFunctionName,
QString &  szReminder,
bool *  pbInternal,
const QString &  szClassName,
bool  bRenameMode 
)
protected
bool ClassEditorWidget::askForNamespaceName ( const QString &  szAction,
const QString &  szText,
const QString &  szInitialText,
QString &  szNameBuffer 
)
protected
void ClassEditorWidget::build ( )
QString ClassEditorWidget::buildFullClassName ( ClassEditorTreeWidgetItem pItem)
protected
void ClassEditorWidget::buildFullItemPath ( ClassEditorTreeWidgetItem pItem,
QString &  szBuffer 
)
protected

References ClassEditorTreeWidgetItem::name().

Referenced by newItem().

bool ClassEditorWidget::classExists ( QString &  szName)
protected

Returns true if the class exists, false otherwise.

Parameters
szNameThe name of the class
Returns
bool

References KviPointerHashTable< Key, T >::find(), and m_pClasses.

Referenced by renameClass().

void ClassEditorWidget::createFullClass ( KviKvsObjectClass pClass,
ClassEditorTreeWidgetItem pItem,
const QString &  szClassName 
)
protected
ClassEditorTreeWidgetItem * ClassEditorWidget::createFullItem ( const QString &  szFullName)
protected
ClassEditorTreeWidgetItem* ClassEditorWidget::createFullItemRecursive ( QTreeWidgetItem *  pCurrent,
QStringList &  lNameSpaces,
int &  iLevel,
bool  bCreateNameSpace = 0 
)
protected
ClassEditorTreeWidgetItem * ClassEditorWidget::createFullNamespace ( const QString &  szFullName)
protected
void ClassEditorWidget::currentItemChanged ( QTreeWidgetItem *  pItem,
QTreeWidgetItem *   
)
protectedslot
void ClassEditorWidget::customContextMenuRequested ( QPoint  pnt)
protectedslot
void ClassEditorWidget::cutItem ( ClassEditorTreeWidgetItem pItem)

Removes the item from the tree.

Parameters
pItemThe item to remove
Returns
void

References m_pTreeWidget.

Referenced by renameClass(), and renameNamespace().

void ClassEditorWidget::exportAll ( )
protectedslot

References exportClasses().

Referenced by customContextMenuRequested().

void ClassEditorWidget::exportClassBuffer ( QString &  szBuffer,
ClassEditorTreeWidgetItem pItem 
)
protected
void ClassEditorWidget::exportClasses ( bool  bSelectedOnly,
bool  bSingleFiles = false 
)
void ClassEditorWidget::exportSelected ( )
protectedslot

References exportClasses().

Referenced by customContextMenuRequested().

void ClassEditorWidget::exportSelectedSepFiles ( )
protectedslot

References exportClasses().

Referenced by customContextMenuRequested().

void ClassEditorWidget::exportSelectionInSinglesFiles ( KviPointerList< ClassEditorTreeWidgetItem > *  pList)
ClassEditorTreeWidgetItem * ClassEditorWidget::findFunction ( const QString &  szFunctionName,
ClassEditorTreeWidgetItem pClass 
)

Searches a function.

Parameters
szFunctionNameThe name of the function
pClassThe class in which the function is
Returns
ClassEditorTreeWidgetItem *

References KviQString::equalCI(), i, and KviRuntimeInfo::name().

Referenced by createFullClass(), and loadNotBuiltClasses().

ClassEditorTreeWidgetItem * ClassEditorWidget::findItem ( const QString &  szName)
protected

Searches an item.

Parameters
szNameThe name of the item to find
Returns
ClassEditorTreeWidgetItem *

References KviQString::equalCI(), findTopLevelItem(), i, and j.

Referenced by loadProperties(), newItem(), and renameNamespace().

ClassEditorTreeWidgetItem * ClassEditorWidget::findTopLevelItem ( const QString &  szName)
protected
bool ClassEditorWidget::hasSelectedItems ( )
protected

References m_pTreeWidget.

Referenced by customContextMenuRequested().

void ClassEditorWidget::loadNotBuiltClasses ( )
void ClassEditorWidget::loadProperties ( KviConfigurationFile pCfg)
virtual

Called to load the window properties.

Parameters
pCfgThe configuration file
Returns
void

References activateItem(), findItem(), m_pSplitter, KviConfigurationFile::readEntry(), and KviConfigurationFile::readIntListEntry().

Referenced by ClassEditorWindow::loadProperties().

void ClassEditorWidget::newClass ( )
protectedslot
ClassEditorTreeWidgetItem * ClassEditorWidget::newItem ( QString &  szName,
ClassEditorTreeWidgetItem::Type  eType 
)
protectedslot
void ClassEditorWidget::newMemberFunction ( )
protectedslot
void ClassEditorWidget::newNamespace ( )
protectedslot
void ClassEditorWidget::oneTimeSetup ( )
protected
void ClassEditorWidget::openParentItems ( QTreeWidgetItem *  pItem)
protected

Referenced by activateItem(), and searchReplace().

void ClassEditorWidget::recursiveCollapseItems ( ClassEditorTreeWidgetItem pItem)
protectedslot

Called when we collapse an item recursively.

Parameters
pItemThe starting item to collapse
Returns
void

References i.

Referenced by slotCollapseItems().

bool ClassEditorWidget::removeItem ( ClassEditorTreeWidgetItem pItem,
KviPointerList< ClassEditorTreeWidgetItem > &  lRemovedItems,
bool *  pbYesToAll 
)
protected
void ClassEditorWidget::removeItemChildren ( ClassEditorTreeWidgetItem pItem,
KviPointerList< ClassEditorTreeWidgetItem > &  lRemovedItems 
)
protected
void ClassEditorWidget::removeSelectedItems ( )
protectedslot

Called when we want to remove all selected items.

Returns
void

References KviPointerList< T >::findRef(), i, m_pTreeWidget, removeItem(), and KviPointerList< T >::setAutoDelete().

Referenced by customContextMenuRequested().

void ClassEditorWidget::renameClass ( ClassEditorTreeWidgetItem pClass)
protected
void ClassEditorWidget::renameFunction ( )
protectedslot
void ClassEditorWidget::renameItem ( )
protectedslot
void ClassEditorWidget::renameNamespace ( ClassEditorTreeWidgetItem pNamespace)
protected
void ClassEditorWidget::saveLastEditedItem ( )
protected
void ClassEditorWidget::saveNotBuiltClasses ( )
void ClassEditorWidget::saveProperties ( KviConfigurationFile pCfg)
virtual

Called to save the window properties.

Parameters
pCfgThe configuration file
Returns
void

References buildFullClassName(), m_pLastEditedItem, m_pSplitter, and KviConfigurationFile::writeEntry().

Referenced by ClassEditorWindow::saveProperties().

void ClassEditorWidget::searchInheritedClasses ( const QString  szClass,
KviPointerList< ClassEditorTreeWidgetItem > &  lInheritsedClasses 
)
protected
void ClassEditorWidget::searchReplace ( const QString &  szSearch,
bool  bReplace = false,
const QString &  szReplace = "n" 
)
protectedslot
void ClassEditorWidget::slotCollapseItems ( )
protectedslot

Called when we collapse an item.

Returns
void

References i, m_pTreeWidget, and recursiveCollapseItems().

Referenced by customContextMenuRequested().

void ClassEditorWidget::slotFind ( )
protectedslot
void ClassEditorWidget::slotFindWord ( const QString &  szSearch)
protectedslot
void ClassEditorWidget::slotReplaceAll ( const QString &  szBefore,
const QString &  szAfter 
)
protectedslot

Called when we replace text everywhere.

Parameters
szBeforeThe text before the replace
szAfterThe text after the replace
Returns
void

References m_pEditor, searchReplace(), and KviScriptEditor::setFindText().

Referenced by ClassEditorWidget().

void ClassEditorWidget::updateClassHierarchy ( ClassEditorTreeWidgetItem pClass)
protected

Member Data Documentation

bool ClassEditorWidget::m_bSaving
KviPointerHashTable<QString, ClassEditorTreeWidgetItem>* ClassEditorWidget::m_pClasses
protected
QLabel* ClassEditorWidget::m_pClassNameLabel
QPushButton* ClassEditorWidget::m_pClassNameRenameButton
QMenu* ClassEditorWidget::m_pContextPopup
KviScriptEditor* ClassEditorWidget::m_pEditor
QLabel* ClassEditorWidget::m_pFunctionNameLabel
QPushButton* ClassEditorWidget::m_pFunctionNameRenameButton
ClassEditorTreeWidgetItem* ClassEditorWidget::m_pLastClickedItem
ClassEditorTreeWidgetItem* ClassEditorWidget::m_pLastEditedItem
QLabel* ClassEditorWidget::m_pReminderLabel
QSplitter* ClassEditorWidget::m_pSplitter
ClassEditorTreeWidget* ClassEditorWidget::m_pTreeWidget
QString ClassEditorWidget::m_szDir

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