summaryrefslogtreecommitdiffstats
path: root/interfaces/ktexteditor/clipboardinterface.cpp
blob: c1bc2803fbffd2f679ebf09b7a70ebb37c39104c (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
#include "clipboardinterface.h"
#include "clipboarddcopinterface.h"

#include "view.h"

using namespace KTextEditor;

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

}

unsigned int ClipboardInterface::globalClipboardInterfaceNumber = 0;

ClipboardInterface::ClipboardInterface()
{
	d = new PrivateClipboardInterface();
	globalClipboardInterfaceNumber++;
        myClipboardInterfaceNumber = globalClipboardInterfaceNumber++;
	TQString name = "ClipboardInterface#" + TQString::number(myClipboardInterfaceNumber);
	d->interface = new ClipboardDCOPInterface(this, name.latin1());
}
ClipboardInterface::~ClipboardInterface()
{
  delete d->interface;
  delete d;
}

unsigned int ClipboardInterface::clipboardInterfaceNumber () const
{
  return myClipboardInterfaceNumber;
}

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

ClipboardInterface *KTextEditor::clipboardInterface (View *view)
{                                    
  if (!view)
    return 0;

  return static_cast<ClipboardInterface*>(view->tqqt_cast("KTextEditor::ClipboardInterface"));
}