[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-devel
Subject:    Re: Fwd: Re: KDevelop editor interfaces
From:       "F () lk Brettschneider" <gigafalk () yahoo ! com>
Date:       2001-04-26 20:16:50
[Download RAW message or body]

Roland Krause wrote:
> 
> You should really have a look at the docviewman class in kdevelop2
> first. It's all there, and it works (almost) perfectly well. Falk, has
> put lots and lots of hours of testing and improving into this.
Christian Chouder and I specially adapted DocViewMan to KDevelop-2.0 for
the use of its special editor and browser documents and views to have
more freedom in doing things in an easy way.
But if you went back to the version I initially committed (and their
bugfix versions after), only a few things would be necessary to let it
work with every document and view. Just a general base class for
documents is needed, once I decided for QObject since there's no
document base class in the Qt/KDE world that is the base of Emacs, Vim,
KWrite, Kate and F*ckKnows. Another solution would be a covering
document class that has got the various embedded special documents.
The general Doc-View-manager should work by using the mechanism of
emitting Qt-signals as abstract commands for the outside world. In that
way it wouldn't matter what kind of document or view is specially meant.
For instance:

//KDoc could be a wrapper class providing a document interface 

int DocViewMan::createDocument(int docType, const QString& strFileName,
                               const QString& strParameters)
{
   KDoc*   pDoc = 0;
   emit sig_createDocumentRequested(docType, strFileName, strParameters,
&pDoc);

   // check success
   if (pDoc != 0) {
      // connect signals
      connect(pDoc, SIGNAL(sig_updated(QObject*, int)),
              this, SIGNAL(sig_updated(QObject*, int)));
...
...
}
...
{
...
connect(m_docViewMgr), 
        SIGNAL(sig_createDocumentRequested(int, const QString&, const
QString&, KDoc**)),
        fooPlugin, 
        SLOT(slot_createDocument(int, const QString&, const QString&,
KDoc**)));
...
}
...

{
void FooPlugin::slot_createDocument( int docType, const QString&
strFileName,
                                     const QString& strParameters,
KDoc** ppNewDoc)
{
   switch( docType) {
   case Foo::DocumentType1:
   {
      KDoc* pDoc = new FooCoverDoc1();
...
   case Foo::DocumentType2:
      KDoc* pDoc = new FooCoverDoc2();
...
...


Ciao,
F@lk

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


-
to unsubscribe from this list send an email to kdevelop-devel-request@kdevelop.org \
with the following body: unsubscribe »your-email-address«


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic