view.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "document.h"
00020 #include "view.h"
00021 #include "kneditfactory.h"
00022
00023 #include <qlayout.h>
00024 #include <qlabel.h>
00025
00026 #include <qxembed.h>
00027 #include <kdebug.h>
00028
00029
00030 namespace KNEdit
00031 {
00032
00033 View::View ( Document *doc, QWidget *parent, const char *name ) : KTextEditor::View (doc, parent, name)
00034 {
00035 setInstance( KNEditFactory::instance() );
00036
00037 doc->addView( this );
00038 m_doc = doc;
00039 setFocusPolicy( StrongFocus );
00040
00041 QVBoxLayout *vbl = new QVBoxLayout( this );
00042
00043 m_embed = new QXEmbed( this, "embedded NEdit" );
00044 vbl->addWidget( m_embed );
00045 }
00046
00047 View::~View ()
00048 {
00049 if ( m_doc )
00050 m_doc->removeView( this );
00051 }
00052
00053 KTextEditor::Document *View::document() const
00054 {
00055 return m_doc;
00056 }
00057
00058 void View::embedNEdit( WId id )
00059 {
00060 kdDebug() << "View: embedding: " << id << endl;
00061
00062 m_embed->embed( id );
00063 }
00064
00065
00066 QPoint View::cursorCoordinates ()
00067 {
00069 return QPoint();
00070 }
00071
00072 void View::cursorPosition (uint *line, uint *col)
00073 {
00075 }
00076
00077 void View::cursorPositionReal (uint *line, uint *col)
00078 {
00080 }
00081
00082 bool View::setCursorPosition (uint line, uint col)
00083 {
00084 Q_ASSERT( m_doc );
00085 m_doc->invokeNC("-line " + QString::number(line + 1), true);
00086 return true;
00087 }
00088
00089 bool View::setCursorPositionReal (uint line, uint col)
00090 {
00091 return setCursorPosition(line, col);
00092 }
00093
00094 uint View::cursorLine ()
00095 {
00097 return 0;
00098 }
00099
00100 uint View::cursorColumn ()
00101 {
00103 return 0;
00104 }
00105
00106 uint View::cursorColumnReal ()
00107 {
00109 return 0;
00110 }
00111
00112 };
00113
00114 #include "view.moc"
00115
This file is part of the documentation for KDevelop Version 3.1.2.