Fairly large overhaul of the JuK codebase to beat out a lot of the Qt 3 stuff.
[kdemultimedia.git] / kmid / slman.h
blobcd51b5deedccb0009ad6face347f696c0e93fc61
1 /* slman.h - SongList Manager, which holds a set of collections (SongLists)
2 Copyright (C) 1997,98,99,2000 Antonio Larrosa Jimenez
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
9 This program 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
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 Send comments and bug fixes to larrosa@kde.org
19 or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain
21 ***************************************************************************/
22 #ifndef SLMAN_H
23 #define SLMAN_H
25 #include "songlist.h"
27 class SLManager
29 protected:
30 int ntotal;
32 struct SongListNode
34 int id;
35 char *name;
36 SongList *SL;
38 SongListNode *next;
40 SongListNode *list;
41 SongList *tempsl;
43 char *getNotUsedName(void);
44 int nameUsed(const char *name);
45 void regenerateid(SongListNode *sl,int id);
47 public:
48 SLManager();
49 SLManager(SLManager &src); // Copy constructor
50 ~SLManager();
52 int createCollection(const char *name=NULL); // Returns the id associated to the
53 // new collection
54 // -1 if name already is used and Collection was
55 // not created
57 void deleteCollection(int id);
58 void changeCollectionName(int id, const char *newname);
60 SongList *getCollection(int id);
61 SongList *getCollection(const char *name);
62 const char *getCollectionName(int id);
64 int numberOfCollections(void) {return ntotal;}
66 void loadConfig(const char *filename);
67 void saveConfig(const char *filename);
69 SongList *createTemporaryCollection(void);
70 SongList *getTemporaryCollection(void) {return tempsl;}
74 #endif