home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / KoDocumentIface.h < prev    next >
Encoding:
C/C++ Source or Header  |  2007-05-30  |  4.8 KB  |  158 lines

  1. /* This file is part of the KDE project
  2.    Copyright (C) 2000 David Faure <faure@kde.org>
  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.
  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.  
  20. #ifndef __KoDocumentIface_h__
  21. #define __KoDocumentIface_h__
  22.  
  23. #include <dcopobject.h>
  24. #include <qvaluelist.h>
  25. #include <dcopref.h>
  26. #include <koffice_export.h>
  27. class KoDocument;
  28. class KDCOPActionProxy;
  29.  
  30. /**
  31.  * DCOP interface for any KOffice document
  32.  * Use KoApplicationIface to get hold of an existing document's interface,
  33.  * or to create a document.
  34.  *
  35.  * Note: KOffice Applications may (and should) reimplement KoDocument::dcopObject()
  36.  * In this case, don't look here... (unless the DCOP interface for the document
  37.  * inherits KoDocumentIface, which is a good thing to do)
  38.  */
  39. class KOFFICECORE_EXPORT KoDocumentIface : public DCOPObject
  40. {
  41.     K_DCOP
  42. public:
  43.  
  44.     KoDocumentIface( KoDocument * doc, const char * name = 0 );
  45.     ~KoDocumentIface();
  46.  
  47.     /**
  48.      * Generate a name for this interface. Automatically used if name=0 is
  49.      * passed to the constructor
  50.      */
  51.     static QCString newIfaceName();
  52.  
  53. k_dcop:
  54.     /**
  55.      * Returns the URL for this document (empty, real URL, or internal one)
  56.      */
  57.     QString url();
  58.  
  59.     /**
  60.      * Opens a document stored in @p url
  61.      * Warning: this is asynchronous. The document might not be loaded yet when
  62.      * this call returns. See isLoading.
  63.      */
  64.     void openURL( QString url );
  65.  
  66.     /**
  67.      * @return TRUE is the document is still loading
  68.      */
  69.     bool isLoading();
  70.  
  71.     /**
  72.      * @return TRUE is the document has been modified
  73.      */
  74.     bool isModified();
  75.  
  76.     /**
  77.      * @return the number of views this document is displayed in
  78.      */
  79.     int viewCount();
  80.  
  81.     /**
  82.      * @return a DCOP reference (DCOPRef) to the view with index @p idx
  83.      */
  84.     DCOPRef view( int idx );
  85.  
  86.     /**
  87.      * DCOP-action proxy
  88.      */
  89.     DCOPRef action( const QCString &name );
  90.     /**
  91.      * @return list of actions
  92.      */
  93.     QCStringList actions();
  94.     /**
  95.      * @return a map of (action name, DCOP reference)
  96.      */
  97.     QMap<QCString,DCOPRef> actionMap();
  98.  
  99.     /**
  100.      * Saves the document under its existing filename
  101.      */
  102.     void save();
  103.  
  104.     /**
  105.      * Saves the document under a new name
  106.      */
  107.     void saveAs( const QString & url );
  108.  
  109.     void setOutputMimeType( const QCString & mimetype );
  110.  
  111.     QString documentInfoAuthorName() const;
  112.     QString documentInfoEmail() const;
  113.     QString documentInfoCompanyName() const;
  114.     QString documentInfoTitle() const;
  115.     QString documentInfoAbstract() const;
  116.     QString documentInfoKeywords() const;
  117.     QString documentInfoSubject() const;
  118.     QString documentInfoTelephone() const;
  119.     QString documentInfoTelephoneWork() const;
  120.     QString documentInfoTelephoneHome() const;
  121.     QString documentInfoFax() const;
  122.     QString documentInfoCountry() const;
  123.     QString documentInfoPostalCode() const;
  124.     QString documentInfoCity() const;
  125.     QString documentInfoStreet() const;
  126.     QString documentInfoInitial() const;
  127.     QString documentInfoAuthorPostion() const;
  128.     void setDocumentInfoAuthorName(const QString & text);
  129.     void setDocumentInfoEmail(const QString &text);
  130.     void setDocumentInfoCompanyName(const QString &text);
  131.     void setDocumentInfoTelephone(const QString &text);
  132.     void setDocumentInfoTelephoneWork(const QString &text);
  133.     void setDocumentInfoTelephoneHome(const QString &text);
  134.     void setDocumentInfoFax(const QString &text);
  135.     void setDocumentInfoCountry(const QString &text);
  136.     void setDocumentInfoTitle(const QString & text);
  137.     void setDocumentInfoPostalCode(const QString &text);
  138.     void setDocumentInfoCity(const QString & text);
  139.     void setDocumentInfoStreet(const QString &text);
  140.     void setDocumentInfoAbstract(const QString &text);
  141.     void setDocumentInfoInitial(const QString & text);
  142.     void setDocumentInfoKeywords(const QString & text );
  143.     void setDocumentInfoSubject(const QString & text);
  144.     void setDocumentInfoAuthorPosition(const QString & text);
  145.  
  146. public:
  147.     virtual QCStringList functionsDynamic();
  148.     virtual bool processDynamic( const QCString &fun, const QByteArray &data,
  149.                                  QCString& replyType, QByteArray &replyData );
  150.  
  151. protected:
  152.     KoDocument * m_pDoc;
  153.     KDCOPActionProxy *m_actionProxy;
  154. };
  155.  
  156. #endif
  157.  
  158.