Source: serial2doc.h


Annotated List
Files
Globals
Hierarchy
Index
/***************************************************************************
                          serial2doc.h  -  description
                             -------------------
    begin                : Ut feb 18 14:21:20 CET 2003
    copyright            : (C) 2003 by Ondrej Krško
    email                : ondrej.krsko@zoznam.sk
 ***************************************************************************/

#ifndef SERIAL2DOC_H
#define SERIAL2DOC_H

#ifdef HAVE_CONFIG_H
#include 
#endif 

// include files for QT
#include 
#include 
#include 

// include files for KDE
#include 

// forward declaration of the Serial2 classes
class Serial2View;

/**	Serial2Doc provides a document object for a document-view model.
  *
  * The Serial2Doc class provides a document object that can be used in conjunction with the classes Serial2App and Serial2View
  * to create a document-view model for standard KDE applications based on KApplication and KMainWindow. Thereby, the document object
  * is created by the Serial2App instance and contains the document structure with the according methods for manipulation of the document
  * data by Serial2View objects. Also, Serial2Doc contains the methods for serialization of the document data from and to files.
  *
  * @author Source Framework Automatically Generated by KDevelop, (c) The KDevelop Team. 	
  * @version KDevelop version 1.2 code generation
  */
class Serial2Doc : public QObject
{
  Q_OBJECT
  public:
    /** Constructor for the fileclass of the application */
    Serial2Doc(QWidget *parent, const char *name=0);
    /** Destructor for the fileclass of the application */
    ~Serial2Doc();

    /** adds a view to the document which represents the document contents. Usually this is your main view. */
    void addView(Serial2View *view);
    /** removes a view from the list of currently connected views */
    void removeView(Serial2View *view);
    /** sets the modified flag for the document after a modifying action on the view connected to the document.*/
    void setModified(bool _m=true){ modified=_m; };
    /** returns if the document is modified or not. Use this to determine if your document needs saving by the user on closing.*/
    bool isModified(){ return modified; };
    /** "save modified" - asks the user for saving if the document is modified */
    bool saveModified();	
    /** deletes the document's contents */
    void deleteContents();
    /** initializes the document generally */
    bool newDocument();
    /** closes the acutal document */
    void closeDocument();
    /** loads the document by filename and format and emits the updateViews() signal */
    bool openDocument(const KURL& url, const char *format=0);
    /** saves the document under filename and format.*/	
    bool saveDocument(const KURL& url, const char *format=0);
    /** returns the KURL of the document */
    const KURL& URL() const;
    /** sets the URL of the document */
	  void setURL(const KURL& url);
	
  public slots:
    /** calls repaint() on all views connected to the document object and is called by the view by which the document has been changed.
     * As this view normally repaints itself, it is excluded from the paintEvent.
     */
    void slotUpdateAllViews(Serial2View *sender);
 	
  public:	
    /** the list of the views currently connected to the document */
    static QList *pViewList;	

  private:
    /** the modified flag of the current document */
    bool modified;
    KURL doc_url;
};

#endif // SERIAL2DOC_H

Generated by: root on localhost.localdomain on Tue Feb 18 14:22:06 2003, using kdoc 2.0a54.