summaryrefslogtreecommitdiffstats
path: root/lib/kotext/KoFontDia.h
blob: bdc102fa5945cb2a1eca95966c6522c9da933d69 (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
98
99
100
101
102
/* This file is part of the KDE project
   Copyright (C)  2001,2002,2003 Montel Laurent <lmontel@mandrakesoft.com>

   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Library General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This library 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
   Library General Public License for more details.

   You should have received a copy of the GNU Library General Public License
   along with this library; see the file COPYING.LIB.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 * Boston, MA 02110-1301, USA.
*/

#ifndef __kofontdia_h__
#define __kofontdia_h__

#include <tdefontdialog.h>
#include <tqtabwidget.h>
#include <KoTextFormat.h>
#include <tqcheckbox.h>
#include <koffice_export.h>

#include "KoFontTab.h"
#include "KoHighlightingTab.h"
#include "KoDecorationTab.h"
#include "KoLayoutTab.h"
#include "KoLanguageTab.h"

#include "KoFontDiaPreview.h"

#include <tdespell2/broker.h>

class TQComboBox;


class KOTEXT_EXPORT KoFontDia : public KDialogBase
{
    TQ_OBJECT
  
public:

    /// If your application supports spell-checking, pass here the KSpell2 Broker
    /// so that the font dialog can show which languages are supported for spellchecking.
    KoFontDia( const KoTextFormat& initialFormat,
               KSpell2::Broker::Ptr broker = 0,
               TQWidget* parent = 0, const char* name = 0 );

    int changedFlags() const { return m_changedFlags; }

    KoTextFormat newFormat() const;

protected slots:
    void slotReset();
    virtual void slotApply();
    virtual void slotOk();
    void slotFontFamilyChanged();
    void slotFontBoldChanged();
    void slotFontItalicChanged();
    void slotFontSizeChanged();
    void slotFontColorChanged( const TQColor& color );
    void slotBackgroundColorChanged( const TQColor& color );
    void slotCapitalisationChanged( int item );
    void slotUnderlineChanged( int item );
    void slotUnderlineStyleChanged( int item );
    void slotUnderlineColorChanged( const TQColor &color );
    void slotStrikethroughChanged( int item );
    void slotStrikethroughStyleChanged( int item );
    void slotWordByWordChanged( bool state );
    void slotShadowDistanceChanged( double distance );
    void slotShadowDirectionChanged( int direction );
    void slotShadowColorChanged( const TQColor &color );
    void slotSubSuperChanged();
    void slotOffsetChanged( int offset );
    void slotRelativeSizeChanged( double relativeSize );
    void slotHyphenationChanged( bool state );
    void slotLanguageChanged();

signals:
    void applyFont();

private:
    void init();

    KoTextFormat m_initialFormat;
    KoFontTab *fontTab;
    KoHighlightingTab *highlightingTab;
    KoDecorationTab *decorationTab;
    KoLayoutTab *layoutTab;
    KoLanguageTab *languageTab;
    KoFontDiaPreview *fontDiaPreview;

    int m_changedFlags;

};

#endif