summaryrefslogtreecommitdiffstats
path: root/khexedit/parts/kpart/khepart.h
blob: ccbd038d94a9d6be60490a19d4598849fcbf5442 (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
/***************************************************************************
                          khepart.h  -  description
                             -------------------
    begin                : Don Jun 19 2003
    copyright            : (C) 2003 by Friedrich W. H. Kossebau
    email                : Friedrich.W.H@Kossebau.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This library is free software; you can redistribute it and/or         *
 *   modify it under the terms of the GNU Library General Public           *
 *   License version 2 as published by the Free Software Foundation.       *
 *                                                                         *
 ***************************************************************************/


#ifndef KHEPART_H
#define KHEPART_H

// kde specific
#include <tdeparts/part.h>
// app specific
#include "kbigbuffer.h"

// forward declarations
class KRadioAction;
class KToggleAction;
class KSelectAction;

namespace KHE
{

// forward declarations
class KHexEdit;

/**
 * This is a "Part".  It that does all the real work in a KPart
 * application.
 *
 * @short Main Part
 * @author Friedrich W. H. Kossebau <Friedrich.W.H@Kossebau.de>
 * @version 0.1.0
 */
class KHexEditPart : public KParts::ReadOnlyPart
{
    Q_OBJECT
  

    friend class KHexEditBrowserExtension;

  public:
    KHexEditPart( TQWidget *ParentWidget, const char *WidgetName, TQObject *Parent, const char *Name,
                  bool BrowserViewWanted );
    virtual ~KHexEditPart();


  protected: // KParts::ReadOnlyPart API
    virtual bool openFile();

  protected:
    void setupActions( bool BrowserViewWanted );
    void fitActionSettings();

  protected slots:
    // used to catch changes in the HexEdit widget
    void slotSelectionChanged();
  protected slots: // action slots
    void slotSelectAll();
    void slotUnselect();
    void slotSetCoding( int Coding );
    void slotSetEncoding( int Encoding );
    void slotSetShowUnprintable();
    void slotSetResizeStyle( int Style );
    void slotToggleOffsetColumn();
    void slotToggleValueCharColumns( int VisibleColunms );

  private:
    KHexEdit *HexEdit;
    KBigBuffer Wrapping;

    // edit menu
    KAction *CopyAction;
    // view menu
    KSelectAction *CodingAction;
    KSelectAction *EncodingAction;
    KToggleAction *ShowUnprintableAction;
    // settings menu
    KSelectAction *ResizeStyleAction;
    KToggleAction *ShowOffsetColumnAction;
    KSelectAction *ToggleColumnsAction;
};

}

#endif