KDbTableSchemaChangeListener

Search for usage in LXR

KDbTableSchemaChangeListener Class Referenceabstract

#include <KDbTableSchemaChangeListener.h>

Public Member Functions

virtual tristate closeListener ()=0
 
QString name () const
 
void setName (const QString &name)
 

Static Public Member Functions

static tristate closeListeners (KDbConnection *conn, const KDbQuerySchema *query, const QList< KDbTableSchemaChangeListener * > &except=QList< KDbTableSchemaChangeListener * >())
 
static tristate closeListeners (KDbConnection *conn, const KDbTableSchema *table, const QList< KDbTableSchemaChangeListener * > &except=QList< KDbTableSchemaChangeListener * >())
 
static QList< KDbTableSchemaChangeListener * > listeners (KDbConnection *conn, const KDbQuerySchema *query)
 
static QList< KDbTableSchemaChangeListener * > listeners (KDbConnection *conn, const KDbTableSchema *table)
 
static void registerForChanges (KDbConnection *conn, KDbTableSchemaChangeListener *listener, const KDbQuerySchema *query)
 
static void registerForChanges (KDbConnection *conn, KDbTableSchemaChangeListener *listener, const KDbTableSchema *table)
 
static void unregisterForChanges (KDbConnection *conn, const KDbQuerySchema *query)
 
static void unregisterForChanges (KDbConnection *conn, const KDbTableSchema *table)
 
static void unregisterForChanges (KDbConnection *conn, KDbTableSchemaChangeListener *listener)
 
static void unregisterForChanges (KDbConnection *conn, KDbTableSchemaChangeListener *listener, const KDbQuerySchema *query)
 
static void unregisterForChanges (KDbConnection *conn, KDbTableSchemaChangeListener *listener, const KDbTableSchema *table)
 

Detailed Description

An interface allowing to listen for table schema changes.

The KDbTableSchemaChangeListener class can be used to listen for changes in table schema. For example query designer window that uses given table schema can be informed about planned changes and it can be decided about closing the window prior to changes in the schema.

Definition at line 36 of file KDbTableSchemaChangeListener.h.

Constructor & Destructor Documentation

◆ KDbTableSchemaChangeListener()

KDbTableSchemaChangeListener::KDbTableSchemaChangeListener ( )

Definition at line 351 of file KDbTableSchemaChangeListener.cpp.

◆ ~KDbTableSchemaChangeListener()

KDbTableSchemaChangeListener::~KDbTableSchemaChangeListener ( )
virtual

Definition at line 356 of file KDbTableSchemaChangeListener.cpp.

Member Function Documentation

◆ closeListener()

virtual tristate KDbTableSchemaChangeListener::closeListener ( )
pure virtual

Closes listening object so it will be deleted and thus no longer use a conflicting table schema.

For example if the listening object is a query designer in Kexi application, the designer window will be closed. This method can be used to avoid conflicts altering table schema or deleting it.

◆ closeListeners() [1/2]

tristate KDbTableSchemaChangeListener::closeListeners ( KDbConnection * conn,
const KDbQuerySchema * query,
const QList< KDbTableSchemaChangeListener * > & except = QList<KDbTableSchemaChangeListener*>() )
static

Closes all table schema listeners for query schema query except for the ones from the except list.

See KDbTableSchemaChangeListener::closeListener() for explanation of the operation of closing listener.

Returns
true if all listenters for the table schema table have been successfully closed (returned true) or false or cancelled if at least one listener returned false or cancelled, respectively. Regardless of returned value, closeListener() is called on all listeners for table.

Definition at line 553 of file KDbTableSchemaChangeListener.cpp.

◆ closeListeners() [2/2]

tristate KDbTableSchemaChangeListener::closeListeners ( KDbConnection * conn,
const KDbTableSchema * table,
const QList< KDbTableSchemaChangeListener * > & except = QList<KDbTableSchemaChangeListener*>() )
static

Closes all table schema listeners for table schema table except for the ones from the except list.

See KDbTableSchemaChangeListener::closeListener() for explanation of the operation of closing listener.

Returns
true if all listenters for the table schema table have been successfully closed (returned true) or false or cancelled if at least one listener returned false or cancelled, respectively. Regardless of returned value, closeListener() is called on all listeners for table.

