2
* WengoPhone, a voice over Internet phone
3
* Copyright (C) 2004-2006 Wengo
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.
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program; if not, write to the Free Software
17
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23
#include <util/owutildll.h>
28
* Represents a picture.
30
* Named OWPicture rather than Picture because of a conflict under MacOSX.
33
* - Detect the picture format from header.
34
* - Return the format of the loaded picture and its size
36
* @author Philippe Bernery
42
* Constructs an empty OWPicture.
44
OWUTIL_API OWPicture();
46
OWUTIL_API OWPicture(const OWPicture & picture);
48
OWUTIL_API OWPicture & operator=(const OWPicture & picture);
51
* Constructs a OWPicture from data in memory.
53
* These data must include the header available in the file from where
54
* it has been extracted. The construtor will then guess the picture format
57
* @param data OWPicture data
59
OWUTIL_API static OWPicture pictureFromData(const std::string & data);
62
* Constructs a OWPicture from a file.
64
* The data are loaded and copied in memory.
66
* @param data OWPicture data
68
OWUTIL_API static OWPicture pictureFromFile(const std::string & filename);
71
* Gets the data with format header.
75
OWUTIL_API std::string getData() const;
78
* Gets the name of the file from which the OWPicture has been created.
80
* This does not return the complete path of the file.
82
* @return the filename
84
OWUTIL_API std::string getFilename() const;
87
* Set the filename of the OWPicture.
89
* Only the last part of the past is saved.
91
OWUTIL_API void setFilename(const std::string & filename);
95
void copy(const OWPicture & picture);
97
std::string _pictureData;
99
std::string _filename;