summaryrefslogtreecommitdiffstats
path: root/src/editorproxy.h
blob: b505656f9c0388cca83fd9684aa02c492383bdf5 (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
#ifndef __EDITORPROXY_H__
#define __EDITORPROXY_H__


#include <tqobject.h>
#include <tqmemarray.h>
#include <tqguardedptr.h>

class TQPopupMenu;
class MultiBuffer;
class TQTimer;

#include <kparts/part.h>
#include <ktexteditor/markinterface.h>
#include <kdeversion.h>
# include <ktexteditor/markinterfaceextension.h>

class EditorProxy : public QObject
{
  Q_OBJECT

public:

  static EditorProxy *getInstance();

  void setLineNumber(KParts::Part *part, int lineNum, int col);

  void installPopup(KParts::Part *part);

  void registerEditor(MultiBuffer* wrapper);
  void deregisterEditor(MultiBuffer* wrapper);

  TQWidget * widgetForPart( KParts::Part * part );
  TQWidget * topWidgetForPart( KParts::Part * part );

  bool isDelayedViewCapable();

  TQWidget * findPartWidget( KParts::Part * part );

public slots:
  void setLineNumberDelayed();

private slots:

  void popupAboutToShow();
  void showPopup();

private:

  EditorProxy();

  static EditorProxy *s_instance;

  TQMemArray<int> m_popupIds;

  // This list is used to save line/col information for not yet activated editor views.
  TQValueList< MultiBuffer* > m_editorParts;

  TQTimer* m_delayedLineTimer;
  bool m_delayedViewCreationCompatibleUI;
  KParts::Part *m_delayedPart;
  int m_delayedLine;
  int m_delayedCol;
};


#endif