File: FileInfo.h

package info (click to toggle)
equalx 0.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,268 kB
  • sloc: cpp: 7,119; ansic: 98; sql: 10; makefile: 6
file content (75 lines) | stat: -rw-r--r-- 2,347 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
 * Copyright 2013 Mihai Niculescu <q.quark@gmail.com>
 *
 * This file is part of EqualX Project (https://launchpad.net/equalx/)
 *
 * EqualX is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * EqualX is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef FILEINFO_H
#define FILEINFO_H

#include <QObject>
#include <QColor>
#include <QString>

#include "defines.h"
#include "HLSelections.h"

namespace EqualX{

/*
 * A EqualX File is any file which contains EqualX metadata embedded as XMP
 *
 * This class only describes the metadata specific for a EqualX file. For reading/writing EqualX Files look in File.h
 *
 */
class FileInfo : public QObject
{
    Q_OBJECT
public:
    explicit FileInfo(QObject *parent = 0);
    FileInfo(const EqualX::FileInfo& other);

    QString equation() const;
    QString preamble() const;
    HLSelections selections() const;
    LATEX_FONT_SIZE fontSize() const;
    QColor fgColor() const;
    QColor bgColor() const;
    LATEX_ENV_MODE environment() const;
    
    void setEquation(const QString& equation);
    void setPreamble(const QString& preamble);
    void setSelections(const HLSelections& selections);
    EqualX::FileInfo& operator=(const EqualX::FileInfo& other);

public slots:
    void setFontSize(int size); // size is enum LATEX_FONT_SIZE
    void setForegroundColor(const QColor& color);
    void setBackgroundColor(const QColor& color);
    void setEnvironment(int env); // int values must be correlated with RENDER_MODE
    
private:
    QString mPreamble;
    QString mEquation;
    LATEX_FONT_SIZE mFontSize; // font size
    QColor mFGColor; // color is in format for latex color
    QColor mBGColor; // color is in format for latex color
    HLSelections mSelections;
    LATEX_ENV_MODE mEnvironment; // latex environment for equation
};

}
#endif // FILEINFO_H