chalk

kis_resource.h
1/*
2 * Copyright (c) 2003 Patrick Julien <freak@codepimps.org>
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18#ifndef KIS_RESOURCE_H_
19#define KIS_RESOURCE_H_
20
21#include <tqimage.h>
22#include <tqobject.h>
23#include <tqstring.h>
24
25
32class KisResource : public TQObject {
33 typedef TQObject super;
34 TQ_OBJECT
35
36
37public:
38
45 KisResource(const TQString& filename);
46 virtual ~KisResource();
47
48public:
52 virtual bool load() = 0;
53
58 virtual bool save() = 0;
59
63 virtual TQImage img() = 0;
64
65public:
66 TQString filename() const;
67 void setFilename(const TQString& filename);
68 TQString name() const;
69 void setName(const TQString& name);
70 bool valid() const;
71 void setValid(bool valid);
72
73private:
75 KisResource& operator=(const KisResource&);
76
77private:
78 TQString m_name;
79 TQString m_filename;
80 bool m_valid;
81};
82
83#endif // KIS_RESOURCE_H_
84
virtual TQImage img()=0
Returns a TQImage representing this resource.
KisResource(const TQString &filename)
Creates a new KisResource object using filename.
virtual bool save()=0
Save this resource asynchronously.
virtual bool load()=0
Load this resource.