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

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.
 
void removeSelectedItems ()
 Called when we want to remove all selected items.
 
void renameFunction ()
 
void renameItem ()
 
void searchReplace (const QString &szSearch, bool bReplace=false, const QString &szReplace="n")
 
void slotCollapseItems ()
 Called when we collapse an item.
 
void slotFind ()
 
void slotFindWord (const QString &)
 
void slotReplaceAll (const QString &szBefore, const QString &szAfter)
 Called when we replace text everywhere.
 

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.
 
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.
 
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.
 
void renameNamespace (ClassEditorTreeWidgetItem *pNamespace)
 Renames a namespace.
 
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::ClassEditorWidget ( QWidget *  pParent)

◆ ~ClassEditorWidget()

ClassEditorWidget::~ClassEditorWidget ( )

Destroys the class editor object.

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

Member Function Documentation

◆ activateItem()

void ClassEditorWidget::activateItem ( QTreeWidgetItem *  pItem)
protected

◆ appendAllClassItems()

void ClassEditorWidget::appendAllClassItems ( KviPointerList< ClassEditorTreeWidgetItem > *  pList)
protected

◆ appendAllClassItemsRecursive()

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

◆ appendSelectedClassItems()

void ClassEditorWidget::appendSelectedClassItems ( KviPointerList< ClassEditorTreeWidgetItem > *  pList)
protected

◆ appendSelectedClassItemsRecursive()

void ClassEditorWidget::appendSelectedClassItemsRecursive ( KviPointerList< ClassEditorTreeWidgetItem > *  pList,
QTreeWidgetItem *  pStartFrom 
)
protected

◆ askForClassName()

bool ClassEditorWidget::askForClassName ( QString &  szClassName,
QString &  szInheritsClassName,
bool  bEdit 
)
protected

◆ askForFunction()

bool ClassEditorWidget::askForFunction ( QString &  szFunctionName,
QString &  szReminder,
bool *  pbInternal,
const QString &  szClassName,
bool  bRenameMode 
)
protected

◆ askForNamespaceName()

bool ClassEditorWidget::askForNamespaceName ( const QString &  szAction,
const QString &  szText,
const QString &  szInitialText,
QString &  szNameBuffer 
)
protected

◆ build()

void ClassEditorWidget::build ( )

◆ buildFullClassName()

QString ClassEditorWidget::buildFullClassName ( ClassEditorTreeWidgetItem pItem)
protected

◆ buildFullItemPath()

void ClassEditorWidget::buildFullItemPath ( ClassEditorTreeWidgetItem pItem,
QString &  szBuffer 
)
protected

References ClassEditorTreeWidgetItem::name(), and szBuffer.

Referenced by newItem().

◆ classExists()

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().

◆ createFullClass()

void ClassEditorWidget::createFullClass ( KviKvsObjectClass pClass,
ClassEditorTreeWidgetItem pItem,
const QString &  szClassName 
)
protected

◆ createFullItem()

ClassEditorTreeWidgetItem * ClassEditorWidget::createFullItem ( const QString &  szFullName)
protected

◆ createFullItemRecursive()

ClassEditorTreeWidgetItem * ClassEditorWidget::createFullItemRecursive ( QTreeWidgetItem *  pCurrent,
QStringList &  lNameSpaces,
int &  iLevel,
bool  bCreateNameSpace = 0 
)
protected

◆ createFullNamespace()

ClassEditorTreeWidgetItem * ClassEditorWidget::createFullNamespace ( const QString &  szFullName)
protected

◆ currentItemChanged

void ClassEditorWidget::currentItemChanged ( QTreeWidgetItem *  pItem,
QTreeWidgetItem *   
)
protectedslot

◆ customContextMenuRequested

void ClassEditorWidget::customContextMenuRequested ( QPoint  pnt)
protectedslot

◆ cutItem()

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().

◆ exportAll

void ClassEditorWidget::exportAll ( )
protectedslot

References exportClasses().

Referenced by customContextMenuRequested().

◆ exportClassBuffer()

void ClassEditorWidget::exportClassBuffer ( QString &  szBuffer,
ClassEditorTreeWidgetItem pItem 
)
protected

◆ exportClasses()

void ClassEditorWidget::exportClasses ( bool  bSelectedOnly,
bool  bSingleFiles = false 
)

◆ exportSelected

void ClassEditorWidget::exportSelected ( )
protectedslot

References exportClasses().

Referenced by customContextMenuRequested().

◆ exportSelectedSepFiles

void ClassEditorWidget::exportSelectedSepFiles ( )
protectedslot

References exportClasses().

Referenced by customContextMenuRequested().

◆ exportSelectionInSinglesFiles()

void ClassEditorWidget::exportSelectionInSinglesFiles ( KviPointerList< ClassEditorTreeWidgetItem > *  pList)

◆ findFunction()

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(), and i.

Referenced by createFullClass(), and loadNotBuiltClasses().

◆ findItem()

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().

◆ findTopLevelItem()

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

◆ hasSelectedItems()

