• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • interfaces
 

interfaces

  • interfaces
  • tdetexteditor
selectioninterfaceext.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2002 Anders Lund <anders@alweb.dk>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 
19  $Id$
20 */
21 
22 #include "selectioninterfaceext.h"
23 #include "selectionextdcopinterface.h"
24 #include "document.h"
25 #include "view.h"
26 #include <dcopclient.h>
27 
28 using namespace KTextEditor;
29 
30 //BEGIN KTextEditor::SelectionInterfaceExt
31 class KTextEditor::PrivateSelectionInterfaceExt {
32  public:
33  PrivateSelectionInterfaceExt() : interface( 0 ) {}
34  ~PrivateSelectionInterfaceExt() {}
35 
36  SelectionExtDCOPInterface *interface;
37 };
38 
39 unsigned int SelectionInterfaceExt::globalSelectionInterfaceExtNumber = 0;
40 
41 SelectionInterfaceExt::SelectionInterfaceExt()
42  : d ( new PrivateSelectionInterfaceExt )
43 {
44  globalSelectionInterfaceExtNumber++;
45  mySelectionInterfaceExtNumber = globalSelectionInterfaceExtNumber;
46  TQString name = "SelectionInterfaceExt#" + TQString::number(mySelectionInterfaceExtNumber);
47  d->interface = new SelectionExtDCOPInterface(this, name.latin1());
48 }
49 
50 SelectionInterfaceExt::~SelectionInterfaceExt()
51 {
52  delete d->interface;
53  delete d;
54 }
55 
56 unsigned int SelectionInterfaceExt::selectionInterfaceExtNumber () const
57 {
58  return mySelectionInterfaceExtNumber;
59 }
60 
61 void SelectionInterfaceExt::setSelectionInterfaceExtDCOPSuffix (const TQCString &suffix)
62 {
63  d->interface->setObjId ("SelectionInterfaceExt#"+suffix);
64 }
65 
66 SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (Document *doc)
67 {
68  if (!doc)
69  return 0;
70 
71  return dynamic_cast<KTextEditor::SelectionInterfaceExt*>(doc);
72 }
73 
74 SelectionInterfaceExt *KTextEditor::selectionInterfaceExt (View *view)
75 {
76  if (!view)
77  return 0;
78 
79  return dynamic_cast<KTextEditor::SelectionInterfaceExt*>(view);
80 }
81 
82 //END KTextEditor::SelectionInterfaceExt
83 
84 //BEGIN KTextEditor::SelectionExtDCOPInterface
85 SelectionExtDCOPInterface::SelectionExtDCOPInterface(
86  SelectionInterfaceExt *parent, const char* name )
87  : DCOPObject( name ),
88  m_parent( parent )
89 {
90 }
91 
92 SelectionExtDCOPInterface::~SelectionExtDCOPInterface()
93 {
94 }
95 
96 int SelectionExtDCOPInterface::selStartLine()
97 {
98  return m_parent->selStartLine();
99 }
100 
101 int SelectionExtDCOPInterface::selStartCol()
102 {
103  return m_parent->selStartCol();
104 }
105 
106 int SelectionExtDCOPInterface::selEndLine()
107 {
108  return m_parent->selEndLine();
109 }
110 
111 int SelectionExtDCOPInterface::selEndCol()
112 {
113  return m_parent->selEndCol();
114 }
115 //END KTextEditor::SelectionExtDCOPInterface
KTextEditor::SelectionExtDCOPInterface::selEndLine
int selEndLine()
The selection end line.
Definition: selectioninterfaceext.cpp:106
KTextEditor::SelectionInterfaceExt::selStartCol
virtual int selStartCol()=0
The selection start col.
KTextEditor::SelectionInterfaceExt::selEndLine
virtual int selEndLine()=0
The selection end line.
KTextEditor::SelectionExtDCOPInterface::selEndCol
int selEndCol()
The selection end col.
Definition: selectioninterfaceext.cpp:111
KTextEditor::Document
The main class representing a text document.
Definition: document.h:31
KTextEditor::SelectionExtDCOPInterface::selStartLine
int selStartLine()
The selection start line number.
Definition: selectioninterfaceext.cpp:96
KTextEditor::SelectionInterfaceExt
Provide access to seleciton positions.
Definition: selectioninterfaceext.h:38
KTextEditor
KTextEditor is KDE's standard text editing KPart interface.
Definition: blockselectiondcopinterface.h:9
KTextEditor::SelectionExtDCOPInterface::selStartCol
int selStartCol()
The selection start col.
Definition: selectioninterfaceext.cpp:101
KTextEditor::SelectionInterfaceExt::selEndCol
virtual int selEndCol()=0
The selection end col.
KTextEditor::SelectionInterfaceExt::selStartLine
virtual int selStartLine()=0
The selection start line number.
KTextEditor::SelectionExtDCOPInterface
DCOP interface for the SelectionInterfaceExt.
Definition: selectionextdcopinterface.h:36
DCOPObject
KTextEditor::View
The View class represents a single view of a Document .
Definition: tdetexteditor/view.h:32
TDEStdAccel::name
TQString name(StdAccel id)

interfaces

Skip menu "interfaces"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

interfaces

Skip menu "interfaces"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for interfaces by doxygen 1.8.8
This website is maintained by Timothy Pearson.