summaryrefslogtreecommitdiffstats
path: root/interfaces/ktexteditor/searchinterface.cpp
blob: 6ea021e0d84b8a136d2872c573b4fd6d994b109d (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
#include "searchinterface.h"
#include "searchdcopinterface.h"
#include "document.h"

using namespace KTextEditor;

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

}

unsigned int SearchInterface::globalSearchInterfaceNumber = 0;

SearchInterface::SearchInterface()
{
	d = new PrivateSearchInterface();
	globalSearchInterfaceNumber++;
	mySearchInterfaceNumber=globalSearchInterfaceNumber;
        TQString name = "SearchInterface#" + TQString::number(mySearchInterfaceNumber);
	 d->interface = new SearchDCOPInterface(this, name.latin1());
}
SearchInterface::~SearchInterface()
{
  delete d->interface;
  delete d;
}

unsigned int SearchInterface::searchInterfaceNumber () const
{
  return mySearchInterfaceNumber;
}

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

SearchInterface *KTextEditor::searchInterface (Document *doc)
{  
  if (!doc)
    return 0;

  return dynamic_cast<KTextEditor::SearchInterface*>(doc);
}