1 /* This file is part of the Calligra project 2 * Copyright (c) 2008 Dag Andersen <danders@get2net> 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Library General Public 6 * License as published by the Free Software Foundation; either 7 * version 2 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Library General Public License for more details. 13 * 14 * You should have received a copy of the GNU Library General Public License 15 * along with this library; see the file COPYING.LIB. If not, write to 16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * Boston, MA 02110-1301, USA. 18 */ 19 20 #ifndef SCRIPTING_RESOURCEGROUP_H 21 #define SCRIPTING_RESOURCEGROUP_H 22 23 #include <QObject> 24 #include <QVariant> 25 26 27 namespace KPlato { 28 class ResourceGroup; 29 } 30 31 namespace Scripting { 32 class Project; 33 class ResourceGroup; 34 35 /** 36 * The ResourceGroup class represents a resource group in a project. 37 */ 38 class ResourceGroup : public QObject 39 { 40 Q_OBJECT 41 public: 42 /// Create a group 43 ResourceGroup(Project *project, KPlato::ResourceGroup *group, QObject *parent); 44 /// Destructor ~ResourceGroup()45 virtual ~ResourceGroup() {} 46 kplatoResourceGroup()47 KPlato::ResourceGroup *kplatoResourceGroup() const { return m_group; } 48 49 public Q_SLOTS: 50 /// Return the project this resource group is part of 51 QObject* project(); 52 /// Return the identity of resource group 53 QString id(); 54 /// Return type of resource group 55 QString type(); 56 /// Number of resources in this group 57 int resourceCount() const; 58 /// Return resource at @p index 59 QObject *resourceAt(int index) const; 60 61 /// Number of resources in this group 62 int childCount() const; 63 /// Return resource at @p index 64 QObject *childAt(int index) const; 65 66 private: 67 Project *m_project; 68 KPlato::ResourceGroup *m_group; 69 }; 70 71 } 72 73 #endif 74