1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2010 Robert Bieber
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
22 #ifndef PROJECTFILES_H
23 #define PROJECTFILES_H
25 #include "projectmodel.h"
28 class ProjectFiles
: public ProjectNode
31 ProjectFiles(QHash
<QString
, QString
>& settings
, ProjectModel
* model
,
33 virtual ~ProjectFiles();
35 virtual ProjectNode
* parent() const;
36 virtual ProjectNode
* child(int row
) const;
37 virtual int numChildren() const;
38 virtual int row() const;
39 virtual QVariant
data(int column
) const;
40 virtual Qt::ItemFlags
flags(int column
) const;
41 virtual void activated();
43 QString
getBase(){ return base
; }
46 ProjectNode
* parentLink
;
51 /* A class to enumerate a single file */
52 class ProjectFile
: public ProjectNode
55 ProjectFile(QString file
, ProjectModel
* model
, ProjectNode
* parent
);
56 virtual ~ProjectFile();
58 virtual ProjectNode
* parent() const{ return parentLink
; }
59 virtual ProjectNode
* child(int row
) const{ return 0; }
60 virtual int numChildren() const{ return 0; }
61 virtual int row() const{
62 return parentLink
->indexOf(const_cast<ProjectFile
*>(this));
64 virtual QVariant
data(int column
) const;
65 virtual Qt::ItemFlags
flags(int column
) const;
66 virtual void activated();
69 ProjectNode
* parentLink
;
73 #endif // PROJECTFILES_H