Logo Search packages:      
Sourcecode: webissues version File versions  Download package

datarows.h

/**************************************************************************
* This file is part of the WebIssues program
* Copyright (C) 2006 Michał Męciński
* Copyright (C) 2007 WebIssues Team
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
**************************************************************************/

#ifndef DATAROWS_H
#define DATAROWS_H

#include <QString>
#include <QDateTime>

#include "rdb/rowbase.h"

namespace WebIssues
{

/**
* Access level for user or member.
*/
00026 enum Access
{
    /**
    * Data is unavailable and the access level is not known.
    */
00031     UnknownAccess = -1,
    /**
    * User has no access to the system or project.
    */
00035     NoAccess = 0,
    /**
    * User has normal access to the system or project.
    */
00039     NormalAccess = 1,
    /**
    * User is a system or project administrator.
    */
00043     AdminAccess = 2
};

/**
* A row of the users table.
*/
00049 class UserRow : public RDB::RowBase< 1 >
{
public:
    /**
    * Constructor.
    */
    UserRow( int userId, const QString& login, const QString& name, Access access );

    /**
    * Destructor.
    */
    ~UserRow();

public:
    /**
    * Return the identifier of the user.
    */
00066     int userId() const { return key( 0 ); }

    /**
    * Return the login of the user.
    */
00071     const QString& login() const { return m_login; }

    /**
    * Return the display name of the user.
    */
00076     const QString& name() const { return m_name; }

    /**
    * Return the global access level of the user.
    */
00081     Access access() const { return m_access; }

private:
    QString m_login;
    QString m_name;
    Access m_access;
};

/**
* A row of the members table.
*/
00092 class MemberRow : public RDB::RowBase< 2 >
{
public:
    /**
    * Constructor.
    */
    MemberRow( int userId, int projectId, Access access );

    /**
    * Destructor.
    */
    ~MemberRow();

public:
    /**
    * Return the idenifier of the user.
    */
00109     int userId() const { return key( 0 ); }

    /**
    * Return the identifier of the project.
    */
00114     int projectId() const { return key( 1 ); }

    /**
    * Return the user's access level to the project.
    */
00119     Access access() const { return m_access; }

private:
    Access m_access;
};

/**
* A row of the issue types table.
*/
00128 class TypeRow : public RDB::RowBase< 1 >
{
public:
    /**
    * Constructor.
    */
    TypeRow( int typeId, const QString& name );

    /**
    * Destructor.
    */
    ~TypeRow();

public:
    /**
    * Return the identifier of the issue type.
    */
00145     int typeId() const { return key( 0 ); }

    /**
    * Return the name of the issue type.
    */
00150     const QString& name() const { return m_name; }

private:
    QString m_name;
};

/**
* A row of the attribute definitions table.
*/
00159 class AttributeRow : public RDB::RowBase< 2 >
{
public:
    /**
    * Constructor.
    */
    AttributeRow( int attributeId, int typeId, const QString& name, const QString& definition );

    /**
    * Destructor.
    */
    ~AttributeRow();

public:
    /**
    * Return the identifier of the attribute.
    */
00176     int attributeId() const { return key( 0 ); }

    /**
    * Return the identifier of the issue type.
    */
00181     int typeId() const { return key( 1 ); }

    /**
    * Return the name of the attribute.
    */
00186     const QString& name() const { return m_name; }

    /**
    * Return the definition of the attribute.
    */
00191     const QString& definition() const { return m_definition; }

private:
    QString m_name;
    QString m_definition;
};

/**
* A row of the projects table.
*/
00201 class ProjectRow : public RDB::RowBase< 1 >
{
public:
    /**
    * Constructor.
    */
    ProjectRow( int projectId, const QString& name );

    /**
    * Destructor.
    */
    ~ProjectRow();

public:
    /**
    * Return the identifier of the project.
    */
00218     int projectId() const { return key( 0 ); }

    /**
    * Return the name of the project.
    */
00223     const QString& name() const { return m_name; }

private:
    QString m_name;
};

/**
* A row of the folders table.
*/
00232 class FolderRow : public RDB::RowBase< 2 >
{
public:
    /**
    * Constructor.
    */
    FolderRow( int folderId, int projectId, const QString& name, int typeId, int stamp );

    /**
    * Destructor.
    */
    ~FolderRow();

public:
    /**
    * Return the identifier of the folder.
    */
00249     int folderId() const { return key( 0 ); }

    /**
    * Return the identifier of the folder's project.
    */
00254     int projectId() const { return key( 1 ); }

    /**
    * Return the folder name.
    */
00259     const QString& name() const { return m_name; }

    /**
    * Return the identifier of the issue type of the folder.
    */
00264     int typeId() const { return m_typeId; }

    /**
    * Return the stamp of the last modification in the folder.
    */
00269     int stamp() const { return m_stamp; }

private:
    QString m_name;
    int m_typeId;
    int m_stamp;
};

/**
* A row of the issues table.
*/
00280 class IssueRow : public RDB::RowBase< 2 >
{
public:
    /**
    * Constructor.
    */
    IssueRow( int issueId, int folderId, const QString& name, int stamp, const QDateTime& createdDate,
        int createdUser, const QDateTime& modifiedDate, int modifiedUser );

    /**
    * Destructor.
    */
    ~IssueRow();

public:
    /**
    * Return the identifier of the issue.
    */
00298     int issueId() const { return key( 0 ); }

    /**
    * Return the identifier of the issue's folder.
    */
00303     int folderId() const { return key( 1 ); }

    /**
    * Return the issue name.
    */
00308     const QString& name() const { return m_name; }

    /**
    * Return the stamp of the last modification of the issue.
    */
00313     int stamp() const { return m_stamp; }

    /**
    * Return the creation date.
    */
00318     const QDateTime& createdDate() const { return m_createdDate; }

    /**
    * Return the identifier of the user who created the issue.
    */
00323     int createdUser() const { return m_createdUser; }

    /**
    * Return the last modification date.
    */
00328     const QDateTime& modifiedDate() const { return m_modifiedDate; }

    /**
    * Return the identifier of the user who last modified the issue.
    */
00333     int modifiedUser() const { return m_modifiedUser; }

private:
    QString m_name;
    int m_stamp;
    QDateTime m_createdDate;
    int m_createdUser;
    QDateTime m_modifiedDate;
    int m_modifiedUser;
};

/**
* A row of the attribute values table.
*/
00347 class ValueRow : public RDB::RowBase< 2 >
{
public:
    /**
    * Constructor.
    */
    ValueRow( int attributeId, int issueId, const QString& value );

    /**
    * Destructor.
    */
    ~ValueRow();

public:
    /**
    * Return the identifier of the attribute.
    */
00364     int attributeId() const { return key( 0 ); }

    /**
    * Return the identifier of the issue.
    */
00369     int issueId() const { return key( 1 ); }

    /**
    * Return the attribute value.
    */
00374     const QString& value() const { return m_value; }

private:
    QString m_value;
};

/**
* A row of the comments table.
*/
00383 class CommentRow : public RDB::RowBase< 2 >
{
public:
    /**
    * Constructor.
    */
    CommentRow( int commentId, int issueId, const QDateTime& createdDate, int createdUser,
        const QString& text );

    /**
    * Destructor.
    */
    ~CommentRow();

public:
    /**
    * Return the identifier of the comment.
    */
00401     int commentId() const { return key( 0 ); }

    /**
    * Return the identifier of the issue.
    */
00406     int issueId() const { return key( 1 ); }

    /**
    * Return the creation date.
    */
00411     const QDateTime& createdDate() const { return m_createdDate; }

    /**
    * Return the identifier of the user who created the comment.
    */
00416     int createdUser() const { return m_createdUser; }

    /**
    * Return the text of the comment.
    */
00421     const QString& text() const { return m_text; }

private:
    QDateTime m_createdDate;
    int m_createdUser;
    QString m_text;
};

/**
* A row of the attachments table.
*/
00432 class AttachmentRow : public RDB::RowBase< 2 >
{
public:
    /**
    * Constructor.
    */
    AttachmentRow( int attachmentId, int issueId, const QString& name, const QDateTime& createdDate,
        int createdUser, int size, const QString& description );

    /**
    * Destructor.
    */
    ~AttachmentRow();

public:
    /**
    * Return the identifier of the attachment.
    */
00450     int attachmentId() const { return key( 0 ); }

    /**
    * Return the identifier of the issue.
    */
00455     int issueId() const { return key( 1 ); }

    /**
    * Return the name of the attachment.
    */
00460     const QString& name() const { return m_name; }

    /**
    * Return the creation date.
    */
00465     const QDateTime& createdDate() const { return m_createdDate; }

    /**
    * Return the identifier of the user who created the attachment.
    */
00470     int createdUser() const { return m_createdUser; }

    /**
    * Return the size of the attachment.
    */
00475     int size() const { return m_size; }

    /**
    * Return the description of the attachment.
    */
00480     const QString& description() const { return m_description; }

private:
    QString m_name;
    QDateTime m_createdDate;
    int m_createdUser;
    int m_size;
    QString m_description;
};

/**
* A row of the changes table.
*/
00493 class ChangeRow : public RDB::RowBase< 2 >
{
public:
    /**
    * Constructor.
    */
    ChangeRow( int changeId, int issueId, const QDateTime& modifiedDate, int modifiedUser,
        int attributeId, const QString& oldValue, const QString& newValue );

    /**
    * Destructor.
    */
    ~ChangeRow();

public:
    /**
    * Return the identifier of the change.
    */
00511     int changeId() const { return key( 0 ); }

    /**
    * Return the identifier of the issue.
    */
00516     int issueId() const { return key( 1 ); }

    /**
    * Return the date of the change.
    */
00521     const QDateTime& modifiedDate() const { return m_modifiedDate; }

    /**
    * Return the identifier of the user who made the change.
    */
00526     int modifiedUser() const { return m_modifiedUser; }

    /**
    * Return the identifier of the changed attribute ( 0 if the issue name was changed ).
    */
00531     int attributeId() const { return m_attributeId; }

    /**
    * Return the old value of the changed attribute.
    */
00536     const QString& oldValue() const { return m_oldValue; }

    /**
    * Return the new value of the changed attribute.
    */
00541     const QString& newValue() const { return m_newValue; }

private:
    QDateTime m_modifiedDate;
    int m_modifiedUser;
    int m_attributeId;
    QString m_oldValue;
    QString m_newValue;
};

}

#endif

Generated by  Doxygen 1.6.0   Back to index