summaryrefslogtreecommitdiffstats
path: root/ksquirrel/sq_library.h
blob: cf350d62df7b03699b33f238682f607d10c7e160 (plain)
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/***************************************************************************
                          sq_library.h  -  description
                             -------------------
    begin                : ðÎÄ éÀÎ 27 2005
    copyright            : (C) 2005 by Baryshev Dmitry
    email                : ksquirrel.iv@gmail.com
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program 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 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/

#ifndef SQ_LIBRARY_H
#define SQ_LIBRARY_H

#include <tqstring.h>
#include <tqregexp.h>
#include <tqpixmap.h>

#include <ksquirrel-libs/fmt_defs.h>
#include <ksquirrel-libs/settings.h>

class TQLibrary;

class KTempFile;

class fmt_codec_base;

/*
 *  SQ_LIBRARY represents a library. It contains all information
 *  needed by other classes, e.g. pointer to codec, mime image,
 *  version string, filter string, etc.
 *
 *  Used by SQ_LibraryHandler.
 */

struct SQ_LIBRARY
{
    SQ_LIBRARY() : lib(0), codec(0), codec_il(0), tmp(0), tmp_il(0)
    {}

    // pointer to library
    TQLibrary    *lib;
    
    // path to a library on disk
    TQString    libpath;

    // converted regular expression
    TQRegExp    regexp;

    // filter for a filemanager
    TQString    filter;

    // path to config file (.ui)
    TQString    config;

    fmt_settings settings;

    // regular expression as string
    TQString    regexp_str;

    TQString mimetype;

    bool mime_multi;

    // information on codec
    TQString    quickinfo;

    // codec's version
    TQString    version;

    // pointer to a codec
    fmt_codec_base    *codec, *codec_il;

    // 'create' and 'destroy' functions.
    // should exist in library!
    fmt_codec_base*     (*codec_create)();
    void                (*codec_destroy)(fmt_codec_base*);

    TQPixmap     mime;

    // options for writers.
    fmt_writeoptionsabs    opt;

    bool        writestatic, writeanimated;
    bool        readable;
    bool        canbemultiple, needtempfile;

    KTempFile *tmp, *tmp_il;
};

#endif