~ubuntu-branches/debian/sid/kxstitch/sid

« back to all changes in this revision

Viewing changes to kxstitch/schememanager.h

  • Committer: Bazaar Package Importer
  • Author(s): eric pareja
  • Date: 2005-02-19 12:37:22 UTC
  • Revision ID: james.westby@ubuntu.com-20050219123722-kt3ru1nqvllietee
Tags: upstream-0.6
ImportĀ upstreamĀ versionĀ 0.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
 *   Copyright (C) 2003 by Stephen Allewell                                *
 
3
 *   stephen@mirramar.fsnet.co.uk                                          *
 
4
 *                                                                         *
 
5
 *   This program is free software; you can redistribute it and/or modify  *
 
6
 *   it under the terms of the GNU General Public License as published by  *
 
7
 *   the Free Software Foundation; either version 2 of the License, or     *
 
8
 *   (at your option) any later version.                                   *
 
9
 ***************************************************************************/
 
10
 
 
11
#ifndef SCHEMEMANAGER_H
 
12
#define SCHEMEMANAGER_H
 
13
 
 
14
#include <qptrlist.h>
 
15
#include <qstringlist.h>
 
16
#include "flossscheme.h"
 
17
 
 
18
/** Manages the global and user specific schemes.
 
19
    Schemes are stored as XML and loaded at application startup.
 
20
    The scheme list can be refreshed if a user stores a new scheme
 
21
    @author Stephen P. Allewell
 
22
  */
 
23
class SchemeManager
 
24
{
 
25
public:
 
26
  SchemeManager();
 
27
/** Create a new scheme
 
28
    @return Pointer to the new FlossScheme, will return NULL if
 
29
    a scheme already exists with this name, or if it could not
 
30
    be created.
 
31
    @param schemeName The name of the scheme to create
 
32
  */
 
33
  FlossScheme* createScheme(QString schemeName);
 
34
/** Read a scheme file
 
35
    @return Pointer to the FlossScheme read,
 
36
    will return NULL if the read failed or a scheme
 
37
    has previously been read by this name, ie if a calibrated
 
38
    scheme was read first.
 
39
    @param name The name of the file (scheme) to be read.
 
40
  */
 
41
  FlossScheme* readScheme(QString name);
 
42
/** write the scheme to a user writable directory.
 
43
    @return TRUE if successful, FALSE if no writable directory found.
 
44
    @param name The name of the scheme to be written.
 
45
  */
 
46
  bool writeScheme(QString name);
 
47
/** Get a list of the currently loaded scheme names.
 
48
    @return @ref QStringList containing the names of the avialable schemes.
 
49
  */
 
50
  QStringList schemes();
 
51
/** Get a pointer to a FlossScheme
 
52
    @return pointer to the FlossScheme,
 
53
    will return NULL if the scheme is not available.
 
54
    @param name The name of the scheme.
 
55
  */
 
56
  FlossScheme* scheme(QString name);
 
57
/** reload schemes
 
58
  */
 
59
  void refresh();
 
60
 
 
61
private:
 
62
  typedef QMap<QString,QColor>  CalibratedColor;
 
63
  QPtrList<FlossScheme>         m_flossSchemes;
 
64
};
 
65
 
 
66
#endif