Public Types | Public Member Functions | Protected Member Functions | List of all members
iauth::CUsersManagerComp Class Reference

Allows manage of list of users. More...

#include <CUsersManagerComp.h>

Inheritance diagram for iauth::CUsersManagerComp:
icomp::CComponentBase iauth::IUsersManager icomp::IComponent iser::ISerializable istd::IPolymorphic istd::IChangeable istd::IPolymorphic

Public Types

typedef icomp::CComponentBase BaseClass
 
- Public Types inherited from iauth::IUsersManager
enum  ChangeFlags { CF_USER_ADDED = 0x36e7c73, CF_USER_REMOVED, CF_USER_RENAMED }
 Data model change notification flags. More...
 

Public Member Functions

void Reset ()
 
virtual int GetUsersCount () const
 Get number of users in this collection. More...
 
virtual int FindUserIndex (const QString &name) const
 Search for user with specified name. More...
 
virtual const CUserGetUser (int index) const
 Get user using its index. More...
 
virtual CUserGetUserRef (int index)
 Get reference to user object using its index. More...
 
virtual CUserAddUser (const QString &name)
 Add a new user to the user list. More...
 
virtual bool DeleteUser (const QString &name)
 Delete the user with the user name. More...
 
virtual bool RenameUser (int userIndex, const QString &userName)
 The method renames the user. More...
 
virtual int GetUserGroupsCount () const
 Get number of user groups. More...
 
virtual const QString & GetUserGroupName (int groupIndex) const
 Get number of user groups. More...
 
virtual bool Serialize (iser::IArchive &archive)
 
- Public Member Functions inherited from icomp::IComponent
virtual const ICompositeComponentGetParentComponent (bool ownerOnly=false) const =0
 
virtual void * GetInterface (const istd::CClassInfo &interfaceType, const QByteArray &subId="")=0
 
virtual const IComponentContextGetComponentContext () const =0
 
virtual void SetComponentContext (const icomp::IComponentContext *contextPtr, const ICompositeComponent *parentPtr, bool isParentOwner)=0
 

Protected Member Functions

virtual void OnComponentCreated ()
 

Detailed Description

Allows manage of list of users.

Definition at line 24 of file CUsersManagerComp.h.

Member Typedef Documentation

Definition at line 29 of file CUsersManagerComp.h.

Member Function Documentation

virtual CUser* iauth::CUsersManagerComp::AddUser ( const QString &  userName)
virtual

Add a new user to the user list.

Parameters
QStringUsername: The user name of the new user. There can be each user name only once.
Returns
pointer to user object, if user was added correctly, otherwise NULL.

Implements iauth::IUsersManager.

virtual bool iauth::CUsersManagerComp::DeleteUser ( const QString &  userName)
virtual

Delete the user with the user name.

Parameters
QStringUsername: The user name of the user which shall be deleted.
Returns
true if the user was successfully deleted, otherwise false

Implements iauth::IUsersManager.

virtual int iauth::CUsersManagerComp::FindUserIndex ( const QString &  name) const
virtual

Search for user with specified name.

Returns
index of user, or negative value, if no user found.

Implements iauth::IUsersManager.

virtual const CUser& iauth::CUsersManagerComp::GetUser ( int  index) const
virtual

Get user using its index.

Implements iauth::IUsersManager.

virtual const QString& iauth::CUsersManagerComp::GetUserGroupName ( int  groupIndex) const
virtual

Get number of user groups.

Implements iauth::IUsersManager.

virtual int iauth::CUsersManagerComp::GetUserGroupsCount ( ) const
virtual

Get number of user groups.

Implements iauth::IUsersManager.

virtual CUser& iauth::CUsersManagerComp::GetUserRef ( int  index)
virtual

Get reference to user object using its index.

Implements iauth::IUsersManager.

virtual int iauth::CUsersManagerComp::GetUsersCount ( ) const
virtual

Get number of users in this collection.

Implements iauth::IUsersManager.

virtual void iauth::CUsersManagerComp::OnComponentCreated ( )
protectedvirtual
virtual bool iauth::CUsersManagerComp::RenameUser ( int  userIndex,
const QString &  userName 
)
virtual

The method renames the user.

You should not call method CUser::SetUserName() directly, because of user name is used as primary key of user list.

Parameters
QStringuserIndex: user index.
QStringuserName: the new user name.
Returns
true if the user name could be changed, otherwise false.

Implements iauth::IUsersManager.

void iauth::CUsersManagerComp::Reset ( )
virtual bool iauth::CUsersManagerComp::Serialize ( iser::IArchive archive)
virtual

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

© 2007-2017 Witold Gantzke and Kirill Lepskiy