bool ClassEditorWidget::hasSelectedItems ( )
protected

References m_pTreeWidget.

Referenced by customContextMenuRequested().

◆ loadNotBuiltClasses()

void ClassEditorWidget::loadNotBuiltClasses ( )

◆ loadProperties()

void ClassEditorWidget::loadProperties ( KviConfigurationFile pCfg)

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().

◆ newClass

void ClassEditorWidget::newClass ( )
protectedslot

◆ newItem

ClassEditorTreeWidgetItem * ClassEditorWidget::newItem ( QString &  szName,
ClassEditorTreeWidgetItem::Type  eType 
)
protectedslot

◆ newMemberFunction

void ClassEditorWidget::newMemberFunction ( )
protectedslot

◆ newNamespace

void ClassEditorWidget::newNamespace ( )
protectedslot

◆ oneTimeSetup()

void ClassEditorWidget::oneTimeSetup ( )
protected

◆ openParentItems()

void ClassEditorWidget::openParentItems ( QTreeWidgetItem *  pItem)
protected

◆ recursiveCollapseItems

void ClassEditorWidget::recursiveCollapseItems ( ClassEditorTreeWidgetItem pItem)
protectedslot

Called when we collapse an item recursively.

Parameters
pItemThe starting item to collapse
Returns
void

References i, and recursiveCollapseItems().

Referenced by recursiveCollapseItems(), and slotCollapseItems().

◆ removeItem()

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

◆ removeItemChildren()

void ClassEditorWidget::removeItemChildren ( ClassEditorTreeWidgetItem pItem,
KviPointerList< ClassEditorTreeWidgetItem > &  lRemovedItems 
)
protected

◆ removeSelectedItems

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().

◆ renameClass()

void ClassEditorWidget::renameClass ( ClassEditorTreeWidgetItem pClass)
protected

◆ renameFunction

void ClassEditorWidget::renameFunction ( )
protectedslot

◆ renameItem

void ClassEditorWidget::renameItem ( )
protectedslot

◆ renameNamespace()

void ClassEditorWidget::renameNamespace ( ClassEditorTreeWidgetItem pNamespace)
protected

◆ saveLastEditedItem()

void ClassEditorWidget::saveLastEditedItem ( )
protected

◆ saveNotBuiltClasses()

void ClassEditorWidget::saveNotBuiltClasses ( )

◆ saveProperties()

void ClassEditorWidget::saveProperties ( KviConfigurationFile pCfg)

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().

◆ searchInheritedClasses()

void ClassEditorWidget::searchInheritedClasses ( const QString  szClass,
KviPointerList< ClassEditorTreeWidgetItem > &  lInheritsedClasses 
)
protected

◆ searchReplace

void ClassEditorWidget::searchReplace ( const QString &  szSearch,
bool  bReplace = false,
const QString &  szReplace = "n" 
)
protectedslot

◆ slotCollapseItems

void ClassEditorWidget::slotCollapseItems ( )
protectedslot

Called when we collapse an item.

Returns
void

References i, m_pTreeWidget, and recursiveCollapseItems().

Referenced by customContextMenuRequested().

◆ slotFind

void ClassEditorWidget::slotFind ( )
protectedslot

◆ slotFindWord

void ClassEditorWidget::slotFindWord ( const QString &  szSearch)
protectedslot

◆ slotReplaceAll

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().

◆ updateClassHierarchy()

void ClassEditorWidget::updateClassHierarchy ( ClassEditorTreeWidgetItem pClass)
protected

Member Data Documentation

◆ m_bSaving

bool ClassEditorWidget::m_bSaving

◆ m_pClasses

KviPointerHashTable<QString, ClassEditorTreeWidgetItem>* ClassEditorWidget::m_pClasses
protected

◆ m_pClassNameLabel

QLabel* ClassEditorWidget::m_pClassNameLabel

◆ m_pClassNameRenameButton

QPushButton* ClassEditorWidget::m_pClassNameRenameButton

◆ m_pContextPopup

QMenu* ClassEditorWidget::m_pContextPopup

◆ m_pEditor

KviScriptEditor* ClassEditorWidget::m_pEditor

◆ m_pFunctionNameLabel

QLabel* ClassEditorWidget::m_pFunctionNameLabel

◆ m_pFunctionNameRenameButton

QPushButton* ClassEditorWidget::m_pFunctionNameRenameButton

◆ m_pLastClickedItem

ClassEditorTreeWidgetItem* ClassEditorWidget::m_pLastClickedItem

◆ m_pLastEditedItem

ClassEditorTreeWidgetItem* ClassEditorWidget::m_pLastEditedItem

◆ m_pReminderLabel

QLabel* ClassEditorWidget::m_pReminderLabel

◆ m_pSplitter

QSplitter* ClassEditorWidget::m_pSplitter

◆ m_pTreeWidget

ClassEditorTreeWidget* ClassEditorWidget::m_pTreeWidget

◆ m_szDir

QString ClassEditorWidget::m_szDir

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