akabeigroup.h 1.77 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13
/* This file is part of the Chakra project

   Copyright (C) 2010 Dario Freddi <drf@chakra-project.org>

   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 AKABEI_AKABEIGROUP_H
#define AKABEI_AKABEIGROUP_H

14
#include <QtCore/QObject>
15 16 17 18 19 20 21 22 23

#include "akabeicore_global.h"

namespace Akabei {

class Database;
class Package;

class GroupPrivate;
Lukas Appelhans's avatar
Lukas Appelhans committed
24
/**
Lukas Appelhans's avatar
Lukas Appelhans committed
25
 * \class Group  akabeigroup.h "akabeigroup.h"
Lukas Appelhans's avatar
Lukas Appelhans committed
26 27 28 29 30
 *
 * \brief This class describes a group of packages.
 * 
 * Groups are usually loaded from a \c Database or from a .group-file (\c Backend).
 */
31 32 33 34 35 36 37
class AKABEICORESHARED_EXPORT Group
{
    Q_DISABLE_COPY(Group)
    Q_DECLARE_PRIVATE(Group)
    public:
        virtual ~Group();

Lukas Appelhans's avatar
Lukas Appelhans committed
38 39 40
        /**
         * @returns the name of the group
         */
41
        QString name() const;
Lukas Appelhans's avatar
Lukas Appelhans committed
42 43 44
        /**
         * @returns a brief description of the group
         */
45
        QString description() const;
Lukas Appelhans's avatar
Lukas Appelhans committed
46 47 48
        /**
         * @returns the icon name of the group (see: http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html)
         */
49 50
        QString iconName() const;

Lukas Appelhans's avatar
Lukas Appelhans committed
51 52 53
        /**
         * @returns a list of packages which are in this group
         */
54
        QList<Package*> packages();
Lukas Appelhans's avatar
Lukas Appelhans committed
55 56 57
        /**
         * @returns a list of packages which match the given token in either the name or the description
         */
58 59 60
        QList<Package*> search(const QString &token);

    private:
61 62
        Group(const QString &name);

63
        GroupPrivate * const d_ptr;
64

65
        friend class GroupPool;
66
        friend class DatabasePrivate;
67
        friend class Backend;
68 69 70 71 72
};

}

#endif // AKABEI_AKABEIGROUP_H