~vcs-imports/wengophone/trunk

« back to all changes in this revision

Viewing changes to libs/util/util/include/util/OWPicture.h

  • Committer: tanguy_k
  • Date: 2006-11-15 14:12:35 UTC
  • Revision ID: vcs-imports@canonical.com-20061115141235-6efc6e38eaa40ca0
* (compilation fix) OWBuild: rename portaudio to PORTAUDIO
* Libutil has only one include path now -> faster compilation
* Remove old directories
* (compilation fix) phapi: ph_msession_stopped() was a macro inside phmedia.h, now it is a standard function. Don't know why but it was not compiling under Windows using CMake

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * WengoPhone, a voice over Internet phone
3
 
 * Copyright (C) 2004-2006  Wengo
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
 
 * 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.
14
 
 *
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
18
 
 */
19
 
 
20
 
#ifndef OWPICTURE_H
21
 
#define OWPICTURE_H
22
 
 
23
 
#include <util/owutildll.h>
24
 
 
25
 
#include <string>
26
 
 
27
 
/**
28
 
 * Represents a picture.
29
 
 *
30
 
 * Named OWPicture rather than Picture because of a conflict under MacOSX.
31
 
 *
32
 
 * TODO
33
 
 * - Detect the picture format from header.
34
 
 * - Return the format of the loaded picture and its size
35
 
 *
36
 
 * @author Philippe Bernery
37
 
 */
38
 
class OWPicture {
39
 
public:
40
 
 
41
 
        /**
42
 
         * Constructs an empty OWPicture.
43
 
         */
44
 
        OWUTIL_API OWPicture();
45
 
 
46
 
        OWUTIL_API OWPicture(const OWPicture & picture);
47
 
 
48
 
        OWUTIL_API OWPicture & operator=(const OWPicture & picture);
49
 
 
50
 
        /**
51
 
         * Constructs a OWPicture from data in memory.
52
 
         *
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
55
 
         * from this header.
56
 
         *
57
 
         * @param data OWPicture data
58
 
         */
59
 
        OWUTIL_API static OWPicture pictureFromData(const std::string & data);
60
 
 
61
 
        /**
62
 
         * Constructs a OWPicture from a file.
63
 
         *
64
 
         * The data are loaded and copied in memory.
65
 
         *
66
 
         * @param data OWPicture data
67
 
         */
68
 
        OWUTIL_API static OWPicture pictureFromFile(const std::string & filename);
69
 
 
70
 
        /**
71
 
         * Gets the data with format header.
72
 
         *
73
 
         * @return the data
74
 
         */
75
 
        OWUTIL_API std::string getData() const;
76
 
 
77
 
        /**
78
 
         * Gets the name of the file from which the OWPicture has been created.
79
 
         *
80
 
         * This does not return the complete path of the file.
81
 
         *
82
 
         * @return the filename
83
 
         */
84
 
        OWUTIL_API std::string getFilename() const;
85
 
 
86
 
        /**
87
 
         * Set the filename of the OWPicture.
88
 
         *
89
 
         * Only the last part of the past is saved.
90
 
         */
91
 
        OWUTIL_API void setFilename(const std::string & filename);
92
 
 
93
 
private:
94
 
 
95
 
        void copy(const OWPicture & picture);
96
 
 
97
 
        std::string _pictureData;
98
 
 
99
 
        std::string _filename;
100
 
};
101
 
 
102
 
#endif  //OWPICTURE_H