Postgres Class Reference

Posgres plugin. More...

#include <postgres.h>

Inheritance diagram for Postgres:
Inheritance graph
[legend]
Collaboration diagram for Postgres:
Collaboration graph
[legend]

Public Member Functions

 Postgres (QWidget *parent=0)
virtual ~Postgres ()
QString getName ()
 Get name.
QWidget * getUserWidget ()
 Get Widget.
QWidget * getGroupWidget ()
 Get Widget.
void showAttributes (KockpitUser *kuser)
 Show attributes.
void assignAttributes (KockpitUser *kuser)
 Assign attributes.
void showAttributes (KockpitGroup *kgrp)
 Show attributes.
void assignAttributes (KockpitGroup *kgrp)
 Assign attributes.
void init (const QList< KockpitUnitMap * > *kumap, const QList< KockpitUnitMap * > *kgmap, KockpitValidator *val)
 Initialize.
void update (const QList< KockpitUnitMap * > *kumap, const QList< KockpitUnitMap * > *kgmap)
 Refresh.
void writeAdditional (QList< KockpitGroup * > &kgrpl, wraddmod mod)
 Write additional.
void writeAdditional (QList< KockpitUser * > &kusr, wraddmod mod)
 Write additional.
virtual void deleteEntry (KockpitGroup *kgrp)
 Delete attributes.
virtual void deleteEntry (KockpitUser *kuser)
 Delete attributes.

Private Member Functions

void build (const QList< KockpitUnitMap * > *kumap, const QList< KockpitUnitMap * > *kgmap)
void resetLists ()

Private Attributes

QList< KockpitUnitMap * > kumap
QList< KockpitUnitMap * > kgmap
KockpitUserselectedUser
KockpitGroupselectedGroup
KockpitBaseObj group
KockpitBaseObj user
KockpitAuthObj auth
DBModule dbmod

Detailed Description

Posgres plugin.

This class represents the example plugin for database access.


Constructor & Destructor Documentation

Postgres::Postgres ( QWidget *  parent = 0  ) 
Postgres::~Postgres (  )  [virtual]

Member Function Documentation

void Postgres::assignAttributes ( KockpitGroup kgrp  )  [virtual]

Assign attributes.

This function is called by the main application. It should be used to assign values which are entered by the user in the formular to the current KockpitGroup object.

Parameters:
kgrp The actual group chosen by the user

Implements KockpitIface.

void Postgres::assignAttributes ( KockpitUser kuser  )  [virtual]

Assign attributes.

This function is called by the main application. It should be used to assign values which are entered by the user in the formular to the current KockpitUser object.

Parameters:
kuser The actual user chosen by the user

Implements KockpitIface.

void Postgres::build ( const QList< KockpitUnitMap * > *  kumap,
const QList< KockpitUnitMap * > *  kgmap 
) [private]
void Postgres::deleteEntry ( KockpitUser kuser  )  [virtual]

Delete attributes.

This function is called by the main application. It should be used to delete entries. This approach only make sense if the plugin has an own datasource (f.e. a relational database).

Parameters:
kuser The actual user chosen by the user

Implements KockpitIface.

void Postgres::deleteEntry ( KockpitGroup kgrp  )  [virtual]

Delete attributes.

This function is called by the main application. It should be used to delete entries. This approach only make sense if the plugin has an own datasource (f.e. a relational database).

Parameters:
kgrp The actual group chosen by the user

Implements KockpitIface.

QWidget * Postgres::getGroupWidget (  )  [virtual]

Get Widget.

This function must return a pointer to a widget which will be displayed as a tab subordinated to the group main tab.

Returns:
QWidget* A poinger to the group tab.

Implements KockpitIface.

QString Postgres::getName (  )  [virtual]

Get name.

This function must return the name of the plugin and will be used as tab label.

Implements KockpitIface.

QWidget * Postgres::getUserWidget (  )  [virtual]

Get Widget.

This function must return a pointer to a widget which will be displayed as a Tab subordinated to the user main tab.

Returns:
QWidget* A pointer to the user tab.

Implements KockpitIface.

void Postgres::init ( const QList< KockpitUnitMap * > *  kumap,
const QList< KockpitUnitMap * > *  kgmap,
KockpitValidator val 
) [virtual]

Initialize.

This function is the first function which is called to initialize the plugin. If a plugin need to manage a user or group list by itself it can access these lists via the giben pointers. A pointer to the validator is already handed to the plugin to make it possible to validate the values changed from the plugin.

Parameters:
kumap Pointer to user (in KockpitUnitMap encapsulated KockpitUser) list from the main application.
kgmap Pointer to group (in KockpitUnitMap encapsulated KockpitGroup) list from the main application.
val Pointer to validator from the main application.

Implements KockpitIface.

void Postgres::resetLists (  )  [private]
void Postgres::showAttributes ( KockpitGroup kgrp  )  [virtual]

Show attributes.

This function is called by the main application. It should be used to diplay attributes in the formular.

Parameters:
kgrp The actual group chosen by the user

Implements KockpitIface.

void Postgres::showAttributes ( KockpitUser kuser  )  [virtual]

Show attributes.

This function is called by the main application. It should be used to diplay attributes in the formular.

Parameters:
kuser The actual user chosen by the user

Implements KockpitIface.

void Postgres::update ( const QList< KockpitUnitMap * > *  kumap,
const QList< KockpitUnitMap * > *  kgmap 
) [virtual]

Refresh.

This function is called from the main application in order to refresh the user or group list. If the plugin need to react to this action, this function has to be implemented.

Parameters:
kumap Pointer to user (in KockpitUnitMap encapsulated KockpitUser) list from the main application.
kgmap Pointer to group (in KockpitUnitMap encapsulated KockpitGroup) list from the main application.

Implements KockpitIface.

void Postgres::writeAdditional ( QList< KockpitUser * > &  kusrl,
wraddmod  mod 
) [virtual]

Write additional.

This function has a very special task. Sometimes it is necessarry to change user attributes after group attributes has been changed. For this use case this function has to bee implemented. This Function is called after writing an entry into the LDAP Backend and before deleting an entry.

Parameters:
kusrl Refernce to group list from the main application.
mod This Variable is needed to determine the intension of the additional writing.

Implements KockpitIface.

void Postgres::writeAdditional ( QList< KockpitGroup * > &  kgrpl,
wraddmod  mod 
) [virtual]

Write additional.

This function has a very special task. Sometimes it is necessarry to change group attributes after user attributes has been changed. For this use case this function has to bee implemented. This Function is called after writing an entry into the LDAP Backend and before deleting an entry.

Parameters:
kgrpl Refernce to group list from the main application.
mod This Variable is needed to determine the intension of the additional writing.

Implements KockpitIface.


Field Documentation

QList<KockpitUnitMap*> Postgres::kgmap [private]
QList<KockpitUnitMap*> Postgres::kumap [private]

The documentation for this class was generated from the following files:
Generated on Wed Mar 24 09:58:14 2010 for kockpit by  doxygen 1.6.3