00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
#include "selectioninterfaceext.h"
00023
#include "selectionextdcopinterface.h"
00024
#include "document.h"
00025
#include "view.h"
00026
#include <dcopclient.h>
00027
00028
using namespace KTextEditor;
00029
00030
00031
class KTextEditor::PrivateSelectionInterfaceExt {
00032
public:
00033 PrivateSelectionInterfaceExt() : interface( 0 ) {};
00034 ~PrivateSelectionInterfaceExt() {};
00035
00036
SelectionExtDCOPInterface *interface;
00037 };
00038
00039
unsigned int SelectionInterfaceExt::globalSelectionInterfaceExtNumber = 0;
00040
00041 SelectionInterfaceExt::SelectionInterfaceExt()
00042 : d ( new PrivateSelectionInterfaceExt )
00043 {
00044 globalSelectionInterfaceExtNumber++;
00045 mySelectionInterfaceExtNumber = globalSelectionInterfaceExtNumber;
00046
QString name =
"SelectionInterfaceExt#" +
QString::number(mySelectionInterfaceExtNumber);
00047 d->interface =
new SelectionExtDCOPInterface(
this,
name.
latin1());
00048 }
00049
00050 SelectionInterfaceExt::~SelectionInterfaceExt()
00051 {
00052
delete d->interface;
00053
delete d;
00054 }
00055
00056
unsigned int SelectionInterfaceExt::selectionInterfaceExtNumber ()
const
00057
{
00058
return mySelectionInterfaceExtNumber;
00059 }
00060
00061
void SelectionInterfaceExt::setSelectionInterfaceExtDCOPSuffix (
const QCString &suffix)
00062 {
00063 d->interface->setObjId (
"SelectionInterfaceExt#"+suffix);
00064 }
00065
00066
SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (
Document *doc)
00067 {
00068
if (!doc)
00069
return 0;
00070
00071
return static_cast<SelectionInterfaceExt*>(doc->qt_cast(
"KTextEditor::SelectionInterfaceExt"));
00072 }
00073
00074
SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (
View *view)
00075 {
00076
if (!view)
00077
return 0;
00078
00079
return static_cast<SelectionInterfaceExt*>(view->qt_cast(
"KTextEditor::SelectionInterfaceExt"));
00080 }
00081
00082
00083
00084
00085 SelectionExtDCOPInterface::SelectionExtDCOPInterface(
00086
SelectionInterfaceExt *parent,
const char* name )
00087 :
DCOPObject(
name ),
00088 m_parent( parent )
00089 {
00090 }
00091
00092 SelectionExtDCOPInterface::~SelectionExtDCOPInterface()
00093 {
00094 }
00095
00096 int SelectionExtDCOPInterface::selStartLine()
00097 {
00098
return m_parent->
selStartLine();
00099 }
00100
00101 int SelectionExtDCOPInterface::selStartCol()
00102 {
00103
return m_parent->
selStartCol();
00104 }
00105
00106 int SelectionExtDCOPInterface::selEndLine()
00107 {
00108
return m_parent->
selEndLine();
00109 }
00110
00111 int SelectionExtDCOPInterface::selEndCol()
00112 {
00113
return m_parent->
selEndCol();
00114 }
00115