summaryrefslogtreecommitdiffstats
path: root/interfaces/ktexteditor/editinterface.cpp
blob: 3a03002b25f7f681b2b1c8c8259bf917c5a2dd53 (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
#include "editinterface.h"
#include "editdcopinterface.h"
#include "document.h"

using namespace KTextEditor;

namespace KTextEditor
{
  class PrivateEditInterface
  {
  public:
    PrivateEditInterface()
    {
    interface = 0;
    }
    ~PrivateEditInterface(){}
  // Data Members
  EditDCOPInterface *interface;
  };

}

uint EditInterface::globalEditInterfaceNumber = 0;

EditInterface::EditInterface()
{
  d = new PrivateEditInterface();
  globalEditInterfaceNumber++;
  myEditInterfaceNumber = globalEditInterfaceNumber;
  TQString name = "EditInterface#" + TQString::number(myEditInterfaceNumber);
  d->interface = new EditDCOPInterface(this, name.latin1());
}

EditInterface::~EditInterface()
{
  delete d->interface;
  delete d;
}

uint EditInterface::editInterfaceNumber () const
{
  return myEditInterfaceNumber;
}

void EditInterface::setEditInterfaceDCOPSuffix (const TQCString &suffix)
{
  d->interface->setObjId ("EditInterface#"+suffix);
}

EditInterface *KTextEditor::editInterface (Document *doc)
{                    
  if (!doc)
    return 0;

  return static_cast<EditInterface*>(doc->tqqt_cast("KTextEditor::EditInterface"));
}