Definition at line 530 of file KDbTableSchemaChangeListener.cpp.

◆ listeners() [1/2]

QList< KDbTableSchemaChangeListener * > KDbTableSchemaChangeListener::listeners ( KDbConnection * conn,
const KDbQuerySchema * query )
static
Returns
list of all table schema listeners registered for receiving (listening) information about changes in query query and other tables or queries depending on query.

Definition at line 513 of file KDbTableSchemaChangeListener.cpp.

◆ listeners() [2/2]

QList< KDbTableSchemaChangeListener * > KDbTableSchemaChangeListener::listeners ( KDbConnection * conn,
const KDbTableSchema * table )
static
Returns
list of all table schema listeners registered for receiving (listening) information about changes in table schema table and other tables or queries depending on table.

Definition at line 496 of file KDbTableSchemaChangeListener.cpp.

◆ name()

QString KDbTableSchemaChangeListener::name ( ) const
Returns
translated string that clearly identifies object that listens for changes in a given table schema.

For example it can be a query that uses the table, see KexiQueryPart in Kexi application and the translated name can be "Query \"abc\"". This friendly identifier can be then displayed by the application to inform users about objects depending on the table so users can decide whether to approve schema changes or close the depending windows to avoid conflicts.

By default the name string is empty.

Definition at line 361 of file KDbTableSchemaChangeListener.cpp.

◆ registerForChanges() [1/2]

void KDbTableSchemaChangeListener::registerForChanges ( KDbConnection * conn,
KDbTableSchemaChangeListener * listener,
const KDbQuerySchema * query )
static

Registers listener for receiving (listening) information about changes in query schema query and all tables that the query uses.

All tables related to lookup fields of these tables are also checked. Changes can be related to table altering and removing.

Definition at line 392 of file KDbTableSchemaChangeListener.cpp.

◆ registerForChanges() [2/2]

void KDbTableSchemaChangeListener::registerForChanges ( KDbConnection * conn,
KDbTableSchemaChangeListener * listener,
const KDbTableSchema * table )
static

Registers listener for receiving (listening) information about changes in table schema table and all tables related to lookup fields.

Changes can be related to altering and removing.

Definition at line 372 of file KDbTableSchemaChangeListener.cpp.

◆ setName()

void KDbTableSchemaChangeListener::setName ( const QString & name)
Returns
translated string that clearly identifies object that listens for changes in a given table schema.
See also
name()

Definition at line 366 of file KDbTableSchemaChangeListener.cpp.

◆ unregisterForChanges() [1/5]

void KDbTableSchemaChangeListener::unregisterForChanges ( KDbConnection * conn,
const KDbQuerySchema * query )
static

Unregisters all listeners for receiving (listening) information about changes in query schema query.

Definition at line 466 of file KDbTableSchemaChangeListener.cpp.

◆ unregisterForChanges() [2/5]

void KDbTableSchemaChangeListener::unregisterForChanges ( KDbConnection * conn,
const KDbTableSchema * table )
static

Unregisters all listeners for receiving (listening) information about changes in table schema table.

Definition at line 432 of file KDbTableSchemaChangeListener.cpp.

◆ unregisterForChanges() [3/5]

void KDbTableSchemaChangeListener::unregisterForChanges ( KDbConnection * conn,
KDbTableSchemaChangeListener * listener )
static

Unregisters listener for receiving (listening) information about changes in any table or query schema.

Definition at line 481 of file KDbTableSchemaChangeListener.cpp.

◆ unregisterForChanges() [4/5]

void KDbTableSchemaChangeListener::unregisterForChanges ( KDbConnection * conn,
KDbTableSchemaChangeListener * listener,
const KDbQuerySchema * query )
static

Unregisters listener for receiving (listening) information about changes in query schema query.

Definition at line 446 of file KDbTableSchemaChangeListener.cpp.

◆ unregisterForChanges() [5/5]

void KDbTableSchemaChangeListener::unregisterForChanges ( KDbConnection * conn,
KDbTableSchemaChangeListener * listener,
const KDbTableSchema * table )
static

Unregisters listener for receiving (listening) information about changes in table schema table.

Definition at line 412 of file KDbTableSchemaChangeListener.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:32 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.