You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
1.4 KiB
66 lines
1.4 KiB
15 years ago
|
#include "selectioninterface.h"
|
||
|
#include "selectiondcopinterface.h"
|
||
|
#include "document.h"
|
||
|
#include "view.h"
|
||
|
|
||
|
using namespace KTextEditor;
|
||
|
|
||
|
namespace KTextEditor
|
||
|
{
|
||
|
class PrivateSelectionInterface
|
||
|
{
|
||
|
public:
|
||
|
PrivateSelectionInterface()
|
||
|
{
|
||
|
interface = 0;
|
||
|
}
|
||
|
~PrivateSelectionInterface(){}
|
||
|
// Data Members
|
||
|
SelectionDCOPInterface *interface;
|
||
|
};
|
||
|
|
||
|
}
|
||
|
|
||
|
unsigned int SelectionInterface::globalSelectionInterfaceNumber = 0;
|
||
|
|
||
|
SelectionInterface::SelectionInterface()
|
||
|
{
|
||
|
d = new PrivateSelectionInterface();
|
||
|
globalSelectionInterfaceNumber++;
|
||
|
mySelectionInterfaceNumber = globalSelectionInterfaceNumber;
|
||
14 years ago
|
TQString name = "SelectionInterface#" + TQString::number(mySelectionInterfaceNumber);
|
||
15 years ago
|
d->interface = new SelectionDCOPInterface(this, name.latin1());
|
||
|
}
|
||
|
SelectionInterface::~SelectionInterface()
|
||
|
{
|
||
|
delete d->interface;
|
||
|
delete d;
|
||
|
}
|
||
|
|
||
|
unsigned int SelectionInterface::selectionInterfaceNumber () const
|
||
|
{
|
||
|
return mySelectionInterfaceNumber;
|
||
|
}
|
||
|
|
||
14 years ago
|
void SelectionInterface::setSelectionInterfaceDCOPSuffix (const TQCString &suffix)
|
||
15 years ago
|
{
|
||
|
d->interface->setObjId ("SelectionInterface#"+suffix);
|
||
|
}
|
||
|
|
||
|
SelectionInterface *KTextEditor::selectionInterface (Document *doc)
|
||
|
{
|
||
|
if (!doc)
|
||
|
return 0;
|
||
|
|
||
14 years ago
|
return dynamic_cast<KTextEditor::SelectionInterface*>(doc);
|
||
15 years ago
|
}
|
||
|
|
||
|
SelectionInterface *KTextEditor::selectionInterface (View *view)
|
||
|
{
|
||
|
if (!view)
|
||
|
return 0;
|
||
|
|
||
14 years ago
|
return dynamic_cast<KTextEditor::SelectionInterface*>(view);
|
||
15 years ago
|
}
|
||
|
|