~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to kmid/slman.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*  slman.h  - SongList Manager, which holds a set of collections (SongLists) 
 
2
    Copyright (C) 1997,98,99,2000  Antonio Larrosa Jimenez
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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., 675 Mass Ave, Cambridge, MA 02139, USA.
 
17
 
 
18
    Send comments and bug fixes to larrosa@kde.org
 
19
    or to Antonio Larrosa, Rio Arnoya, 10 5B, 29006 Malaga, Spain
 
20
 
 
21
***************************************************************************/
 
22
#ifndef SLMAN_H
 
23
#define SLMAN_H
 
24
 
 
25
#include "songlist.h"
 
26
 
 
27
class SLManager
 
28
{
 
29
protected:
 
30
int ntotal;
 
31
 
 
32
struct SongListNode
 
33
   {
 
34
   int id;
 
35
   char *name;
 
36
   SongList *SL;
 
37
   
 
38
   SongListNode *next;
 
39
   };
 
40
SongListNode *list;
 
41
SongList *tempsl;
 
42
 
 
43
char *getNotUsedName(void);
 
44
int nameUsed(const char *name);
 
45
void regenerateid(SongListNode *sl,int id);
 
46
 
 
47
public:
 
48
SLManager();
 
49
SLManager(SLManager &src);  // Copy constructor
 
50
~SLManager();
 
51
 
 
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
 
56
 
 
57
void deleteCollection(int id);
 
58
void changeCollectionName(int id, const char *newname);
 
59
 
 
60
SongList *getCollection(int id);
 
61
SongList *getCollection(const char *name);
 
62
const char *getCollectionName(int id);
 
63
 
 
64
int numberOfCollections(void) {return ntotal;};
 
65
 
 
66
void loadConfig(const char *filename);
 
67
void saveConfig(const char *filename);
 
68
 
 
69
SongList *createTemporaryCollection(void);
 
70
SongList *getTemporaryCollection(void) {return tempsl;};
 
71
 
 
72
};
 
73
 
 
74
#endif