00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
#include "document.h"
00020
#include "document.moc"
00021
00022
#include "view.h"
00023
#include "view.moc"
00024
00025
#include "katecmd.h"
00026
00027
namespace Kate
00028 {
00029
00030
bool Document::s_openErrorDialogsActivated =
true;
00031
bool Document::s_fileChangedDialogsActivated =
false;
00032
QString Document::s_defaultEncoding;
00033
00034 Document::Document (
QObject* parent,
const char* name)
00035 : KTextEditor::Document (parent,
name)
00036 {
00037 }
00038
00039 Document::Document () : KTextEditor::Document (0L, "Kate::Document")
00040 {
00041 }
00042
00043 Document::~Document ()
00044 {
00045 }
00046
00047
void Document::setOpenErrorDialogsActivated (
bool on)
00048 {
00049 s_openErrorDialogsActivated = on;
00050 }
00051
00052
void Document::setFileChangedDialogsActivated (
bool on)
00053 {
00054 s_fileChangedDialogsActivated = on;
00055 }
00056
00057
const QString &Document::defaultEncoding ()
00058 {
00059
return s_defaultEncoding;
00060 }
00061
00062 bool Document::registerCommand (
Command *cmd)
00063 {
00064
return KateCmd::self()->registerCommand (cmd);
00065 }
00066
00067
bool Document::unregisterCommand (
Command *cmd)
00068 {
00069
return KateCmd::self()->unregisterCommand (cmd);
00070 }
00071
00072 Command *Document::queryCommand (
const QString &cmd)
00073 {
00074
return KateCmd::self()->queryCommand (cmd);
00075 }
00076
00077 View::View ( KTextEditor::Document *doc,
QWidget *parent,
const char *name ) : KTextEditor::
View (doc, parent, name)
00078 {
00079 }
00080
00081 View::~View ()
00082 {
00083 }
00084
00085
void ConfigPage::slotChanged()
00086 {
00087 emit changed();
00088 }
00089
00090 DocumentExt::DocumentExt ()
00091 {
00092 }
00093
00094 DocumentExt::~DocumentExt ()
00095 {
00096 }
00097
00098 Document *
document (KTextEditor::Document *doc)
00099 {
00100
if (!doc)
00101
return 0;
00102
00103
return static_cast<Document*>(doc->qt_cast(
"Kate::Document"));
00104 }
00105
00106 DocumentExt *
documentExt (KTextEditor::Document *doc)
00107 {
00108
if (!doc)
00109
return 0;
00110
00111
return static_cast<DocumentExt*>(doc->qt_cast(
"Kate::DocumentExt"));
00112 }
00113
00114 Document *
createDocument (
QObject *parent,
const char *name )
00115 {
00116
return (
Document* ) KTextEditor::createDocument (
"libkatepart", parent, name);
00117 }
00118
00119 View *view (KTextEditor::View *view)
00120 {
00121
if (!view)
00122
return 0;
00123
00124
return static_cast<View*>(view->qt_cast(
"Kate::View"));
00125 }
00126
00127 }