File indexing completed on 2024-04-14 05:37:00

0001 /***************************************************************************
0002  *   Copyright (C) 2005 by David Saxton                                    *
0003  *   david@bluehaze.org                                                    *
0004  *                                                                         *
0005  *   This program is free software; you can redistribute it and/or modify  *
0006  *   it under the terms of the GNU General Public License as published by  *
0007  *   the Free Software Foundation; either version 2 of the License, or     *
0008  *   (at your option) any later version.                                   *
0009  ***************************************************************************/
0010 
0011 #ifndef DOCMANAGERIFACE_H
0012 #define DOCMANAGERIFACE_H
0013 
0014 //#include <dcopobject.h>
0015 //#include <dcopref.h>
0016 #include "dcop_stub.h"
0017 
0018 class DocManager;
0019 class Document;
0020 
0021 /**
0022 @author David Saxton
0023 */
0024 class DocManagerIface : public DCOPObject
0025 {
0026     K_DCOP
0027 
0028 public:
0029     DocManagerIface(DocManager *docManager);
0030     ~DocManagerIface();
0031 
0032     k_dcop :
0033         /**
0034          * Attempt to close all documents, returning true if successful.
0035          */
0036         bool
0037         closeAll();
0038     /**
0039      * Attempt to open the given URL.
0040      */
0041     DCOPRef openURL(const QString &url);
0042     /**
0043      * Attempt to open the text file at the given url (if it isn't already
0044      * open), and then go to that line in the text file.
0045      */
0046     void gotoTextLine(const QString &url, int line);
0047     /**
0048      * Creates a new Text document.
0049      */
0050     DCOPRef createTextDocument();
0051     /**
0052      * Creates a new Circuit document.
0053      */
0054     DCOPRef createCircuitDocument();
0055     /**
0056      * Creates a new FlowCode document.
0057      */
0058     DCOPRef createFlowCodeDocument();
0059     /**
0060      * Creates a new Mechanics document.
0061      */
0062     DCOPRef createMechanicsDocument();
0063 
0064 protected:
0065     DCOPRef docToRef(Document *document);
0066 
0067     DocManager *m_pDocManager;
0068 };
0069 
0070 #endif